@import url('/theme.css');

* { box-sizing: border-box; }
:root { color-scheme: light; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--paper); font-synthesis: none; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
input { width: 100%; min-height: 54px; padding: 13px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
label { display: block; font-weight: 700; margin-bottom: 10px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; line-height: 1.1; letter-spacing: -.04em; font-weight: 500; }
h1 { font-size: clamp(2.3rem, 5vw, 4.5rem); }
h2 { font-size: 1.65rem; }
[hidden] { display: none !important; }
.page-shell { max-width: 1200px; margin: auto; padding: 0 32px; }
.masthead { min-height: 80px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--ink); }
.wordmark { font-family: Georgia, 'Times New Roman', serif; font-size: 2rem; font-weight: 700; letter-spacing: -.07em; }
#connection { color: var(--red); font-size: .8rem; }
main { padding: 32px 0; }
.muted, .small-copy, .lede { color: var(--muted); }
.small-copy { font-size: .85rem; margin-top: 16px; }
.lede { font-size: 1.3rem; margin-top: 20px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 49px; padding: 12px 22px; border: 1px solid var(--ink); border-radius: 4px; background: var(--ink); color: #fff; font-size: .95rem; font-weight: 700; text-decoration: none; }
.button:hover:not(:disabled) { background: var(--green); border-color: var(--green); }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button.secondary:hover:not(:disabled) { border-color: var(--ink); }
.button.small { min-height: 40px; padding: 8px 13px; font-size: .85rem; }
.button.full { width: 100%; margin-top: 16px; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.text-button { display: inline-block; padding: 6px 0; border: 0; background: none; font-size: .85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.notice { max-width: 580px; margin: 14px auto 0; padding: 10px 13px; background: var(--green-light); border-left: 3px solid var(--green); font-size: .85rem; }
.notice.error { background: #f9eeea; border-color: var(--red); }
.join-view { max-width: 360px; margin: clamp(40px, 14vh, 140px) auto 0; }
.join-view label { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; letter-spacing: -.04em; }
.join-view .text-button { margin-top: 24px; }
.waiting { text-align: center; padding: clamp(50px, 17vh, 180px) 0; }
.waiting h1 { font-size: clamp(2rem, 6vw, 3rem); overflow-wrap: anywhere; }
.waiting p { margin-top: 18px; color: var(--muted); }
.loading { text-align: center; margin-top: 60px; color: var(--muted); }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.admin-top h1 { font-size: 2rem; }
.admin-top .button-row { gap: 20px; }
.host-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 24px; }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.panel-head p { margin-top: 7px; font-size: .9rem; }
.round-controls .button-row { margin-top: 28px; }
.team-list { margin-top: 18px; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border: 0; }
.team-row strong, .team-row > span:first-child { overflow-wrap: anywhere; }
.team-status { font-size: .85rem; white-space: nowrap; color: var(--muted); }
.panel > .muted { margin-top: 18px; }
.settings { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 20px; }
summary { cursor: pointer; font-size: .9rem; color: var(--muted); }
.settings-content { max-width: 600px; padding-top: 22px; }
.settings-content > .button-row { margin-top: 20px; }
.settings-content details { margin-top: 25px; }
.duration-row { display: flex; gap: 14px; align-items: end; }
.duration-row label { margin: 0; font-size: .85rem; }
.duration-row input { display: block; max-width: 140px; margin-top: 8px; }
.duration-row button { margin-bottom: 2px; }
.transfer-result { background: var(--green-light); padding: 18px; margin-top: 18px; font-size: .9rem; }
.transfer-result code { display: block; font-size: 1.5rem; letter-spacing: .1em; padding: 8px 0; }
.clock { font-size: 2.5rem; font-weight: 700; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.clock.urgent { color: var(--red); }
.play-view .page-shell { max-width: 580px; padding: 0 16px; }
.play-view .masthead { min-height: 62px; }
.play-view .wordmark { font-size: 1.55rem; }
.play-view main { padding-top: 20px; }
.game-layout { max-width: 540px; margin: auto; }
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; }
.game-top h1 { font-size: 1.9rem; }
.team-name { font-size: .8rem; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.game-top .clock { font-size: 2rem; flex-shrink: 0; }
progress { display: block; width: 100%; height: 3px; border: 0; background: var(--line); accent-color: var(--green); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.game-status { text-align: center; min-height: 30px; padding: 5px 0; font-size: .85rem; color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; max-width: min(300px, 75vw); margin: 0 auto 20px; }
.board-row { display: contents; }
.tile { aspect-ratio: 1; min-height: 0; display: flex; justify-content: center; align-items: center; position: relative; border: 2px solid #d6d7d3; font-size: 1.8rem; font-weight: 700; line-height: 1; }
.tile.filled { border-color: #8b8f89; }
.tile.correct, .sample-tile.correct { background: var(--green); border-color: var(--green); color: #fff; }
.tile.present, .sample-tile.present { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.tile.absent, .sample-tile.absent { background: var(--absent); border-color: var(--absent); color: #fff; }
.tile-marker { position: absolute; bottom: 3px; right: 3px; font-size: .55rem; font-weight: 400; }
.keyboard { display: grid; gap: 7px; touch-action: manipulation; }
.keyboard-row { display: flex; justify-content: center; gap: 5px; }
.key { flex: 1; max-width: 49px; min-width: 0; min-height: 51px; padding: 0; border: 0; border-radius: 4px; background: #dfe2dd; color: var(--ink); font-size: .85rem; font-weight: 700; }
.key.wide { flex: 1.6; max-width: 74px; font-size: .65rem; }
.key.correct { background: var(--green); color: #fff; }
.key.present { background: var(--yellow); color: #fff; }
.key.absent { background: var(--absent); color: #fff; }
.countdown-view { text-align: center; padding: 8vh 0; }
.countdown-number { font-family: Georgia, serif; font-size: clamp(8rem, 22vw, 17rem); line-height: 1; color: var(--green); }
.screen-view .page-shell { max-width: 1600px; padding: 0 48px; }
.screen-view .masthead { justify-content: center; padding: 16px 0; }
.screen-view .wordmark { font-size: clamp(2.5rem, 6vw, 5.5rem); }
.screen-view #connection { position: absolute; top: 10px; right: 16px; }
.screen-view main { padding-top: 45px; }
.screen-lobby { display: grid; grid-template-columns: 1fr 360px; gap: 70px; align-items: start; padding-top: 25px; }
.qr-panel { text-align: center; }
.qr-panel img { display: block; width: 100%; max-width: 360px; height: auto; margin: auto; }
.join-address { font-size: .95rem; margin-top: 15px; overflow-wrap: anywhere; }
.teams-heading { margin-top: 50px; font-size: 1.5rem; }
.team-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.team-chip { padding: 11px 17px; background: #fff; border: 1px solid var(--line); border-radius: 3px; font-size: 1.1rem; overflow-wrap: anywhere; }
.instructions { max-width: 850px; margin: 15px auto; }
.sample-tiles { display: flex; gap: 8px; margin: 30px 0 18px; }
.sample-tile { display: grid; place-items: center; width: 60px; height: 60px; border: 2px solid var(--line); font-size: 1.9rem; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 22px; font-size: 1rem; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; background: var(--green); margin-right: 7px; }
.legend span:nth-child(2)::before { background: var(--yellow); }
.legend span:nth-child(3)::before { background: var(--absent); }
.instruction-rules { margin: 30px 0; padding-left: 23px; font-size: 1.25rem; }
.instruction-rules li { margin-top: 12px; }
.projector-active { max-width: 850px; margin: 10px auto; text-align: center; }
.projector-clock { display: block; font-family: Georgia, serif; font-size: clamp(6rem, 16vw, 14rem); font-weight: 400; margin: 30px 0; }
.participation { font-size: 1.15rem; color: var(--muted); margin-top: 28px; }
.reveal { text-align: center; margin: 40px auto; }
.answer-preview { display: flex; justify-content: center; gap: 12px; margin-top: 50px; }
.answer-preview span { display: grid; place-items: center; background: var(--green); color: #fff; width: clamp(45px, 9vw, 100px); height: clamp(50px, 10vw, 110px); font-size: clamp(1.8rem, 5vw, 3.5rem); font-weight: 700; }
.leaderboard-wrap { max-width: 950px; margin: 15px auto; }
.leaderboard { width: 100%; border-collapse: collapse; margin-top: 35px; text-align: left; }
.leaderboard th { padding: 13px; border-bottom: 2px solid var(--ink); font-size: .9rem; font-weight: 400; color: var(--muted); }
.leaderboard td { padding: 22px 13px; border-bottom: 1px solid var(--line); font-size: 1.55rem; overflow-wrap: anywhere; }
.leaderboard th:last-child, .leaderboard td:last-child { text-align: right; }
.leaderboard td:first-child { width: 90px; }
.leaderboard .winner { background: var(--green-light); }
dialog { width: calc(100% - 32px); max-width: 460px; padding: 28px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); border-radius: 4px; }
dialog::backdrop { background: #1119; }
dialog p { margin-top: 16px; color: var(--muted); }
dialog .button-row { margin-top: 24px; }
@supports (height: 100svh) {
  .play-view .board { max-width: clamp(175px, calc((100svh - 390px) * .82), 300px); }
}
@media (max-width: 700px) {
  .page-shell { padding: 0 20px; }
  .host-layout { grid-template-columns: 1fr; }
  .admin-top .button-row { gap: 12px; }
  .panel { padding: 22px; }
  .screen-view .page-shell { padding: 0 22px; }
  .screen-lobby { grid-template-columns: 1fr; gap: 30px; }
  .qr-panel { grid-row: 1; }
  .qr-panel img { max-width: 250px; }
  .teams-heading { margin-top: 30px; }
  .keyboard-row { gap: 4px; }
  .key.wide { font-size: .6rem; }
  .leaderboard td { font-size: 1rem; padding: 16px 8px; }
  .leaderboard td:first-child { width: 45px; }
}
