/* Quintet. AndrewNet chrome (Styling Guide) around the club. Milestone 2: plain lobby styling. */
:root {
  --bg: #0d1020;
  --bg2: #151a33;
  --surface: rgba(255, 255, 255, .05);
  --surface-hi: rgba(255, 255, 255, .09);
  --text: #f2f3fa;
  --muted: #9aa0bf;
  --accent: #8fb0ff;
  --border: rgba(255, 255, 255, .10);
  --glow: rgba(110, 120, 255, .45);
  --brass: #e8b84a;
  --plum: #2a1438;
  --walnut: #2b1a14;
  --cream: #f4ead2;
  --teal: #37d6c0;
  --coral: #ff5a5f;
  --ruby: #e5484d;
  --sapphire: #4c8dff;
  --emerald: #2fbf71;
  --k: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(47, 111, 228, .35), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(123, 63, 228, .30), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }

.back {
  position: fixed; top: 10px; left: 12px; z-index: 20;
  font-size: .85rem; text-decoration: none; color: var(--muted);
  padding: 6px 10px; border-radius: 999px; background: rgba(13, 16, 32, .6);
}
.back:hover, .back:focus-visible { color: var(--text); }

#app { max-width: 720px; margin: 0 auto; padding: 52px 16px 32px; }

h1, h2, h3 { margin: 0 0 .4em; letter-spacing: -.02em; }
.title { font-size: clamp(2.2rem, 9vw, 3.4rem); font-weight: 800; text-align: center; margin-top: 8px; }
.title span { color: var(--brass); }
.tag { text-align: center; color: var(--muted); margin: 0 0 24px; }
.label { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px; margin: 12px 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; font-weight: 600; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { background: var(--surface-hi); border-color: rgba(143, 176, 255, .45); }
.btn.primary { background: linear-gradient(135deg, #8fd8ff, #a98bff); color: #0d1020; border: 0; }
.btn.big { width: 100%; min-height: 56px; font-size: 1.1rem; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.on { border-color: var(--brass); color: var(--brass); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn:focus-visible { background: var(--surface-hi); }

.menu { display: grid; gap: 12px; max-width: 420px; margin: 0 auto; }

input.text {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border); font-size: 1.1rem;
}
input.code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-size: 1.6rem; font-weight: 800; }

/* Lobby */
.roombar { display: flex; align-items: center; gap: 12px; }
.roomcode { font-size: 1.8rem; font-weight: 800; letter-spacing: .2em; color: var(--brass); }
.qr { background: #fff; border-radius: 12px; padding: 6px; width: 140px; height: 140px; }
.qr img { width: 100%; height: 100%; display: block; }

.instruments { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.inst {
  min-height: 48px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  font-size: .82rem; cursor: pointer; padding: 4px;
}
.inst.mine { border-color: var(--brass); color: var(--brass); background: rgba(232, 184, 74, .12); }
.inst:disabled { opacity: .35; cursor: not-allowed; }

.sides { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 10px; }
.side { border-radius: 18px; padding: 12px; background: rgba(0, 0, 0, .2); border: 2px solid var(--sc, var(--border)); min-width: 0; }
.side h3 { color: var(--sc); font-size: 1.05rem; display: flex; justify-content: space-between; }
.side.s0 { --sc: var(--ruby); }
.side.s1 { --sc: var(--sapphire); }
.side.s2 { --sc: var(--emerald); }
.member { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); min-height: 44px; }
.member:last-of-type { border-bottom: 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--dc, var(--muted)); }
.member .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .sub { color: var(--muted); font-size: .78rem; display: block; }
.member.off { opacity: .5; }
.badge { font-size: .7rem; padding: 2px 7px; border-radius: 999px; background: var(--surface-hi); color: var(--muted); white-space: nowrap; }
.badge.host { color: var(--brass); }
.x { min-width: 44px; min-height: 44px; border-radius: 50%; background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.side .btn { width: 100%; margin-top: 8px; }

.blocker { color: var(--coral); text-align: center; margin: 8px 0; min-height: 1.4em; }

select.sel { min-height: 44px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--border); padding: 6px 10px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #1d2240; border: 1px solid var(--border); padding: 10px 16px; border-radius: 14px; z-index: 50;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.status { position: fixed; top: 10px; right: 12px; font-size: .8rem; color: var(--coral); z-index: 20; }

/* ---------- TV: a 1920x1080 stage scaled to the screen ---------- */
html.tv body { overflow: hidden; }
html.tv #app { max-width: none; padding: 0; }
html.tv .back { font-size: 26px; top: 20px; left: 30px; }
.stage {
  position: fixed; left: 50%; top: 50%; width: 1920px; height: 1080px;
  transform: translate(-50%, -50%) scale(var(--k)); transform-origin: center;
  padding: 54px 96px; display: flex; flex-direction: column; gap: 28px;
  font-size: 32px;
}
.stage .title { font-size: 96px; margin: 0; }
.tv-lobby { display: grid; grid-template-columns: 520px 1fr; gap: 56px; flex: 1; min-height: 0; }
.tv-join { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.tv-join .qr { width: 380px; height: 380px; padding: 14px; border-radius: 24px; }
.tv-join .roomcode { font-size: 110px; line-height: 1; }
.tv-join .url { font-size: 30px; color: var(--muted); }
.stage .sides { gap: 28px; align-content: start; }
.stage .side { padding: 24px; border-width: 3px; border-radius: 26px; }
.stage .side h3 { font-size: 44px; }
.stage .member { font-size: 34px; min-height: 64px; gap: 16px; }
.stage .member .sub { font-size: 24px; }
.stage .dot { width: 28px; height: 28px; }
.stage .badge { font-size: 22px; padding: 4px 12px; }
.stage .btn { font-size: 34px; min-height: 76px; padding: 12px 36px; }
.stage :focus-visible, .stage .btn:focus { outline: 6px solid var(--brass); outline-offset: 6px; }
.tv-foot { display: flex; gap: 24px; align-items: center; justify-content: flex-end; }
.tv-foot .info { flex: 1; color: var(--muted); font-size: 30px; }
.tv-msg { margin: auto; text-align: center; font-size: 48px; }

/* Placeholder game screen (milestone 3 replaces it) */
.hand { display: flex; flex-wrap: wrap; gap: 8px; }
.pcard { min-width: 52px; min-height: 64px; display: grid; place-items: center; border-radius: 10px; background: var(--cream); color: #1b1622; font-weight: 800; font-size: 1.1rem; }
.pcard.r { color: #d7263d; }

/* Fixes after the first browser check (29-Nov-2026) */
.btn.primary:focus-visible, .btn.primary:hover { background: linear-gradient(135deg, #a6e1ff, #bba3ff); }
.stage .side h3 .small { font-size: 30px; }
@media (max-width: 560px) {
  #app .sides { grid-template-columns: 1fr; }
}
.side .btn + .btn { margin-top: 6px; }
