/* =============================================================================
   ART QUIZ v2 — Supercell-inspired theme
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Museum palette — ivory, gold, deep jewel tones */
  --bg: linear-gradient(180deg, #F7F1E5 0%, #EFE6D1 100%);
  --bg-solid: #F7F1E5;
  --card: #FFFFFF;
  --card-shadow: rgba(50, 35, 20, 0.08);
  --cream: #FAF6EE;
  --parchment: #F3EBD8;
  --ivory-dark: #E2D5B9;

  /* Accent palette (kept same variable names — now museum tones) */
  /* --orange = deep burgundy (SOLO, primary actions) */
  --orange: #6E2932;
  --orange-dark: #4A1D23;
  --orange-light: #8F3D47;
  /* --purple = deep navy (DUEL) */
  --purple: #1E3A5F;
  --purple-dark: #122741;
  /* --blue = museum gold / ochre (LEARN, secondary primary) */
  --blue: #B8893A;
  --blue-dark: #8B6620;
  --blue-light: #D4B068;
  /* --green = moss (correct answers) */
  --green: #4A5D3E;
  --green-dark: #2E3B26;
  /* --red = antique crimson (incorrect) */
  --red: #8B2E2A;
  --red-dark: #5F1F1C;
  /* --yellow = warm bronze (leaderboard accent) */
  --yellow: #9C7A2E;
  --yellow-dark: #6B5020;
  /* --pink = dusty rose */
  --pink: #9C4A5F;

  /* Text */
  --text: #2B2420;
  --text-secondary: #5C4E3E;
  --text-muted: #8C7B68;
  --text-white: #FAF6EE;

  /* Misc */
  --border: rgba(120, 90, 50, 0.18);
  --border-strong: rgba(120, 90, 50, 0.35);
  --radius: 4px;
  --radius-lg: 6px;
  --radius-pill: 50px;
  --shadow-btn: 0 2px 0;
  --shadow-soft: 0 2px 12px rgba(50, 35, 20, 0.08);
  --font: 'Inter', Georgia, serif;
  --font-title: 'Playfair Display', 'Didot', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;

  /* Duel */
  --p1-color: #1E3A5F;
  --p1-bg: rgba(30, 58, 95, 0.10);
  --p2-color: #6E2932;
  --p2-bg: rgba(110, 41, 50, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================== SCREENS ===================== */
.screen { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; overflow-y: auto; }
.screen.active { display: flex; flex-direction: column; animation: screenIn 0.35s ease; }
@keyframes screenIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* ===================== BUTTONS — museum refined ===================== */
.btn-3d {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.85rem 2rem; border: 1px solid transparent; border-radius: var(--radius);
  font-family: var(--font); font-size: 0.95rem; font-weight: 500;
  cursor: pointer; position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.btn-3d:hover:not(:disabled) { transform: translateY(-1px); }
.btn-3d:active { transform: translateY(0); }
.btn-3d:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.btn-orange { background: var(--orange); color: var(--cream); border-color: var(--orange-dark); box-shadow: var(--shadow-btn) var(--orange-dark), var(--shadow-soft); }
.btn-orange:hover:not(:disabled) { background: var(--orange-light); box-shadow: 0 4px 0 var(--orange-dark), var(--shadow-soft); }

.btn-blue { background: var(--blue); color: var(--cream); border-color: var(--blue-dark); box-shadow: var(--shadow-btn) var(--blue-dark), var(--shadow-soft); }
.btn-blue:hover:not(:disabled) { background: var(--blue-light); box-shadow: 0 4px 0 var(--blue-dark), var(--shadow-soft); }

.btn-green { background: var(--green); color: var(--cream); border-color: var(--green-dark); box-shadow: var(--shadow-btn) var(--green-dark), var(--shadow-soft); }

.btn-purple { background: var(--purple); color: var(--cream); border-color: var(--purple-dark); box-shadow: var(--shadow-btn) var(--purple-dark), var(--shadow-soft); }
.btn-purple:hover:not(:disabled) { background: #2D4E7A; box-shadow: 0 4px 0 var(--purple-dark), var(--shadow-soft); }

.btn-red { background: var(--red); color: var(--cream); border-color: var(--red-dark); box-shadow: var(--shadow-btn) var(--red-dark), var(--shadow-soft); }

.btn-yellow { background: var(--yellow); color: var(--cream); border-color: var(--yellow-dark); box-shadow: var(--shadow-btn) var(--yellow-dark), var(--shadow-soft); }

.btn-white { background: var(--cream); color: var(--text); box-shadow: var(--shadow-btn) var(--ivory-dark), var(--shadow-soft); border: 1px solid var(--border-strong); }

.btn-link-feedback {
  background: transparent; border: none; color: var(--text-muted);
  font-family: var(--font); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer;
  padding: 0.35rem 0.6rem; margin-top: 0.4rem;
  transition: color 0.2s; opacity: 0.7;
}
.btn-link-feedback:hover { color: var(--orange); opacity: 1; }

/* Feedback modal styles */
.feedback-modal { max-width: 480px; }
.feedback-textarea {
  width: 100%; min-height: 120px; padding: 0.9rem 1rem; margin-bottom: 0.8rem;
  background: white; border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-family: var(--font-serif); font-size: 1.05rem; color: var(--text); line-height: 1.5;
  resize: vertical; outline: none; transition: border-color 0.2s;
}
.feedback-textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(110,41,50,0.1); }
.feedback-email {
  width: 100%; padding: 0.7rem 1rem; margin-bottom: 1rem;
  background: white; border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-family: var(--font); font-size: 0.95rem; color: var(--text); outline: none;
  transition: border-color 0.2s;
}
.feedback-email:focus { border-color: var(--orange); }
.feedback-actions {
  display: flex; justify-content: center; gap: 0.8rem; margin-bottom: 0.5rem;
}
.feedback-status {
  font-family: var(--font-serif); font-style: italic; font-size: 0.95rem;
  color: var(--green-dark); margin-top: 0.6rem; min-height: 1.2em;
}
.feedback-status.error { color: var(--red-dark); }

.btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border-strong);
  padding: 0.7rem 1.4rem; box-shadow: none; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.82rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}
.btn-ghost:hover {
  color: var(--orange); border-color: var(--orange); background: var(--parchment);
  transform: translateY(-1px);
}

.btn-large { padding: 1.05rem 2.6rem; font-size: 1rem; border-radius: var(--radius-lg); letter-spacing: 0.18em; }
.btn-icon { font-size: 1.1em; opacity: 0.9; }

/* ===================== HOME — museum grand entrance ===================== */
.home-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 2rem; text-align: center; gap: 1.2rem;
  position: relative;
}
.home-container::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 1px; height: 60px; background: var(--border-strong);
}

