/* Trivia — builds on shared/style.css */

/* ---------- hub ---------- */
.tv-hub { max-width: 560px; margin: 0 auto; padding: 0 1rem 2rem; }
.tv-hero { text-align: center; padding: 1.4rem 0 .4rem; }
.tv-hero h1 { font-size: 2.3rem; margin-bottom: .1rem; }
.tv-hero .logo { font-size: 3rem; display: inline-block; animation: wobble 3s ease-in-out infinite; }
.tv-hero p { margin: 0; }
.daily-card { border-radius: 22px; padding: 1.1rem; margin: 1rem 0; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(140deg, #ff8a3d, #e63f7e 55%, #7a3cff); box-shadow: 0 12px 30px #0006; border: 1px solid #ffffff2a; }
.daily-card::after { content: "?"; position: absolute; right: -10px; bottom: -60px; font: 700 13rem/1 var(--fun); color: #ffffff14;
  transform: rotate(14deg); pointer-events: none; }
.daily-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.kicker { font-family: var(--fun); font-weight: 600; font-size: 1.2rem; }
.daily-sub { color: #ffffffcc; font-size: .9rem; }
.flame { font-size: 1.5rem; background: #0003; border-radius: 999px; padding: .1rem .6rem; white-space: nowrap; }
.flame b { font-family: var(--fun); font-size: 1.2rem; margin-left: .15rem; }
.daily-card .primary.big { background: #fff; color: #7a1e48; box-shadow: 0 3px 0 #0004; position: relative; z-index: 1; }
.daily-done { display: flex; align-items: center; gap: .8rem; margin: .8rem 0 .2rem; flex-wrap: wrap; font-size: 1.1rem; }
.daily-card .row2 { position: relative; z-index: 1; }
.daily-card .muted { color: #ffffffcc; }
.row2 { display: flex; gap: .5rem; margin-top: .8rem; }
.row2 > * { flex: 1; }
.grid-emoji { letter-spacing: .05em; font-size: 1.15rem; line-height: 1.2; }
.grid-emoji.center { margin: .6rem 0; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.mode { text-align: left; border-radius: 18px; padding: 1rem .9rem; color: var(--text); display: flex; flex-direction: column; gap: .15rem;
  border: 1px solid #ffffff1a; box-shadow: 0 8px 20px #0005; background: linear-gradient(155deg, var(--c1), var(--c2)); }
.mode.wide { grid-column: 1 / -1; }
.mode .emoji { font-size: 2rem; }
.mode .name { font-family: var(--fun); font-weight: 600; font-size: 1.2rem; }
.mode .meta { color: #ffffffb0; font-size: .82rem; }
.mode:active { transform: scale(.97); }
.board-card { width: 100%; margin: 1rem 0; }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 2rem 1fr auto auto; gap: .5rem; align-items: center; padding: .45rem .2rem;
  border-bottom: 1px solid var(--line); }
.board li.me { background: #ffc14518; border-radius: 10px; }
.board .rank { text-align: center; font-family: var(--fun); }
.board .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .g { font-size: .55rem; letter-spacing: 0; }
.foot { margin-top: 1rem; line-height: 1.6; }

/* ---------- setup ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.chip { border-radius: 999px; padding: .55em 1em; background: var(--panel-2); color: var(--muted); }
.chip.on { background: linear-gradient(155deg, var(--c1, #ffd36b), var(--c2, var(--accent))); color: #fff; border-color: #ffffff40; }
.chip.all.on { color: var(--accent-ink); }

/* ---------- question screen ---------- */
.catpill { display: inline-block; border-radius: 999px; padding: .15em .7em; font-size: .78rem; font-weight: 600; color: #fff;
  background: linear-gradient(155deg, var(--c1), var(--c2)); white-space: nowrap; }
.tv { gap: .5rem; }
.tv-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex: none; min-height: 1.6rem; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); }
.dots i.cur { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dots i.ok { background: var(--good); border-color: var(--good); }
.dots i.no { background: var(--bad); border-color: var(--bad); }
.surv { font-family: var(--fun); }
.tv-score { font-family: var(--fun); font-weight: 600; white-space: nowrap; }
.tv-timer { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; flex: none; }
.tv-timer i { display: block; height: 100%; transform-origin: left; border-radius: inherit;
  background: linear-gradient(90deg, var(--bad), var(--accent) 35%, var(--good)); background-size: 100vw 100%; }
.tv-timer.stopped i { opacity: .3; }
.tv-qcard { flex: 1 1 auto; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem .8rem .9rem; display: flex; flex-direction: column; gap: .5rem; overflow: hidden; }
.tv-meta { display: flex; align-items: center; gap: .5rem; flex: none; }
.tv-secs { margin-left: auto; font-family: var(--fun); font-weight: 700; font-size: 1.15rem; min-width: 1.5em; text-align: right; }
.tv-secs.hurry { color: var(--bad); animation: tick .5s; }
@keyframes tick { 0% { transform: scale(1.5); } }
.tv-img { flex: 1 1 0; min-height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.tv-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; background: #fff1;
  box-shadow: 0 6px 16px #0006; animation: up .3s ease-out; }
.tv-img.loading { background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tv-qtext { font-family: var(--fun); font-weight: 600; font-size: clamp(1.15rem, 3dvh, 1.6rem); line-height: 1.25; flex: none;
  margin: auto 0; text-wrap: balance; }
.tv-img + .tv-qtext { margin: 0; font-size: clamp(1.05rem, 2.6dvh, 1.35rem); }
.tv-qtext.long { font-size: clamp(1rem, 2.4dvh, 1.25rem); }
.tv-choices { display: grid; gap: .45rem; flex: none; }
.choice { display: flex; align-items: center; gap: .6rem; text-align: left; padding: .65rem .75rem; border-radius: 14px;
  min-height: clamp(48px, 7dvh, 62px); font-size: clamp(.95rem, 2.2dvh, 1.1rem); font-weight: 600; background: var(--panel-2);
  border: 2px solid var(--line); box-shadow: 0 3px 0 #120d20; }
.choice:disabled { opacity: 1; cursor: default; }
.choice .let { flex: none; width: 1.8em; height: 1.8em; border-radius: 8px; display: grid; place-items: center; font-family: var(--fun);
  background: var(--bg); color: var(--accent); font-size: .85em; }
.choice .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice:not(:disabled):hover { border-color: var(--accent); }
.choice.right { background: #1d6b45; border-color: var(--good); box-shadow: 0 0 0 2px var(--good), 0 0 22px #4fe39a66; }
.choice.right .let { background: var(--good); color: #062; }
.choice.wrong { background: #6b1d2a; border-color: var(--bad); animation: shake .4s; }
.choice.wrong .let { background: var(--bad); color: #300; }
.choice.dim { opacity: .45; }
.choice.gone { opacity: .12; transform: scale(.96); }
.choice.picked { border-color: var(--held); background: #1d3f6b; box-shadow: 0 0 0 2px var(--held); }
.choice.pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.tv-dock { flex: none; display: flex; flex-direction: column; gap: .35rem; }
.tv-dock .big { margin-top: .2rem; }
.lifelines { display: flex; justify-content: space-between; align-items: center; min-height: 2.2rem; }
.reveal-line { font-family: var(--fun); font-size: 1.15rem; text-align: center; }
.reveal-line.good { color: var(--good); }
.reveal-line.bad { color: var(--bad); }
.streak { color: var(--accent); }
.note { font-size: .85rem; color: var(--muted); text-align: center; }
.learn { display: block; text-align: center; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- results ---------- */
.result { text-align: center; }
.big-num { font-family: var(--fun); font-weight: 700; font-size: 3.6rem; line-height: 1; color: var(--accent);
  text-shadow: 0 4px 0 #0005; margin-top: .3rem; animation: pop .6s cubic-bezier(.2, .9, .3, 1.4); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin: .8rem 0 .4rem; }
.stats div { background: var(--panel-2); border-radius: 12px; padding: .5rem .2rem; display: flex; flex-direction: column; }
.stats b { font-family: var(--fun); font-size: 1.3rem; }
.stats span { font-size: .7rem; color: var(--muted); }
.result h3 { text-align: left; margin-top: 1.2rem; }
.result .board { text-align: left; }
.namebox { display: flex; gap: .5rem; align-items: flex-end; text-align: left; }
.namebox label { flex: 1; margin-bottom: 0; }
.namebox button { margin-bottom: 0; }
.hide { display: none !important; }
.review .rv { border-bottom: 1px solid var(--line); padding: .8rem 0; display: flex; flex-direction: column; gap: .35rem; }
.rv-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--fun); }
.rv.ok .rv-head span { color: var(--good); }
.rv.no .rv-head span { color: var(--bad); }
.rv-img { max-height: 140px; max-width: 60%; object-fit: contain; border-radius: 8px; align-self: flex-start; }
.rv-q { font-weight: 600; }
.rv .note, .rv .learn { text-align: left; }

/* ---------- party ---------- */
.pp-players { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; flex: none; }
.pchip { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; padding: .1rem .5rem .1rem .15rem;
  background: var(--panel-2); border: 1px solid var(--line); font-size: .75rem; max-width: 9rem; }
.pchip .av { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: .65rem; font-weight: 800;
  color: #fff; flex: none; }
.pchip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip.done { border-color: var(--good); }
.pchip.done::after { content: "✓"; color: var(--good); font-weight: 800; }
.pchip.off { opacity: .45; }
.picks { display: flex; gap: 2px; flex: none; }
.picks .av { width: 1.45rem; height: 1.45rem; border-radius: 50%; display: grid; place-items: center; font-size: .6rem; font-weight: 800;
  color: #fff; border: 2px solid var(--panel); animation: pop .4s; }
.standings { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; min-height: 0; overflow: auto; }
.standings li { display: grid; grid-template-columns: 1.8rem 1.6rem 1fr auto auto; gap: .45rem; align-items: center;
  padding: .35rem .3rem; border-bottom: 1px solid var(--line); }
.standings li.me { background: #ffc14518; border-radius: 10px; }
.standings .av { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .65rem; font-weight: 800; color: #fff; }
.standings .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standings .gain { font-size: .8rem; color: var(--good); font-weight: 700; min-width: 3.4rem; text-align: right; }
.standings .gain.zero { color: var(--muted); font-weight: 400; }
.standings .tot { font-family: var(--fun); font-weight: 700; min-width: 3.6rem; text-align: right; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; margin: .6rem 0 .2rem; flex: none; }
.podium .step { flex: 0 1 30%; display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.podium .block { width: 100%; border-radius: 12px 12px 4px 4px; display: grid; place-items: center; font-family: var(--fun);
  font-weight: 700; font-size: 1.6rem; color: var(--accent-ink); animation: rise .7s cubic-bezier(.2, .9, .3, 1.2) both; }
.podium .p1 .block { height: 96px; background: linear-gradient(180deg, #ffe08a, var(--accent)); animation-delay: .5s; }
.podium .p2 .block { height: 70px; background: linear-gradient(180deg, #f1f1f1, #b8b8c8); animation-delay: .25s; }
.podium .p3 .block { height: 52px; background: linear-gradient(180deg, #f0b27a, #b86b2b); }
.podium .av { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem;
  font-weight: 800; color: #fff; }
.podium .pn { font-weight: 700; font-size: .85rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .ps { font-size: .75rem; color: var(--muted); }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom; } }
.waiting-msg { text-align: center; color: var(--muted); font-size: .9rem; }

/* ---------- picture answers (e.g. "Which mountain is taller?") ---------- */
.choice .crow { display: flex; align-items: center; gap: .6rem; min-width: 0; width: 100%; }
.tv.pics .tv-qcard { flex: none; }
.tv.pics .tv-choices { flex: 1 1 auto; min-height: 0; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
.choice.has-pic { flex-direction: column; align-items: stretch; padding: .4rem; gap: .4rem; height: 100%; min-height: 0; }
.choice .cpic { flex: 1 1 0; min-height: 70px; border-radius: 10px; overflow: hidden; background: #0004;
  display: flex; align-items: center; justify-content: center; }
.choice .cpic img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.choice.has-pic .crow { flex: none; padding: 0 .2rem .15rem; }
.choice.has-pic .picks { margin-left: auto; }
.tv.pics .tv-dock { flex: none; }
.choice { touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.choice .cpic.flag img { object-fit: contain; padding: .3rem; }
.choice .cpic { position: relative; }
.choice.has-pic .picks { position: absolute; top: .35rem; right: .35rem; flex-wrap: wrap; justify-content: flex-end; max-width: 80%; }
