@font-face { font-family: 'Russo One'; src: url('/static/broadcast/fonts/RussoOne-Regular.ttf') format('truetype'); font-display: swap; }
@view-transition { navigation: auto; }

/* ---------- Glanopoly design tokens: Soft Premium / Pastel Tech ----------
   Light is the brand's default; dark (graphite) only by the theme switch. Pink is the brand and decoration,
   teal is what you press, graphite is text and the rare dark accent. Player colours stay their own. */
:root {
  /* palette */
  --pink: #EFAFC1; --pink-soft: #FBE3EA; --pink-deep: #D4628A;
  --teal: #39D0D8; --teal-active: #20B8C5; --teal-ink: #0E3A41;
  --graphite: #1F2A44;
  /* surfaces and text */
  --bg: #FFF9FB; --bg-2: #FCF3F6; --card: #FFFFFF; --card-2: #F8F3F6; --card-3: #F1E9EE;
  --line: #E9EDF3; --line-2: #DCE2EB;
  --text: #1F2A44; --muted: #5D6880; --dim: #6E788D;
  /* roles */
  --acc: var(--teal); --acc-2: var(--teal-active); --acc-ink: var(--teal-ink);
  --brand: var(--pink); --brand-2: var(--pink-deep);
  --go: var(--teal-active); --go-ink: var(--teal-ink);
  --warn: #F2A93B; --live: var(--pink-deep); --off: #8A93A6; --bad: #E5566F;
  --focus: var(--teal-active);
  --scrim: rgba(31, 42, 68, .32);
  --shadow: 0 1px 2px rgba(31, 42, 68, .04), 0 8px 24px -14px rgba(31, 42, 68, .16);
  --shadow-up: 0 2px 6px rgba(31, 42, 68, .05), 0 22px 44px -18px rgba(31, 42, 68, .24);
  --shadow-pop: 0 30px 70px -28px rgba(31, 42, 68, .35);
  /* shape and motion */
  --r-s: 10px; --r: 16px; --r-l: 22px;
  --ease: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ui: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --num: 'Russo One', var(--ui);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121624; --bg-2: #171C2C; --card: #1B2133; --card-2: #232A3F; --card-3: #2C344D;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --text: #F2F4F9; --muted: #A2ABC2; --dim: #8890A6;
  --pink-soft: #3A2633; --pink-deep: #F09AB6;
  --scrim: rgba(5, 7, 12, .55);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -14px rgba(0, 0, 0, .7);
  --shadow-up: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 22px 44px -18px rgba(0, 0, 0, .85);
  --shadow-pop: 0 40px 90px -30px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* theme switch: the new theme spreads from the switch as a circle (view transition); elsewhere colours blend */
:root.theme-vt::view-transition-old(root), :root.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.theme-vt::view-transition-new(root) { z-index: 2; }
:root.theme-fade, :root.theme-fade * {
  transition: background-color .5s ease, color .5s ease, border-color .5s ease, box-shadow .5s ease, fill .5s ease, stroke .5s ease !important;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 14px/1.4 var(--ui); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@supports (corner-shape: squircle) {
  .room, .sheet-card, .seat, .panel, .return, .btn.big { corner-shape: squircle; }
  .room, .panel, .return { border-radius: 30px; }
  .sheet-card { border-radius: 40px; }
  .seat { border-radius: 30px; }
}

/* ---------- buttons, chips, segmented ---------- */
.btn {
  --b: var(--card-2); --i: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 12px; background: var(--b); color: var(--i); font-weight: 650; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line); transition: transform .14s var(--ease), filter .2s, background .2s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn.primary { --b: var(--acc); --i: var(--acc-ink); box-shadow: 0 8px 22px -12px var(--acc-2), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary:hover:not(:disabled), .btn.go:hover:not(:disabled) { --b: var(--acc-2); filter: none; }
.btn.go { --b: var(--go); --i: var(--go-ink); box-shadow: 0 8px 22px -12px var(--go), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.ghost { --b: transparent; }
.btn.big { height: 46px; padding: 0 20px; border-radius: 14px; font-size: 15px; }
.btn.busy { pointer-events: none; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s, transform .14s var(--ease); }
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: inline; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { height: 32px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; transition: color .2s, background .2s, box-shadow .2s, transform .14s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button:active { transform: scale(.95); }
.seg button[aria-checked="true"], .seg button.on { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2), 0 2px 6px -2px rgba(31, 42, 68, .14); }
.seg button:disabled { cursor: default; }
.seg.small button { height: 28px; padding: 0 10px; font-size: 12.5px; }
.chip { height: 38px; padding: 0 14px; border-radius: 12px; background: var(--card); color: var(--muted); font-weight: 600; font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--line); transition: color .2s, background .2s, box-shadow .2s, transform .14s var(--ease); }
.chip:hover { color: var(--text); }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--acc) 16%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 55%, transparent); }
.chip.ghost { background: transparent; box-shadow: none; }
.select { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.select select { height: 30px; border: 0; background: transparent; color: var(--text); font-weight: 600; cursor: pointer; padding-right: 4px; }
.select select option { background: var(--card); color: var(--text); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; height: 64px; padding: 0 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; position: relative; flex: none;
  background: linear-gradient(145deg, #F8D3DE, var(--pink) 55%, #E496AE); box-shadow: 0 6px 16px -8px var(--pink-deep), inset 0 1px 0 rgba(255, 255, 255, .55); }
.brand-mark i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--graphite); }
.brand-mark i:nth-child(1) { left: 7px; top: 7px; } .brand-mark i:nth-child(2) { right: 7px; top: 7px; }
.brand-mark i:nth-child(3) { left: 14px; top: 14px; }
.brand-mark i:nth-child(4) { left: 7px; bottom: 7px; } .brand-mark i:nth-child(5) { right: 7px; bottom: 7px; }
.brand:hover .brand-mark { transform: rotate(-8deg); }
.brand-mark { transition: transform .35s var(--spring); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font: 17px var(--num); letter-spacing: .02em; font-weight: 400; }
.brand-text small { color: var(--muted); font-size: 12px; font-weight: 600; }
.nav { display: flex; gap: 4px; }
.nav-item { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 10px; font-weight: 650; color: var(--muted); transition: color .2s, background .2s; }
.nav-item:hover { color: var(--text); }
.nav-item.on { color: var(--text); background: var(--card-2); }
.search { flex: 1; max-width: 340px; margin-left: auto; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--dim); transition: box-shadow .2s; }
.search:focus-within { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 70%, transparent), 0 0 0 4px color-mix(in srgb, var(--acc) 16%, transparent); color: var(--muted); }
.search svg { width: 17px; height: 17px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.top-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.me { display: flex; align-items: center; min-width: 38px; height: 40px; }
.me-skel { width: 120px; height: 34px; border-radius: 12px; background: var(--card-2); }
.me-chip { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px 0 4px; border-radius: 13px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); max-width: 220px; }
.me-chip b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; margin-top: -2px; }
.me-chip .av { width: 32px; height: 32px; font-size: 13px; }

