/* ===== Phone and tablet: one clean column ===== */
main { max-width: 560px; margin: auto; padding: 14px 10px 28px }
#game { margin: 12px auto; padding: 18px 14px }
#tools { display: flex; justify-content: flex-end; gap: 8px }
.tv-head { display: block }
.tv-head h1 { margin: .4em 0 }
.tv-foot { text-align: center; margin: 16px 0 0 }
#tv-status { min-height: 1.5em; font-weight: 700; margin: 6px 0; text-align: center }
kbd { font: 800 .74rem/1 'Nunito', system-ui, sans-serif; padding: 2px 6px; border: 1px solid var(--lg-line); border-bottom-width: 2px; border-radius: 6px; background: var(--lg-cream); color: var(--lg-ink) }
.tv-menu #tv-menuhint { margin: 0 0 8px }
.tv-rules { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0 }
.tv-rules li { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 11px; font-size: .78rem; font-weight: 800; background: var(--lg-tint-3); color: var(--lg-ink); border: 1px solid var(--lg-line) }
.tv-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 }
.tv-cats button { position: relative; min-height: 64px; padding: 8px; text-align: center; line-height: 1.2; flex-direction: column; gap: 2px; overflow: hidden; box-shadow: inset 0 4px 0 var(--acc, transparent), 0 3px 0 var(--lg-line); transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s ease, border-color .2s ease }
.tv-cats button.t0 { background: var(--lg-tint-1) } .tv-cats button.t1 { background: var(--lg-tint-2) } .tv-cats button.t2 { background: var(--lg-tint-3) }
.tv-cats button[data-acc="0"] { --acc: var(--lg-p1) } .tv-cats button[data-acc="1"] { --acc: var(--lg-p2) } .tv-cats button[data-acc="2"] { --acc: var(--lg-leaf) }
.tv-cats button[data-acc="3"] { --acc: var(--lg-warn) } .tv-cats button[data-acc="4"] { --acc: var(--lg-rose) }
.tv-cats .ic { font-size: 1.4rem; line-height: 1; transition: transform .2s ease }
.tv-cats .mixed, .tv-cats .daily { grid-column: 1 / -1 }
.tv-cats .daily { border: 2px solid var(--lg-rose); background: var(--lg-pink); --acc: transparent !important }
.tv-cats .lg-primary { background: var(--lg-rose); --acc: transparent !important }
.tv-cats small { display: block; font-weight: 700; font-size: .72rem; color: var(--lg-ink) }
.tv-cats .lg-primary small { color: var(--lg-on-rose) }
.tv-cats .bar { display: block; width: 70%; max-width: 120px; height: 5px; border-radius: 99px; background: var(--lg-line); overflow: hidden; margin-top: 2px }
.tv-cats .bar i { display: block; height: 100%; background: var(--lg-good) }
.tv-left, .tv-score { display: none }
.tv-quiz { display: flex; flex-direction: column }
.tv-quiz > aside.tv-right, .tv-quiz > section { display: contents }
#tv-board { order: 1 } .tv-meta { order: 2 } .tv-timer { order: 3 } .tv-card { order: 4 } #tv-opts { order: 5 } #tv-lifelines { order: 6 } #tv-feedback { order: 7 } .tv-actions { order: 8 }
.tv-board { display: flex; gap: 8px; margin: 6px 0 10px }
.tv-board > div { flex: 1 1 0; min-width: 0; border: 1px solid var(--lg-line); border-radius: 14px; padding: 6px 10px; background: var(--lg-cream) }
.tv-board .me { border: 2px solid var(--lg-rose) }
.tv-board b { display: block; font-size: 1.3rem; font-family: 'Fredoka', system-ui, sans-serif; font-weight: 500 }
.tv-board span { display: block; font-size: .8rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tv-board em { display: block; font-size: .72rem; font-style: normal; color: var(--lg-muted); min-height: 1.1em }
.tv-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; margin: 6px 0 }
.tv-timer { height: 14px; border-radius: 99px; background: var(--lg-pink); overflow: hidden; border: 1px solid var(--lg-line) }
.tv-timer i { display: block; height: 100%; width: 100%; background: var(--lg-good); transition: background-color .4s ease }
.tv-timer.mid i { background: var(--lg-warn) }
.tv-timer.low i { background: var(--lg-bad) }
#tv-q { font-family: 'Fredoka', system-ui, sans-serif; font-size: 1.3rem; font-weight: 500; line-height: 1.3; margin: 14px 0 12px }
.tv-card { margin: 0 }
.tv-opts { display: grid; gap: 8px }
.tv-opt { position: relative; width: 100%; min-height: 56px; justify-content: flex-start; text-align: left; padding: 10px 14px; line-height: 1.25; box-shadow: 0 3px 0 var(--lg-line); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease }
.tv-opt .k { flex: 0 0 auto; min-width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--lg-pink); color: var(--lg-rose); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem }
.tv-opt:active:not([aria-disabled=true]) { transform: translateY(3px); box-shadow: 0 0 0 var(--lg-line) }
.tv-opt.chosen { border: 3px solid var(--lg-rose) }
.tv-opt.right { background: var(--lg-tint-2); border: 3px solid var(--lg-good); animation: tv-pop .4s cubic-bezier(.34, 1.56, .64, 1) }
.tv-opt.right::after { content: '✓ Correct'; margin-left: auto; color: var(--lg-good); font-size: .8rem }
.tv-opt.wrong { background: var(--lg-tint-1); border: 3px solid var(--lg-bad); animation: tv-shake .4s ease }
.tv-opt.wrong::after { content: '✗ Your pick'; margin-left: auto; color: var(--lg-bad); font-size: .8rem }
.tv-opt.out { opacity: .38; text-decoration: line-through }
@keyframes tv-pop { 0% { transform: scale(.96) } 60% { transform: scale(1.03) } 100% { transform: scale(1) } }
@keyframes tv-shake { 0%, 100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.tv-lifelines { display: flex; gap: 8px; justify-content: center; margin: 8px 0 0 }
.tv-lifelines .tv-h { display: none }
.tv-lifelines button { min-height: 44px }
.tv-lifelines button[disabled] { opacity: .45 }
.tv-lifelines kbd { display: none }
.tv-row { font-size: 1.5rem; letter-spacing: .1em; margin: 4px 0 }
#tv-feedback { min-height: 3em; font-weight: 800; margin: 12px 0 6px; text-align: center }
.tv-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 10px 0 }
#tv-final { text-align: center }
#tv-final h2 { font-size: 1.6rem; margin: 8px 0 }
.tv-big { font-family: 'Fredoka', system-ui, sans-serif; font-size: 2.6rem; font-weight: 500; line-height: 1.1 }
.tv-facts { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 4px; font-weight: 700 }
.tv-h { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--lg-muted); margin: 0 0 8px; font-weight: 800; font-family: 'Nunito', system-ui, sans-serif }
@media (max-width: 420px) { main { padding: 8px 4px 24px } #game { padding: 14px 8px } }

/* ===== PC and laptop (1000px and wider): the menu is a wide category board, the quiz is a no-scroll stage
   (progress | question card | score and lifelines). ===== */
@media (min-width: 1000px) {
  :root { --lg-stage-max: 1280px }
  body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden }
  main { flex: 1; min-height: 0; max-width: none; width: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative }
  #tools { position: absolute; top: 10px; right: max(24px, calc((100vw - var(--lg-stage-max)) / 2 + 24px)); z-index: 5 }
  #lobby { flex: 1; min-height: 0; overflow: auto; padding-top: 4px }
  #lobby .lg-lobby { max-width: 620px; margin: 8px auto }
  #lobby .lg-avatar-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) }
  #lobby .lg-avatar { width: 100%; height: 46px }
  #lobby .lg-lobby > .lg-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) }
  #game { flex: 1; min-height: 0; width: 100%; max-width: var(--lg-stage-max); margin: 0 auto; padding: 10px 24px 18px; display: flex; flex-direction: column; background: transparent; border: 0; box-shadow: none; border-radius: 0 }
  .tv-head { display: flex; align-items: center; gap: 18px; min-height: 48px; padding-right: 90px; flex: none }
  .tv-head h1 { margin: 0; font-size: 1.6rem }
  #tv-status { margin: 0; text-align: left; flex: 1; min-height: 0; font-size: .95rem; color: var(--lg-muted) }
  .tv-back { margin: 0; font-size: .9rem }

  /* category board */
  .tv-menu { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 6px }
  .tv-menu #tv-menuhint { font-size: 1.05rem; margin: 0 0 8px; color: var(--lg-ink); font-weight: 700 }
  .tv-rules { margin: 0 0 14px }
  .tv-cats { flex: 1; min-height: 0; max-height: 640px; margin: 0; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)) }
  .tv-cats .daily { grid-column: span 3 } .tv-cats .mixed { grid-column: span 2 }
  .tv-cats:not(:has(.daily)) .mixed { grid-column: 1 / -1 }
  .tv-cats button { min-height: 0; gap: 6px; font-size: 1.05rem; border-radius: 20px; justify-content: center }
  .tv-cats .ic { font-size: 2.4rem }
  .tv-cats .daily .ic, .tv-cats .mixed .ic { font-size: 2.8rem }
  .tv-cats small { font-size: .82rem }
  .tv-cats button:hover:not(:disabled) { transform: translateY(-4px) scale(1.02); box-shadow: inset 0 4px 0 var(--acc, transparent), 0 14px 26px -8px #53223f33, 0 3px 0 var(--lg-line); border-color: var(--lg-rose) }
  .tv-cats button:hover:not(:disabled) .ic { transform: scale(1.18) rotate(-5deg) }
  .tv-cats button:active:not(:disabled) { transform: translateY(1px) }

  /* quiz stage */
  .tv-quiz.lg-stage { display: grid; flex: 1; height: auto; min-height: 0; padding: 0; max-width: none; width: 100%; grid-template-columns: 232px minmax(0, 1fr) 272px }
  .tv-left { display: flex }
  .tv-quiz > aside.tv-right { display: flex }
  .tv-quiz > section { display: flex }
  .tv-centre { gap: 12px; justify-content: center; padding: 2px 6px 8px }
  .tv-centre > * { width: 100%; max-width: 780px }
  .tv-meta { margin: 0; font-size: 1rem }
  #tv-timetext { font-family: 'Fredoka', system-ui, sans-serif; font-size: 1.6rem; color: var(--lg-rose); font-variant-numeric: tabular-nums }
  .tv-timer { height: 12px; flex: none }
  .tv-card { background: var(--lg-white); border: 1px solid var(--lg-line); border-radius: 24px; padding: 22px 28px; box-shadow: var(--lg-shadow); display: grid; place-items: center; min-height: 130px; text-align: center }
  #tv-q { font-size: clamp(1.35rem, 2.2vw, 1.8rem); margin: 0; text-wrap: balance }
  .tv-opts { grid-template-columns: 1fr 1fr; gap: 12px; grid-auto-rows: minmax(76px, auto) }
  .tv-opt { min-height: 76px; font-size: 1.08rem; font-weight: 800; border-radius: 18px; gap: 12px; padding: 12px 16px }
  .tv-opt .k { min-width: 2em; height: 2em; font-size: .95rem }
  .tv-opt:hover:not([aria-disabled=true]) { transform: translateY(-2px); border-color: var(--lg-rose); box-shadow: 0 7px 0 var(--lg-line), 0 14px 22px -10px #53223f33 }
  .tv-opt.right::after, .tv-opt.wrong::after { display: none }
  .tv-opt .k { position: relative }
  .tv-opt.right .k, .tv-opt.wrong .k { color: transparent }
  .tv-opt.right .k { background: var(--lg-good) } .tv-opt.wrong .k { background: var(--lg-bad) }
  .tv-opt.right .k::after, .tv-opt.wrong .k::after { position: absolute; inset: 0; display: grid; place-items: center; color: var(--lg-white); font-size: 1rem }
  .tv-opt.right .k::after { content: '✓' } .tv-opt.wrong .k::after { content: '✗' }
  #tv-feedback { min-height: 3.2em; margin: 0; display: grid; place-items: center }
  .tv-actions { margin: 0; min-height: 50px; padding: 4px }

  .tv-left { padding: 18px }
  .tv-pips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px }
  .tv-pips li { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: .85rem; background: var(--lg-cream); border: 2px solid var(--lg-line); color: var(--lg-muted) }
  .tv-pips li.ok { background: var(--lg-tint-2); border-color: var(--lg-good); color: var(--lg-good) }
  .tv-pips li.no { background: var(--lg-tint-1); border-color: var(--lg-bad); color: var(--lg-bad) }
  .tv-pips li.now { border-color: var(--lg-rose); color: var(--lg-rose); background: var(--lg-pink); box-shadow: 0 0 0 3px var(--lg-pink) }
  .tv-cat { margin: 6px 0 0; font-family: 'Fredoka', system-ui, sans-serif; font-size: 1.35rem; line-height: 1.25 }
  .tv-cat .ic { display: block; font-size: 2.6rem; margin-bottom: 4px }
  .tv-keys { margin: auto 0 0; font-size: .8rem; line-height: 2 }

  .tv-right { padding: 18px }
  .tv-right .tv-board { flex-direction: column; margin: 0 }
  .tv-score { display: grid; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--lg-pink) }
  .tv-score[hidden] { display: none }
  .tv-score .tv-h { margin: 0; color: var(--lg-ink) }
  .tv-score b { font-family: 'Fredoka', system-ui, sans-serif; font-size: 3rem; font-weight: 500; line-height: 1; color: var(--lg-rose); font-variant-numeric: tabular-nums }
  .tv-streak { font-weight: 800; font-size: .9rem }
  .tv-lifelines { flex-direction: column; align-items: stretch; margin: 0 }
  .tv-lifelines .tv-h { display: block }
  .tv-lifelines button { justify-content: flex-start; box-shadow: 0 3px 0 var(--lg-line) }
  .tv-lifelines button:hover:not(:disabled) { border-color: var(--lg-rose) }
  .tv-lifelines kbd { display: inline-block; margin-left: auto }

  /* result card */
  .tv-final { margin: auto; width: min(620px, 100%); padding: 26px 30px; background: var(--lg-white); border: 1px solid var(--lg-line); border-radius: 28px; box-shadow: var(--lg-shadow); animation: tv-pop .45s cubic-bezier(.34, 1.56, .64, 1) }
  .tv-final .tv-board { flex-direction: row }
  .tv-big { font-size: 3.6rem; color: var(--lg-rose) }
}
@media (min-width: 1700px) {
  :root { --lg-stage-max: 1480px }
  .tv-quiz.lg-stage { grid-template-columns: 260px minmax(0, 1fr) 300px }
  .tv-centre > * { max-width: 920px }
  .tv-centre { gap: 16px }
  #tv-q { font-size: 2.1rem }
  .tv-card { min-height: 170px }
  .tv-opts { grid-auto-rows: minmax(92px, auto); gap: 16px }
  .tv-opt { font-size: 1.25rem; min-height: 92px }
}
