@font-face { font-family: Pixelify; src: url(/PixelifySans.ttf); font-display: swap; }
@font-face { font-family: Barlow; src: url(/BarlowCondensed-Medium.ttf); font-weight: 500; font-display: swap; }
@font-face { font-family: Barlow; src: url(/BarlowCondensed-Bold.ttf); font-weight: 700; font-display: swap; }
/* the same palette as the in-game lobby (tectica/scripts/ui/lobby/ui.gd) */
:root {
  --bg: #07090c; --panel: #0f1318; --card: #171c22; --line: rgba(255, 255, 255, .09); --line-strong: rgba(255, 255, 255, .18);
  --text: #edf2f5; --dim: #9eabb8; --faint: #6b7884; --accent: #f2a03d; --accent-ink: #1a1206; --ok: #70e08a; --bad: #ff5c54;
  --info: #5fd4ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* overscroll-behavior: no pull-to-refresh (a swipe down from the top used to reload the page mid-match) */
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none;
  font: 500 17px/1.4 Barlow, "Barlow Condensed", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent; }
/* web/arena.js sizeCanvas() sets --app-w / --app-h (and the canvas's own size): the full screen, also in an iOS
   home-screen app where 100% / 100dvh stop short of the bottom */
#canvas { position: fixed; top: 0; left: 0; width: var(--app-w, 100%); height: var(--app-h, 100%); display: block; outline: none; touch-action: none; background: #000; }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* ---- splash: brand, enter, account */
#lobby { position: fixed; inset: 0; overflow-y: auto; overscroll-behavior: contain; height: var(--app-h, 100%);
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(60% 55% at 50% 62%, rgba(242, 160, 61, .22), transparent 70%),
    radial-gradient(90% 60% at 50% 110%, rgba(40, 90, 150, .35), transparent 70%),
    linear-gradient(180deg, #0b0f14, #06080b);
  display: grid; align-content: center; justify-items: center; gap: 26px; text-align: center; }
#lobby[hidden] { display: none; }
#lobby .glow { position: fixed; inset: auto 0 0; height: 45%; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 80px),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, .02));
  mask-image: linear-gradient(180deg, transparent, #000); transform: perspective(400px) rotateX(55deg); transform-origin: bottom; }
@media (display-mode: standalone), (display-mode: fullscreen) { html, body { min-height: 100lvh; } }
header { position: relative; }
.brand { font: 700 clamp(44px, 9vw, 96px)/1 Pixelify, system-ui; letter-spacing: .06em; margin: 0; color: var(--accent);
  text-shadow: 0 0 40px rgba(242, 160, 61, .35); }
.tag { margin: 10px 0 0; color: var(--dim); font-size: clamp(15px, 2vw, 19px); letter-spacing: .04em; }
.enter { position: relative; display: grid; gap: 12px; width: min(420px, 100%); }
#play { position: relative; overflow: hidden; display: grid; gap: 2px; justify-items: start; text-align: left; min-height: 78px;
  padding: 14px 64px 16px 22px; border: 0; border-radius: 16px; background: var(--accent); color: var(--accent-ink); cursor: pointer;
  box-shadow: 0 10px 40px rgba(242, 160, 61, .3); transition: filter .15s, transform .1s; }
#play::after { content: "»"; position: absolute; right: 22px; top: 50%; transform: translateY(-54%); font: 700 40px/1 Barlow, sans-serif; }
#play .label { font: 700 28px/1 Barlow, sans-serif; letter-spacing: .03em; text-transform: uppercase; }
#play .sub { font: 700 14px/1.2 Barlow, sans-serif; letter-spacing: .06em; text-transform: uppercase; opacity: .78; min-height: 1.2em; }
#play .load { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .18); }
#play .load b { display: block; height: 100%; width: 0; background: var(--accent-ink); opacity: .55; transition: width .2s; }
#play:hover { filter: brightness(1.07); }
#play:active { transform: scale(.985); }
#play:disabled { cursor: progress; filter: saturate(.8); }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.ghost { min-height: 48px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, .04);
  color: var(--text); font: 700 16px/1 Barlow, sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.ghost:hover { background: rgba(255, 255, 255, .08); }
.ghost[hidden] { display: none; }
.modes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 170px)); gap: 10px; }
.modes li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(15, 19, 24, .7); display: grid; gap: 2px; }
.modes b { font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: .02em; }
.modes small { color: var(--dim); font-size: 14px; }
footer a { color: var(--faint); font-size: 14px; }
.is-touch .desktop, .is-desktop .touch { display: none; }

/* ---- account dialog: over the splash and over the running game */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top))
  max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); overflow-y: auto; }
.modal[hidden] { display: none; }
.sheet { position: relative; width: min(460px, 100%); padding: 26px 24px 24px; border-radius: 18px; background: var(--panel);
  border: 1px solid var(--line-strong); box-shadow: 0 20px 80px rgba(0, 0, 0, .6); text-align: left; animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.sheet h2 { margin: 0 44px 6px 0; font: 700 30px/1.05 Barlow, sans-serif; text-transform: uppercase; letter-spacing: .01em; }
.sheet p { margin: 0 0 16px; color: var(--dim); }
.sheet [data-step] { display: none; }
.modal[data-step=signin] [data-step=signin], .modal[data-step=username] [data-step=username], .modal[data-step=signed] [data-step=signed] { display: block; }
.close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .05); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.close:hover { background: rgba(255, 255, 255, .1); }
.google { min-height: 44px; display: flex; justify-content: center; margin: 6px 0 14px; }
.fine { font-size: 14px; color: var(--faint) !important; margin: 0 !important; }
.field { display: grid; gap: 6px; }
.field span { font: 700 13px/1 Barlow, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.field input { min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: #0a0d11;
  color: var(--text); font: 700 22px/1 Barlow, sans-serif; letter-spacing: .02em; }
.field input:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px rgba(95, 212, 255, .2); }
.hint { min-height: 1.4em; margin: 8px 0 14px !important; font-size: 15px; }
.hint.ok { color: var(--ok) !important; }
.hint.bad { color: var(--bad) !important; }
.primary { width: 100%; min-height: 52px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  font: 700 20px/1 Barlow, sans-serif; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.who { display: grid; gap: 2px; margin-bottom: 18px !important; }
.who b { color: var(--text); font: 700 28px/1.1 Barlow, sans-serif; }
.who small { color: var(--dim); font-size: 15px; }
.actions { display: grid; gap: 10px; }
.actions .ghost { width: 100%; min-height: 52px; }

#install { position: fixed; inset: auto 16px 16px; z-index: 21; max-width: 520px; margin: 0 auto; padding: 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line-strong); display: grid; gap: 10px; text-align: left; }
#install[hidden] { display: none; }
#install p { margin: 0; }
#install button { justify-self: end; min-height: 44px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--accent);
  color: var(--accent-ink); font-weight: 700; cursor: pointer; }
#rotate { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .92); z-index: 10; text-align: center; padding: 24px; }
#rotate[hidden] { display: none; }
#rotate p { font: 700 24px/1.3 Barlow, sans-serif; text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 720px) {
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(420px, 100%); }
}
@media (max-height: 520px) and (orientation: landscape) {
  #lobby { gap: 14px; }
  .brand { font-size: 44px; }
  .tag { margin-top: 4px; }
  .modes { display: none; }
}