/* Hide cartoon mascot on home — keep it for leaderboard small size */
.home-container .mascot { display: none; }
.mascot { width: 80px; height: 80px; opacity: 0.85; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.home-title {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-size: 3.5rem; font-weight: 700;
  color: var(--text); letter-spacing: -0.02em; text-transform: uppercase;
  line-height: 0.95; padding: 0 0.5rem; max-width: 90vw;
}
.home-subtitle {
  font-family: 'Inter', sans-serif; font-size: 0.78rem;
  color: var(--text-secondary); font-weight: 500; margin: 0.8rem 0 1.6rem;
  letter-spacing: 0.28em; text-transform: uppercase;
}
@media (max-width: 600px) {
  .home-title { font-size: 2.4rem; }
  .home-subtitle { font-size: 0.72rem; letter-spacing: 0.22em; }
}
.home-modes { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; justify-content: center; }

/* ===================== DUEL SETUP ===================== */
.duel-setup-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 2rem; gap: 1.5rem; }
.duel-setup-title { font-family: var(--font-title); font-size: 2.4rem; font-weight: 500; color: var(--text); letter-spacing: 0.1em; text-transform: uppercase; }
.duel-setup-title::after { content: ""; display: block; width: 40px; height: 1px; background: var(--purple); margin: 0.6rem auto 0; }
.duel-setup-desc { color: var(--text-secondary); font-size: 0.95rem; font-family: var(--font-serif); font-style: italic; }
.duel-inputs { display: flex; align-items: center; gap: 1rem; }
.duel-input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.duel-input-group label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.player-blue label { color: var(--p1-color); }
.player-red label { color: var(--p2-color); }
.duel-input {
  background: var(--cream); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 0.75rem 1rem; color: var(--text); font-family: var(--font-serif); font-size: 1.05rem;
  width: 160px; text-align: center; outline: none; font-weight: 500;
  transition: border-color 0.2s;
}
.player-blue .duel-input:focus { border-color: var(--p1-color); box-shadow: 0 0 0 2px rgba(30,58,95,0.1); }
.player-red .duel-input:focus { border-color: var(--p2-color); box-shadow: 0 0 0 2px rgba(110,41,50,0.1); }
.duel-vs { font-family: var(--font-title); font-size: 1.6rem; font-style: italic; color: var(--text-muted); letter-spacing: 0.15em; }

