:root {
  --bg-base: #060606;
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --bg-elevated-2: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.035);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-glass-strong: rgba(255, 255, 255, 0.16);

  --text: #ededed;
  --text-dim: #9a9a9a;
  --text-faint: #666666;

  --accent-1: #c9992c; /* deep gold */
  --accent-2: #f0d78a; /* champagne gold */
  --gradient-main: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --gradient-warm: linear-gradient(135deg, var(--accent-2), var(--accent-1));

  --success: #34d399;
  --danger: #fb7185;

  --radius-lg: 10px;
  --radius-md: 7px;
  --radius-sm: 5px;
  --radius-pill: 6px;

  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;

  --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-body);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.site-header,
.game-container,
.modal,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---- Header ---- */
.site-header {
  padding: 2rem 1.25rem 0.5rem;
}

.header-row {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.logo span {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  color: var(--text-dim);
  margin-top: 0.35rem;
  font-size: 0.92rem;
}

.header-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: var(--bg-elevated);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-glass-strong);
  background: var(--bg-elevated-2);
  transform: translateY(-1px);
}

/* ---- Layout ---- */
.game-container {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 720px) {
  .game-container {
    grid-template-columns: 1fr;
  }
}

/* ---- Poster panel ---- */
.poster-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.poster-frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-soft);
  background: var(--bg-elevated);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.poster-frame.pulse {
  animation: pulse-glow 0.5s ease;
}

@keyframes pulse-glow {
  0% { box-shadow: var(--shadow-soft); }
  50% { box-shadow: 0 0 0 10px rgba(201, 153, 44, 0.25), var(--shadow-soft); }
  100% { box-shadow: var(--shadow-soft); }
}

#poster-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.attempts-track {
  display: flex;
  gap: 0.45rem;
}

.pip {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-faint);
}

.pip.used {
  border-color: var(--border-glass-strong);
}

.pip.latest {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 1px rgba(201, 153, 44, 0.3);
  color: var(--text);
}

/* ---- Play panel ---- */
.play-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.facts-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  backdrop-filter: blur(20px);
}

.facts-panel h3 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

#facts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fact {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-faint);
}

.fact span {
  font-weight: 500;
}

.fact.revealed {
  color: var(--text-dim);
  background: rgba(201, 153, 44, 0.1);
  border-color: rgba(201, 153, 44, 0.35);
}

.fact.revealed span {
  color: var(--text);
  font-weight: 600;
}

/* ---- Guess form ---- */
.guess-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

#skip-btn {
  padding: 0.75rem 1.1rem;
}

.autocomplete-wrapper {
  position: relative;
  flex: 1;
}

#guess-input {
  width: 100%;
  padding: 0.8rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem; /* must be ≥16px to prevent iOS auto-zoom */
  font-family: var(--font-body);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#guess-input::placeholder {
  color: var(--text-faint);
}

#guess-input:focus {
  outline: none;
  border-color: rgba(201, 153, 44, 0.6);
  box-shadow: 0 0 0 3px rgba(201, 153, 44, 0.22);
}

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #101010;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-md);
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  max-height: 240px;
  overflow-y: auto;
  z-index: 30;
  box-shadow: var(--shadow-soft);
}

.suggestions.hidden {
  display: none;
}

.suggestions li {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.suggestions li:hover,
.suggestions li.active {
  background: rgba(201, 153, 44, 0.16);
  color: var(--text);
}

#guess-btn,
.primary-btn {
  background: var(--gradient-main);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 1.4rem;
  font-weight: 700;
  font-size: 0.92rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 20px rgba(201, 153, 44, 0.35);
}

#guess-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(201, 153, 44, 0.45);
}

#guess-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.4rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.secondary-btn:hover {
  background: var(--bg-elevated-2);
  border-color: var(--border-glass-strong);
}