/* ---------- avatars ---------- */
.av { --c: var(--teal-active); width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 45%, #fff) 0%, var(--c) 46%, color-mix(in srgb, var(--c) 60%, #000) 100%);
  color: #fff; font: 12px var(--num); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); box-shadow: 0 0 0 2px var(--card); }
.av.empty { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); color: transparent; border: 0; }
.av.out { filter: grayscale(1) opacity(.5); }

/* ---------- hub page ---------- */
.view { display: block; outline: 0; }
.hub, .lobby { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 18px; }
.hub-title h1 { margin: 0; font: 34px/1 var(--num); font-weight: 400; letter-spacing: .01em; }
.stats { margin: 8px 0 0; color: var(--muted); font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px 14px; min-height: 20px; }
.stats span { display: inline-flex; align-items: center; gap: 6px; }
.stats i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--go)); }
.stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.skel-line { display: inline-block; width: 240px; height: 14px; border-radius: 7px; background: var(--card-2); }

.return { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px 14px 14px 18px; border-radius: var(--r-l);
  background: linear-gradient(110deg, var(--pink-soft) 0%, var(--card) 62%); box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--pink) 70%, transparent);
  animation: rise .45s var(--ease) both; }
.return .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--go); flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--go) 60%, transparent); animation: pulse 2s ease-out 3; }
.return div { flex: 1; min-width: 0; }
.return b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.return small { color: var(--muted); font-weight: 600; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }

.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: stretch; }
.room { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 14px 16px; border-radius: var(--r-l);
  background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); min-height: 168px;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease); contain: layout paint; }
.room:hover { transform: translateY(-2px); box-shadow: var(--shadow-up), inset 0 0 0 1px var(--line-2); }
.room.enter { animation: card-in .34s var(--spring) both; }
.room.leave { animation: card-out .22s var(--ease) both; pointer-events: none; }
@keyframes card-in { from { opacity: 0; transform: scale(.94) translateY(6px); } }
@keyframes card-out { to { opacity: 0; transform: scale(.94); } }
.room.flash { animation: flash .6s var(--ease); }
@keyframes flash { 30% { box-shadow: var(--shadow-up), inset 0 0 0 1.5px color-mix(in srgb, var(--acc) 70%, transparent); } }
.room-top { display: flex; align-items: center; gap: 8px; }
.status { --c: var(--go); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: 8px; font-size: 12px; font-weight: 700;
  color: color-mix(in srgb, var(--c) 52%, var(--text)); background: color-mix(in srgb, var(--c) 16%, transparent); transition: color .3s, background .3s; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.status.waiting { --c: var(--go); } .status.full { --c: var(--warn); } .status.playing { --c: var(--live); } .status.closed { --c: var(--off); }
.lock { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.lock svg { width: 14px; height: 14px; }
.room h3 { margin: 0; font-size: 16.5px; font-weight: 720; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host { margin-top: -6px; color: var(--muted); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seats { display: flex; align-items: center; gap: 10px; }
.seats-row { display: flex; }
.seats-row .av { margin-left: -6px; transition: transform .3s var(--spring); }
.seats-row .av:first-child { margin-left: 0; }
.seats-row .av.pop { animation: pop .38s var(--spring); }
@keyframes pop { from { transform: scale(.4); } }
.count { margin-left: auto; font: 15px var(--num); font-variant-numeric: tabular-nums; color: var(--text); display: inline-flex; overflow: hidden; height: 20px; }
.count small { color: var(--dim); font-size: 13px; margin-left: 1px; }
.count .n { display: inline-block; }
.count .n.up { animation: num-up .3s var(--ease); } .count .n.down { animation: num-down .3s var(--ease); }
@keyframes num-up { from { transform: translateY(100%); opacity: 0; } }
@keyframes num-down { from { transform: translateY(-100%); opacity: 0; } }
.room-foot { display: flex; align-items: flex-end; gap: 10px; margin-top: auto; }
.rules { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; flex: 1; }
.rules span { height: 22px; padding: 0 7px; border-radius: 7px; display: inline-flex; align-items: center; background: var(--card-2); color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.room .btn { height: 36px; padding: 0 14px; border-radius: 11px; }

.skeleton { pointer-events: none; }
.skeleton .bar { height: 12px; border-radius: 6px; background: var(--card-2); }
.skeleton .bar.w40 { width: 40%; } .skeleton .bar.w70 { width: 70%; height: 16px; } .skeleton .bar.w55 { width: 55%; }
.skeleton { background-image: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--text) 4%, transparent) 50%, transparent 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

.empty-state { display: grid; justify-items: center; gap: 10px; padding: 48px 16px 40px; text-align: center; animation: rise .35s var(--ease) both; }
.empty-dice { width: 72px; height: 72px; border-radius: 20px; position: relative; background: var(--pink-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pink) 70%, transparent); transform: rotate(-10deg); margin-bottom: 6px; }
.empty-dice i { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--pink-deep); }
.empty-dice i:nth-child(1) { left: 15px; top: 15px; } .empty-dice i:nth-child(2) { right: 15px; bottom: 15px; } .empty-dice i:nth-child(3) { left: 30.5px; top: 30.5px; }
.empty-state h2 { margin: 0; font-size: 18px; }
.empty-state p { margin: 0 0 6px; color: var(--muted); max-width: 380px; }
.more-wrap { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- sheet (create room, sign in) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: var(--scrim); backdrop-filter: blur(4px); animation: fade .2s var(--ease) both; }
.sheet.out { animation: fade-out .18s ease-in both; }
@keyframes fade { from { opacity: 0; } } @keyframes fade-out { to { opacity: 0; } }
.sheet-card { width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain; border-radius: 26px; background: var(--card); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line-2);
  padding: 22px; display: flex; flex-direction: column; gap: 16px; animation: sheet-in .38s var(--spring) both; }
.sheet.out .sheet-card { animation: sheet-out .18s ease-in both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font: 22px var(--num); font-weight: 400; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.input { height: 46px; padding: 0 14px; border-radius: 13px; border: 0; outline: 0; background: var(--bg-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; transition: box-shadow .2s; }
.input:focus { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 70%, transparent), 0 0 0 4px color-mix(in srgb, var(--acc) 16%, transparent); }
.access { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.access button { text-align: left; padding: 12px; border-radius: 14px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 3px; transition: box-shadow .2s, background .2s, transform .14s var(--ease); }
.access button:active { transform: scale(.97); }
.access button b { font-size: 14px; } .access button small { color: var(--muted); font-size: 12px; }
.access button[aria-checked="true"] { background: color-mix(in srgb, var(--acc) 12%, var(--bg-2)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--acc) 70%, transparent); }
.rule-grid { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.rule-grid h3 { margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rule-grid h3:first-child { margin-top: 0; }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rule b { font-size: 13.5px; font-weight: 650; }
.rule small { display: block; color: var(--dim); font-size: 11.5px; font-weight: 500; }
.sheet .actions { display: flex; gap: 8px; justify-content: flex-end; }
.sheet .error { color: var(--bad); font-weight: 600; min-height: 18px; font-size: 13px; }
.sign { display: flex; flex-direction: column; gap: 12px; }
.sign .way { padding: 14px; border-radius: 16px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 8px; }
.sign .way b { font-size: 14px; } .sign .way p { margin: 0; color: var(--muted); font-size: 13px; }
.sign form { display: flex; gap: 8px; }
.sign form .input { flex: 1; min-width: 0; }

/* ---------- lobby ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 6px; border-radius: 10px; color: var(--muted); font-weight: 650; margin-bottom: 10px; transition: color .2s, background .2s; }
.back:hover { color: var(--text); background: var(--card-2); }
.back svg { width: 18px; height: 18px; }
.lobby-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.lobby-head h1 { margin: 0; font: 30px/1.1 var(--num); font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
.lobby-head .edit { color: var(--muted); }
.name-input { font: 26px var(--num); height: 48px; max-width: 520px; flex: 1; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.panel { border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); padding: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; align-items: center; }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px; border-radius: 18px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); min-height: 148px; transition: box-shadow .3s, background .3s; }
.seat .av { width: 58px; height: 58px; font-size: 22px; box-shadow: 0 8px 20px -8px var(--c); }
.seat b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.seat .tag { font-size: 12px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.seat .tag.ready { color: color-mix(in srgb, var(--go) 52%, var(--text)); }
.seat.ready { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--go) 55%, transparent); background: color-mix(in srgb, var(--go) 6%, var(--bg-2)); }
.seat.me::after { content: 'вы'; position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--muted); }
.seat .crown { position: absolute; top: 8px; left: 10px; font-size: 14px; }
.seat.empty { justify-content: center; color: var(--dim); box-shadow: inset 0 0 0 1.5px var(--line-2); background: transparent; border: 0; }
.seat.empty .av { width: 58px; height: 58px; box-shadow: inset 0 0 0 2px var(--line-2); }
.seat.empty button { color: var(--muted); font-weight: 650; font-size: 13px; padding: 4px 10px; border-radius: 9px; transition: color .2s, background .2s; }
.seat.empty button:hover { color: var(--text); background: var(--card-2); }
.seat.enter { animation: card-in .4s var(--spring) both; }
.seat.leave { animation: card-out .24s var(--ease) both; }
.invite { display: flex; flex-direction: column; gap: 8px; }
.invite-row { display: flex; gap: 8px; align-items: center; }
.invite-row code { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: 12px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.invite-row code.code { font: 18px var(--num); letter-spacing: .2em; color: var(--text); flex: none; }
.lobby-side { display: flex; flex-direction: column; gap: 14px; }
.actionbar { position: sticky; bottom: 0; z-index: 10; margin-top: 18px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px;
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.actionbar .why { flex: 1; color: var(--muted); font-weight: 600; font-size: 13px; text-align: right; }
.actionbar .btn.big { min-width: 170px; }
.ready-btn[aria-pressed="true"] { --b: color-mix(in srgb, var(--go) 18%, var(--card-2)); --i: color-mix(in srgb, var(--go) 52%, var(--text)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--go) 60%, transparent); }

/* ---------- toast, curtain, network ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 20px); opacity: 0; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 13px;
  background: var(--text); color: var(--bg); font-weight: 650; box-shadow: 0 16px 40px -14px rgba(31, 42, 68, .45); transition: transform .3s var(--ease), opacity .3s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { background: var(--bad); color: #fff; }
.curtain { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: radial-gradient(circle at 35% 40%, color-mix(in srgb, var(--pink) 45%, #1F2A44), transparent 55%), radial-gradient(circle at 70% 65%, color-mix(in srgb, var(--teal) 35%, #1F2A44), transparent 55%), #1F2A44;
  animation: curtain .32s var(--ease) both; }
@keyframes curtain { from { clip-path: circle(0% at var(--cx, 50%) var(--cy, 50%)); } to { clip-path: circle(150% at var(--cx, 50%) var(--cy, 50%)); } }
.curtain-in { display: grid; justify-items: center; gap: 16px; color: #fff; animation: rise .4s .1s var(--ease) both; }
.curtain-in b { font: 22px var(--num); font-weight: 400; letter-spacing: .02em; }
.curtain-dice { width: 64px; height: 64px; border-radius: 18px; position: relative; background: #fff; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .6); animation: roll 1s var(--ease) infinite; }
.curtain-dice i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--graphite); }
.curtain-dice i:nth-child(1) { left: 12px; top: 12px; } .curtain-dice i:nth-child(2) { right: 12px; top: 12px; } .curtain-dice i:nth-child(3) { left: 27px; top: 27px; }
.curtain-dice i:nth-child(4) { left: 12px; bottom: 12px; } .curtain-dice i:nth-child(5) { right: 12px; bottom: 12px; }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.9); } 100% { transform: rotate(360deg) scale(1); } }
.net { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 8px 14px; border-radius: 11px; background: var(--warn); color: #1b1404; font-weight: 700; font-size: 13px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); animation: rise .3s var(--ease) both; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .lobby-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top-in { height: 58px; padding: 0 14px; gap: 10px; }
  .brand-text small, .nav { display: none; }
  .search { order: 5; }
  .top-in { flex-wrap: wrap; height: auto; padding-top: 9px; padding-bottom: 9px; }
  .search { max-width: none; flex-basis: 100%; margin-left: 0; height: 42px; }
  .top-tools { margin-left: auto; }
  .me-chip { max-width: 160px; } .me-chip small { display: none; }
  .hub, .lobby { padding: 16px 14px 96px; }
  .hub-title h1 { font-size: 28px; }
  .hub-head { align-items: center; }
  #create-btn { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 15; height: 54px; padding: 0 20px; border-radius: 18px; box-shadow: 0 14px 30px -10px var(--acc); }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 14px; padding: 0 14px 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters > * { flex: none; }
  .rooms { grid-template-columns: 1fr; gap: 10px; }
  .room { min-height: 0; }
  .sheet { place-items: end stretch; padding: 0; }
  .sheet-card { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  .lobby-head h1 { font-size: 24px; }
  .seat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seat { min-height: 128px; }
  .actionbar { flex-wrap: wrap; }
  .actionbar .why { flex-basis: 100%; order: -1; text-align: left; }
  .actionbar .btn.big { flex: 1; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- sign-in page ---------- */
.login-page { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px;
  background: radial-gradient(900px 600px at 50% -10%, color-mix(in srgb, var(--pink) 38%, transparent), transparent 70%), var(--bg); }
.login { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.login .brand { margin-bottom: 4px; }
.login-card { width: 100%; padding: 26px 22px 20px; border-radius: 28px; background: var(--card); box-shadow: var(--shadow-up), inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; gap: 14px; animation: sheet-in .45s var(--spring) both; }
@supports (corner-shape: squircle) { .login-card { corner-shape: squircle; border-radius: 44px; } }
.login-card h1 { margin: 0; font: 28px var(--num); font-weight: 400; }
.login-sub { margin: 0; color: var(--muted); }
.login-ways { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.login-skel { height: 50px; border-radius: 14px; background: var(--card-2); }
.way-btn { --b: var(--card-2); --i: var(--text); display: flex; align-items: center; justify-content: center; gap: 10px; height: 50px; border-radius: 14px;
  background: var(--b); color: var(--i); font-weight: 700; font-size: 15px; box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .14s var(--ease), filter .2s, box-shadow .2s; animation: rise .35s var(--ease) both; }
.way-btn:nth-child(2) { animation-delay: .05s; } .way-btn:nth-child(3) { animation-delay: .1s; }
.way-btn svg { width: 22px; height: 22px; flex: none; }
.way-btn:hover { filter: brightness(1.07); }
.way-btn:active { transform: scale(.97); }
.way-btn.discord { --b: #5865F2; --i: #fff; box-shadow: 0 10px 24px -12px #5865F2; }
.way-btn.google { --b: #fff; --i: #1f1f1f; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 8px 20px -12px rgba(0, 0, 0, .5); }
.way-btn.telegram { --b: #27A6E5; --i: #fff; box-shadow: 0 10px 24px -12px #27A6E5; }
.way-btn.busy { pointer-events: none; filter: saturate(.7) brightness(.95); }
.way-btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .6s linear infinite; }
.login-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); font-weight: 600; font-size: 13px; }
.login-note { margin: 2px 0 0; color: var(--dim); font-size: 12px; line-height: 1.45; }
.dev-login { display: flex; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.dev-login .input { flex: 1; min-width: 0; height: 42px; }

/* profile menu */
.me { position: relative; }
.me-chip { cursor: pointer; transition: background .2s, transform .14s var(--ease); }
.me-chip:hover { background: var(--card-2); }
.me-chip:active { transform: scale(.97); }
.me-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; border-radius: 14px; background: var(--card); z-index: 30;
  box-shadow: var(--shadow-up), inset 0 0 0 1px var(--line-2); animation: sheet-in .25s var(--spring) both; }
.me-menu .who { padding: 8px 10px 10px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.me-menu .who b { display: block; color: var(--text); font-size: 14px; }
.me-menu button { width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; font-weight: 600; color: var(--text); transition: background .2s; }
.me-menu button:hover { background: var(--card-2); }

/* ---------- documents (privacy) and the footer ---------- */
.doc-page { min-height: 100dvh; padding: 28px 16px 48px; background: var(--bg); }
.doc { width: min(760px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.doc-card { padding: 28px 26px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); line-height: 1.6; }
.doc-card h1 { margin: 0; font: 28px var(--num); font-weight: 400; }
.doc-card h2 { margin: 24px 0 6px; font-size: 16px; }
.doc-card p, .doc-card li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.doc-card ul { padding-left: 20px; margin: 6px 0; }
.doc-card li { margin: 4px 0; }
.doc-date { margin: 6px 0 14px; color: var(--muted); font-size: 13px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 8px 20px 28px; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--dim); font-size: 12.5px; }
.foot a { color: var(--muted); transition: color .2s; }
.foot a:hover { color: var(--text); }
@media (max-width: 760px) { .foot { padding-bottom: 96px; } }

.lead { margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 560px; }
@media (max-width: 760px) { .lead { font-size: 13px; } }