/* ===================== GAME SCREEN ===================== */
#screen-game { padding: 0; gap: 0; background: var(--bg-solid); }

/* Top bar */
.game-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 1rem; background: var(--cream);
  border-bottom: 1px solid var(--border-strong); flex-shrink: 0; z-index: 10; min-height: 52px;
  box-shadow: var(--shadow-soft);
}
.topbar-left, .topbar-right { flex: 1; }
.topbar-right { text-align: right; display: flex; justify-content: flex-end; }
.topbar-center { flex: 0 0 auto; }

.player-info { display: flex; align-items: center; gap: 0.4rem; }
.player-name { font-size: 0.85rem; font-weight: 700; }
.player-name.blue { color: var(--p1-color); }
.player-name.red { color: var(--p2-color); }

.hearts { display: flex; gap: 0.1rem; }
.heart { font-size: 1.2rem; transition: all 0.3s; }
.heart.lost { opacity: 0.2; transform: scale(0.7); filter: grayscale(1); }

.score-big {
  font-family: var(--font-title); font-size: 1.7rem; color: var(--orange);
  font-weight: 500; letter-spacing: 0.05em; line-height: 1;
}
.topbar-brand {
  font-family: 'Inter', sans-serif; font-size: 0.7rem; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 0.1rem;
}
.topbar-center { display: flex; flex-direction: column; align-items: center; }
.topbar-home {
  position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 1.1rem; font-family: var(--font-title);
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s ease; z-index: 5;
  padding: 0; line-height: 1;
}
.topbar-home:hover {
  border-color: var(--orange); color: var(--orange);
  background: var(--parchment); transform: translateY(-50%) scale(1.05);
}
.game-topbar { position: relative; padding-left: 3rem !important; }

/* DUEL TURN BANNER — refined strip above painting */
.duel-turn-banner {
  flex-shrink: 0; text-align: center; padding: 0.6rem 1rem;
  font-family: var(--font-title); font-size: 1.1rem; font-style: italic; color: var(--cream);
  letter-spacing: 0.18em; text-transform: uppercase;
}
.duel-turn-banner.hidden { display: none; }
.duel-turn-banner.blue { background: var(--p1-color); border-bottom: 1px solid var(--purple-dark); }
.duel-turn-banner.red { background: var(--p2-color); border-bottom: 1px solid var(--orange-dark); }

/* Painting */
.painting-container {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 0.4rem; min-height: 0; position: relative; overflow: hidden;
}
.painting-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 0 0 6px var(--cream), 0 0 0 8px var(--blue-dark), 0 10px 30px rgba(30,20,10,0.3);
  transition: box-shadow 0.35s ease, opacity 0.3s; cursor: zoom-in;
}
.painting-img.answered-correct {
  box-shadow: 0 0 0 6px var(--cream), 0 0 0 10px var(--green), 0 10px 30px rgba(74,93,62,0.45), 0 0 50px rgba(74,93,62,0.25);
}
.painting-img.answered-wrong {
  box-shadow: 0 0 0 6px var(--cream), 0 0 0 10px var(--red), 0 10px 30px rgba(139,46,42,0.55), 0 0 60px rgba(139,46,42,0.45);
  animation: wrongShake 0.5s ease;
}
@keyframes wrongShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.painting-img.loading { opacity: 0; }
.painting-loading { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; color: var(--text-muted); }
.painting-loading.hidden { display: none; }
.spinner { width: 40px; height: 40px; border: 4px solid #E8D8B8; border-top-color: var(--orange); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Options — 2x2 grid of 3D buttons */
.options-container { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; padding: 0.85rem 1rem; flex-shrink: 0; }

.option-btn {
  padding: 1.2rem 0.85rem; background: var(--cream); border: 1px solid var(--border-strong);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-serif);
  font-size: 1.5rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s ease; text-align: center; line-height: 1.25;
  box-shadow: 0 1px 0 var(--ivory-dark), var(--shadow-soft);
  min-height: 80px; letter-spacing: 0.01em;
  word-break: break-word; hyphens: auto;
}
@media (max-width: 600px) {
  .option-btn { font-size: 1.35rem; min-height: 72px; padding: 1rem 0.6rem; }
}
.option-btn:hover:not(:disabled) { background: var(--parchment); border-color: var(--blue); color: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 3px 0 var(--ivory-dark), var(--shadow-soft); }
.option-btn:active:not(:disabled) { transform: translateY(0); box-shadow: 0 0 0 var(--ivory-dark), var(--shadow-soft); }