.text-btn {
  background: none;
  border: none;
  color: var(--accent-2);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.text-btn:hover {
  text-decoration: underline;
}

.message {
  min-height: 1.4rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.message.correct { color: var(--success); }
.message.wrong { color: var(--danger); }

.round-guesses {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.round-guesses.hidden {
  display: none;
}

.round-guesses-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.round-guesses-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.guess-chip {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.25);
  color: var(--danger);
  text-decoration: line-through;
  opacity: 0.85;
}

.score-bar {
  display: flex;
  gap: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  backdrop-filter: blur(20px);
}

.score-item {
  flex: 1;
  text-align: center;
}

.score-item span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.score-item small {
  color: var(--text-faint);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- Modals ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #0c0c0c;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
}

.modal-content img {
  width: 150px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass-strong);
  margin-bottom: 0.9rem;
}

.modal-content h2 {
  font-family: var(--font-display);
  margin: 0.2rem 0;
  font-weight: 700;
}

.end-meta, .end-cast {
  color: var(--text-dim);
  font-size: 0.87rem;
  margin: 0.25rem 0;
}

.result-grid {
  font-size: 1.6rem;
  letter-spacing: 0.2rem;
  margin: 1rem 0;
}

.end-score {
  font-weight: 600;
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1.1rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Settings modal ---- */
.settings-content {
  text-align: left;
  max-width: 460px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.settings-header h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.3rem;
}

.settings-header .icon-btn {
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
}

.settings-section {
  margin-bottom: 1.4rem;
}

.settings-section h3 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 0.7rem;
}

.settings-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.year-range-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.year-picker-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-faint);
  min-width: 0;
}

.year-picker {
  position: relative;
}

.year-picker-btn {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.year-picker-btn:hover {
  border-color: var(--border-glass-strong);
}

.year-picker-btn svg {
  color: var(--text-faint);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.year-picker-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.year-picker-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #101010;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-md);
  list-style: none;
  margin: 0;
  padding: 0.3rem;
  max-height: 220px;
  overflow-y: auto;
  z-index: 40;
  box-shadow: var(--shadow-soft);
}

.year-picker-list.hidden {
  display: none;
}

.year-picker-list li {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.year-picker-list li:hover {
  background: rgba(201, 153, 44, 0.16);
  color: var(--text);
}

.year-picker-list li.selected {
  background: rgba(201, 153, 44, 0.14);
  color: var(--accent-2);
  font-weight: 600;
}

.year-range-dash {
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--border-glass-strong);
}

.chip.active {
  background: var(--gradient-main);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.settings-hint {
  font-size: 0.76rem;
  color: var(--text-faint);
  margin: 0.6rem 0 0;
}

.settings-match-count {
  font-size: 0.85rem;
  color: var(--text-dim);
  background: rgba(201, 153, 44, 0.1);
  border: 1px solid rgba(201, 153, 44, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  margin: 0 0 1.2rem;
}

.settings-match-count.warning {
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.3);
  color: var(--danger);
}

/* ---- History panel ---- */
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 55vh;
  overflow-y: auto;
}

.history-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}

.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.history-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.history-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
}

.history-badge.won {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.history-badge.lost {
  background: rgba(251, 113, 133, 0.15);
  color: var(--danger);
}

.history-meta {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ======================================================
   BOLLYWOOD RIDDLE — comparison/deduction game styles
   ====================================================== */

/* ---- Full-height lock (riddle page only) ---- */
/* Prevents the page from scrolling; only the history section scrolls internally */
.riddle-page {
  height: 100vh;
  height: 100dvh; /* accounts for mobile address bar collapsing */
  overflow: hidden;
}

.riddle-page .site-footer {
  display: none; /* footer lives in the bottom bar instead */
}

/* ---- Page layout ---- */
.riddle-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.25rem 0;
}

.riddle-container {
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  min-height: 0;       /* allows shrinking without overflow: hidden, so absolute children aren't clipped */
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ---- ① Clue panel (top) ---- */
.clue-panel {
  flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem 1.1rem;
}

.clue-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.clue-panel-heading {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}

/* Hint bar inside clue panel header */
.clue-panel-header .hint-bar {
  padding: 0;
}

.hint-bar.hidden {
  display: none;
}

.clue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.clue-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.clue-item-wide {
  grid-column: 1 / -1;
}

.clue-label {
  font-size: 0.68rem;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.clue-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.3s ease;
}

.clue-value.clue-unknown {
  color: var(--text-faint);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.clue-value.clue-partial {
  color: var(--text);
}

.clue-value.clue-revealed {
  color: var(--accent-2);
  font-weight: 700;
}

.clue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.6rem;
  align-items: flex-start;
}

.clue-empty {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-style: italic;
  align-self: center;
}

/* A revealed clue tag (gold) */
.clue-tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(201, 153, 44, 0.18);
  border: 1px solid rgba(201, 153, 44, 0.45);
  color: var(--accent-2);
  animation: tag-pop 0.25s ease;
}

/* Newly revealed at game-end (items not previously matched) */
.clue-tag.clue-tag-new {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-glass-strong);
  color: var(--text-dim);
  font-weight: 400;
}

