:root {
  --bg-1: #ffefb3;
  --bg-2: #ffd4f5;
  --bg-3: #c8f3ff;
  --bg-4: #d6ffe6;
  --ink: #1f2544;
  --muted: #556070;
  --primary: #ff6f61;
  --primary-dark: #e14c3b;
  --accent: #ffbc3f;
  --success: #17a26b;
  --danger: #e14f57;
  --card-bg: rgba(255, 255, 255, 0.88);
  --line: rgba(255, 255, 255, 0.7);
  --shadow: 0 18px 38px rgba(41, 41, 96, 0.24);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Nunito", "Comic Sans MS", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
  background:
    repeating-radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.46) 26px, transparent 28px, transparent 72px),
    radial-gradient(circle at 5% 5%, #fffae0 0%, transparent 180px),
    radial-gradient(circle at 85% 8%, #ffe1ff 0%, transparent 220px),
    radial-gradient(circle at 0% 72%, #d0f8ff 0%, transparent 190px),
    linear-gradient(160deg, #ffd1a8 0%, #ffd0ef 24%, #c8f5ff 56%, #d2ffd3 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(16px);
  pointer-events: none;
  z-index: -1;
}

body::before {
  width: 380px;
  height: 380px;
  right: -130px;
  top: -70px;
  background: linear-gradient(135deg, #ff9ecf, #ffce6b);
  opacity: 0.5;
}

body::after {
  width: 460px;
  height: 460px;
  left: -170px;
  bottom: -120px;
  background: linear-gradient(135deg, #8fd6ff, #9cffb5);
  opacity: 0.45;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 20px;
}

.hero-card,
.panel,
.game-card,
.mode-card {
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
}

.hero-card::before,
.panel::before,
.game-card::before,
.mode-card::before {
  content: "";
  position: absolute;
  pointer-events: none;
  width: 170px;
  aspect-ratio: 1;
  border-radius: 50%;
  right: -42px;
  top: -34px;
  opacity: 0.2;
  background: radial-gradient(circle, #ffffff 0%, transparent 74%);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
}

h1,
h2,
p {
  margin-top: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: #6f2e2b;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.77rem;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.05;
}

.hero-text .subtitle {
  margin-bottom: 0;
  color: var(--muted);
  max-width: 58ch;
  font-size: 1.06rem;
  line-height: 1.55;
}

.section-title,
.panel h2 {
  margin-bottom: 10px;
}

.help-panel h2,
.progress-panel h2,
.mode-panel .section-title {
  font-size: 1.05rem;
}

.how-to-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.how-to-list li + li {
  margin-top: 8px;
}

.player-panel label,
.section-title {
  font-weight: 800;
  display: block;
}

.name-status {
  margin: 10px 0 0;
  min-height: 20px;
  color: var(--success);
  font-weight: 800;
}

.name-row {
  display: flex;
  gap: 10px;
}

input {
  width: 100%;
  border: 2px solid #ebecff;
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.16);
}

.mascot {
  display: grid;
  place-items: center;
  width: clamp(96px, 20vw, 128px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe9a6 0, #ffb4b4 100%);
  font-size: clamp(3rem, 10vw, 4.5rem);
  flex: 0 0 auto;
  box-shadow: inset -8px -8px 0 rgba(255, 255, 255, 0.46);
}

.panel,
.game-card {
  padding: 18px;
  margin-top: 16px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mode-card {
  border: 3px solid transparent;
  min-height: 140px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.mode-card:hover,
.mode-card:focus-visible {
  transform: translateY(-2px);
}

.mode-card:nth-child(1),
.mode-card:nth-child(2),
.mode-card:nth-child(3) {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 247, 229, 0.9) 100%
  );
}

.mode-card.active {
  border-color: rgba(255, 111, 97, 0.8);
  background: linear-gradient(145deg, #fff8cc, #ffe0ec);
}

.mode-card.active::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  border: 2px dashed rgba(255, 111, 97, 0.65);
  pointer-events: none;
}

.mode-icon {
  font-size: 2.1rem;
}

.mode-title {
  font-size: 1.05rem;
}

.mode-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.mode-panel {
  display: grid;
  gap: 8px;
}

#modeHint,
#questionHint {
  margin: 0;
  color: var(--muted);
}

.mode-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: #3f4250;
  font-weight: 700;
}

.score-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}

.score-panel div {
  border-radius: 16px;
  padding: 12px 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(251, 240, 252, 0.85));
}

.score-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
  font-weight: 700;
}

.score-panel strong {
  font-size: 1.4rem;
}

.game-card {
  text-align: center;
}

.question-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  color: #65310d;
  background: linear-gradient(90deg, #ffe69c, #ffc8f3);
  font-weight: 900;
}

#questionText {
  margin-bottom: 10px;
  font-size: clamp(1.5rem, 5.5vw, 2.5rem);
}

.question-hint {
  margin-bottom: 12px;
}

.visual-area {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.object-token {
  display: inline-grid;
  place-items: center;
  width: 56px;
  aspect-ratio: 1;
  border-radius: 18px;
  background: linear-gradient(145deg, #fffae5, #ffe2ff);
  border: 2px solid rgba(255, 255, 255, 0.7);
  font-size: 2rem;
}

.shape-token,
.big-token {
  display: inline-grid;
  place-items: center;
  width: 110px;
  height: 110px;
  font-size: 4rem;
  border-radius: 24px;
  border: 2px solid #fff;
  background: linear-gradient(145deg, #e4fbff, #fff6ff);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto 14px;
  max-width: 680px;
}

.answer-btn {
  min-height: 74px;
  border: 0;
  border-radius: 18px;
  color: #1f2a44;
  font-size: clamp(1.1rem, 4vw, 1.95rem);
  font-weight: 900;
  background: linear-gradient(180deg, #eefeff, #d0e8ff);
  box-shadow: inset 0 -4px 0 rgba(30, 48, 73, 0.12);
}

.answer-btn:hover,
.answer-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    inset 0 -4px 0 rgba(30, 48, 73, 0.12),
    0 10px 15px rgba(44, 56, 122, 0.2);
}

.answer-btn.correct {
  background: linear-gradient(180deg, #cbffe6, #a8f3c8);
  color: #0e6a49;
}

.answer-btn.wrong {
  background: linear-gradient(180deg, #ffd8db, #ffb9c0);
  color: #7d1116;
}

.answer-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.feedback-text {
  min-height: 42px;
  color: var(--muted);
  font-weight: 800;
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 19px;
  font-weight: 900;
}

.primary-btn {
  color: white;
  background: linear-gradient(180deg, #ff816f, var(--primary-dark));
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary-btn {
  color: #6b2850;
  background: linear-gradient(180deg, #ffeec7, #ffe0b4);
}

.danger-btn {
  color: #7d1116;
  background: linear-gradient(180deg, #ffe8ec, #ffbfc6);
}

.progress-panel p {
  margin-top: 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-grid,
  .score-panel,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .name-row {
    flex-direction: column;
  }

  .mode-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
