/* G13 private rooms (rm-) and the family sign-in sheet (fs-). Graphics first: glass panels over the arena's key art, team
   colours on every seat, icons instead of words, short entrance motion only. Phones landscape (the rotate screen covers
   portrait phones); tablets in both orientations. */
.rm { z-index: 5; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; overflow: hidden; overflow: clip; /* clip: the scaled art must never make the screen scrollable */
  padding: calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 0%, #17263f 0%, #070b13 65%); }
.rm.busy { cursor: progress; } .rm.busy button { pointer-events: none; }
.rm-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .22; filter: blur(12px) saturate(1.3); transform: scale(1.08); pointer-events: none; }
.rm::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(7,11,19,.15), rgba(7,11,19,.85) 75%); }
.rm > * { position: relative; z-index: 1; }
.rm > .rm-bg { position: absolute; z-index: 0; } .rm > .rm-toast { position: absolute; z-index: 3; }

.rm-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rm-back svg { width: 100%; height: 100%; }
.rm-title { display: flex; align-items: center; gap: .3em; font-weight: 900; font-style: italic; letter-spacing: .14em; font-size: 22px; }
.rm-title span:first-child { color: var(--t0); } .rm-title span:last-child { color: var(--t1); }
.rm-title .logo-line { display: inline-block; width: 1.2em; height: .16em; }
.rm-code { display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 4px 10px 4px 12px; border-radius: 16px; border: 1px solid rgba(255,179,71,.45);
  background: linear-gradient(160deg, rgba(40,30,12,.9), rgba(12,12,18,.92)); box-shadow: 0 0 22px rgba(255,179,71,.18); }