@keyframes tag-pop {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---- ② Guess history — scrolls internally ---- */
.riddle-history {
  flex: 1;
  min-height: 0;          /* critical: lets the flex child shrink below content size */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  /* Thin themed scrollbar — Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 153, 44, 0.35) transparent;
}

/* Thin themed scrollbar — WebKit/Blink */
.riddle-history::-webkit-scrollbar {
  width: 4px;
}
.riddle-history::-webkit-scrollbar-track {
  background: transparent;
}
.riddle-history::-webkit-scrollbar-thumb {
  background: rgba(201, 153, 44, 0.35);
  border-radius: 2px;
}
.riddle-history::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 153, 44, 0.6);
}

.history-empty-hint {
  font-size: 0.82rem;
  color: var(--text-faint);
  text-align: center;
  margin: auto 0;         /* vertically centres the hint in the available space */
  padding: 0.5rem 0;
}

.history-empty-hint.hidden {
  display: none;
}

/* ---- ③ Bottom area (stats + input) — never shrinks ---- */
.riddle-bottom-area {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.6rem 0 0.75rem;
  border-top: 1px solid var(--border-glass);
}

/* ---- Stats bar ---- */
.riddle-stats-bar {
  display: flex;
  gap: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
}

.riddle-stat {
  flex: 1;
  text-align: center;
}

.riddle-stat span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.riddle-stat small {
  color: var(--text-faint);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- Input area ---- */
.riddle-input-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.riddle-input-area #guess-form {
  display: flex;
  gap: 0.6rem;
}

/* Input always grows, button never steals space — at any screen width */
.riddle-input-area .autocomplete-wrapper {
  flex: 1 1 0;    /* grow freely, shrink freely, start from 0 basis */
  min-width: 0;   /* allow shrinking below content width */
}

.riddle-input-area #guess-btn {
  flex: 0 0 auto; /* never grow, never shrink */
  padding: 0 1.1rem;
  white-space: nowrap;
  width: auto;    /* override any stray width: 100% */
}

.riddle-input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.4rem;
}

.attempts-left {
  font-size: 0.8rem;
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ---- Guess grid ---- */
.riddle-grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.riddle-grid {
  min-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Each row: header + guess rows */
.riddle-row {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) 100px minmax(140px, 1.2fr) minmax(160px, 1.5fr) minmax(200px, 2fr);
  gap: 0.45rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.riddle-row.row-visible {
  opacity: 1;
  transform: none;
}

/* ---- Cells ---- */
.riddle-cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

/* Title column */
.riddle-col-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.3;
}

/* Year column */
.riddle-col-year {
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  gap: 0.3rem;
}

.riddle-col-year.year-up    { background: rgba(52, 211, 153, 0.1);  border-color: rgba(52, 211, 153, 0.3); }
.riddle-col-year.year-down  { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.3); }
.riddle-col-year.year-equal { background: rgba(201, 153, 44, 0.15); border-color: rgba(201, 153, 44, 0.4); }

.ryear-num {
  color: var(--text);
}

.year-arrow {
  font-size: 0.95rem;
  font-weight: 700;
}