.option-btn.correct {
  background: #E8EEDF; border-color: var(--green); color: var(--green-dark);
  box-shadow: 0 1px 0 var(--green-dark), var(--shadow-soft); animation: correctBounce 0.5s ease;
  font-weight: 600;
}
@keyframes correctBounce { 0% { transform: scale(1); } 30% { transform: scale(1.03); } 100% { transform: scale(1); } }

.option-btn.incorrect {
  background: #F1DBD8; border-color: var(--red); color: var(--red-dark);
  box-shadow: 0 1px 0 var(--red-dark), var(--shadow-soft); animation: shake 0.4s ease;
  font-weight: 600;
}
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

.option-btn.dimmed { opacity: 0.2; pointer-events: none; }
.option-btn.eliminated { opacity: 0.15; pointer-events: none; text-decoration: line-through; }
.option-btn:disabled { cursor: default; transform: none !important; }

/* Powerups — 3D buttons */
.powerups-container { display: flex; justify-content: center; gap: 0.7rem; padding: 0.4rem 0.75rem 0.6rem; flex-shrink: 0; }

.btn-powerup {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.5rem 1rem; background: var(--cream); border: 1px solid var(--border-strong);
  border-radius: var(--radius); color: var(--text); cursor: pointer;
  transition: all 0.2s ease; position: relative; font-family: var(--font);
  box-shadow: 0 1px 0 var(--ivory-dark);
}
.btn-powerup:hover:not(:disabled) { background: var(--parchment); border-color: var(--blue); transform: translateY(-1px); }
.btn-powerup:active:not(:disabled) { transform: translateY(0); }
.btn-powerup:disabled { opacity: 0.35; cursor: not-allowed; }
.powerup-icon { font-size: 1.4rem; opacity: 0.9; }
.powerup-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); }
.powerup-count {
  position: absolute; top: -7px; right: -7px;
  background: var(--orange); color: var(--cream);
  font-size: 0.65rem; font-weight: 700; font-family: var(--font-serif);
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--orange-dark);
}

/* ===================== GAME MODAL (universal overlay) ===================== */
.game-modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.game-modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.game-modal {
  background: var(--cream); border-radius: var(--radius-lg);
  padding: 1.6rem 1.6rem 1.2rem; max-width: 620px; width: 94%;
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  text-align: center; position: relative;
  box-shadow: 0 20px 50px rgba(30,20,10,0.25);
  border: 1px solid var(--border-strong);
  animation: modalPop 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}
