/* Off-Meta: Daily, Unlimited and Trivia. Start screens, prompt card, timer, tries, guesses, between-prompt card, results, share. */
.intro { text-align: center; animation: rise .45s cubic-bezier(.2, 1.3, .4, 1); }
.intro-rules { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.intro-rules div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; min-width: 92px; }
.intro-rules b { display: block; font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--gold2); }
.intro-rules span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.hard-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; max-width: 420px; margin: 0 auto 14px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); text-align: left;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.hard-row b { display: block; font-size: 14px; }
.hard-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.intro.hard .hard-row { border-color: var(--legendary); background: rgba(255, 154, 60, .08); }
.intro.hard .intro-rules div:nth-child(2) b { color: var(--legendary); }
.hard-row .switch:checked { background: var(--legendary); }
.hard-badge { color: var(--legendary); border-color: var(--legendary); vertical-align: middle; font-size: 10px; }
.progress { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.progress .segs { flex: 1; display: flex; gap: 5px; }
.progress .segs i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .3s; }
.progress .segs i.done { background: var(--gold); }
.progress .segs i.cur { background: var(--gold2); animation: pipPulse 1.4s ease-in-out infinite; }
.run-score { color: var(--gold2); font-weight: 800; min-width: 54px; text-align: right; }
.timer {
  position: relative; height: 26px; margin-top: 12px; border-radius: 999px; background: var(--bg2);
  border: 1px solid var(--line); overflow: hidden;
}
.timer-fill {
  position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .06s linear, background .3s;
}
.timer span {
  position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .85), 0 0 6px rgba(0, 0, 0, .55);
}
.timer.low .timer-fill { background: linear-gradient(90deg, #c23b4a, var(--bad)); }
.timer.low { animation: timerPulse .5s ease-in-out infinite alternate; border-color: var(--bad); }
.between .big { margin-top: 10px; }
.end .aces { color: var(--gem); font-weight: 700; margin-top: 4px; }
.summary .s-emoji { letter-spacing: 2px; white-space: nowrap; }
.summary .s-pts { color: var(--gold2); font-weight: 800; width: 40px; text-align: right; }
.prompt { font-family: var(--font-display); font-size: 25px; font-weight: 700; line-height: 1.35; letter-spacing: .01em; }
.pips { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.pip.used { background: var(--muted); }
.pip.miss { background: var(--bad); }
.guess-form { display: flex; gap: 8px; margin: 12px 0; }
.guess-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); outline: none;
}
.guess-form input:focus { border-color: var(--gold); }
.guess-form input:disabled, .guess-form button:disabled { opacity: .45; cursor: default; }
.toast { min-height: 22px; text-align: center; font-size: 15px; color: var(--muted); }
.toast.bad { color: var(--bad); }
.toast.good { color: var(--good); }
.guesses { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.guess img { width: 40px; height: 40px; border-radius: 8px; background: var(--bg2); }
.guess .name { flex: 1; font-weight: 600; }
.guess .pts { color: var(--muted); width: 42px; text-align: right; }
.guess.miss { --tc: var(--bad); opacity: .75; }
.legendary { --tc: var(--legendary); }
.t-common { color: var(--common); }
.t-rare { color: var(--rare); }
.t-epic { color: var(--epic); }
.t-legendary { color: var(--legendary); }
.t-mythic { color: var(--mythic); }
.t-gem { color: var(--gem); }
.end { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-align: center; }
.end .score { font-family: var(--font-display); font-size: 44px; font-weight: 900; color: var(--gold2); }
.legend { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.guess-form button:active { transform: scale(.94); }
.guess-form button {
  background: var(--gold); color: #1a1406; border: 0; font-weight: 700; padding: 0 18px; border-radius: 10px;
  transition: transform .1s, background .15s, box-shadow .2s;
}
.guess-form button:hover { background: var(--gold2); box-shadow: 0 0 18px rgba(228, 181, 79, .45); }
/* Prompt card: drops in with a sweeping shine */
.prompt-card {
  background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 20px; text-align: center; position: relative; overflow: hidden;
}
.prompt-card.enter { animation: drop .55s cubic-bezier(.2, 1.4, .4, 1); }
.prompt-card.enter::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(246, 217, 139, .25) 50%, transparent 65%);
  transform: translateX(-100%); animation: shine 1.1s .25s ease-out forwards;
}
.guess.new { animation: slam .45s cubic-bezier(.2, 1.5, .4, 1); }
.guess.new.epic, .guess.new.legendary, .guess.new.mythic { animation: slam .5s cubic-bezier(.2, 1.5, .4, 1), glowPulse 1.2s ease-out; }
.guess.new.gem { animation: gemIn .8s cubic-bezier(.2, 1.4, .4, 1); }
.guess.new.miss { animation: slam .3s ease-out, missShake .4s .1s; }
.guess.new::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .25) 50%, transparent 70%);
  transform: translateX(-100%); animation: shine .7s .15s ease-out forwards;
}
.guess.new.miss::after { display: none; }
.guess.gem { box-shadow: 0 0 0 1px var(--gem), 0 0 24px rgba(111, 240, 255, .25); animation: gemGlow 2.2s ease-in-out infinite; }
.guess.gem.new { animation: gemIn .8s cubic-bezier(.2, 1.4, .4, 1), gemGlow 2.2s .8s ease-in-out infinite; }
.guess.new img { animation: iconPop .5s .1s cubic-bezier(.2, 1.8, .4, 1) backwards; }
.guess .tier {
  font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--tc);
  text-shadow: 0 0 10px var(--tc);
}
.pip { width: 34px; height: 8px; border-radius: 4px; background: var(--line); transition: background .3s; }
.pip.next { animation: pipPulse 1.4s ease-in-out infinite; }
.pip.fresh { animation: pipPop .4s cubic-bezier(.2, 1.8, .4, 1); }
.end:not([hidden]) { animation: rise .55s cubic-bezier(.2, 1.3, .4, 1); }
.end.won h3 { color: var(--gem); text-shadow: 0 0 18px rgba(111, 240, 255, .6); }
.float-text {
  position: fixed; z-index: 60; pointer-events: none; font-family: var(--font-display); font-weight: 900;
  font-size: 26px; text-shadow: 0 2px 0 rgba(0, 0, 0, .6), 0 0 6px rgba(0, 0, 0, .5);
}
.float-text.float-big { font-size: 40px; }
.end h3 { margin: 0 0 6px; font-size: 22px; font-family: var(--font-display); letter-spacing: .02em; }
.intro-head { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; font-size: 14px; }
.next-daily { margin-top: 14px; color: var(--muted); font-size: 14px; text-align: center; }
.countdown {
  font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--gold2); margin-left: 4px;
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.guess-form input:focus-visible { outline: none; }
.prompt-badges { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.badge {
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--bg);
}
.badge.kind-item { color: var(--gold2); border-color: rgba(228, 181, 79, .45); }
.badge.kind-champion { color: var(--gem); border-color: rgba(111, 240, 255, .35); }
.badge.diff-easy { color: var(--good); border-color: rgba(95, 211, 154, .45); }
.badge.diff-medium { color: var(--legendary); border-color: rgba(255, 154, 60, .45); }
.badge.diff-hard { color: var(--bad); border-color: rgba(239, 93, 106, .5); }
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 4px 0 14px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px;
}
.mode-switch button { background: transparent; border: 0; color: var(--muted); padding: 9px; border-radius: 9px; font-weight: 600; }
.mode-switch button.active { background: var(--card); color: var(--gold2); box-shadow: 0 0 0 1px var(--line); }
/* Page header: same on every tab */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 2px 16px; }
.intro-head:empty { display: none; }
.view-head, #board-intro, #board-play, #board-end, #trivia-intro, #trivia-play, #trivia-end {
  animation: swapIn .42s cubic-bezier(.2, .9, .3, 1) both;
}
/* Between prompts: hide the finished prompt's controls and show one clean result card */
#board-play.is-between .timer, #board-play.is-between .pips, #board-play.is-between .guess-form, #board-play.is-between .toast, #trivia-play.is-between .timer, #trivia-play.is-between .pips, #trivia-play.is-between .guess-form, #trivia-play.is-between .toast {
  display: none;
}
#board-play.is-between .guesses, #trivia-play.is-between .guesses { margin-top: 14px; }
.between { text-align: center; animation: rise .4s cubic-bezier(.2, 1.3, .4, 1); margin-top: 12px; }
.between-card {
  background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 18px 16px; text-align: center; animation: swapIn .4s cubic-bezier(.2, 1.2, .3, 1) both;
}
.between-card.ace { border-color: rgba(111, 240, 255, .6); box-shadow: 0 0 26px rgba(111, 240, 255, .18); }
.between-card.timeout { border-color: rgba(239, 93, 106, .5); }
.between-head { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--muted); }
.between-card.ace .between-head { color: var(--gem); }
.between-pts { font-family: var(--font-display); font-weight: 800; font-size: 46px; line-height: 1.1; color: var(--gold2); }
.between-pts span { font-size: 16px; color: var(--muted); font-weight: 600; }
.between-card .big { margin-top: 12px; }
#board-play .guesses { min-height: 166px; align-content: start; }
/* room for all 3 guesses */
#board-play.is-between .guesses { min-height: 0; }
/* Small second line under a name (e.g. a trivia hint), purple kind badge for ability questions */
.guess .name small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 1px; }
.badge.kind-ability { color: var(--epic); border-color: rgba(182, 120, 255, .45); }
.chip-icon { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.s-icons { display: flex; gap: 5px; margin-top: 6px; }
.s-icons:empty { display: none; }
.s-pick.t-common { --tc: var(--common); }
.s-pick.t-rare { --tc: var(--rare); }
.s-pick.t-epic { --tc: var(--epic); }
.s-pick.t-legendary { --tc: var(--legendary); }
.s-pick.t-mythic { --tc: var(--mythic); }
.s-pick.t-gem { --tc: var(--gem); box-shadow: 0 0 10px rgba(111, 240, 255, .5); }
.s-pick .chip-icon { width: 26px; height: 26px; }
#trivia-modes { max-width: 320px; margin: 0 auto 14px; }
.guess.miss .tier { color: var(--bad); }
.progress .segs i.wrong { background: var(--bad); }
.t-answer { display: inline-flex; align-items: center; gap: 12px; margin: 10px 0 2px; text-align: left; }
.t-answer img, .t-answer .img-fallback { width: 52px; height: 52px; border-radius: 10px; background: var(--bg2); }
.t-answer b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--gold2); line-height: 1.15; }
.t-answer small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
/* Trivia: everything fits one screen. Guesses are chips; the results are a 5 x 2 grid (2 x 5 on phones). */
#trivia-guesses { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0; }
#trivia-play.is-between #trivia-guesses { margin-top: 10px; }
.t-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 5px; border-radius: 999px;
  font-size: 14px; font-weight: 600; background: var(--card); border: 1px solid var(--line); animation: pop .3s ease;
}
.t-chip:not(:has(img)) { padding-left: 11px; }
.t-chip.wrong { border-color: rgba(239, 93, 106, .55); color: #f3b3b9; }
.t-chip.right { border-color: rgba(95, 211, 154, .6); color: var(--good); }
.t-hint { color: var(--muted); font-weight: 500; font-size: 13px; }
#trivia-between .between-card { padding: 14px 16px 14px; }
#trivia-between .t-answer { margin-top: 6px; }
#trivia-end { padding: 14px 16px; }
.t-end-head h3 { margin: 0; font-size: 19px; }
.t-end-head .score { font-size: 38px; line-height: 1.1; }
.t-end-head .aces { margin-top: 0; }
.t-grid { list-style: none; padding: 0; margin: 12px 0 4px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.t-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  padding: 8px 4px 6px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line);
  animation: chipIn .4s cubic-bezier(.2, 1.4, .4, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms + 150ms);
}
.t-cell img, .t-cell .img-fallback { width: 34px; height: 34px; border-radius: 7px; }
.t-cell-name {
  font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.t-cell-res { position: absolute; top: 3px; right: 4px; font-size: 11px; }
.t-cell.miss .t-cell-name, .t-cell.timeout .t-cell-name { color: var(--muted); }
#trivia-end .actions { margin-top: 10px; }
/* Guess cards: only the newest animates, rarer tiers land harder */
.guess {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--tc, var(--line)); border-radius: 10px; animation: none; position: relative;
  overflow: hidden; padding: 6px 12px;
}
.guess img, .guess .img-fallback { width: 36px; height: 36px; }
/* Daily results: one line per prompt (prompt, picks, tier squares, points). */
.summary li {
  display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; animation: chipIn .4s cubic-bezier(.2, 1.4, .4, 1) backwards;
  animation-delay: calc(var(--i, 0) * 90ms + 200ms); padding: 6px 12px;
}
.summary .s-prompt { flex: 1; font-size: 14px; color: var(--muted); display: flex; flex-direction: row; align-items: center; gap: 10px; }
.summary .s-icons { margin-top: 0; margin-left: auto; flex: none; }
.summary .s-pick .chip-icon { width: 22px; height: 22px; }
#board-end { padding: 14px 16px; }
#board-end h3 { font-size: 20px; margin-bottom: 0; }
#board-end .score { font-size: 38px; line-height: 1.15; }
.summary { list-style: none; padding: 0; display: grid; text-align: left; margin: 10px 0 4px; gap: 5px; }
.q-pic { display: flex; justify-content: center; margin: 4px 0 8px; }
.q-pic img {
  width: 72px; height: 72px; border-radius: 14px; border: 2px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35); background: var(--bg2);
}
.q-pic[hidden] { display: none; }
.split {
  list-style: none; margin: 2px 0 10px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 14px; font-size: 14px;
}
.split li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.split li span { color: var(--text); font-weight: 600; }
.split li b { color: var(--gold2); font-family: var(--font-display); font-size: 16px; }
.s-pick { display: inline-flex; border-radius: 7px; padding: 1px; border: 2px solid var(--tc, var(--line)); position: relative; }
.s-pct {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font-size: 9.5px; font-weight: 800;
  line-height: 1; padding: 1px 3px; border-radius: 4px; background: var(--bg); color: var(--gold2);
  white-space: nowrap;
}
.s-icons:has(.s-pct) { margin-bottom: 6px; }
#stats-body > .next-daily:first-child { margin: 0 0 12px; }
.next-daily.outside { margin: 0 0 10px; }
.next-daily.outside[hidden] { display: none; }