.year-arrow.up    { color: var(--success); }
.year-arrow.down  { color: var(--danger); }
.year-arrow.equal { color: var(--accent-2); }

/* Director column */
.riddle-col-dir {
  color: var(--text-dim);
  gap: 0.4rem;
  justify-content: space-between;
}

.riddle-col-dir.dir-match {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--success);
}

.rdir-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rdir-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.riddle-col-dir:not(.dir-match) .rdir-icon { color: var(--text-faint); }
.riddle-col-dir.dir-match .rdir-icon       { color: var(--success); }

/* Genres + Cast columns */
.riddle-col-genres,
.riddle-col-cast {
  align-items: flex-start;
  align-content: flex-start;
}

/* Tags (genres / cast members) */
.riddle-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-faint);
  white-space: nowrap;
}

.riddle-tag.match {
  background: rgba(201, 153, 44, 0.18);
  border-color: rgba(201, 153, 44, 0.5);
  color: var(--accent-2);
  font-weight: 600;
}

.rtag-none {
  color: var(--text-faint);
  font-size: 0.8rem;
}

/* ---- Redesigned end modal ---- */
.riddle-end-modal {
  padding: 0;
  overflow: hidden;
  text-align: center;
  max-width: 380px;
}

/* Status banner */
.end-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.end-banner.banner-won  { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.end-banner.banner-lost { background: rgba(251, 113, 133, 0.12); color: var(--danger); }

.end-banner-icon { font-size: 1.2rem; }

/* Poster */
.end-poster-wrap {
  padding: 1.25rem 1.25rem 0.75rem;
}

.end-poster-wrap img {
  width: 140px;
  height: 210px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass-strong);
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  display: block;
  margin: 0 auto;
}

/* Details block */
.end-details {
  padding: 0 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.end-movie-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.25;
  color: var(--text);
}

/* Year + genre row */
.end-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.end-meta-chip {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(201, 153, 44, 0.15);
  border: 1px solid rgba(201, 153, 44, 0.4);
  color: var(--accent-2);
}

.end-genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.end-genre-chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-glass);
  color: var(--text-dim);
}

/* Director */
.end-director {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

/* Guess dots */
.end-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.25rem 0;
}

.end-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot-win    { background: var(--success); box-shadow: 0 0 6px rgba(52,211,153,0.6); }
.dot-miss   { background: rgba(251, 113, 133, 0.5); }
.dot-unused { background: transparent; border: 1.5px solid var(--border-glass-strong); }

/* Cast */
.end-cast {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 0;
  line-height: 1.5;
}

/* Play Again button */
.riddle-end-modal .modal-actions {
  padding: 0.75rem 1.25rem 1.25rem;
}

.end-play-btn {
  width: 100%;
  padding: 0.8rem;
  font-size: 0.95rem;
}

/* ---- Hint system ---- */

/* Hint bar (sits between stats and input) */
.hint-bar {
  padding: 0.5rem 1rem 0.1rem;
  display: flex;
  justify-content: center;
}

@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 153, 44, 0.5); }
  60%       { box-shadow: 0 0 0 8px rgba(201, 153, 44, 0); }
}

.hint-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  background: linear-gradient(135deg, rgba(201,153,44,0.18), rgba(201,153,44,0.06));
  border: 1.5px solid rgba(201,153,44,0.55);
  border-radius: var(--radius-pill);
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  animation: hint-pulse 2.2s ease-in-out infinite;
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap;
}

.hint-trigger-btn:hover {
  background: rgba(201,153,44,0.28);
  border-color: var(--accent-2);
  animation: none;
}

.hint-trigger-icon { font-size: 0.85rem; line-height: 1; }

.hint-trigger-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  background: var(--accent-2);
  color: #1a1208;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 800;
  font-family: var(--font-display);
  flex-shrink: 0;
}

/* Hint picker overlay */
.hint-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.hint-picker-overlay.hidden { display: none; }

.hint-picker-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass-strong);
  border-radius: 20px 20px 0 0;
  padding: 1.4rem 1.25rem 2rem;
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.22s ease-out, opacity 0.22s ease-out;
}