@media (min-width: 600px) {
  .game-modal { padding: 2.2rem 2.2rem 1.6rem; max-height: 92vh; }
}
@keyframes modalPop { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; border-radius: 50%;
  font-size: 2.2rem; font-weight: 500; line-height: 1;
  margin: 0 auto 0.6rem;
  border: 1.5px solid var(--border-strong);
  background: var(--cream); color: var(--text-muted);
  font-family: var(--font-title);
}
.modal-icon.success { color: var(--green-dark); border-color: var(--green); background: #E8EEDF; }
.modal-icon.fail { color: var(--red-dark); border-color: var(--red); background: #F1DBD8; }
.modal-icon.hint { color: var(--yellow-dark); border-color: var(--yellow); background: var(--parchment); }
.modal-title {
  font-family: var(--font-title); font-size: 2.1rem; font-weight: 500;
  margin-bottom: 0.3rem; letter-spacing: 0.04em;
}
.modal-title.success { color: var(--green-dark); font-weight: 700; }
.modal-title.fail { color: var(--red-dark); font-weight: 700; }
.modal-title.hint { color: var(--yellow-dark); }
.modal-title::after {
  content: ""; display: block; width: 30px; height: 1px;
  background: currentColor; opacity: 0.4; margin: 0.55rem auto 0;
}

.modal-subtitle { font-family: var(--font-serif); font-size: 1.55rem; font-weight: 500; color: var(--text); margin-top: 0.6rem; margin-bottom: 0.15rem; font-style: italic; line-height: 1.3; }
.modal-details {
  font-family: var(--font-title); font-size: 1.05rem; color: var(--text-secondary);
  margin-bottom: 1.4rem; letter-spacing: 0.1em; font-weight: 500;
}
.modal-details:empty { margin-bottom: 0.8rem; }

.modal-body {
  font-family: var(--font-serif); font-size: 1.18rem; color: var(--text-secondary); line-height: 1.65;
  padding: 1.3rem 0 0; text-align: left; margin-bottom: 1rem;
  border-top: 1px solid var(--border-strong);
}
.modal-body ul { list-style: none; padding: 0; margin: 0; }
.modal-body li { padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.modal-body li:last-child { border-bottom: none; padding-bottom: 0; }
.modal-body li:first-child { padding-top: 0.6rem; }
.modal-body strong {
  color: var(--blue-dark); font-weight: 600; font-family: var(--font);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.22em;
  display: block; margin-bottom: 0.35rem;
}
.modal-body .edu-tips {
  list-style: none; padding: 0; margin: 0.3rem 0 0;
}
.modal-body .edu-tips li {
  padding: 0.35rem 0; border-bottom: none;
  font-size: 1.05rem; line-height: 1.5;
}
.modal-body .edu-tips li:first-child { padding-top: 0.4rem; }
.modal-body .edu-tips li:not(:last-child) {
  border-bottom: 1px dashed var(--border);
}

/* Comparison — 2 cajas limpias (una roja, una verde) */
.modal-compare {
  display: flex; flex-direction: column; gap: 0.7rem;
  margin: 0.5rem 0 1rem;
  text-align: left;
}
.compare-col {
  padding: 1rem 1.1rem;
  font-family: var(--font-serif);
  border-radius: var(--radius);
  border: 1px solid;
}
.compare-col.wrong {
  background: rgba(139,46,42,0.06);
  border-color: rgba(139,46,42,0.3);
}
.compare-col.right {
  background: rgba(74,93,62,0.08);
  border-color: rgba(74,93,62,0.4);
}
.compare-name {
  font-family: var(--font); font-weight: 600; font-size: 0.68rem;
  letter-spacing: 0.24em; text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.compare-col.wrong .compare-name { color: var(--red-dark); }
.compare-col.right .compare-name { color: var(--green-dark); }
.compare-artist {
  font-family: var(--font-title); font-size: 1.3rem; font-weight: 600;
  color: var(--text); line-height: 1.2; margin-bottom: 0.3rem;
  letter-spacing: 0.02em;
}
.compare-text {
  font-family: var(--font-serif); font-size: 1rem;
  color: var(--text-secondary); line-height: 1.5;
}
.compare-detail {
  margin-top: 0.9rem; padding-top: 0.8rem;
  border-top: 1px solid rgba(74,93,62,0.2);
}
.compare-detail ul { list-style: none; padding: 0; margin: 0; }
.compare-detail li {
  font-family: var(--font-serif); font-size: 1rem; line-height: 1.55;
  padding: 0.5rem 0; border-bottom: 1px dashed rgba(74,93,62,0.2);
  color: var(--text-secondary);
}
.compare-detail li:last-child { border-bottom: none; padding-bottom: 0; }
.compare-detail li:first-child { padding-top: 0; }
.compare-detail strong {
  display: block; margin-bottom: 0.3rem;
  font-family: var(--font); font-weight: 600;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--green-dark);
}

.modal-actions { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.btn-modal-report {
  position: absolute; top: 0.65rem; right: 0.7rem; z-index: 5;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.05rem; line-height: 1; padding: 0.35rem 0.5rem;
  cursor: pointer; opacity: 0.35; transition: opacity 0.2s, color 0.2s;
  border-radius: 50%;
}
.btn-modal-report:hover { opacity: 1; color: var(--red); background: rgba(139,46,42,0.06); }
.btn-modal-report:disabled { opacity: 0.6; cursor: default; color: var(--green-dark); }

.modal-tap {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; font-family: var(--font);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ===================== GAME OVER / WIN ===================== */
.gameover-container {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.5rem; gap: 0.8rem; overflow-y: auto; height: 100%;
  position: relative; z-index: 1;
}
.gameover-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  opacity: 0.06; filter: blur(8px);
}

.gameover-icon { font-size: 2.8rem; opacity: 0.85; }
.gameover-title { font-family: var(--font-title); font-size: 2.3rem; font-weight: 500; color: var(--text); letter-spacing: 0.1em; text-transform: uppercase; }
.gameover-title::after { content: ""; display: block; width: 50px; height: 1px; background: var(--orange); margin: 0.6rem auto 0; }
.gameover-subtitle { color: var(--text-secondary); font-size: 1rem; font-family: var(--font-serif); font-style: italic; }

.gameover-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem;
  width: 100%; max-width: 340px;
}
.stat-card {
  background: var(--cream); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 0.85rem 0.6rem; text-align: center;
}
.stat-card.stat-highlight { grid-column: 1 / -1; background: var(--parchment); border-color: var(--orange); border-left: 3px solid var(--orange); }
.stat-card.stat-highlight .stat-value { font-size: 2.6rem; color: var(--orange); }
.stat-value { font-family: var(--font-title); font-size: 1.5rem; font-weight: 500; color: var(--text); }
.stat-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; margin-top: 0.2rem; }

.leaderboard-entry { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 100%; max-width: 280px; }
.leaderboard-entry.hidden { display: none; }
.lb-entry-text { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
.lb-input {
  background: var(--cream); border: 1px solid var(--orange); border-radius: var(--radius);
  padding: 0.75rem 1rem; color: var(--text); font-family: var(--font-serif); font-size: 1.1rem;
  width: 100%; text-align: center; outline: none; font-weight: 500;
}
.lb-input:focus { box-shadow: 0 0 0 2px rgba(110,41,50,0.1); }
.gameover-actions { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; max-width: 280px; }

/* ===================== DUEL RESULT ===================== */
.duel-result-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 2rem; gap: 1.2rem; position: relative; z-index: 1;
}
.duel-winner-icon { font-size: 3rem; opacity: 0.9; }
.duel-winner-title { font-family: var(--font-title); font-size: 2.3rem; font-weight: 500; color: var(--text); letter-spacing: 0.1em; text-transform: uppercase; }
.duel-winner-title::after { content: ""; display: block; width: 40px; height: 1px; background: var(--orange); margin: 0.5rem auto 0; }
.duel-winner-name { font-family: var(--font-serif); font-size: 1.6rem; font-style: italic; }
.duel-scores { display: flex; align-items: center; gap: 1rem; }
.duel-score-card {
  padding: 1rem 1.3rem; border-radius: var(--radius); text-align: center; min-width: 120px;
  background: var(--cream); border: 1px solid var(--border-strong); border-top: 3px solid var(--border-strong);
}
.duel-score-card.player-blue-bg { border-top-color: var(--p1-color); }
.duel-score-card.player-red-bg { border-top-color: var(--p2-color); }
.duel-score-name { font-size: 0.75rem; font-weight: 500; margin-bottom: 0.3rem; letter-spacing: 0.15em; text-transform: uppercase; }
.duel-score-card.player-blue-bg .duel-score-name { color: var(--p1-color); }
.duel-score-card.player-red-bg .duel-score-name { color: var(--p2-color); }
.duel-score-value { font-family: var(--font-title); font-size: 2rem; font-weight: 500; color: var(--text); }
.duel-score-vs { font-family: var(--font-title); font-size: 1.1rem; font-style: italic; color: var(--text-muted); letter-spacing: 0.1em; }

/* ===================== LEARN MODE ===================== */
#screen-learn { padding: 0; gap: 0; background: var(--bg-solid); }

.learn-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.8rem; background: var(--cream);
  border-bottom: 1px solid var(--border-strong); flex-shrink: 0; z-index: 10; min-height: 44px;
  box-shadow: var(--shadow-soft); gap: 0.5rem;
}
.learn-topbar .btn-powerup { padding: 0.3rem 0.7rem; }
.learn-topbar .powerup-icon { font-size: 1rem; }
.learn-counter {
  font-family: var(--font-title); font-size: 1rem; font-style: italic; color: var(--text); letter-spacing: 0.08em;
}

.learn-container {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem;
  padding: 0.7rem; min-height: 0; overflow: hidden;
}

.learn-left {
  display: flex; flex-direction: column; gap: 0.55rem; min-height: 0;
}

.learn-gallery {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
  background: var(--cream); padding: 0.5rem; border-radius: var(--radius);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-soft);
  flex-shrink: 1; min-height: 0;
}
.learn-gallery-item {
  aspect-ratio: 1; border-radius: 2px;
  overflow: hidden; background: var(--parchment); position: relative;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px var(--blue-dark), 0 2px 8px rgba(30,20,10,0.15);
}
.learn-gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s;
  cursor: zoom-in;
}
.learn-gallery-item img:hover { transform: scale(1.04); }
.learn-gallery-item.loading img { opacity: 0; }
.learn-gallery-item .mini-spinner {
  position: absolute; width: 24px; height: 24px;
  border: 2px solid var(--ivory-dark); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

.learn-style-box {
  background: var(--parchment); border-radius: var(--radius);
  border-left: 3px solid var(--blue);
  padding: 0.75rem 1rem; flex-shrink: 0;
}
.learn-style-title {
  font-family: var(--font); font-size: 0.68rem; color: var(--blue-dark); font-weight: 600;
  margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.22em;
  display: flex; align-items: center; gap: 0.5rem;
}
.learn-style-title::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.learn-style-text {
  font-family: var(--font-serif); font-size: 0.98rem; color: var(--text-secondary); line-height: 1.45;
}
.learn-style-text ul { list-style: none; padding: 0; margin: 0; }
.learn-style-text li { padding: 0.25rem 0; border-bottom: 1px dashed var(--border); }
.learn-style-text li:last-child { border-bottom: none; padding-bottom: 0; }
.learn-style-text li:first-child { padding-top: 0; }

.learn-right {
  display: flex; flex-direction: column; gap: 0.85rem;
}

.learn-question {
  font-family: var(--font-title); font-size: 1.3rem; font-weight: 500; color: var(--text);
  text-align: center; font-style: italic; letter-spacing: 0.02em;
}
.learn-question::after { content: ""; display: block; width: 36px; height: 1px; background: var(--blue); margin: 0.4rem auto 0; }

.learn-options {
  display: grid; grid-template-columns: 1fr; gap: 0.45rem;
}
.learn-options .option-btn { min-height: 54px; font-size: 1.08rem; padding: 0.85rem 0.8rem; }

.learn-options .option-btn.correct {
  background: #D1FAE5; border-color: var(--green); color: var(--green-dark);
  box-shadow: 0 3px 0 var(--green-dark);
}
.learn-options .option-btn.incorrect {
  background: #FEE2E2; border-color: var(--red); color: var(--red-dark);
  box-shadow: 0 3px 0 var(--red-dark);
}

.learn-feedback {
  background: var(--cream); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 1.4rem 1.6rem; box-shadow: var(--shadow-soft);
  text-align: center; display: flex; flex-direction: column; gap: 0.5rem;
}
.learn-feedback.hidden { display: none; }
.learn-feedback-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%;
  font-size: 1.9rem; font-weight: 500; line-height: 1;
  margin: 0 auto 0.25rem;
  border: 1.5px solid var(--border-strong);
  background: var(--cream); color: var(--text-muted);
  font-family: var(--font-title);
}
.learn-feedback-icon.success { color: var(--green-dark); border-color: var(--green); background: #E8EEDF; }
.learn-feedback-icon.fail { color: var(--red-dark); border-color: var(--red); background: #F1DBD8; }
.learn-feedback-title {
  font-family: var(--font-title); font-size: 1.8rem; font-weight: 500; letter-spacing: 0.04em;
}
.learn-feedback-title.success { color: var(--green-dark); font-weight: 700; }
.learn-feedback-title.fail { color: var(--red-dark); font-weight: 700; }
.learn-feedback-title::after { content: ""; display: block; width: 30px; height: 1px; background: currentColor; opacity: 0.4; margin: 0.45rem auto 0; }
.learn-feedback-artist {
  font-family: var(--font-serif); font-size: 1.3rem; font-weight: 500; font-style: italic; color: var(--text);
  margin-bottom: 0.3rem;
}

/* Sections inside feedback */
.learn-feedback-section {
  text-align: left;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}
.learn-feedback-section:first-of-type { border-top: 1px solid var(--border-strong); margin-top: 0.4rem; padding-top: 1rem; }
.learn-section-label {
  font-family: var(--font); font-size: 0.72rem; color: var(--blue-dark);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.22em;
  margin-bottom: 0.45rem; display: flex; align-items: center; gap: 0.6rem;
}
.learn-section-label::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.learn-section-text {
  font-family: var(--font-serif); font-size: 1.1rem;
  color: var(--text-secondary); line-height: 1.6;
}
.learn-section-tips ul { list-style: none; padding: 0; margin: 0; }
.learn-section-tips li {
  font-family: var(--font-serif); font-size: 1.05rem;
  color: var(--text-secondary); padding: 0.32rem 0; line-height: 1.5;
}

/* Responsive: stack vertical on narrow screens */
@media (max-width: 720px) {
  .learn-container { grid-template-columns: 1fr; }
  .learn-question { font-size: 1.2rem; }
}

/* ===================== LEADERBOARD ===================== */
.leaderboard-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 2rem; gap: 1.2rem; }
.leaderboard-title { font-family: 'Inter', sans-serif; font-size: 2.4rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; text-transform: uppercase; }

/* Tabs This week / All time */
.lb-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border-strong);
  margin: 0.4rem 0 0.8rem;
}
.lb-tab {
  background: transparent; border: none;
  font-family: 'Inter', sans-serif; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted); cursor: pointer;
  padding: 0.7rem 1.2rem; transition: color 0.2s;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.lb-tab:hover { color: var(--text); }
