:root {
  --ink: #102a43;
  --ink-light: #334e68;
  --muted: #627d98;
  --paper: #ffffff;
  --cream: #fff9e6;
  --blue: #2f80ed;
  --blue-dark: #1055b0;
  --blue-light: #e6f0fd;
  --teal: #06d6a0;
  --teal-dark: #059669;
  --orange: #ff9f43;
  --orange-dark: #e67e22;
  --coral: #f45b69;
  --gold: #ffd166;
  --purple: #8b5cf6;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 4px 12px rgba(16, 42, 67, 0.06);
  --shadow-md: 0 12px 30px rgba(16, 42, 67, 0.1);
  --shadow-lg: 0 24px 60px rgba(16, 42, 67, 0.16);
  --font-main: "Noto Sans Thai", "Th Sarabun New", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-main);
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 159, 67, 0.22), transparent 28rem),
    radial-gradient(circle at 90% 85%, rgba(47, 128, 237, 0.2), transparent 32rem),
    radial-gradient(circle at 50% 50%, rgba(6, 214, 160, 0.1), transparent 40rem),
    #f0f8ff;
  overflow-x: hidden;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

button:active {
  transform: scale(0.96);
}

.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* APP SHELL CONTAINER */
.app-shell {
  width: min(1200px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(16, 42, 67, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 4px 14px rgba(47, 128, 237, 0.35);
  transform: rotate(-4deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text span {
  font-size: 1.2rem;
}

.brand-text small {
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-light);
  font-size: 1.2rem;
}

.icon-button:hover {
  background: #d4e6fc;
  transform: scale(1.08);
}

.best-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #fff4d6;
  color: #8c5b00;
  font-size: 0.85rem;
  font-weight: 600;
}

.best-score strong {
  color: #d97706;
  font-size: 1.2rem;
  font-weight: 800;
}

/* SCREENS */
.screen {
  flex: 1;
  padding: 36px clamp(20px, 4vw, 50px) 48px;
}

.is-hidden {
  display: none !important;
}

/* HERO LAYOUT & START SCREEN */
.hero-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: start;
}

.mascot-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  animation: floatBounce 3s ease-in-out infinite;
}

.mascot-avatar {
  font-size: 1.2rem;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  margin: 0 0 24px;
  color: var(--ink-light);
  font-size: 1.05rem;
  line-height: 1.6;
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.name-field span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-light);
}

.name-field input {
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--ink);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.name-field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.15);
}

/* MODE TABS */
.mode-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: #edf2f7;
  margin-bottom: 24px;
}

.mode-tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.mode-tab.active {
  background: white;
  color: var(--blue-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* MODE CONFIGS */
.mission-length {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0;
  margin: 0 0 24px;
  border: none;
}

.mission-length legend {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-light);
  margin-bottom: 10px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-card:hover {
  border-color: var(--blue);
}

.radio-card input:checked + span strong {
  color: var(--blue);
}

.radio-card span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.radio-card small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 28px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue), #1a6ed8);
  color: white;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(47, 128, 237, 0.35);
}

.primary-button:hover {
  background: linear-gradient(135deg, #3b8cf5, var(--blue));
  box-shadow: 0 10px 30px rgba(47, 128, 237, 0.45);
  transform: translateY(-2px);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  background: white;
  color: var(--ink-light);
  font-size: 1rem;
  font-weight: 700;
}

.secondary-button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.speed-button {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.sandbox-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.sandbox-btn {
  padding: 14px;
  border-radius: var(--radius-md);
  background: white;
  border: 2px solid #e2e8f0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.sandbox-btn:hover {
  border-color: var(--teal);
  background: #f0fdf4;
  transform: translateY(-2px);
}

.keyboard-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ISLAND MAP CARDS */
.island-map {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #eef7ff 0%, #f7fbff 100%);
  border: 1px solid rgba(47, 128, 237, 0.15);
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}

.map-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.map-header span {
  font-size: 0.8rem;
  color: var(--blue);
  font-weight: 700;
}

.map-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.island-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.island-card:hover {
  transform: translateX(4px);
}

.island-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #edf2f7;
  color: var(--ink-light);
  font-size: 0.85rem;
  font-weight: 800;
}

.island-icon {
  font-size: 1.4rem;
}

.island-card strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
}

.island-card small {
  color: var(--muted);
  font-size: 0.75rem;
}

/* GAMEPLAY SCREEN */
.game-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.status-copy .stage-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 700;
}

