/* bored. portal — business storefronts on the web, against the real backend.
   Tokens match handoff/BOREDUI/Brand.swift and web/css/site.css (2026-10-06 site system):
   system type, ink on white, one purple accent, hairline dividers. */

:root {
  --purple: #6934ED;
  --ink: #202124;
  --muted: #64646B;
  --lavender: #F3EEFF;
  --line: #E5DCF7;
  --green: #32A971;
  --go: #FFD23F;
  --surface: #FFFFFF;
  --danger: #D62F50;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --purple: #A68BFF; --ink: #F1F1F4; --muted: #ABABB0; --lavender: #1C1C1E; --line: #2C2C2E; --surface: #000000; --danger: #FF6B85; }
}
html { color-scheme: light dark; }

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--body); font-weight: 400; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.1; letter-spacing: -.01em; }
:where(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
p { margin: 0; line-height: 1.5; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
@media (max-width: 880px) { .shell { grid-template-columns: 1fr; } }

.side {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh;
}
@media (max-width: 880px) { .side { position: static; height: auto; } }

.brand {
  display: flex; width: fit-content; align-items: baseline; gap: 2px; font-family: var(--display); font-size: 24px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .01em; margin-bottom: 18px;
  background: linear-gradient(110deg, #FF5A1F 0%, #FF3D6E 38%, #7B3CFF 76%, #FFD166 100%);
  background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.brand i { width: .26em; height: .26em; border-radius: 50%; background: #FFD166; display: inline-block; font-style: normal; }

.navbtn {
  display: flex; align-items: center; gap: 11px; width: 100%;
  border: 0; background: transparent; color: var(--muted);
  padding: 11px 13px; border-radius: 14px; font-size: 15px; font-weight: 700; text-align: left;
  transition: background .15s, color .15s;
}
.navbtn:hover { background: var(--lavender); color: var(--ink); }
.navbtn[aria-current="true"] { background: var(--lavender); color: var(--ink); }
.navbtn svg { width: 19px; height: 19px; flex: 0 0 auto; }
.navbtn .count { margin-left: auto; font-size: 12px; background: var(--lavender); color: var(--purple); border-radius: 99px; padding: 2px 8px; }
.navbtn[aria-current="true"] .count { background: var(--surface); color: var(--purple); }

.me { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 11px; }
.me .name { font-family: var(--display); font-size: 15px; }
.me .sub { font-size: 12px; color: var(--muted); }

/* ---------- main ---------- */

main { padding: 30px clamp(18px, 3vw, 40px) 70px; max-width: 1080px; }
.head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { font-size: clamp(30px, 4vw, 44px); }
.head p { color: var(--muted); font-size: 15px; }

.panel { display: none; }
.panel[data-active="true"] { display: block; animation: rise .32s cubic-bezier(.2,.8,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .panel[data-active="true"] { animation: none; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px;
}
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); }

.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--purple); display: grid; place-items: center; flex: 0 0 auto; }
.avatar svg { width: 76%; }
.avatar.lg { width: 84px; height: 84px; }

.row { display: flex; align-items: center; gap: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 800; color: var(--purple); background: var(--lavender); border-radius: 99px; padding: 4px 11px; }
.muted { color: var(--muted); font-size: 14px; }

.btn { border: 1px solid var(--ink); border-radius: 14px; background: var(--ink); color: var(--surface); font-family: var(--body); font-weight: 600; font-size: 15px; min-height: 44px; padding: 0 20px; transition: opacity .15s; }
.btn:hover:not(:disabled) { opacity: .86; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.mini { font-size: 13px; padding: 8px 14px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

input[type=text] {
  font: inherit; font-weight: 700; border: 1px solid var(--line); background: var(--lavender);
  border-radius: 14px; padding: 12px 14px; width: 100%; color: var(--ink);
}
input[type=text]:focus { outline: 2px solid var(--purple); outline-offset: 1px; }

.empty { color: var(--muted); font-size: 15px; padding: 26px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; }

/* ---------- specifics ---------- */

.stat { text-align: center; padding: 18px; }
.stat b { display: block; font-family: var(--display); font-size: 32px; }
.stat span { font-size: 13px; color: var(--muted); }

#qr { width: 100%; max-width: 230px; margin-inline: auto; }
#qr canvas, #qr img { width: 100%; height: auto; image-rendering: pixelated; border-radius: 12px; }
.code-value { font-family: ui-monospace, Menlo, monospace; font-size: 27px; font-weight: 800; text-align: center; letter-spacing: .06em; }

#map { height: 460px; border-radius: 22px; border: 1px solid var(--line); }
.leaflet-popup-content { font-family: var(--body); font-weight: 700; }

.game-tile { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.game-tile button { width: 100%; border: 0; background: transparent; padding: 18px; text-align: left; }
.game-tile h4 { font-size: 19px; }
.game-tile .muted { margin-top: 4px; }

#gameFrame { width: 100%; height: min(78vh, 760px); border: 0; border-radius: 22px; background: #000; }

.banner { border-radius: 16px; padding: 13px 16px; font-size: 14px; margin-bottom: 18px; }
.banner.warn { background: #FFF6DA; border: 1px solid var(--go); }
.banner.bad { background: #FDE7EB; border: 1px solid #E4405F; }
.banner.ok { background: #E6F7EF; border: 1px solid var(--green); }

.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; color: var(--green); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live i { animation: none; } }

/* Account gate: the 2026-10-06 site system. White page, hairline fields, 48 px controls,
   no card shadow, a plain two-way segmented switch. */
[hidden] { display: none !important; }
.auth-gate { min-height: 100dvh; display: grid; place-items: center; padding: 48px 24px; background: var(--surface); }
.auth-card { width: min(100%, 400px); }
.auth-card .brand { margin: 0 0 48px; font-size: 28px; }
.auth-card h1 { font-size: 28px; line-height: 1.15; margin-bottom: 8px; }
.auth-card > .muted { font-size: 15px; line-height: 1.5; }
.auth-card form { display: grid; gap: 8px; margin-top: 24px; }
.auth-card form[hidden] { display: none; }
.auth-card form > label:not(.checkline) { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.auth-card input:not([type="checkbox"]) { min-width: 0; width: 100%; font: inherit; font-size: 16px; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface); }
.auth-card input:not([type="checkbox"]):focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; border-color: transparent; }
.auth-card .btn { margin-top: 16px; min-height: 48px; }
.auth-note { font-size: 14px; margin-top: 24px; line-height: 1.5; }
.auth-note a { color: var(--purple); text-decoration: underline; text-underline-offset: 3px; }
#authMessage { margin-top: 16px; font-size: 15px; }
#authMessage:empty { display: none; }
button:disabled { cursor: default; opacity: .6; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-top: 32px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.auth-tabs button { border: 0; min-height: 44px; padding: 0 12px; color: var(--muted); background: transparent; font-weight: 500; font-size: 15px; }
.auth-tabs button + button { border-left: 1px solid var(--line); }
.auth-tabs button[aria-pressed="true"] { background: var(--lavender); color: var(--ink); font-weight: 600; }
.checkline { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 8px; }
.checkline input { width: 18px; height: 18px; flex: 0 0 auto; margin: 1px 0 0; padding: 0; accent-color: var(--ink); }
.checkline span { flex: 1; min-width: 0; }

.business-layout { display:grid; grid-template-columns:minmax(190px, .7fr) minmax(0, 1.6fr); gap:24px; align-items:start; }
.business-form { display:grid; gap:16px; }
.business-form[hidden] { display:none; }
.business-form label { display:grid; gap:7px; font-weight:800; }
.business-form input, .business-form select, .business-form textarea { width:100%; box-sizing:border-box; border:1px solid var(--line, #e7e7ea); border-radius:14px; padding:12px 14px; font:inherit; color:inherit; background:var(--surface); }
.business-form textarea { resize:vertical; }
.business-actions { display:flex; flex-wrap:wrap; gap:10px; }
.business-row { display:flex; justify-content:space-between; gap:12px; width:100%; border:1px solid var(--line); border-radius:14px; background:var(--surface); color:var(--ink); font:inherit; padding:15px; margin-bottom:10px; text-align:left; cursor:pointer; }
.business-row span { color:var(--muted); font-size:13px; }
.business-row strong { overflow-wrap:anywhere; }
.business-empty { color:var(--muted); font-size:14px; line-height:1.45; padding:4px 2px 14px; }
@media(max-width:760px) { .business-layout { grid-template-columns:1fr; } }
