:root {
  --ink: #17202a;
  --muted: #62707f;
  --paper: rgba(255, 255, 255, 0.9);
  --line: rgba(23, 32, 42, 0.14);
  --green: #10a66a;
  --red: #d94b45;
  --gold: #f2b705;
  --blue: #2477c7;
  --teal: #0e9aa7;
  --shadow: 0 24px 60px rgba(21, 36, 52, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(242, 183, 5, 0.24), transparent 26%),
    radial-gradient(circle at 85% 18%, rgba(14, 154, 167, 0.20), transparent 24%),
    linear-gradient(135deg, #f8fbff 0%, #eef7f4 42%, #fff6de 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(36, 119, 199, 0.22);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#fxCanvas {
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 20;
}

.app {
  min-height: 100vh;
  padding: 16px 28px;
}
@media (max-height: 800px) {
  .app {
    padding: 10px 16px;
  }
}


.screen {
  display: none;
}

.screen.active {
  display: grid;
}

.welcome-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 1080px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
  padding: 20px;
  box-sizing: border-box;
}

.welcome-screen.active {
  display: flex;
}

/* Group styled game & result panels */
.question-panel,
.coach-panel,
.result-card,
.result-screen .leaderboard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.96;
  margin-bottom: 22px;
  max-width: 760px;
}

/* Logo Area Styling */
.logo-area {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 45px;
  width: 100%;
}
.logo-cloud {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.85);
  padding: 18px 45px;
  border-radius: 30px;
  border: 4px solid #1a5276;
  box-shadow: 0 12px 0 #11364f, 0 15px 30px rgba(0, 0, 0, 0.15);
  position: relative;
}
.crown {
  font-size: 3rem;
  animation: bounceCrown 1.5s infinite alternate;
}
.crown-left {
  transform: rotate(-15deg);
}
.crown-right {
  transform: rotate(15deg);
}
@keyframes bounceCrown {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.05); }
}
.game-title {
  font-family: 'Segoe UI', Arial, sans-serif;
  text-align: center;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  line-height: 1.1;
  color: #1a5276;
  margin: 0;
  letter-spacing: 0.5px;
}
.game-title .highlight {
  color: #f1c40f;
  font-size: clamp(2rem, 4vw, 3.2rem);
  text-shadow: 
    -2px -2px 0 #d35400,  
     2px -2px 0 #d35400,
    -2px  2px 0 #d35400,
     2px  2px 0 #d35400,
     3px  3px 5px rgba(0, 0, 0, 0.3);
}

/* Boards Container */
.boards-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  width: 100%;
  margin-bottom: 20px;
}