@media (max-width: 480px) {
  .prompt { font-size: 20px; }
  .legend { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .intro-rules { gap: 8px; }
  .intro-rules div { min-width: 0; flex: 1; padding: 10px 6px; }
  .intro-rules b { font-size: 26px; }
  .t-grid { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .t-cell { flex-direction: row; padding: 5px 24px 5px 6px; }
  .t-cell img, .t-cell .img-fallback { width: 26px; height: 26px; flex: none; }
  .t-cell-name { text-align: left; }
  .t-cell-res { top: 50%; transform: translateY(-50%); right: 6px; }
  #trivia-end .actions .ghost { flex: 1 1 30%; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
  .t-end-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; text-align: left; }
  .t-end-head .score { font-size: 30px; }
  .t-end-head .aces { flex-basis: 100%; }
  /* Heading: date and pills share less space */
  .view-head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 10px; }
  .prompt-card { padding: 14px 14px; }
  .prompt { font-size: 19px; line-height: 1.3; }
  .timer { margin-top: 10px; height: 22px; }
  .pips { margin: 10px 0; }
  .guess-form { margin: 8px 0; }
  .guess { padding: 5px 10px; gap: 10px; }
  .guess img, .guess .img-fallback { width: 32px; height: 32px; }
  .guesses { gap: 6px; margin: 6px 0; }
  .between-card { padding: 12px 14px; }
  .between-pts { font-size: 34px; }
  .between-card .big { margin-top: 8px; }
  .progress { margin-bottom: 8px; }
  /* 16px+ stops iOS from zooming in on focus */
  .summary li { flex-wrap: nowrap; padding: 6px 10px; gap: 8px; }
  .summary .s-prompt { flex-basis: auto; font-size: 13px; line-height: 1.3; }
  .summary .s-icons { display: none; }
  .summary .s-emoji { flex: none; font-size: 12px; letter-spacing: 1px; }
  .summary .s-pts { width: 34px; }
  .mode-switch { margin-bottom: 10px; }
  .mode-switch button { padding: 7px; }
  .guess-form button { padding: 0 14px; min-height: 44px; }
  .guess-form input { font-size: 16px; padding-top: 10px; padding-bottom: 10px; }
  #board-play .guesses { min-height: 144px; }
  #board-end .t-end-head, #board-end { text-align: center; }
  /* Daily results on phones: prompt and score side by side; the tier squares show each pick */
  #board-end h3 { font-size: 18px; display: inline-block; margin-right: 10px; }
  #board-end .score { font-size: 30px; display: inline-block; }
  #board-end .actions { flex-wrap: nowrap; gap: 6px; }
  #board-end .actions .ghost { flex: 1 1 0; padding: 9px 4px; font-size: 13px; white-space: nowrap; }
  #board-stats-open { display: none; }
  .between { margin-top: 8px; }
  /* Heading: small label and title on one line */
  .view-head > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .q-pic { margin: 2px 0 6px; }
  .q-pic img { width: 56px; height: 56px; border-radius: 12px; }
  .split { margin: 0 0 6px; gap: 2px 12px; font-size: 13px; }
  .split li b { font-size: 14px; }
}