.rm-code b { display: grid; place-items: center; width: 30px; height: 40px; border-radius: 8px; background: rgba(0,0,0,.45); color: var(--gold); font: 900 24px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.rm-link { width: 30px; height: 30px; color: var(--gold); margin-left: 4px; }

.rm-main { display: grid; place-items: center; min-height: 0; }
.rm-card { background: linear-gradient(155deg, rgba(26,38,60,.92), rgba(9,14,24,.94)); border: 1px solid rgba(140,200,255,.16); border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06); padding: 18px; animation: rm-in .28s ease-out both; }
@keyframes rm-in { from { opacity: 0; transform: translateY(10px); } }
.rm-main:has(.rm-create) { grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 16px; align-content: center; }
.rm-create, .rm-join { display: grid; justify-items: center; gap: 14px; align-content: center; min-height: 0; }
.rm-join { animation-delay: .06s; }
.rm-formats { display: flex; gap: 10px; }
.rm-format { display: grid; grid-auto-flow: column; align-items: center; gap: 6px; min-height: 64px; padding: 8px 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(8,13,23,.75); }
.rm-format.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(255,179,71,.25); }
.rm-format em { font-style: normal; font-weight: 900; font-size: 18px; color: var(--ink); }
.rm-figs { display: flex; } .rm-figs i { width: 22px; height: 30px; display: block; } .rm-figs i + i { margin-left: -6px; }
.rm-figs.s0 { color: var(--t0); } .rm-figs.s1 { color: var(--t1); }
.rm-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-width: 0; }
.rm-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; max-width: 100%; padding: 3px 12px 3px 4px; border-radius: 999px; background: rgba(8,13,23,.8); border: 1px solid var(--line); font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-chip > span { overflow: hidden; text-overflow: ellipsis; }
.rm-chip img, .rm-chip svg { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; color: var(--gold); }
.rm-chip svg { padding: 3px; }
.rm-big, .rm-ready { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; min-width: 170px; padding: 0 26px; border-radius: 999px; font-weight: 900; font-size: 19px; letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid rgba(255,179,71,.6); background: linear-gradient(180deg, #ffbf5c, #e8902a); color: #1b1206; box-shadow: 0 8px 22px rgba(232,144,42,.35); }
.rm-big svg, .rm-ready svg { width: 26px; height: 26px; flex: none; }
.rm-bigav { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2a3c5c, #0d1524); border: 1px solid var(--line); color: var(--gold); padding: 14px; }
.rm-codein, .rm-name input { width: 100%; max-width: 240px; min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--gold); text-align: center;
  font: 900 30px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .3em; text-transform: uppercase; }
.rm-codein::placeholder { color: rgba(255,179,71,.3); }
.rm-name { display: flex; align-items: center; gap: 12px; }
.rm-name input { font: 800 22px/1 system-ui, sans-serif; letter-spacing: .02em; text-transform: none; color: var(--ink); padding: 0 14px; }
.rm-go { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 0; padding: 14px; background: linear-gradient(180deg, #ffbf5c, #e8902a); color: #1b1206; }

/* lobby */
.rm-lobby { width: min(980px, 100%); height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; min-height: 0; }
.rm-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; align-content: center; gap: 12px; min-height: 0; }
.rm-vs { font-weight: 900; font-style: italic; font-size: 26px; color: var(--dim); letter-spacing: .08em; }
.rm-team { position: relative; display: grid; gap: 10px; padding: 26px 12px 12px; border-radius: 20px; background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 14%, rgba(12,18,30,.9)), rgba(8,12,20,.92)); border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); min-height: 0; animation: rm-in .28s ease-out both; }
.rm-team.s0 { --tc: var(--t0); } .rm-team.s1 { --tc: var(--t1); animation-delay: .05s; }
.rm-shape { position: absolute; top: 5px; left: 50%; width: 18px; height: 18px; margin-left: -9px; background: var(--tc); box-shadow: 0 0 12px var(--tc); }
.rm-shape.s0 { border-radius: 50%; } .rm-shape.s1 { clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); }
.rm-seat { --tc: var(--t0); display: flex; align-items: center; gap: 10px; min-height: 84px; padding: 8px 10px; border-radius: 16px; background: rgba(6,10,18,.7); border: 1px solid rgba(140,200,255,.14); min-width: 0; }
.rm-seat.s1 { --tc: var(--t1); }
.rm-seat.you { border-color: var(--tc); box-shadow: 0 0 0 1px var(--tc), 0 0 18px color-mix(in srgb, var(--tc) 30%, transparent); }
.rm-seat.ready .rm-av { box-shadow: 0 0 0 3px #59e68f; }
.rm-seat.away { opacity: .62; }
.rm-seat.open { justify-content: center; gap: 12px; border-style: dashed; background: rgba(6,10,18,.4); }
.rm-av { position: relative; display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; font-weight: 900; font-size: 22px; color: #071019;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tc) 70%, #fff), var(--tc)); }
.rm-av.bot { background: radial-gradient(circle at 35% 30%, #3a4a62, #1a2333); color: var(--tc); padding: 10px; }
.rm-zz { position: absolute; right: 0; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: #1d2638; color: #ffd36b; padding: 3px; display: block; }
.rm-who { display: grid; min-width: 0; flex: 1; line-height: 1.15; }
.rm-who b { font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-who small { width: 18px; height: 18px; color: var(--dim); display: block; }
.rm-marks { display: flex; gap: 4px; flex: none; }
.rm-marks i { width: 24px; height: 24px; display: block; }
.rm-crown { color: var(--gold); } .rm-ok { color: #59e68f; }
.rm-x, .rm-sit, .rm-lv { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: rgba(8,13,23,.85); padding: 9px; color: var(--ink); }
.rm-sit { width: 52px; height: 52px; border-radius: 50%; color: var(--tc); border-color: color-mix(in srgb, var(--tc) 50%, transparent); }
.rm-levels { display: flex; gap: 6px; }
.rm-lv { color: var(--gold); }
.rm-lv:nth-child(2) { color: #8fd6ff; } .rm-lv:nth-child(3) { color: #ff8a6b; }
.rm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.rm-foot .rm-chips { justify-content: flex-start; flex-wrap: nowrap; min-width: 0; }
.rm-ready { background: rgba(10,16,28,.9); color: var(--gold); box-shadow: none; }
.rm-ready.on { background: linear-gradient(180deg, #6ff0a4, #2fbf6e); color: #062012; border-color: #59e68f; box-shadow: 0 8px 22px rgba(47,191,110,.35); }
.rm-wait { width: 44px; height: 44px; color: var(--gold); }
.rm-toast { position: absolute; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; max-width: 90vw; padding: 8px 14px; border-radius: 10px; background: #1c2a3a; border: 1px solid var(--ok); color: #d9f1ff; text-align: center; }

/* in-match strip: only when a seat needs a hand */
.rm-strip { position: absolute; left: calc(8px + env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); display: grid; gap: 8px; z-index: 4; }
.rm-alert { --tc: var(--t0); display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(8,13,23,.9); border: 1px solid color-mix(in srgb, var(--tc) 50%, transparent); box-shadow: 0 0 16px rgba(0,0,0,.5); animation: rm-in .25s ease-out both; }
.rm-alert.s1 { --tc: var(--t1); }
.rm-alert .rm-av { width: 40px; height: 40px; font-size: 18px; }
.rm-take { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid rgba(255,179,71,.6); background: linear-gradient(180deg, #ffbf5c, #e8902a); color: #1b1206; font-weight: 900; white-space: nowrap; }
.rm-take svg { width: 22px; height: 22px; flex: none; }

/* menu tile: on short landscape screens five tiles share one row, so the room tile adds no second row */
.tile-room .tile-icon { color: var(--t0); }
.menu-grid { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
@media (max-height: 500px) { .menu-grid { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); } }

@media (max-height: 500px) {
  .rm { gap: 6px; padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .rm-code { min-height: 46px; } .rm-code b { width: 26px; height: 34px; font-size: 20px; }
  .rm-card { padding: 12px; } .rm-create, .rm-join { gap: 8px; }
  .rm-bigav { width: 48px; height: 48px; padding: 10px; }
  .rm-big, .rm-ready { min-height: 48px; font-size: 16px; min-width: 140px; padding: 0 18px; }
  .rm-codein { min-height: 48px; font-size: 24px; }
  .rm-format { min-height: 52px; padding: 4px 10px; }
  .rm-team { gap: 6px; padding: 20px 8px 8px; } .rm-shape { top: 3px; width: 14px; height: 14px; margin-left: -7px; }
  .rm-seat { min-height: 52px; padding: 4px 8px; gap: 8px; }
  .rm-av { width: 40px; height: 40px; font-size: 18px; }
  .rm-who b { font-size: 15px; }
  .rm-vs { font-size: 18px; }
  .rm-foot .rm-chips .rm-chip:nth-child(2) > span { display: none; }
}
@media (max-height: 400px) { .rm-bigav { display: none; } .rm-lobby.f2v2 .rm-seat { min-height: 48px; padding: 2px 8px; } .rm-lobby.f2v2 .rm-av { width: 34px; height: 34px; font-size: 15px; } }
@media (max-width: 720px) { .rm-main:has(.rm-create) { gap: 10px; } .rm-levels { gap: 4px; } .rm-formats { gap: 6px; max-width: 100%; } .rm-format { min-width: 0; padding: 4px 6px; gap: 4px; } .rm-format em { font-size: 16px; } .rm-format .rm-figs i { width: 14px; } }
@media (orientation: portrait) and (min-width: 600px) {
  .rm-main:has(.rm-create) { grid-template-columns: minmax(0, 420px); }
  .rm-teams { grid-template-columns: minmax(0, 1fr); } .rm-vs { justify-self: center; }
}

/* family sign-in sheet (hosted only) */
.fs { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 20%, #16233a 0%, #070b13 70%); overflow: auto; }
.fs-bg { position: absolute; inset: 0; background: url(/arenas/stadium.jpg) center / cover; opacity: .18; filter: blur(10px); }
.fs-card { position: relative; width: min(380px, 100%); display: grid; justify-items: center; gap: 10px; padding: 20px 22px; border-radius: 22px; background: linear-gradient(155deg, rgba(26,38,60,.94), rgba(9,14,24,.96)); border: 1px solid rgba(140,200,255,.18); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.fs-logo { font-size: 34px; }
.fs-crest { width: 56px; height: 56px; color: var(--gold); }
.fs-title { font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
.fs-field { width: 100%; display: grid; gap: 4px; color: var(--dim); font-size: 13px; }
.fs-field input { min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.4); color: var(--ink); font: 600 17px system-ui, sans-serif; padding: 0 12px; }
.fs-msg { min-height: 1.2em; margin: 0; color: #ffb4a8; font-size: 14px; text-align: center; }
.fs-go { width: 100%; min-height: 50px; border-radius: 999px; border: 0; font-weight: 900; font-size: 17px; text-transform: uppercase; letter-spacing: .05em; background: linear-gradient(180deg, #ffbf5c, #e8902a); color: #1b1206; }
.fs-lib { color: var(--t0); font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
@media (max-height: 500px) { .fs-crest, .fs-title { display: none; } .fs-card { gap: 6px; padding: 12px 18px; } .fs-logo { font-size: 26px; } .fs-field input { min-height: 44px; } }
.fs-chip { gap: 8px; }
.fs-av { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--t0); color: #071019; font-weight: 900; font-size: 14px; flex: none; }
.fs-out { width: 20px; height: 20px; flex: none; }
.fs-chip.armed { border-color: var(--bad); color: #ffd9d4; }

/* bl-rules-9 four-way room: four seats in a 2 x 2 grid, each in its side colour and shape (diamond, triangle for sides 2 and 3) */
.rm-figs.s2 { color: var(--t2); } .rm-figs.s3 { color: var(--t3); }
.rm-team.s2 { --tc: var(--t2); animation-delay: .1s; } .rm-team.s3 { --tc: var(--t3); animation-delay: .15s; }
.rm-shape.s2 { transform: rotate(45deg) scale(.8); border-radius: 2px; } .rm-shape.s3 { clip-path: polygon(50% 6%, 96% 92%, 4% 92%); }
.rm-seat.s2 { --tc: var(--t2); } .rm-seat.s3 { --tc: var(--t3); }
.rm-alert.s2 { --tc: var(--t2); } .rm-alert.s3 { --tc: var(--t3); }
.rm-lobby.ffour .rm-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rm-lobby.ffour .rm-vs { display: none; }
.rm-format[data-format="four"] .rm-figs i { width: 16px; }
@media (max-height: 400px) { .rm-lobby.ffour .rm-seat { min-height: 44px; padding: 2px 8px; } .rm-lobby.ffour .rm-av { width: 32px; height: 32px; font-size: 14px; } .rm-lobby.ffour .rm-team { padding: 16px 8px 6px; } }