.status-copy h2 {
  margin: 2px 0 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.score-panel {
  display: flex;
  gap: 10px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
}

.stat-pill span {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
}

.stat-pill strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.score-pill strong { color: var(--blue); }
.streak-pill strong { color: #d97706; }
.lives-pill strong { color: var(--coral); letter-spacing: 2px; }

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  margin: 6px 0 20px;
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

/* QUESTION CARD */
.question-card {
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-md);
}

.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tag-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-tag {
  padding: 4px 12px;
  border-radius: 20px;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 0.8rem;
  font-weight: 700;
}

.mascot-mood {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-light);
}

.hint-button {
  padding: 6px 14px;
  border-radius: 20px;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.85rem;
  font-weight: 700;
}

.hint-button:hover:not(:disabled) {
  background: #fde68a;
}

.hint-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.hint-text {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  border-left: 4px solid var(--orange);
  color: #92400e;
  font-size: 0.95rem;
  margin: 14px 0;
}

#question-prompt {
  margin: 16px 0 20px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

/* INTERACTIVE WIDGET AREA */
.interactive-area {
  margin: 18px 0;
  padding: 18px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.interactive-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.95rem;
}

.widget-label {
  font-weight: 700;
  color: var(--ink-light);
}

/* PIZZA WIDGET */
.pizza-widget {
  width: 100%;
}

.fraction-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.math-fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-size: 1.2rem;
  color: var(--blue-dark);
}

.math-fraction .bar {
  width: 100%;
  height: 2px;
  background: var(--blue-dark);
  margin: 2px 0;
}

.dec-val {
  color: var(--muted);
  font-weight: 700;
}

.den-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.den-picker span {
  font-size: 0.8rem;
  color: var(--muted);
}

.slice-btn {
  padding: 4px 8px;
  border-radius: 6px;
  background: white;
  border: 1px solid #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
}

.slice-btn.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.pizza-plate {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
}

.pizza-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.12));
}

.pizza-crust {
  fill: #e6a15c;
  stroke: #c87a32;
  stroke-width: 6;
}

.pizza-slice {
  stroke: #ffffff;
  stroke-width: 2.5;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pizza-slice.filled {
  fill: #ffb830;
}

.pizza-slice.empty {
  fill: #fff2d6;
  opacity: 0.6;
}

.pizza-slice:hover {
  transform: scale(1.04);
  transform-origin: 0 0;
}

/* BALANCE SCALE WIDGET */
.scale-visual {
  position: relative;
  width: 280px;
  height: 120px;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.scale-fulcrum {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 50px solid #94a3b8;
}

.scale-beam {
  position: absolute;
  top: 65px;
  width: 240px;
  height: 8px;
  background: #475569;
  border-radius: 4px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
}

.scale-pan {
  position: absolute;
  top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.left-pan { left: -10px; }
.right-pan { right: -10px; }

.pan-string {
  width: 2px;
  height: 25px;
  background: #94a3b8;
}

.pan-dish {
  padding: 4px 10px;
  border-radius: 12px;
  background: white;
  border: 2px solid #cbd5e1;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  display: flex;
  gap: 4px;
}

.weight-badge {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 0.85rem;
}

.target-badge {
  background: #fef3c7;
  color: #b45309;
}

/* NUMBER LINE WIDGET */
.numberline-container {
  width: 100%;
  padding: 10px 0;
}

.line-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: #e2e8f0;
}

.line-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #06d6a0, #2f80ed);
}

.diver-avatar {
  position: absolute;
  top: -24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.5rem;
  transition: left 0.3s ease;
}

.diver-avatar small {
  font-size: 0.75rem;
  font-weight: 800;
  background: white;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  color: var(--blue-dark);
}

.line-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

/* AREA GRID WIDGET */
.area-grid {
  display: grid;
  width: 200px;
  height: 120px;
  border: 2px solid #334e68;
  border-radius: 6px;
  overflow: hidden;
}

.cell {
  background: white;
  border: 1px dashed #cbd5e1;
}

.cell.row-shaded { background: rgba(47, 128, 237, 0.25); }
.cell.col-shaded { background: rgba(255, 159, 67, 0.25); }
.cell.overlap {
  background: linear-gradient(135deg, var(--blue), var(--orange));
  opacity: 0.85;
}

/* BEAKER WIDGET */
.beaker-glass {
  position: relative;
  width: 70px;
  height: 110px;
  border: 3px solid #64748b;
  border-top: none;
  border-radius: 0 0 16px 16px;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.beaker-liquid {
  width: 100%;
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  border-radius: 0 0 12px 12px;
  transition: height 0.5s ease;
}

.beaker-ticks {
  position: absolute;
  right: 4px;
  top: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 700;
}

/* ANSWER BUTTONS GRID */
.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.answer-grid.wide-options {
  grid-template-columns: 1fr;
}

.answer-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  background: white;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.answer-button:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f0f7ff;
  transform: translateY(-2px);
}

.opt-num {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #edf2f7;
  color: var(--ink-light);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.answer-button.correct {
  border-color: var(--teal);
  background: #d1fae5;
  color: #065f46;
}

.answer-button.correct .opt-num {
  background: var(--teal);
  color: white;
}

.answer-button.incorrect {
  border-color: var(--coral);
  background: #ffe4e6;
  color: #9f1239;
}

.answer-button.incorrect .opt-num {
  background: var(--coral);
  color: white;
}

/* FEEDBACK AREA */
.feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  background: #ecfdf5;
  border: 2px solid #a7f3d0;
  margin-top: 20px;
  animation: slideUp 0.25s ease-out;
}

.feedback.is-wrong {
  background: #fff1f2;
  border-color: #fecdd3;
}

.feedback-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feedback-icon {
  font-size: 2rem;
}

.feedback strong {
  display: block;
  font-size: 1.05rem;
  color: #065f46;
}

.feedback.is-wrong strong {
  color: #9f1239;
}

.feedback p {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--ink-light);
}

