/* ── What's Missing — Game Styles ─────────────────────────────────────── */

/* Phase label in nav */
.phase-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #f59e0b);
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.12);
  border-radius: 99px;
}

/* Countdown bar (BEFORE phase — 3s to study) */
.countdown-wrap {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin: 4px 0 8px;
}
.countdown-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 99px;
  transition: width linear;
}

/* Timer bar (AFTER phase) */
.timer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
}
.timer-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
#timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ef4444, #f97316);
  border-radius: 99px;
  transition: width linear, background 0.3s;
}
.timer-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text2);
  min-width: 28px;
  text-align: right;
  transition: color 0.3s ease;
}
.timer-num.urgent {
  color: #ef4444;
  animation: wmTimerUrgent 0.5s ease infinite alternate;
}
@keyframes wmTimerUrgent {
  from { transform: scale(1);    opacity: 1; }
  to   { transform: scale(1.12); opacity: 0.75; }
}

/* Scene container */
.scene-wrap {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  margin-bottom: 12px;
}
.scene-label {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #f59e0b);
  background: rgba(245, 158, 11, 0.15);
  padding: 3px 8px;
  border-radius: 99px;
  z-index: 2;
}
.scene-panel {
  min-height: 140px;
  padding: 44px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scene-panel > * {
  width: 100%;
}
.scene-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
  padding: 0 16px 12px;
}

/* Scene transition animation */
.scene-wrap.flash-in {
  animation: sceneFlash 0.38s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes sceneFlash {
  0%   { opacity: 0; transform: scale(0.94) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Flash overlay */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 158, 11, 0.15);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none; /* never block taps — animation fades to 0 anyway */
  animation: flashPulse 0.5s ease-out;
}
.flash-text {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
  animation: flashTextPop 0.5s ease-out;
}
@keyframes flashPulse {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes flashTextPop {
  0%   { transform: scale(0.8); opacity: 0; }
  50%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Options area */
.options-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.options-question {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text2);
  text-align: center;
  letter-spacing: 0.02em;
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.option-btn {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  text-align: center;
  line-height: 1.2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.option-btn {
  transition:
    transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.option-btn:active {
  transform: scale(0.93) translateY(1px);
  transition: transform 0.07s ease;
}
.option-btn:hover {
  border-color: var(--accent, rgba(245, 158, 11, 0.5));
  background: var(--surface);
}
.option-btn.correct {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
  animation: wmCorrectPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.option-btn.wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
  animation: wmWrongShake 0.4s ease both;
}
@keyframes wmCorrectPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(16,185,129,0.2); }
  100% { transform: scale(1); box-shadow: none; }
}
@keyframes wmWrongShake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-7px); }
  40%  { transform: translateX(7px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
}
.option-btn.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* Nothing Changed button */
.nothing-btn {
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.nothing-btn:hover {
  border-color: var(--text2);
  background: var(--surface2);
}
.nothing-btn.correct {
  border-style: solid;
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
}
.nothing-btn.wrong {
  border-style: solid;
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}
.nothing-btn.disabled {
  pointer-events: none;
}

/* Result panel */
.result-panel {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  border: 1.5px solid var(--border);
  animation: resultSlideUp 0.25s ease-out;
}
@keyframes resultSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.result-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* Emoji scene display */
.emoji-scene {
  background: var(--surface2);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  min-height: 90px;
  width: 100%;
}

/* Score-per-speed indicator */
.speed-bonus-pop {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent, #f59e0b);
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  pointer-events: none;
  animation: bonusPop 0.8s ease-out forwards;
  z-index: 200;
}
@keyframes bonusPop {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateX(-50%) translateY(-20px) scale(1.2); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(0.9); }
}

/* Mode grid */
.mode-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 12px;
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.mode-btn {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s, border-color 0.2s;
  color: var(--text);
}
.mode-btn:hover, .mode-btn.selected {
  border-color: var(--accent, #f59e0b);
  background: rgba(var(--accent-rgb, 245 158 11) / 0.08);
  transform: translateY(-2px);
}
.mode-emoji { font-size: 1.6rem; }
.mode-name  { font-size: 0.9rem; font-weight: 800; }
.mode-desc  { font-size: 0.7rem; color: var(--text2); text-align: center; }
.mode-start-hint {
  font-size: 0.75rem;
  color: var(--text2);
  text-align: center;
}

/* HUD */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.hud-mid {
  flex: 1;
  padding: 0 8px;
}
.hud-lives { font-size: 0.9rem; margin-bottom: 2px; }
.hud-mode  { font-size: 0.65rem; color: var(--text2); font-weight: 700; }
.hud-score { font-size: 0.78rem; font-weight: 700; }
.hud-streak { font-size: 0.7rem; color: #f59e0b; font-weight: 700; }
.progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Best pill */
.best-pill {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 600;
}

/* How to play */
.how-to-play {
  font-size: 0.8rem;
  color: var(--text2);
  text-align: center;
  line-height: 1.6;
  padding: 14px 16px;
}

/* In-game nav */
.in-game-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.in-game-back-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 0;
  font-weight: 600;
}

/* Stats grid on game over */
.stats-grid {
  display: grid;
  gap: 12px;
  margin: 20px 0 8px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border-radius: 12px;
  padding: 12px 8px;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
}
.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
}
.over-title {
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 4px;
}
.over-sub {
  font-size: 0.82rem;
  color: var(--text2);
}

/* Survival timer display */
.survival-timer {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent, #f59e0b);
  text-align: center;
  margin: 4px 0;
}

/* Responsive */
@media (min-width: 480px) {
  .options-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .mode-grid { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
}
@media (min-width: 900px) {
  .scene-panel { min-height: 180px; padding: 52px 24px 24px; }
  .options-grid { gap: 14px; }
  .survival-timer { font-size: 2.6rem; }
}
@media (min-width: 1200px) {
  .scene-panel { min-height: 200px; }
}