.hint-picker-card.hint-card-visible {
  transform: translateY(0);
  opacity: 1;
}

/* Pull handle */
.hint-picker-card::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--border-glass-strong);
  border-radius: 2px;
  margin: 0 auto 1.2rem;
}

.hint-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.hint-picker-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.hint-picker-sub {
  font-size: 0.81rem;
  color: var(--text-faint);
  margin: 0 0 1.2rem;
}

/* 2×2 grid of hint tiles */
.hint-picker-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.hint-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.75rem;
  background: var(--bg-elevated-2);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  text-align: center;
}

.hint-option-btn:hover:not(:disabled) {
  border-color: var(--accent-2);
  background: rgba(201,153,44,0.1);
  transform: translateY(-2px);
}

.hint-option-btn:active:not(:disabled) {
  transform: translateY(0);
}

.hint-option-icon {
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 0.1rem;
}

.hint-option-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.hint-option-desc {
  font-size: 0.71rem;
  color: var(--text-faint);
  line-height: 1.3;
}

/* Already used / no new info states */
.hint-option-btn.hint-option-used,
.hint-option-btn.hint-option-no-info {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
}

.hint-option-btn.hint-option-used .hint-option-desc {
  color: var(--success);
  opacity: 0.9;
}

/* End modal hints row */
.end-hints-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.85rem;
  background: rgba(201,153,44,0.1);
  border: 1px solid rgba(201,153,44,0.3);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0 auto;
}

.end-hints-icon { font-size: 0.85rem; }
.end-hints-label { font-weight: 500; }
.end-hints-count { font-weight: 800; color: var(--accent-2); }
.end-hints-max   { color: var(--text-faint); }

/* ---- How to play modal ---- */
.how-content {
  max-width: 480px;
}

.how-intro {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0 0 1.2rem;
  line-height: 1.5;
}

.how-section {
  margin-bottom: 1.2rem;
}

.how-section h3 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 0.7rem;
}

.how-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.how-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.87rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.how-list .riddle-tag {
  font-size: 0.78rem;
}

.how-list .year-arrow {
  font-size: 0.9rem;
}

/* ---- Mobile: card layout ---- */
@media (max-width: 768px) {
  /* Kill horizontal scroll — cards flow vertically instead */
  .riddle-grid-scroll {
    overflow-x: visible;
  }

  .riddle-grid {
    min-width: 0;
    gap: 0.6rem;
  }

  /* Each guess row becomes a card */
  .riddle-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title  year"
      "dir    dir"
      "genres genres"
      "cast   cast";
    gap: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    /* Reset the desktop animation defaults so cards appear immediately */
    opacity: 1;
    transform: none;
  }

  /* Cells: flush with card edges, separator lines between sections */
  .riddle-cell {
    border: none;
    border-bottom: 1px solid var(--border-glass);
    border-radius: 0;
    background: transparent;
    padding: 0.6rem 0.75rem;
  }

  .riddle-col-cast {
    border-bottom: none;
  }

  /* Grid area assignments */
  .riddle-col-title  { grid-area: title; background: var(--bg-elevated-2); font-size: 0.92rem; align-items: center; }
  .riddle-col-year   { grid-area: year;  justify-content: center; border-left: 1px solid var(--border-glass); min-width: 72px; }
  .riddle-col-dir    { grid-area: dir; }
  .riddle-col-genres { grid-area: genres; align-items: flex-start; align-content: flex-start; }
  .riddle-col-cast   { grid-area: cast;   align-items: flex-start; align-content: flex-start; }

  /* Year colour overrides (must repeat since base class uses bg: transparent now) */
  .riddle-col-year.year-up    { background: rgba(52, 211, 153, 0.12);  border-color: rgba(52, 211, 153, 0.25); }
  .riddle-col-year.year-down  { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.25); }
  .riddle-col-year.year-equal { background: rgba(201, 153, 44, 0.15);  border-color: rgba(201, 153, 44, 0.3); }

  /* Inline section labels via ::before (replaces the hidden header) */
  .riddle-col-dir::before,
  .riddle-col-genres::before,
  .riddle-col-cast::before {
    font-size: 0.65rem;
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    flex-shrink: 0;
    margin-right: 0.25rem;
  }

  .riddle-col-dir::before    { content: "Dir"; align-self: center; }
  .riddle-col-genres::before { content: "Genres"; align-self: flex-start; padding-top: 0.18rem; }
  .riddle-col-cast::before   { content: "Cast";   align-self: flex-start; padding-top: 0.18rem; }

  /* Director match highlight needs to carry through on mobile */
  .riddle-col-dir.dir-match {
    background: rgba(52, 211, 153, 0.08);
  }

  /* Animate-in still works — just override opacity/transform after class is added */
  .riddle-row.row-visible {
    opacity: 1;
    transform: none;
    animation: card-drop 0.25s ease;
  }

  @keyframes card-drop {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
}

