@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 200, 50, 0.15), 0 0 60px rgba(255, 200, 50, 0.05); }
  50%       { box-shadow: 0 0 30px rgba(255, 200, 50, 0.25), 0 0 80px rgba(255, 200, 50, 0.1); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0%   { transform: scale(0.8); opacity: 0; }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes streakPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, a, input, select { touch-action: manipulation; }

html { height: 100%; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: #0a0a1a;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(100, 40, 200, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 180, 50, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(50, 100, 255, 0.05) 0%, transparent 50%);
  color: #e8e0f0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 24px;
  overflow-x: hidden;
}

#game {
  width: 100%;
  max-width: 680px;
  max-height: var(--game-height, calc(100vh - 32px));
  max-height: var(--game-height, calc(100dvh - 32px));
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  animation: slideIn 0.4s ease-out;
}
#game::-webkit-scrollbar { display: none; }

/* ===== START SCREEN ===== */
.start-screen { text-align: center; }
.start-screen h1 {
  font-family: 'Righteous', cursive;
  font-size: 52px;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffd700, #ff8c00, #ffd700);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(255, 200, 50, 0.3);
}
.start-screen .subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #8a7ab5;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.start-screen .rules {
  background: linear-gradient(135deg, #1a1235, #1e1640);
  border: 1px solid rgba(255, 200, 50, 0.15);
  border-radius: 12px;
  padding: 22px 28px;
  margin: 0 auto 24px;
  max-width: 420px;
  font-size: 15px;
  color: #b8a8d8;
  line-height: 1.7;
}
.daily-banner {
  margin: 8px 0 12px;
}
.daily-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #ffd700;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.countdown-label {
  font-size: 12px;
  color: #6a5a8a;
  margin-bottom: 12px;
}
.rank-label {
  font-family: 'Righteous', cursive;
  font-size: 14px;
  color: #b8a8d8;
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.footer-credit {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #6a5a8a;
  margin-top: 32px;
  letter-spacing: 2px;
}

/* ===== META ROW ===== */
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.meta .question-num {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #ffd700;
  letter-spacing: 2px;
}
.meta .clue-num {
  font-size: 11px;
  color: #6a5a8a;
  font-weight: 500;
}
.meta .score-badge span {
  background: linear-gradient(135deg, #2a1a45, #1e1235);
  border: 1px solid rgba(255, 200, 50, 0.2);
  padding: 5px 16px;
  border-radius: 20px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #ffd700;
  letter-spacing: 1px;
}

/* ===== CLUE PROGRESS DOTS ===== */
.clue-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 4px;
}
.clue-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a2040;
  border: 1px solid #3a3060;
  transition: all 0.3s;
}
.clue-dot.active { background: #ffd700; border-color: #ffd700; box-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
.clue-dot.seen   { background: #5a4a7a; border-color: #6a5a8a; }

/* ===== CLUE CARD ===== */
.clue-card {
  background: linear-gradient(135deg, #1a1235, #1e1640);
  border: 1px solid rgba(255, 200, 50, 0.12);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 14px;
  text-align: center;
  font-size: 17px;
  line-height: 1.7;
  color: #d8d0e8;
  animation: glow 2s ease-in-out 1;
  position: relative;
  contain: layout style;
}
.clue-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,200,50,0.15), transparent 40%, transparent 60%, rgba(255,200,50,0.1));
  z-index: -1;
  pointer-events: none;
}