.next-button {
  width: auto;
  padding: 12px 24px;
  white-space: nowrap;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* SANDBOX VIEWPORT */
.sandbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.tool-switcher {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: #edf2f7;
  border-radius: var(--radius-md);
}

.tool-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
}

.tool-btn.active {
  background: white;
  color: var(--blue-dark);
  box-shadow: var(--shadow-sm);
}

.sandbox-viewport {
  padding: 40px;
  border-radius: var(--radius-lg);
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  min-height: 360px;
}

/* SPEED RUSH SCREEN */
.speed-header {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
}

.speed-timer-box, .speed-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-sm);
}

.speed-timer-box strong { color: #dc2626; font-size: 2rem; }
.speed-score-box strong { color: #d97706; font-size: 2rem; }

.speed-card {
  padding: 36px;
  border-radius: var(--radius-lg);
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.speed-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.speed-opt-btn {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
}

.speed-opt-btn:hover {
  background: #eff6ff;
  border-color: var(--blue);
  transform: translateY(-2px);
}

/* RESULT SCREEN */
.result-hero {
  text-align: center;
  margin-bottom: 32px;
}

.result-badge {
  font-size: 3.5rem;
  margin-bottom: 8px;
  animation: floatBounce 2s ease-in-out infinite;
}

.result-hero h2 {
  margin: 4px 0 8px;
  font-size: 2.2rem;
  font-weight: 900;
}

.result-message {
  color: var(--ink-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.score-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.final-score-card, .final-streak-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid #e2e8f0;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.final-score-card strong { color: var(--blue); font-size: 2.2rem; }
.final-streak-card strong { color: #d97706; font-size: 2.2rem; }

/* BADGES SHOWCASE */
.badges-showcase {
  margin-bottom: 32px;
}

.badges-showcase h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 800;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid #e2e8f0;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.badge-item.earned {
  border-color: #fde047;
  background: #fefce8;
}

.badge-item.locked {
  opacity: 0.6;
  background: #f8fafc;
}

.badge-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.badge-item strong {
  font-size: 0.95rem;
  color: var(--ink);
}

.badge-item small {
  color: var(--muted);
  font-size: 0.75rem;
}

/* SKILL SUMMARY */
.skill-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 36px;
}

.skill-result {
  padding: 18px;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
}

.skill-result.is-passed {
  border-left: 5px solid var(--teal);
}

.skill-result.needs-work {
  border-left: 5px solid var(--coral);
}

.indicator-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.indicator-status {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.is-passed .indicator-status {
  background: #d1fae5;
  color: #065f46;
}

.needs-work .indicator-status {
  background: #ffe4e6;
  color: #9f1239;
}

.indicator-score {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  font-size: 0.85rem;
}

.result-actions {
  display: flex;
  gap: 14px;
}

@media (max-width: 860px) {
  .hero-layout { grid-template-columns: 1fr; }
  .answer-grid { grid-template-columns: 1fr; }
  .skill-summary { grid-template-columns: 1fr; }
  .mission-length { grid-template-columns: 1fr; }
}

/* LANGUAGE TOGGLE BUTTON */
.lang-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: white;
  border: 1.5px solid #cbd5e1;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lang-toggle-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  transform: scale(1.05);
}

.lang-toggle-btn span {
  font-size: 1.1rem;
}

.lang-toggle-btn strong {
  color: var(--blue-dark);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}
