/* =====================================================
   Який ти ВІшка? - game.css
   Mobile-first, Час Індиго brand style
   ===================================================== */

/* === CSS VARIABLES === */
:root {
  --indigo:       #5B21B6;
  --indigo-deep:  #3B0D8A;
  --indigo-light: #7C3AED;
  --indigo-soft:  #EDE9FE;
  --gold:         #F59E0B;
  --yellow:       #FFDD00;
  --white:        #FFFFFF;
  --lilac:        #C4B5FD;
  --lilac-soft:   #F5F3FF;
  --text-dark:    #1E1B4B;
  --text-muted:   #6B7280;
  --shadow-sm:    0 2px 8px rgba(91,33,182,0.10);
  --shadow-md:    0 6px 24px rgba(91,33,182,0.16);
  --shadow-lg:    0 16px 48px rgba(91,33,182,0.22);
  --radius-sm:    12px;
  --radius-md:    20px;
  --radius-lg:    28px;
  --radius-xl:    40px;
  --font-display: 'Nunito', 'Comfortaa', 'Rounded Mplus 1c', system-ui, sans-serif;
  --font-body:    'Nunito', system-ui, sans-serif;
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(160deg, #EDE9FE 0%, #F5F3FF 40%, #ffffff 100%);
  min-height: 100vh;
  color: var(--text-dark);
  overflow-x: hidden;
}

/* === GOOGLE FONT IMPORT (inline fallback handled in HTML) === */

/* === BACKGROUND DECORATION === */
body::before {
  content: '';
  position: fixed;
  top: -120px;
  right: -120px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(124,58,237,0.13) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px;
  left: -100px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(245,158,11,0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* === GAME WRAPPER === */
#wishka-game {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 40px;
}

/* === SCREENS === */
.wg-screen {
  display: none;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px;
  animation: wg-fadeIn 0.4s ease both;
}

.wg-screen.wg-active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes wg-fadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === LOGO / BRAND === */
.wg-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.wg-brand-logo {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--indigo-light);
  text-transform: uppercase;
  opacity: 0.8;
}

.wg-brand-dot {
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
}

/* === START SCREEN === */
.wg-start-hero {
  margin: 8px 0 4px;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wg-float 3.5s ease-in-out infinite;
}

@keyframes wg-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.wg-start-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(91,33,182,0.22));
}

.wg-start-hero .wg-hero-emoji {
  font-size: 100px;
  filter: drop-shadow(0 8px 24px rgba(91,33,182,0.22));
  line-height: 1;
}

.wg-start-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--indigo-deep);
  text-align: center;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.wg-start-title span {
  color: var(--indigo-light);
}

.wg-start-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.55;
  max-width: 300px;
  margin-bottom: 20px;
}

.wg-previous-result {
  background: var(--white);
  border: 2px solid var(--lilac);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  text-align: center;
  margin-bottom: 20px;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.wg-previous-result p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.wg-previous-result strong {
  font-size: 16px;
  color: var(--indigo);
  font-weight: 800;
}

/* === BUTTONS === */
.wg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: var(--radius-xl);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.wg-btn:active {
  transform: scale(0.96);
}

.wg-btn-primary {
  background: linear-gradient(135deg, var(--indigo-light) 0%, var(--indigo-deep) 100%);
  color: var(--white);
  box-shadow: 0 6px 20px rgba(91,33,182,0.35);
  width: 100%;
}

.wg-btn-primary:hover {
  box-shadow: 0 8px 28px rgba(91,33,182,0.45);
  transform: translateY(-2px);
}

.wg-btn-secondary {
  background: var(--white);
  color: var(--indigo);
  border: 2px solid var(--lilac);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.wg-btn-secondary:hover {
  background: var(--lilac-soft);
  border-color: var(--indigo-light);
}

.wg-btn-gold {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--gold) 100%);
  color: var(--indigo-deep);
  box-shadow: 0 6px 20px rgba(245,158,11,0.35);
  width: 100%;
}

.wg-btn-gold:hover {
  box-shadow: 0 8px 28px rgba(245,158,11,0.45);
  transform: translateY(-2px);
}

.wg-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 16px;
}

.wg-btn-ghost:hover {
  color: var(--indigo);
}

.wg-btn-icon {
  font-size: 20px;
  line-height: 1;
}

/* === QUESTION SCREEN === */
.wg-progress-wrap {
  width: 100%;
  margin-bottom: 20px;
}

.wg-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.wg-progress-label span {
  font-size: 13px;
  font-weight: 700;
  color: var(--indigo-light);
}

.wg-progress-bar {
  height: 8px;
  background: var(--lilac-soft);
  border-radius: 100px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.07);
}

.wg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo-light), var(--gold));
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  min-width: 8px;
}

.wg-question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  width: 100%;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid rgba(196,181,253,0.4);
}

.wg-question-num {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--lilac);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.wg-question-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.35;
}

/* === ANSWER BUTTONS === */
.wg-answers {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.wg-answer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  background: var(--white);
  border: 2px solid var(--lilac-soft);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}