/* Suggestions open upward on riddle page (input is at bottom of screen) */
.riddle-page .suggestions {
  top: auto;
  bottom: calc(100% + 6px);
  border-radius: var(--radius-md);
}

/* Narrow phones: keep input + button in one row, just tighten the button */
@media (max-width: 480px) {
  .riddle-input-area #guess-btn {
    padding: 0 0.85rem;
    font-size: 0.88rem;
  }

  .riddle-stats-bar {
    gap: 0.5rem;
  }
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 1.4rem 1rem 2rem;
  color: var(--text-faint);
  font-size: 0.76rem;
}

.site-footer a {
  color: var(--accent-2);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---- Home link (game page header) ---- */
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-faint);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  transition: color 0.15s ease;
}

.home-link:hover {
  color: var(--accent-2);
}

/* ---- Homepage ---- */
.home-container {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.home-hero {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
}

.home-hero h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.2vw, 1.9rem);
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.home-hero p {
  color: var(--text-dim);
  margin: 0.3rem 0;
  font-size: 0.98rem;
}

.home-stats {
  color: var(--text-faint) !important;
  font-size: 0.82rem !important;
  margin-top: 0.9rem !important;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.3rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

a.game-card:hover {
  border-color: var(--accent-1);
  background: var(--bg-elevated-2);
  transform: translateY(-2px);
}

.game-card.disabled {
  opacity: 0.55;
  cursor: default;
}

.game-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(201, 153, 44, 0.1);
  border: 1px solid rgba(201, 153, 44, 0.25);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card.disabled .game-card-icon {
  background: var(--bg-elevated-2);
  border-color: var(--border-glass);
  color: var(--text-faint);
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.game-card-desc {
  color: var(--text-dim);
  font-size: 0.86rem;
  margin: 0;
  line-height: 1.45;
}

.game-card-cta {
  margin-top: auto;
  padding-top: 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-2);
}

.game-card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  color: var(--text-faint);
  border: 1px solid var(--border-glass-strong);
}

/* =========================================================================
   GUESS THE FRAME — frames.html
   ========================================================================= */

/* Full-height fixed layout */
body.frames-page {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.frames-page .site-header {
  flex-shrink: 0;
}

body.frames-page .site-footer {
  display: none;
}

.frames-main {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.frames-container {
  flex: 1 1 0;
  min-height: 0;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: hidden;
}

/* ── Frame display ── */
.frame-display-area {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.frame-display-inner {
  position: relative;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 36vh;
}

.frame-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}

.frame-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
}

.frame-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-glass-strong);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Thumbnail strip ── */
.frame-thumb-strip-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.1rem;
}

.frame-thumb-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1 1 0;
  min-width: 0;
  padding: 3px 1px;
  scrollbar-width: none;
}

.frame-thumb-strip::-webkit-scrollbar {
  display: none;
}