/* Wood Frame Boards */
.wood-frame {
  position: relative;
  background: linear-gradient(135deg, #a05a2c 0%, #8d5524 50%, #5c3a21 100%);
  padding: 24px;
  border-radius: 24px;
  border: 4px solid #4a2811;
  box-shadow: 
    0 18px 36px rgba(0,0,0,0.3),
    inset 0 4px 6px rgba(255,255,255,0.3),
    inset 0 -4px 6px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.close-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  background: #d94b45;
  border: 3px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  z-index: 5;
  transition: transform 140ms ease;
}
.close-badge:hover {
  transform: scale(1.1) rotate(90deg);
}

.board-header {
  background: linear-gradient(180deg, #e67e22 0%, #d35400 100%);
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  padding: 8px 24px;
  border-radius: 12px;
  border: 3px solid #5e2700;
  box-shadow: 0 5px 0 #4a1f00, 0 8px 15px rgba(0, 0, 0, 0.2);
  text-shadow: 1px 1px 0 #5e2700;
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.board-content {
  border-radius: 14px;
  border: 6px solid #4a2811;
  flex-grow: 1;
  padding: 24px 18px 18px 18px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 290px;
}

/* Left Board Content: Blackboard */
.blackboard {
  background: #1e2d3d;
  box-shadow: inset 0 8px 16px rgba(0,0,0,0.5);
  color: #ffffff;
  justify-content: center;
}
.form-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.board-label {
  display: block;
  font-weight: 900;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.5px;
  text-align: center;
}
.input-container input {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1.05rem;
  background: #ffffff;
  color: #17202a;
  outline: none;
  font-weight: bold;
}
.input-container input:focus {
  border-color: #f39c12;
  box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.25);
}

.start-btn-premium {
  background: linear-gradient(180deg, #f39c12 0%, #e67e22 100%);
  border: 3px solid #f1c40f;
  border-radius: 16px;
  padding: 14px 28px;
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1px 2px 0 #900c3f;
  box-shadow: 0 6px 0 #7e2c00, 0 10px 15px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
  margin-top: 10px;
  box-sizing: border-box;
}
.start-btn-premium:hover {
  transform: translateY(1px);
  box-shadow: 0 5px 0 #7e2c00, 0 8px 12px rgba(0, 0, 0, 0.25);
}
.start-btn-premium:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #7e2c00, 0 4px 6px rgba(0, 0, 0, 0.2);
}
.btn-avatar {
  font-size: 1.6rem;
}

/* Right Board Content: Scroll Paper */
.scroll-paper {
  background: #fefcf2;
  background: linear-gradient(180deg, #fefcf2 0%, #f7f1d4 100%);
  box-shadow: 
    inset 0 8px 16px rgba(0,0,0,0.15),
    0 4px 8px rgba(0,0,0,0.1);
  color: #2b1c10;
}
.scroll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px dashed rgba(43, 28, 16, 0.15);
}
.podium-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.podium {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px 8px 4px 4px;
  width: 44px;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.podium .trophy {
  font-size: 1.35rem;
}
.podium-num {
  font-size: 0.8rem;
  color: #2b1c10;
}
.rank-1 {
  height: 52px;
  background: #fef5d1;
  border: 2px solid #f1c40f;
}
.rank-2 {
  height: 45px;
  background: #eaeded;
  border: 2px solid #bdc3c7;
}
.rank-3 {
  height: 39px;
  background: #f5ebde;
  border: 2px solid #e59866;
}

.clear-btn-premium {
  background: #e6b0aa;
  border: 2px solid #c0392b;
  color: #78281f;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  transition: transform 140ms ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.clear-btn-premium:hover {
  transform: rotate(-180deg) scale(1.1);
}

.scroll-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}
.scroll-list li {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(43, 28, 16, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: #2b1c10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.scroll-list li b {
  color: #1a5276;
}
.scroll-list li small {
  display: block;
  font-size: 0.72rem;
  color: #7f8c8d;
  font-weight: normal;
}

/* Footnote Styling */
.welcome-footer {
  width: 100%;
  text-align: center;
  margin-top: 35px;
  padding: 10px;
}
.footnote {
  font-size: 0.8rem;
  color: #566573;
  line-height: 1.5;
  max-width: 780px;
  margin: 0 auto;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Responsive grid layout helpers */
.panel-title,
.game-header,
.stats,
.topic-row,
.result-actions {
  align-items: center;
  display: flex;
}

.panel-title,
.game-header,
.topic-row {
  justify-content: space-between;
}

.panel-title {
  font-weight: 900;
  margin-bottom: 14px;
}

.icon-btn,
.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.icon-btn {
  height: 34px;
  width: 34px;
}

.leaderboard ol {
  margin: 0;
  padding-left: 24px;
}

.leaderboard li {
  margin: 10px 0;
  padding-left: 4px;
}

.game-screen {
  gap: 12px;
  max-width: 1220px;
  margin: 0 auto;
}

.game-header {
  background: linear-gradient(180deg, #ffffff 0%, #f2f4f4 100%);
  border: 2px solid #bdc3c7;
  border-bottom: 4px solid #95a5a6;
  border-radius: 14px;
  gap: 12px;
  padding: 10px 18px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
}

.game-header h2 {
  color: #1b4f72;
  font-weight: 900;
  margin-bottom: 0;
  text-shadow: 0 1px 1px rgba(255,255,255,0.9);
  font-size: 1.15rem;
}

.game-header .eyebrow {
  color: #7f8c8d;
  margin-bottom: 2px;
  font-size: 0.72rem;
}

.stats {
  flex-wrap: wrap;
  gap: 8px;
}

.stats span {
  display: inline-flex;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 9px;
  box-sizing: border-box;
}

.stats #questionCounter {
  background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
  border: 2px solid #2980b9;
  border-bottom: 4px solid #1b4f72;
  color: #fff;
  text-shadow: 1px 1px 0px #154360;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.stats #scoreBadge {
  background: linear-gradient(180deg, #f1c40f 0%, #f39c12 100%);
  border: 2px solid #f39c12;
  border-bottom: 4px solid #b7950b;
  color: #fff;
  text-shadow: 1px 1px 0px #7d6608;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.stats #streakBadge {
  background: linear-gradient(180deg, #1abc9c 0%, #16a085 100%);
  border: 2px solid #16a085;
  border-bottom: 4px solid #0e6251;
  color: #fff;
  text-shadow: 1px 1px 0px #0b5345;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.stats #timerBadge {
  background: #090b0d; /* Deep LCD screen background */
  border: 3px solid #7f8c8d; /* Metallic casing bezel */
  border-color: #bdc3c7 #7f8c8d #566573 #7f8c8d;
  color: #ff3b30;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 10px;
  box-shadow: 
    inset 0 3px 6px rgba(0, 0, 0, 0.9),  /* Deep sunken LCD shadow */
    0 3px 0 #34495e,                     /* 3D bottom bezel height */
    0 6px 12px rgba(0, 0, 0, 0.25);        /* Drop shadow */
  text-shadow: 
    0 0 4px rgba(255, 59, 48, 0.85),
    0 0 8px rgba(255, 59, 48, 0.4);
  letter-spacing: 0.5px;
}

.stats #timerBadge::before {
  content: "⏱️ ";
  font-size: 1rem;
  text-shadow: none;
}

.stats #timerBadge.danger {
  background: #1c0605;
  color: #ff4d4d;
  border-color: #e74c3c;
  box-shadow: 
    inset 0 3px 6px rgba(28, 6, 5, 0.9),
    0 3px 0 #c0392b,
    0 6px 12px rgba(217, 75, 69, 0.3);
  text-shadow: 
    0 0 6px rgba(255, 77, 77, 0.9),
    0 0 12px rgba(255, 77, 77, 0.5);
  animation: pulseTimer 700ms ease-in-out infinite alternate;
}

@keyframes pulseTimer {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

#quitBtn.ghost-btn {
  background: linear-gradient(180deg, #fceae9 0%, #f5b7b1 100%);
  border: 2px solid #f1948a;
  border-bottom: 3px solid #c0392b;
  color: #78281f;
  border-radius: 10px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 3px 6px rgba(0,0,0,0.06);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

#quitBtn.ghost-btn:hover {
  background: linear-gradient(180deg, #fceae9 0%, #f1948a 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#quitBtn.ghost-btn:active {
  transform: translateY(1.5px);
  border-bottom-width: 1.5px;
  box-shadow: 0 2px 3px rgba(0,0,0,0.04);
}

.progress-track {
  background: #ebedef;
  border: 2px solid #bdc3c7;
  border-radius: 999px;
  height: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.03);
  overflow: hidden;
  position: relative;
}

#progressFill {
  background: linear-gradient(90deg, #1abc9c, #2ecc71, #f1c40f);
  background-size: 200% auto;
  animation: shineProgress 3s linear infinite;
  height: 100%;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.4);
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shineProgress {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.quiz-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 380px;
}

.question-panel {
  background: linear-gradient(135deg, #1f2d3d 0%, #15202b 100%);
  border: 4px solid #2c3e50;
  border-radius: 20px;
  box-shadow: 
    inset 0 6px 12px rgba(0,0,0,0.5),
    0 10px 24px rgba(0,0,0,0.25),
    0 0 0 3px #34495e;
  color: #fff;
  position: relative;
  padding: 16px 20px;
}

.topic-row {
  margin-bottom: 12px;
  margin-right: 110px; /* Leave space for absolute language-toggle */
}

#topicPill {
  background: linear-gradient(180deg, #e67e22 0%, #d35400 100%);
  border: 1px solid #e67e22;
  border-bottom: 3px solid #b35300;
  color: #fff !important;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#sourceText {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #d5dbdb !important;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  backdrop-filter: blur(5px);
}

#questionText {
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  line-height: 1.3;
  margin: 12px 0;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  color: #fcfcfc;
}

.language-toggle {
  position: absolute;
  top: 16px;
  right: 20px;
  margin: 0;
  background: linear-gradient(180deg, #34495e 0%, #2c3e50 100%);
  border: 2px solid #566573;
  border-bottom: 3px solid #1f2a36;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  padding: 5px 12px;
  font-size: 0.8rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.language-toggle:hover {
  background: linear-gradient(180deg, #415b76 0%, #2c3e50 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

.language-toggle:active {
  transform: translateY(1.5px);
  border-bottom-width: 1.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.answers {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.answer-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f4f6f7 100%);
  border: 2px solid #d5dbdb;
  border-bottom: 4px solid #bdc3c7; /* 3D pressable bottom border */
  border-radius: 14px;
  color: #17202a;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 16px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease, background 100ms ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  font-weight: 700;
  font-size: 0.98rem;
}

.answer-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #eaeded 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.answer-btn:active:not(:disabled) {
  transform: translateY(2.5px);
  border-bottom-width: 1.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.answer-btn .letter {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ebf5fb 0%, #d4e6f1 100%);
  border: 2px solid #a9cce3;
  border-radius: 50%;
  font-weight: 900;
  height: 30px;
  width: 30px;
  color: #2980b9;
  font-size: 0.9rem;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.8), 0 1px 2px rgba(0,0,0,0.04);
}

.answer-btn.correct {
  background: linear-gradient(180deg, #e8f8f5 0%, #d1f2eb 100%) !important;
  border-color: #76d7c4 !important;
  border-bottom-color: #1abc9c !important;
  color: #0e6251;
}

.answer-btn.correct .letter {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  border-color: #27ae60;
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 1px 2px rgba(0,0,0,0.15);
}

.answer-btn.wrong {
  background: linear-gradient(180deg, #fceae9 0%, #f5b7b1 100%) !important;
  border-color: #f1948a !important;
  border-bottom-color: #e74c3c !important;
  color: #78281f;
}

.answer-btn.wrong .letter {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  border-color: #c0392b;
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 1px 2px rgba(0,0,0,0.15);
}

.coach-panel {
  display: flex;
  flex-direction: column;
  align-self: stretch; /* Match height of .question-panel */
  gap: 12px;
  background: linear-gradient(135deg, #8d5524 0%, #5c3a21 100%);
  border: 4px solid #4a2811;
  border-radius: 20px;
  box-shadow: 
    0 10px 24px rgba(0,0,0,0.3),
    inset 0 3px 5px rgba(255,255,255,0.2);
  padding: 16px 20px;
}

.coach-panel .eyebrow {
  color: #f39c12;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
  font-weight: 900;
  margin-bottom: 4px;
}

.feedback-box {
  background: #fefcf2;
  background: linear-gradient(180deg, #fefcf2 0%, #f7f1d4 100%);
  border: 2px solid #d5dbdb;
  border-radius: 12px;
  box-shadow: 
    inset 0 3px 6px rgba(0,0,0,0.1),
    0 4px 8px rgba(0,0,0,0.15);
  color: #2b1c10;
  flex-grow: 1; /* Grow to fill panel height */
  min-height: 180px; /* Allow shrinking to 180px */
  overflow-y: auto; /* Scroll internally if needed */
  padding: 14px 16px;
  font-size: 0.94rem;
}

.feedback-box.correct {
  background: linear-gradient(180deg, #e8f8f5 0%, #d1f2eb 100%);
  border-color: #a3e4d7;
}

.feedback-box.wrong {
  background: linear-gradient(180deg, #fef9e7 0%, #fdebd0 100%);
  border-color: #fad7a0;
}

.feedback-box strong {
  display: block;
  font-size: 1.1rem;
  color: #1a5276;
  border-bottom: 2px dashed rgba(43,28,16,0.15);
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-weight: 900;
}

.feedback-box p {
  color: #34495e;
  line-height: 1.5;
  margin-bottom: 10px;
}

.memory-tip {
  background: #fff;
  border-left: 5px solid #16a085;
  border-radius: 8px;
  color: #2c3e50 !important;
  padding: 10px 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#nextBtn {
  background: linear-gradient(180deg, #f39c12 0%, #e67e22 100%);
  border: 3px solid #f1c40f;
  border-bottom: 4px solid #b35300;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1px 1px 0 #900c3f;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
  width: 100%;
  box-sizing: border-box;
}

#nextBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, #f5b041 0%, #e67e22 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
}

#nextBtn:active:not(:disabled) {
  transform: translateY(3px);
  border-bottom-width: 1.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#nextBtn:disabled {
  background: #bdc3c7 !important;
  border-color: #d2d7d9 !important;
  border-bottom: 2px solid #95a5a6 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none !important;
  opacity: 0.65;
}



.result-screen {
  align-items: center;
  gap: 22px;
  grid-template-columns: minmax(280px, 1fr) 380px;
  max-width: 1040px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
}

.result-card {
  padding: clamp(28px, 5vw, 54px);
}

.result-card h2 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.result-card p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.result-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .app {
    padding: 16px;
  }

  .welcome-screen,
  .quiz-layout,
  .result-screen {
    grid-template-columns: 1fr;
  }

  .welcome-screen .leaderboard {
    grid-column: auto;
  }

  .brand-panel {
    min-height: 360px;
  }

  .game-header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .name-row {
    grid-template-columns: 1fr;
  }

  .answer-btn {
    grid-template-columns: 32px 1fr;
  }

  .question-panel,
  .coach-panel,
  .leaderboard,
  .login-panel {
    padding: 18px;
  }
}