.wg-answer-btn .wg-answer-dot {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--indigo-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--indigo);
  transition: background 0.15s, color 0.15s;
}

.wg-answer-btn:hover {
  border-color: var(--indigo-light);
  background: var(--lilac-soft);
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
}

.wg-answer-btn:active {
  transform: scale(0.98) translateX(2px);
}

.wg-answer-btn.wg-selected {
  border-color: var(--indigo-light);
  background: linear-gradient(135deg, var(--indigo-soft) 0%, #f0ebff 100%);
  box-shadow: 0 4px 16px rgba(91,33,182,0.18);
}

.wg-answer-btn.wg-selected .wg-answer-dot {
  background: var(--indigo-light);
  color: var(--white);
}

/* Pulse animation on select */
@keyframes wg-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(124,58,237,0.35); }
  70%  { box-shadow: 0 0 0 10px rgba(124,58,237,0); }
  100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); }
}

.wg-answer-btn.wg-selected {
  animation: wg-pulse 0.4s ease;
}

/* === NAV ROW === */
.wg-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.wg-nav-back {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--white);
  border: 2px solid var(--lilac);
  border-radius: var(--radius-xl);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--indigo);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.wg-nav-back:hover {
  background: var(--lilac-soft);
  border-color: var(--indigo-light);
}

.wg-nav-back:active {
  transform: scale(0.96);
}

.wg-nav-next {
  flex: 1;
}

/* === RESULT SCREEN === */
.wg-result-screen {
  animation: wg-resultReveal 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes wg-resultReveal {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wg-confetti-area {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.wg-confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: wg-confettiFall 2.2s ease-in forwards;
}

@keyframes wg-confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

.wg-result-badge {
  background: linear-gradient(135deg, var(--indigo-light), var(--indigo-deep));
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(91,33,182,0.3);
}

.wg-result-hero-wrap {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  position: relative;
  animation: wg-heroEntrance 0.7s cubic-bezier(0.34,1.56,0.64,1) 0.15s both;
}

@keyframes wg-heroEntrance {
  from { opacity: 0; transform: scale(0.5) rotate(-8deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.wg-result-hero-wrap::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,181,253,0.5) 0%, transparent 70%);
  animation: wg-glowPulse 2.5s ease-in-out infinite;
}

@keyframes wg-glowPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%       { transform: scale(1.08); opacity: 1; }
}

.wg-result-hero-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 10px 30px rgba(91,33,182,0.28));
}

.wg-result-title-row {
  text-align: center;
  margin-bottom: 16px;
}

.wg-result-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--indigo-deep);
  line-height: 1.1;
}

.wg-result-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--indigo-light);
  margin-top: 3px;
}

.wg-result-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  box-shadow: var(--shadow-md);
  border: 1.5px solid rgba(196,181,253,0.4);
  margin-bottom: 12px;
}

.wg-result-section {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--lilac-soft);
}

.wg-result-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.wg-result-section-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}

.wg-result-section-text {
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.55;
  font-weight: 600;
}

.wg-result-message {
  background: linear-gradient(135deg, var(--indigo-soft) 0%, #f0ebff 100%);
  border-radius: var(--radius-md);
  padding: 16px;
  width: 100%;
  margin-bottom: 20px;
  border-left: 4px solid var(--indigo-light);
}

.wg-result-message p {
  font-size: 15px;
  color: var(--indigo-deep);
  line-height: 1.6;
  font-weight: 700;
  font-style: italic;
}

.wg-task-card {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border-radius: var(--radius-md);
  padding: 16px;
  width: 100%;
  margin-bottom: 20px;
  border: 1.5px solid rgba(245,158,11,0.3);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wg-task-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.wg-task-text {
  font-size: 14px;
  color: #92400E;
  line-height: 1.55;
  font-weight: 700;
}

.wg-result-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* === SHARE TOAST === */
.wg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--indigo-deep);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
}

.wg-toast.wg-toast-show {
  transform: translateX(-50%) translateY(0);
}

/* === QUESTION TRANSITION === */
.wg-question-enter {
  animation: wg-slideIn 0.3s ease both;
}

.wg-question-leave {
  animation: wg-slideOut 0.25s ease both;
}

@keyframes wg-slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes wg-slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-30px); }
}

/* === STARS DECORATION === */
.wg-stars {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.wg-star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--indigo-light);
  opacity: 0;
  animation: wg-twinkle var(--dur, 3s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes wg-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%       { opacity: 0.6; transform: scale(1.2); }
}

/* === RESPONSIVE TWEAKS === */
@media (min-width: 480px) {
  .wg-start-title { font-size: 36px; }
  .wg-question-text { font-size: 21px; }
  .wg-answer-btn { font-size: 16px; }
}

@media (max-width: 360px) {
  .wg-start-title { font-size: 28px; }
  .wg-answer-btn { font-size: 14px; min-height: 54px; }
  .wg-question-text { font-size: 18px; }
  .wg-result-name { font-size: 24px; }
}

/* === FOCUS VISIBLE === */
button:focus-visible,
.wg-btn:focus-visible {
  outline: 3px solid var(--indigo-light);
  outline-offset: 2px;
}
