/* assets/timer.css - the shot clock (timer.php): one big clock filling the screen, in portrait or landscape, in the
   league's navy and gold; amber and red as time runs out.

   Version history:
     v1.0  08/11/2026 Original. */
:root { --bg: #0b1a33; --ink: #ffffff; --muted: #c9d6ea; --navy: #0b3d6e; --gold: #f2c14e; --card: #13284a; --line: #2a4470;
  --ok: #1d4ed8; --amber: #d97706; --red: #dc2626; --green: #15803d; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif; display: flex; flex-direction: column;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
.tm-test { background: #f97316; color: #fff; text-align: center; font-weight: 700; padding: 4px; font-size: 13px; }
.tm-bar { display: flex; align-items: center; gap: 10px; background: var(--navy); border-bottom: 4px solid var(--gold);
  padding: 10px max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px)); }
.tm-home { color: #fff; text-decoration: none; font-size: 22px; padding: 2px 6px; }
.tm-title { flex: 1; min-width: 0; }
.tm-title small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-title b { font-family: 'Barlow Semi Condensed', sans-serif; font-size: 22px; }
.tm-icon { background: rgba(255, 255, 255, .12); border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 700; font-size: 15px; }
.tm-linked { background: var(--gold); color: #14213d; font-weight: 700; text-align: center; padding: 6px 12px; font-size: 15px; }
.tm-linked button { background: none; border: 0; text-decoration: underline; font-weight: 700; color: #14213d; margin-left: 8px; }
.tm-main { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 12px max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); min-height: 0; }
.tm-clock { flex: 1; min-height: 0; border: 0; border-radius: 22px; background: var(--ok); display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background-color .25s; user-select: none; touch-action: manipulation; }
.tm-clock.amber { background: var(--amber); }
.tm-clock.red, .tm-clock.done { background: var(--red); }
.tm-clock.stopped { background: #334a6e; }
.tm-clock.done.flash { animation: tmflash .6s steps(2) infinite; }
@keyframes tmflash { 50% { background: #7f1d1d; } }
@media (prefers-reduced-motion: reduce) { .tm-clock.done.flash { animation: none; } }
.tm-secs { font-family: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif; font-weight: 800; font-size: min(46vw, 46vh); line-height: .9; font-variant-numeric: tabular-nums; }
.tm-hint { font-size: 18px; opacity: .85; margin-top: 6px; }
.tm-btns { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.tm-btn { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 16px 8px; font-weight: 700; font-size: 18px; }
.tm-btn:active { transform: scale(.98); }
.tm-ext { background: var(--gold); color: #14213d; border-color: var(--gold); }
.tm-go { background: var(--green); border-color: var(--green); }
@media (orientation: landscape) and (max-height: 520px) {
  .tm-main { flex-direction: row; }
  .tm-btns { grid-template-columns: 1fr; width: 34%; }
  .tm-secs { font-size: min(40vw, 62vh); }
}
.tm-dialog { border: 0; border-radius: 16px; background: #13284a; color: #fff; width: min(420px, calc(100vw - 32px)); padding: 18px; }
.tm-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.tm-dialog h2 { font-family: 'Barlow Semi Condensed', sans-serif; margin: 0 0 10px; font-size: 26px; }
.tm-dialog > * + * { margin-top: 10px; }
.tm-dialog .tm-btn { width: 100%; }
.tm-field { display: grid; gap: 4px; font-weight: 600; }
.tm-field input, .tm-join input { font: inherit; font-size: 20px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #0b1a33; color: #fff; width: 100%; }
.tm-check { display: flex; gap: 10px; align-items: center; font-size: 17px; }
.tm-check input { width: 22px; height: 22px; accent-color: var(--gold); }
.tm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tm-note { color: var(--muted); font-size: 14px; margin: 0; }
.tm-code { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 800; font-size: 64px; letter-spacing: .12em; text-align: center; color: var(--gold); line-height: 1; }
.tm-join { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.tm-join input { text-transform: uppercase; letter-spacing: .15em; text-align: center; }
.tm-wa { display: block; text-align: center; background: var(--green); border-radius: 14px; padding: 15px; font-weight: 700; color: #fff; text-decoration: none; font-size: 18px; }
.tm-err { background: #3d1717; color: #ff9a92; border-radius: 10px; padding: 8px 10px; font-size: 15px; }
.tm-foot { text-align: center; color: #5b6f92; font-size: 11px; padding: 0 0 max(6px, env(safe-area-inset-bottom, 0px)); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