/* ===== INPUT ===== */
.input-area { text-align: center; margin-bottom: 12px; }
.input-area input {
  background: #120e25;
  border: 2px solid #3a2a60;
  border-radius: 10px;
  padding: 12px 18px;
  color: #e8e0f0;
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  width: 100%;
  max-width: 360px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-area input::placeholder { color: #5a4a7a; }
.input-area input:focus { border-color: #ffd700; box-shadow: 0 0 16px rgba(255, 215, 0, 0.15); }

/* ===== BUTTONS ===== */
.buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.btn-primary { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #1a0a30; box-shadow: 0 4px 16px rgba(255, 200, 50, 0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(255, 200, 50, 0.35); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(255, 200, 50, 0.2); filter: brightness(0.9); }
.btn-secondary { background: rgba(255, 255, 255, 0.05); border: 1px solid #4a3a70; color: #b8a8d8; }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: #6a5a90; transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); background: rgba(255, 255, 255, 0.15); }

/* ===== WRONG BANNER ===== */
.wrong-banner {
  background: linear-gradient(135deg, #2a0a15, #1e0810);
  border: 1px solid rgba(255, 60, 80, 0.3);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  text-align: center;
  animation: popIn 0.3s ease-out;
}
.wrong-banner .label       { font-family: 'Righteous', cursive; font-size: 18px; color: #ff4060; margin-bottom: 6px; }
.wrong-banner .wrong-answer { font-size: 15px; color: #ff6080; text-decoration: line-through; }
.wrong-banner .no-points   { font-size: 12px; color: #a07a8a; margin-top: 8px; }

/* ===== REVEAL ===== */
.reveal-header {
  background: linear-gradient(135deg, #0a2a15, #0e2a10);
  border: 1px solid rgba(80, 255, 120, 0.25);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
  animation: popIn 0.4s ease-out;
}
.reveal-header .status   { font-family: 'Press Start 2P', monospace; font-size: 10px; color: #50ff80; letter-spacing: 3px; margin-bottom: 8px; }
.reveal-header .answer   { font-family: 'Righteous', cursive; font-size: 28px; color: #50ff80; text-shadow: 0 0 12px rgba(80, 255, 120, 0.3); }
.reveal-header .points   { font-family: 'Press Start 2P', monospace; font-size: 12px; color: #ffd700; margin-top: 10px; }
.reveal-header .category { font-size: 12px; color: #8a9a8a; margin-top: 10px; background: rgba(255,255,255,0.06); display: inline-block; padding: 4px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); }
.reveal-header.wrong-reveal { background: linear-gradient(135deg, #2a0a15, #1e0810); border-color: rgba(255, 60, 80, 0.3); }
.reveal-header.wrong-reveal .status { color: #ff4060; }
.reveal-header.wrong-reveal .answer { color: #ff6080; text-shadow: 0 0 12px rgba(255, 60, 80, 0.3); }

/* ===== ALL CLUES LIST ===== */
.all-clues { background: linear-gradient(135deg, #1a1235, #1e1640); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.all-clues .heading { font-family: 'Press Start 2P', monospace; font-size: 8px; color: #6a5a8a; letter-spacing: 2px; margin-bottom: 14px; }
.clue-item { border-left: 2px solid #3a2a60; padding: 10px 14px; margin-bottom: 10px; border-radius: 0 8px 8px 0; }
.clue-item:last-child { margin-bottom: 0; }
.clue-item .clue-label { font-size: 10px; color: #8a7ab5; margin-bottom: 4px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.clue-item .clue-text  { font-size: 13px; color: #a898c8; line-height: 1.6; }
.clue-item.highlighted { border-left-color: #ffd700; background: rgba(255, 215, 0, 0.06); }
.clue-item.highlighted .clue-label { color: #ffd700; }
.clue-item.highlighted .clue-text  { color: #d8d0e8; }

/* ===== PREVIOUS CLUES ===== */
.prev-clues-toggle { text-align: center; margin-bottom: 12px; }
.prev-clues-toggle button {
  background: rgba(255,255,255,0.04); border: 1px solid #3a2a60; border-radius: 20px;
  padding: 5px 16px; font-size: 11px; color: #6a5a8a; cursor: pointer;
  font-family: 'Outfit', sans-serif; transition: all 0.2s;
}
.prev-clues-toggle button:hover { color: #b8a8d8; border-color: #5a4a80; background: rgba(255,255,255,0.06); }
.prev-clues { background: linear-gradient(135deg, #14102a, #181430); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.prev-clue { border-left: 2px solid #2a2040; padding: 8px 12px; margin-bottom: 8px; border-radius: 0 6px 6px 0; }
.prev-clue:last-child { margin-bottom: 0; }
.prev-clue .prev-label { font-size: 9px; color: #7a6a9a; margin-bottom: 3px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.prev-clue .prev-text  { font-size: 12px; color: #6a5a8a; line-height: 1.5; }

/* ===== END SCREEN ===== */
.end-screen { text-align: center; }
.end-screen h2 { font-family: 'Righteous', cursive; font-size: 28px; background: linear-gradient(135deg, #ffd700, #ff8c00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 4px; }
.end-screen .final-label { font-size: 11px; color: #6a5a8a; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 2px; }
.end-screen .final-score { font-family: 'Righteous', cursive; font-size: 48px; color: #50ff80; margin-bottom: 2px; text-shadow: 0 0 20px rgba(80, 255, 120, 0.2); }
.end-screen .final-score .max { font-size: 18px; color: #5a4a7a; }

/* ===== SCORE TABLE ===== */
.score-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; text-align: left; background: linear-gradient(135deg, #1a1235, #1e1640); border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.06); }
.score-table thead tr { background: rgba(255, 200, 50, 0.06); }
.score-table th { font-family: 'Press Start 2P', monospace; font-size: 7px; color: #6a5a8a; letter-spacing: 1px; padding: 8px; font-weight: normal; }
.score-table td { padding: 7px 8px; color: #b8a8d8; border-top: 1px solid rgba(255,255,255,0.04); }
.score-table .clue-pill  { background: rgba(255,215,0,0.1); border: 1px solid rgba(255,215,0,0.2); color: #ffd700; padding: 3px 12px; border-radius: 12px; font-size: 10px; font-weight: 600; }
.score-table .wrong-pill { background: rgba(255,60,80,0.1); border: 1px solid rgba(255,60,80,0.2); color: #ff4060; padding: 3px 12px; border-radius: 12px; font-size: 10px; font-weight: 600; }
.pts-positive { color: #50ff80; font-weight: 600; }
.pts-zero     { color: #ff4060; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }

/* ===== SHARE CARD ===== */
.share-card { background: linear-gradient(135deg, #12102a, #1a1440); border: 1px solid rgba(255,200,50,0.15); border-radius: 14px; padding: 14px 16px; margin: 12px 0; font-family: monospace; font-size: 13px; line-height: 1.8; color: #c8b8e8; text-align: left; white-space: pre-wrap; word-break: break-word; }
.share-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.btn-copy { background: linear-gradient(135deg, #2a1a45, #1e1235); border: 1px solid rgba(255,200,50,0.3); color: #ffd700; }
.btn-copy:hover { background: linear-gradient(135deg, #3a2a55, #2e2245); border-color: rgba(255,200,50,0.5); transform: translateY(-1px); }
.btn-copy.copied { background: linear-gradient(135deg, #0a2a15, #0e2a10); border-color: rgba(80,255,120,0.4); color: #50ff80; }
.btn-swap { background: rgba(255,255,255,0.03); border: 1px solid #3a2a60; color: #6a5a8a; font-size: 12px; padding: 10px 18px; }
.btn-swap:hover { background: rgba(255,255,255,0.07); border-color: #5a4a80; color: #a090c0; transform: translateY(-1px); }
.swap-used-label { font-size: 11px; color: #3a2a50; padding: 10px 18px; border: 1px solid #2a1a40; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.game-hint { text-align: center; font-size: 11px; color: #5a4a7a; margin-top: 8px; letter-spacing: 0.3px; }
.streak-badge { display: inline-block; font-size: 13px; color: #ff8c00; animation: streakPop 0.3s ease-out; margin-left: 8px; }

/* ===== TUTORIAL OVERLAY ===== */
.tutorial-overlay {
  position: fixed; inset: 0; background: rgba(5,4,20,0.96);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px; animation: slideIn 0.3s ease-out;
}
.tutorial-card {
  background: linear-gradient(135deg, #1a1235, #1e1640);
  border: 1px solid rgba(255,200,50,0.25); border-radius: 18px;
  padding: 28px 28px 22px; max-width: 420px; width: 100%;
  text-align: center;
}
.tutorial-card h2 {
  font-family: 'Righteous', cursive; font-size: 22px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 20px;
}
.tutorial-rule {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; text-align: left;
}
.tutorial-rule .icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.tutorial-rule .text { font-size: 13px; color: #b8a8d8; line-height: 1.55; }
.tutorial-rule .text strong { color: #e8e0f0; font-weight: 600; }
.tutorial-scoring {
  display: flex; justify-content: center; gap: 8px;
  margin: 14px 0 20px; flex-wrap: wrap;
}
.tutorial-pts {
  background: rgba(255,215,0,0.08); border: 1px solid rgba(255,215,0,0.15);
  border-radius: 8px; padding: 6px 10px; text-align: center;
  font-size: 11px; color: #b8a8d8;
}
.tutorial-pts .num { font-family: 'Righteous', cursive; font-size: 16px; color: #ffd700; display: block; }
.tutorial-skip { background: none; border: none; color: #3d3060; font-size: 11px; font-family: 'Outfit', sans-serif; cursor: pointer; margin-top: 8px; text-decoration: underline; padding: 4px; }

/* ===== PERFECT BADGE ===== */
.perfect-badge {
  font-family: 'Righteous', cursive;
  font-size: 18px;
  color: #ffd700;
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(255,215,0,0.5);
  animation: shimmer 2s linear infinite;
}

/* ===== RESPONSIVE ===== */
/* ===== TABLET ===== */
@media (max-width: 680px) {
  body { padding: 14px 18px; }
  .clue-card { font-size: 16px; }
  .reveal-header .answer { font-size: 24px; }
  .end-screen .final-score { font-size: 44px; }
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  body { padding: 12px 14px; }
  #game { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .start-screen h1 { font-size: 36px; letter-spacing: 2px; }
  .start-screen .subtitle { font-size: 7px; letter-spacing: 2px; }
  .start-screen .rules { font-size: 14px; padding: 14px 16px; }
  .meta .question-num { font-size: 7px; letter-spacing: 1px; }
  .meta .score-badge span { font-size: 7px; padding: 4px 10px; }
  .clue-card { font-size: 15px; padding: 14px 14px; }
  .input-area input { max-width: 100%; font-size: 16px; }
  .buttons { gap: 8px; }
  .btn { padding: 10px 14px; font-size: 12px; }
  .reveal-header .answer { font-size: 22px; }
  .reveal-header .status { font-size: 8px; }
  .reveal-header .points { font-size: 10px; }
  .end-screen h2 { font-size: 24px; }
  .end-screen .final-score { font-size: 40px; }
  .end-screen .final-score .max { font-size: 16px; }
  .score-table th { font-size: 6px; padding: 6px; }
  .score-table td { font-size: 12px; padding: 6px; }
  .score-table .clue-pill, .score-table .wrong-pill { padding: 2px 8px; font-size: 9px; }
  .wrong-banner .label { font-size: 16px; }
  .share-card { font-size: 11px; padding: 10px 12px; line-height: 1.6; }
}

/* ===== SHORT VIEWPORT ===== */
@media (max-height: 700px) {
  body { padding: 8px 12px; }
  .meta { margin-bottom: 4px; }
  .clue-card { padding: 12px 14px; margin-bottom: 6px; font-size: 14px; line-height: 1.5; }
  .clue-dots { margin: 2px 0 1px; }
  .input-area { margin-bottom: 4px; }
  .input-area input { padding: 8px 14px; }
  .btn { padding: 9px 14px; font-size: 12px; }
  .game-hint { margin-top: 2px; font-size: 10px; }
  .reveal-header { padding: 12px; margin-bottom: 8px; }
  .reveal-header .answer { font-size: 20px; }
  .reveal-header .points { margin-top: 4px; font-size: 10px; }
  .reveal-header .category { margin-top: 4px; }
  .end-screen h2 { font-size: 24px; }
  .end-screen .final-score { font-size: 42px; }
  .end-screen .final-score .max { font-size: 16px; }
  .score-table th { padding: 6px; }
  .score-table td { padding: 5px 6px; }
}