.frame-counter-num {
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Individual thumbnail */
.fthumb {
  flex-shrink: 0;
  width: 64px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.fthumb-locked {
  cursor: default;
  border-color: var(--border-glass);
}

.fthumb-unlocked {
  cursor: pointer;
  border-color: var(--border-glass-strong);
}

.fthumb-unlocked:hover {
  border-color: var(--accent-1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 153, 44, 0.25);
}

.fthumb-active {
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 1px var(--accent-2), 0 4px 12px rgba(201, 153, 44, 0.35) !important;
  transform: translateY(-2px);
}

.fthumb-win {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 1px var(--success) !important;
}

.fthumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-elevated-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fthumb-lock {
  font-size: 0.7rem;
  opacity: 0.4;
}

.fthumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Wrong guesses list ── */
.frames-history {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.frames-wrong-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.frames-wrong-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  background: rgba(251, 113, 133, 0.07);
  border: 1px solid rgba(251, 113, 133, 0.18);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.frames-wrong-x {
  color: var(--danger);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.frames-wrong-title {
  color: var(--text);
  font-weight: 500;
}

.frames-hint-text {
  color: var(--text-faint);
  font-size: 0.84rem;
  text-align: center;
  margin: 0;
  padding: 0.5rem 0;
}

/* ── Bottom area: stats + input ── */
.frames-bottom-area {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
}

.frames-stats-bar {
  display: flex;
  justify-content: center;
  gap: 1.8rem;
}

.frames-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.frames-stat span {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-display);
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.frames-stat small {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* ── Frames input ── */
.frames-input-area {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.frames-input-area form {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.frames-autocomplete-wrapper {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.frames-autocomplete-wrapper input {
  width: 100%;
  padding: 0.72rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem; /* must be ≥16px to prevent iOS auto-zoom */
  outline: none;
  transition: border-color 0.15s;
}

.frames-autocomplete-wrapper input:focus {
  border-color: var(--accent-1);
}

.frames-autocomplete-wrapper input::placeholder {
  color: var(--text-faint);
}

/* Suggestions — opens upward */
.frames-suggestions {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-md);
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
}

.frames-suggestions.frames-suggestions-hidden {
  display: none;
}

.frames-suggestions li {
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  transition: background 0.1s;
}

.frames-suggestions li:hover {
  background: var(--bg-elevated-2);
}

/* Guess button */
.frames-input-area button[type="submit"] {
  flex: 0 0 auto;
  padding: 0.72rem 1.3rem;
  background: var(--gradient-main);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.frames-input-area button[type="submit"]:hover {
  opacity: 0.88;
}

.frames-input-area button[type="submit"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Input meta row */
.frames-input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 1.4rem;
}

.frames-skip-btn {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.84rem;
  padding: 0.72rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.frames-skip-btn:hover {
  border-color: var(--accent-1);
  color: var(--text);
}

/* ── End modal ── */
.frames-end-modal-hidden {
  display: none !important;
}

.frames-end-content {
  max-width: 420px;
}

.fend-poster-wrap {
  display: flex;
  justify-content: center;
  margin: 1rem 0 0.8rem;
}

.fend-poster-wrap img {
  width: 120px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  object-fit: cover;
}

.fend-score-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.8rem 0 0.4rem;
  flex-wrap: wrap;
}

.fend-score-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.fend-dots {
  display: flex;
  gap: 5px;
}

.fend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.fend-dot-win    { background: var(--success); }
.fend-dot-used   { background: var(--danger); opacity: 0.7; }
.fend-dot-unused { background: var(--bg-elevated-2); border: 1px solid var(--border-glass-strong); }

.fend-score-text {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ── How to play modal for frames ── */
.frames-how-hidden {
  display: none !important;
}

/* ── Mobile adjustments ── */
@media (max-width: 600px) {
  .frame-display-inner {
    max-height: 30vh;
  }

  .frames-stats-bar {
    gap: 1.2rem;
  }

  .frames-autocomplete-wrapper input {
    font-size: 0.88rem;
  }

  .frames-input-area button[type="submit"] {
    padding: 0.72rem 0.9rem;
    font-size: 0.84rem;
  }
}

@media (max-width: 400px) {
  .frames-container {
    padding: 0 0.65rem;
  }
}
