/* bored. portal — the app's features on the web, against the real backend.
   Tokens match handoff/BOREDUI/Brand.swift exactly, same as the marketing site. */

:root {
  --purple: #6934ED;
  --ink: #202124;
  --muted: #64646B;
  --lavender: #F4F4F6;
  --line: #E7E7EB;
  --green: #32A971;
  --go: #FFD23F;
  --surface: #FFFFFF;
  --display: "Nunito", ui-rounded, system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--body); font-weight: 600; color: var(--ink); background: var(--lavender); }
h1,h2,h3,h4 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.05; letter-spacing: -.01em; }
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; align-items: baseline; gap: 3px; font-family: var(--display); font-size: 26px; color: var(--purple); margin-bottom: 18px; }
.brand i { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); 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(--purple); color: #fff; }
.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: rgba(255,255,255,.22); color: #fff; }

.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: 22px; 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: 0; border-radius: 99px; background: var(--purple); color: #fff; font-family: var(--display); font-size: 15px; padding: 11px 20px; transition: filter .15s, transform .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--lavender); color: var(--ink); }
.btn.mini { font-size: 13px; padding: 8px 14px; }
.btn.danger { background: #E4405F; }

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 uses the same rounded typography and brand accents as the app. */
[hidden] { display: none !important; }
.auth-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 430px); padding: clamp(24px, 5vw, 40px); border-radius: 30px; background: var(--surface); box-shadow: 0 20px 70px #2110520c; }
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { font-size: 32px; margin-bottom: 12px; }
.auth-card form { display: grid; gap: 10px; margin-top: 28px; }
.auth-card form[hidden] { display: none; }
.auth-card input { min-width: 0; width: 100%; font: inherit; font-size: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface); }
.auth-card input:focus-visible { outline: 3px solid #6934ed50; border-color: var(--purple); }
.auth-card .btn { margin-top: 12px; min-height: 48px; }
.auth-note { font-size: 13px; margin-top: 22px; }
.auth-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#authMessage { margin-top: 14px; font-size: 14px; }
button:disabled { cursor: default; opacity: .6; }

.auth-card .btn { background: var(--ink); color: #fff; }
.auth-card .brand { background: linear-gradient(110deg,#ff5a31,#ff367d,#7b3cff,#f5c978); background-clip: text; -webkit-background-clip: text; color: transparent; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 24px; padding: 4px; border-radius: 999px; background: var(--lavender); }
.auth-tabs button { border: 0; border-radius: 999px; padding: 10px 12px; color: var(--muted); background: transparent; font-weight: 800; }
.auth-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px #00000010; }
.checkline { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.checkline input { width: auto; flex: 0 0 auto; margin-top: 2px; padding: 0; }
.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(--bg, #fafafa); }
.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:0; border-radius:16px; background:#f4f4f6; color:#202124; font:inherit; padding:15px; margin-bottom:10px; text-align:left; cursor:pointer; }
.business-row span { color:#64646b; 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; } }