.lb-tab.active { color: var(--text); border-bottom-color: var(--orange); }
.leaderboard-table { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 0.3rem; }
.lb-row {
  display: flex; align-items: center; padding: 0.75rem 1rem;
  background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius);
  gap: 0.8rem;
}
.lb-row.gold { border-color: var(--yellow); border-left: 3px solid var(--yellow); background: var(--parchment); }
.lb-row.silver { border-color: #9B8F7D; border-left: 3px solid #9B8F7D; background: var(--parchment); }
.lb-row.bronze { border-color: #8B5A2B; border-left: 3px solid #8B5A2B; background: var(--parchment); }
.lb-rank { font-family: var(--font-title); font-size: 1.1rem; font-weight: 500; color: var(--text-muted); min-width: 2rem; font-style: italic; }
.lb-row.gold .lb-rank { color: var(--yellow-dark); }
.lb-row.silver .lb-rank { color: #6B5A45; }
.lb-row.bronze .lb-rank { color: #8B5A2B; }
.lb-name { flex: 1; font-family: var(--font-serif); font-weight: 500; font-size: 1.1rem; }
.lb-score { font-family: var(--font-title); font-size: 1.3rem; font-weight: 500; color: var(--orange); }
.lb-empty { text-align: center; color: var(--text-muted); padding: 1.5rem; font-family: var(--font-serif); font-style: italic; }
.leaderboard-actions { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; max-width: 280px; }

/* ===================== ZOOM ===================== */
.zoom-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 60; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.zoom-overlay img { max-width: 95%; max-height: 95%; object-fit: contain; border-radius: var(--radius); }

/* ===================== UTILITY ===================== */
.hidden { display: none !important; }

/* ===================== RESPONSIVE ===================== */
@media (min-width: 768px) {
  .home-title { font-size: 4.5rem; }
  .options-container { max-width: 550px; margin: 0 auto; }
  .painting-container { padding: 0.75rem 2rem; }
  .option-btn { font-size: 1rem; padding: 0.85rem; }
  .gameover-stats { grid-template-columns: repeat(4, 1fr); }
  .stat-card.stat-highlight { grid-column: 1 / -1; }
  .game-modal { max-width: 440px; padding: 1.8rem; }
}

@media (max-height: 700px) {
  .game-topbar { padding: 0.3rem 0.5rem; min-height: 38px; }
  .heart { font-size: 1rem; }
  .painting-container { padding: 0.25rem; }
  .options-container { gap: 0.35rem; padding: 0.3rem 0.5rem; }
  .option-btn { padding: 0.5rem 0.4rem; font-size: 0.8rem; }
  .powerups-container { padding: 0.25rem 0.5rem 0.3rem; }
  .btn-powerup { padding: 0.3rem 0.7rem; }
  .powerup-icon { font-size: 1.3rem; }
  .game-modal { padding: 1rem; }
  .modal-icon { font-size: 2rem; }
  .modal-title { font-size: 1.3rem; }
}
