/* Velvet Row: Gilded Deco. Midnight ink, restrained gold, stepped frames and fan motifs.
   Type: Federo (display) + Jost (interface). Spacing scale 4 / 8 / 12 / 16 / 24 / 32 / 48. Icons: icons.css. */
@font-face { font-family: 'Federo'; src: url('/fonts/federo.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-var-ext.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --display: 'Federo', Georgia, serif;
  --ui: 'Jost', 'Futura', 'Trebuchet MS', sans-serif;
  --ink: #0A0C11;
  --panel: #12151D;
  --raised: #1A1F2B;
  --side: #0D1017;
  --gold: #C9A55A;
  --gold2: #E9D18F;
  --cream: #F3EBDD;
  --muted: #A7A193;
  --line: rgba(201,165,90,.42);
  --hair: rgba(201,165,90,.17);
  --fam: #E07A68;
  --lon: #B79AE6;
  --hus: #7FC9A0;
  --red: #E07A68;
  --green: #7FC9A0;
  --blue: #8FB0E8;
  --pink: #F2A6C8;
  --dark-text: #17120A;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--cream); font-family: var(--ui); overflow: hidden; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
b, strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: #3a3324; border-radius: 4px; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- type helpers ---------- */
.lbl { font: 600 11px/1.2 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted) !important; }
.dias { display: inline-flex; align-items: center; gap: 10px; }
.t-cit { color: var(--gold2); } .t-fam { color: var(--fam); } .t-lon { color: var(--lon); } .t-hus { color: var(--hus); }

/* ---------- frames ---------- */
/* .panel: hairline inner frame and gold corner brackets */
.panel { position: relative; background: rgba(15,18,25,.96); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.panel::before { content: ''; position: absolute; inset: 4px; border: 1px solid var(--hair); pointer-events: none; }
.panel::after { content: ''; position: absolute; inset: -1px; pointer-events: none; background:
  linear-gradient(var(--gold2), var(--gold2)) 0 0 / 16px 2px, linear-gradient(var(--gold2), var(--gold2)) 0 0 / 2px 16px,
  linear-gradient(var(--gold2), var(--gold2)) 100% 0 / 16px 2px, linear-gradient(var(--gold2), var(--gold2)) 100% 0 / 2px 16px,
  linear-gradient(var(--gold2), var(--gold2)) 0 100% / 16px 2px, linear-gradient(var(--gold2), var(--gold2)) 0 100% / 2px 16px,
  linear-gradient(var(--gold2), var(--gold2)) 100% 100% / 16px 2px, linear-gradient(var(--gold2), var(--gold2)) 100% 100% / 2px 16px;
  background-repeat: no-repeat; }
/* .step: a gold frame with stepped (notched) corners; the content sits in .in */
.step { --s: 12px; position: relative; padding: 1px; background: var(--gold);
  clip-path: polygon(0 var(--s), var(--s) var(--s), var(--s) 0, calc(100% - var(--s)) 0, calc(100% - var(--s)) var(--s), 100% var(--s), 100% calc(100% - var(--s)), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s)) 100%, var(--s) 100%, var(--s) calc(100% - var(--s)), 0 calc(100% - var(--s))); }
.step > .in { position: relative; height: 100%; background: linear-gradient(180deg, #161a24, #0d1016); clip-path: inherit; }
/* .fan: an Art Deco sunburst */
.fan { position: absolute; pointer-events: none; aspect-ratio: 2 / 1; background:
  radial-gradient(circle at 50% 100%, transparent 0 30%, rgba(201,165,90,.55) 30% calc(30% + 1px), transparent calc(30% + 1px) 47%, rgba(201,165,90,.35) 47% calc(47% + 1px), transparent calc(47% + 1px)),
  repeating-conic-gradient(from 270deg at 50% 100%, rgba(201,165,90,.42) 0deg 1deg, transparent 1deg 9deg);
  -webkit-mask: radial-gradient(circle at 50% 100%, #000 0 69%, transparent 70%); mask: radial-gradient(circle at 50% 100%, #000 0 69%, transparent 70%); }
.rule { display: flex; align-items: center; gap: 10px; color: var(--gold); }
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.rule::after { background: linear-gradient(90deg, var(--line), transparent); }
.dia { display: inline-block; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); flex: none; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 40px; padding: 0 16px; font: 600 12.5px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--gold2); background: rgba(10,12,17,.6); border: 1px solid var(--gold); border-radius: 0; transition: background .15s, filter .15s, border-color .15s; white-space: nowrap; }
.btn .ic { font-size: 16px; }
.btn:hover:not(:disabled) { background: rgba(201,165,90,.16); }
.btn-primary, .btn.gold { color: var(--dark-text); background: linear-gradient(180deg, #EED595, #C9A55A 58%, #B38F48); border-color: #F4E2AE; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 22px rgba(201,165,90,.2); }
.btn-primary:hover:not(:disabled), .btn.gold:hover:not(:disabled) { background: linear-gradient(180deg, #F6E2AA, #D6B468 58%, #C09A52); }
.btn:disabled { cursor: not-allowed; color: #8A8472; background: #15171d; border-color: #3A3529; box-shadow: none; }
.btn-lg, .btn.big { height: 54px; font-size: 15px; padding: 0 28px; }
.btn-block, .btn.big { width: 100%; }
.btn-sm { height: 36px; font-size: 11.5px; padding: 0 14px; }
.btn-icon { width: 40px; height: 40px; padding: 0; }
.btn.danger { border-color: var(--fam); color: #F2A597; }
.btn.active { background: rgba(201,165,90,.28); color: #fff; }
/* busy: ui.js swaps the label for a spinner and the data-busy text */
.btn.busy { pointer-events: none; }
.btn-primary .spinner, .btn.gold .spinner { border-color: rgba(23,18,10,.22); border-top-color: var(--dark-text); }

/* spinner: a gold ring turning on the compositor, so it keeps going while the page is busy building the town */
.spinner { --sz: 14px; --bw: 2px; display: inline-block; flex: none; width: var(--sz); height: var(--sz); border-radius: 50%; border: var(--bw) solid rgba(201,165,90,.22); border-top-color: var(--gold2); animation: spin .8s linear infinite; vertical-align: -2px; will-change: transform; }
.spinner.big { --sz: 52px; --bw: 2px; animation-duration: 1.1s; box-shadow: 0 0 24px rgba(201,165,90,.12); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.field > span { font: 600 11px/1.2 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.field > span small { font: 400 12px var(--ui); letter-spacing: .02em; text-transform: none; color: var(--muted); margin-left: 6px; }
.input { width: 100%; height: 48px; padding: 0 14px; background: #0B0D13; border: 1px solid #403928; border-radius: 0; color: var(--cream); font: 400 16px var(--ui); outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: #8A8576; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,165,90,.2); }
.input.code { font: 400 22px var(--display); letter-spacing: .5em; text-transform: uppercase; text-align: center; padding-left: calc(14px + .5em); }
.input.code::placeholder { letter-spacing: .5em; }
.input:disabled { opacity: .5; }
.select { height: 36px; padding: 0 28px 0 10px; background: #0B0D13 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A55A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 8px center / 14px no-repeat; border: 1px solid #403928; border-radius: 0; color: var(--cream); font: 500 13px var(--ui); appearance: none; -webkit-appearance: none; }
.select:focus { outline: none; border-color: var(--gold); }
.err { display: flex; align-items: center; gap: 8px; color: #F2A597; font-size: 13px; }

/* ---------- glyphs, tags, seat numbers ---------- */
/* team glyphs: the shape says the team as well as the colour */
.tg { display: inline-block; width: 8px; height: 8px; flex: none; background: var(--gold); border-radius: 50%; }
.tg.fam { background: var(--fam); border-radius: 0; }
.tg.lon { background: var(--lon); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 10px; height: 9px; }
.tg.hus { background: var(--hus); border-radius: 0; transform: rotate(45deg) scale(.85); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; font: 700 9.5px/1 var(--ui); letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; flex: none; }
.tag .ic { font-size: 11px; }
.tag.you { color: var(--dark-text); background: var(--gold2); }
.tag.st { color: var(--gold2); border: 1px solid var(--gold); }
.tag.doom { color: #fff; background: #A8342A; border: 1px solid var(--fam); }
.tag.lv { color: var(--dark-text); background: linear-gradient(180deg, #EED595, #C9A55A); }
.tag.gst { color: var(--muted); border: 1px dashed rgba(167,161,147,.55); }
.tag.ok { color: #0F1A14; background: var(--hus); }
.seat { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #17130B; border: 1px solid var(--gold); color: var(--gold2); font: 600 10.5px/1 var(--ui); flex: none; }

/* ---------- join ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; overflow-y: auto;
  background: radial-gradient(ellipse 60% 70% at 50% 45%, #1a1e2a 0%, #0d0f15 60%, #07080b 100%); }
.rain-bg { position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: repeating-linear-gradient(105deg, transparent 0 18px, rgba(180,200,255,.2) 18px 19px);
  animation: rain .6s linear infinite; }
@keyframes rain { from { background-position: 0 0; } to { background-position: -20px 60px; } }
.join-rails { position: absolute; inset: 0; pointer-events: none; display: flex; justify-content: center; gap: min(660px, 84vw); align-items: center; }
.join-rails i { position: relative; width: 1px; height: min(500px, 60vh); background: linear-gradient(180deg, transparent, rgba(201,165,90,.5), transparent); }
.join-rails i::after { content: ''; position: absolute; left: -3px; top: 50%; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.join-card { --s: 16px; width: min(500px, 94vw); margin: 24px 0; }
.join-card > .in { overflow: hidden; padding: 30px 40px 26px; display: flex; flex-direction: column; gap: 16px; }
.join-form { display: flex; flex-direction: column; gap: 16px; }
.join-card .fan { width: 380px; left: 50%; margin-left: -190px; top: -26px; opacity: .32; }
.join-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.logo { margin: 0; font: 400 54px/1 var(--display); letter-spacing: .14em; color: var(--gold2); text-shadow: 0 2px 18px rgba(201,165,90,.25); }
.tagline { margin: 0; font-size: 16px; font-style: italic; color: var(--cream); }
.join-err { justify-content: center; margin-top: -6px; animation: popIn .2s ease-out; }
.howto { border-top: 1px solid var(--hair); padding-top: 14px; }
.howto summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary .ic { font-size: 15px; }
.howto summary .tog { margin-left: auto; transition: transform .2s; }
.howto[open] summary .tog { transform: rotate(180deg); }
.steps { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; font-size: 13.5px; line-height: 1.45; color: var(--cream); text-align: left; }
.steps .n { display: grid; place-items: center; width: 22px; height: 22px; flex: none; margin-top: 1px; border: 1px solid var(--gold); transform: rotate(45deg); }
.steps .n b { transform: rotate(-45deg); font: 600 11px var(--ui); color: var(--gold2); }
.join-foot { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); pointer-events: none; }

/* wardrobe button on the join card */
.wardrobe-btn { display: flex; align-items: center; gap: 14px; width: 100%; height: 76px; padding: 0 16px 0 10px; background: #141821; border: 1px solid rgba(201,165,90,.35); color: var(--cream); text-align: left; transition: background .15s, border-color .15s; }
.wardrobe-btn:hover { background: var(--raised); border-color: var(--gold); }
.wardrobe-btn .av { position: relative; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none; background: radial-gradient(circle at 50% 38%, #3a3f52, #1a1d27 72%); box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px #141821; }
.wardrobe-btn .av img { width: 100%; height: 100%; display: block; }
.wardrobe-btn .av img:not([src]) { visibility: hidden; }
.wardrobe-btn .av:has(img:not([src]))::after { content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -12px 0 0 -12px; border-radius: 50%; border: 2px solid rgba(201,165,90,.2); border-top-color: var(--gold2); animation: spin .9s linear infinite; }
.wardrobe-btn.noav .av::after { display: none; }
.wardrobe-btn .tx { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.wardrobe-btn b { font: 600 15px var(--ui); letter-spacing: .04em; color: var(--cream); }
.wardrobe-btn small { color: var(--muted); font-size: 13px; }
.wardrobe-btn .go { color: var(--gold); font-size: 20px; }

/* account on the join card: sign-in buttons, or who is signed in */
.acct { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--hair); }
/* Sign in with Google: Google's dark button (fill #131314, stroke #8E918F, the four-colour G, Roboto Medium) */
.gsi { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 42px; padding: 0 12px; background: #131314; border: 1px solid #8E918F; border-radius: 4px; color: #E3E3E3; font: 500 14px/20px Roboto, 'Segoe UI', Arial, sans-serif; letter-spacing: .25px; transition: background .15s; }
.gsi:hover { background: #262728; }
.gsi:active { background: #303132; }
.gsi svg { width: 20px; height: 20px; flex: none; }
.acct-dev { border-style: dashed; }
.acct-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-align: center; }
.acct-note a { color: var(--gold2); }
.acct-in { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; background: #141821; border: 1px solid rgba(201,165,90,.35); }
.acct-in .pic { position: relative; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none; background: var(--raised); box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px #141821; }
.acct-in .pic::before { content: attr(data-i); position: absolute; inset: 0; display: grid; place-items: center; font: 400 19px/1 var(--display); color: var(--gold2); text-transform: uppercase; }
.acct-in .pic img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
.acct-in .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.acct-in .tx .lbl { font-size: 9.5px; }
.acct-in .tx b { font: 600 15px var(--ui); color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-in .tx small { font-size: 12.5px; color: var(--muted); }
.acct-in .pic { width: 48px; height: 48px; }
.acct-in .tx b { font: 400 21px/1.1 var(--display); letter-spacing: .04em; color: var(--gold2); }
/* level and XP (member card, game over) */
.lvl, .go-xp { display: flex; align-items: center; gap: 8px; }
.lvl .lv, .go-xp .lv { font: 600 10.5px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--gold2); white-space: nowrap; }
.xpbar { position: relative; width: 96px; height: 4px; flex: none; background: rgba(201,165,90,.18); }
.xpbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); box-shadow: 0 0 6px rgba(233,209,143,.45); }
.lvl .xp, .go-xp .xp { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.acct-links { display: flex; align-items: center; justify-content: center; gap: 12px; }
.acct-links .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: .6; }
.acct-link { background: none; border: none; padding: 2px 4px; font: 500 12.5px var(--ui); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(167,161,147,.4); }
.acct-link:hover { color: var(--cream); }
.acct-link.del:hover { color: #F2A597; }
.acct-link.del.armed { color: #fff; background: #A8342A; text-decoration: none; padding: 5px 10px; }
/* the first sign-in: choose a username */
.uname { display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: center; }
.uname .lbl { align-self: center; }
.uname h2 { margin: 0; font: 400 28px/1.1 var(--display); letter-spacing: .06em; color: var(--gold2); }
.uname p { margin: -4px 0 4px; font-size: 14px; color: var(--muted); }
.uname .input { text-align: center; font-size: 19px; letter-spacing: .02em; }
.uname-st { min-height: 18px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); }
.uname-st .ic { font-size: 14px; }
.uname-st.ok { color: var(--hus); }
.uname-st.bad { color: #F2A597; }
/* guests: the wardrobe is locked */
.wardrobe-btn .av .lk { display: none; }
.wardrobe-btn.locked .av img { display: none; }
.wardrobe-btn.locked .av::after { display: none; }
.wardrobe-btn.locked .av .lk { display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 22px; color: var(--gold); }
.wardrobe-btn.locked small { color: var(--gold2); }

/* ---------- layout ---------- */
#game { position: fixed; inset: 0; display: flex; }
#stage { position: relative; flex: 1; min-width: 0; overflow: hidden; }
#town { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#side { width: 344px; display: flex; flex-direction: column; background: var(--side); border-left: 1px solid var(--line); }

/* ---------- top bar: room, phase plaque with the timer dial, sound ---------- */
#topbar { position: absolute; z-index: 8; top: 16px; left: 16px; right: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; background: rgba(10,12,17,.88); border: 1px solid var(--line); color: var(--cream); font: 500 13px var(--ui); white-space: nowrap; }
.pill b { font: 400 16px var(--display); letter-spacing: .26em; color: var(--gold2); }
.pill .ic { color: var(--gold); font-size: 16px; }
.pill:hover { border-color: var(--gold); }
.pill.icon { width: 38px; padding: 0; justify-content: center; }
.pill.off .ic { color: var(--muted); }
.plaque { width: 400px; min-height: 84px; }
.plaque > .in { display: flex; align-items: center; gap: 16px; min-height: 82px; padding: 0 18px 0 26px; overflow: hidden; }
.plaque.no-timer > .in { justify-content: center; text-align: center; padding: 0 24px; }
.ph-text { min-width: 0; flex: 1; }
.plaque.no-timer .ph-text { flex: none; max-width: 100%; }
.plaque.no-timer .dial { display: none; }
#phaseTitle { font: 400 34px/1 var(--display); letter-spacing: .08em; color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#phaseSub { font: 400 14.5px/1.3 var(--ui); color: var(--cream); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dial { position: relative; width: 60px; height: 60px; flex: none; }
.dial svg { position: absolute; inset: 0; width: 60px; height: 60px; transform: rotate(-90deg); }
.dial circle { fill: none; stroke-width: 3; }
.dial .track { stroke: rgba(201,165,90,.2); }
.dial .bar { stroke: var(--gold2); stroke-dasharray: 163.4; transition: stroke .3s; }
#timerText { position: absolute; inset: 0; display: grid; place-items: center; font: 400 22px/1 var(--display); color: var(--gold2); }
.dial.low #timerText { color: #F2A597; }

/* ---------- role strip: every role in this game, by team ---------- */
#roleStrip { position: absolute; z-index: 6; top: 116px; left: 16px; right: 16px; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 10px 18px; pointer-events: none; }
#roleStrip > * { pointer-events: auto; }
.rgroup { display: flex; flex-direction: column; gap: 6px; }
.rgroup .glabel { align-self: flex-start; display: flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px 0 7px; font: 600 10px/1 var(--ui); letter-spacing: .18em; text-transform: uppercase; background: rgba(10,12,17,.82); border-bottom: 1px solid currentColor; }
.rgroup .rchips { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 8px; font: 500 12.5px/1 var(--ui); color: var(--cream); background: rgba(15,18,25,.9); border: 1px solid rgba(201,165,90,.3); white-space: nowrap; transition: border-color .15s, background .15s; }
.rchip .ic { font-size: 15px; color: var(--gold2); }
.rchip:hover { border-color: var(--gold); background: rgba(28,30,34,.95); }
.rchip.mine { border-color: var(--gold2); box-shadow: inset 0 0 0 1px var(--gold2), 0 0 16px rgba(233,209,143,.22); }
.rchip.mine::after { content: ''; position: absolute; top: -4px; right: -4px; width: 8px; height: 8px; background: var(--gold2); transform: rotate(45deg); }
.rchip.dead { color: #928C80; border-color: rgba(255,255,255,.1); }
.rchip.dead .ic { color: #6F6A5F; }
.rchip.dead .nm { text-decoration: line-through; text-decoration-color: var(--fam); text-decoration-thickness: 1.5px; }
.rchip .x { display: none; }
.rchip.open { background: rgba(201,165,90,.2); border-color: var(--gold2); }

#rolePop { position: absolute; z-index: 30; width: 300px; padding: 16px 18px 14px; animation: popIn .16s ease-out; }
/* Overlays that sit on top of other panels are solid, so nothing shows through them. */
#rolePop.panel, #gameOver.panel, #tally.panel, #lobbyPanel.panel { background: #10131A; }
#rolePop .ph { display: flex; gap: 14px; align-items: center; position: relative; }
#rolePop .pn { font: 400 22px/1.1 var(--display); letter-spacing: .04em; color: var(--gold2); }
#rolePop .pt { display: flex; align-items: center; gap: 6px; font: 600 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; margin-top: 6px; }
#rolePop .pd { font-size: 14px; line-height: 1.5; color: var(--cream); margin: 12px 0 6px; position: relative; }
#rolePop .pg { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
#rolePop .meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
#rolePop .meta span { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); padding: 4px 8px; }
#rolePop .dl { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: #F2A597; }
#rolePop .you { margin-top: 10px; }
#rolePop .close { position: absolute; z-index: 1; top: 10px; right: 10px; background: none; border: none; color: var(--muted); font-size: 16px; padding: 4px; }
#rolePop .close:hover { color: var(--cream); }
/* the diamond frame round a role icon */
.rc-ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; margin: 6px; border: 1px solid var(--gold); transform: rotate(45deg); background: #0D1016; box-shadow: 0 0 0 4px #121620, 0 0 0 5px var(--hair); }
.rc-ic .ic { transform: rotate(-45deg); font-size: 22px; color: var(--gold2); }
.rc-ic .emo { transform: rotate(-45deg); font-size: 22px; }

/* ---------- residents panel ---------- */
#playersPanel { position: absolute; z-index: 5; left: 16px; top: 184px; width: 248px; display: flex; flex-direction: column; max-height: calc(100% - 300px); }
#playersPanel.collapsed { width: 220px; }
.res-h { display: flex; align-items: center; gap: 8px; height: 42px; flex: none; padding: 0 14px; border-bottom: 1px solid var(--hair); cursor: pointer; user-select: none; background: none; border-top: 0; border-left: 0; border-right: 0; color: inherit; width: 100%; text-align: left; }
.res-h > .ic { color: var(--gold); }
.res-h .tog { margin-left: auto; color: var(--gold); transition: transform .2s; }
#playersPanel.collapsed .res-h { border-bottom: 0; }
#playersPanel.collapsed .res-h .tog { transform: rotate(180deg); }
.res-body { overflow-y: auto; min-height: 0; padding: 2px 0; }
.prow { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 14px; border-bottom: 1px solid rgba(255,255,255,.045); font-size: 14px; cursor: pointer; }
.prow:last-child { border-bottom: 0; }
.prow .no { width: 16px; flex: none; text-align: right; font-size: 12px; color: var(--muted); }
.prow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .st { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; }
.prow .st .ic.r { color: var(--gold2); }
.prow:hover { background: rgba(201,165,90,.1); }
.prow.me .nm { color: var(--gold2); font-weight: 600; }
.prow.fam .nm { color: #F2A597; }
.prow.dead { color: #928C80; }
.prow.dead .nm { text-decoration: line-through; text-decoration-color: rgba(224,122,104,.7); }
.prow.valid { box-shadow: inset 2px 0 0 rgba(201,165,90,.55); }
.prow.marked { background: rgba(201,165,90,.16); box-shadow: inset 0 0 0 1px var(--gold2); }
.prow .dot { width: 30px; height: 30px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px var(--ink); }

/* ---------- portraits ---------- */
.av { display: inline-block; flex: none; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #3a3f52, #1a1d27 72%); }
.prow .av { width: 30px; height: 30px; box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px var(--ink); }
.prow.dead .av, .prow.dead .dot { filter: grayscale(1) brightness(.6); }
/* a portrait still being painted: the player's coat colour with a turning ring around it */
.av.wait { position: relative; box-sizing: border-box; background: radial-gradient(circle, var(--c) 0 26%, #232736 30%); }
.av.wait::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--gold2); animation: spin .9s linear infinite; }
.ptw { position: relative; display: inline-block; flex: none; line-height: 0; }
.ptw .seat { position: absolute; right: -6px; bottom: -4px; line-height: 1; }

/* ---------- the tally (voting board) ---------- */
#tally { position: absolute; z-index: 12; right: 16px; top: 184px; width: 320px; max-height: calc(100% - 300px); display: flex; flex-direction: column; animation: popIn .25s ease-out; }
.tv-head { display: flex; align-items: baseline; gap: 10px; padding: 16px 16px 6px; cursor: pointer; user-select: none; }
.tv-ttl { font: 400 20px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold2); }
.tv-count { margin-left: auto; font: 600 11px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tv-tog { color: var(--gold); font-size: 14px; transition: transform .2s; }
#tally.collapsed .tv-tog { transform: rotate(180deg); }
.tv-sum { padding: 0 16px 12px; font-size: 14.5px; line-height: 1.4; color: var(--cream); border-bottom: 1px solid var(--hair); }
.tv-sum b { color: var(--gold2); font-weight: 600; }
.tv-sum.doom { color: #F8CFC7; } .tv-sum.doom b { color: #F2A597; }
.tv-sum.spared { color: #CDEBD9; } .tv-sum.spared b { color: var(--hus); }
#tally.collapsed .tv-sum { border-bottom: none; }
.tv-body { overflow-y: auto; min-height: 0; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.tv-row { display: flex; gap: 12px; padding: 10px; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07); transition: background .15s, border-color .15s, opacity .3s; }
.tv-row.can { cursor: pointer; }
.tv-row.can:hover { background: rgba(201,165,90,.08); border-color: var(--line); }
.tv-row.lead { border-color: rgba(201,165,90,.7); }
.tv-row.mine { background: rgba(201,165,90,.12); border-color: var(--gold2); box-shadow: inset 0 0 0 1px var(--gold2); }
.tv-row.doomed { background: linear-gradient(90deg, #5E1C15, #2A100C); border-color: var(--fam); box-shadow: 0 0 22px rgba(224,122,104,.25); }
.tv-row.spent { opacity: .5; }
.tv-face { position: relative; flex: none; width: 44px; height: 44px; margin-top: 2px; }
.tv-face .av, .tv-face .dot { width: 44px !important; height: 44px !important; border-radius: 50%; display: block; box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px var(--ink); }
.tv-row.doomed .tv-face .av { box-shadow: 0 0 0 1.5px var(--fam), 0 0 0 3px var(--ink); filter: saturate(.8); }
.tv-face .tv-no { position: absolute; right: -6px; bottom: -4px; }
.tv-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px dashed rgba(201,165,90,.5); color: var(--muted); font-size: 20px; }
.tv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.tv-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tv-name { font: 600 15px/1.2 var(--ui); color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tv-tags { display: flex; gap: 5px; margin-top: -3px; }
.tv-n { margin-left: auto; flex: none; font: 400 26px/1 var(--display); color: var(--gold2); padding-left: 6px; }
.tv-row.doomed .tv-n { color: #F2A597; }
.tv-bar { position: relative; height: 6px; background: rgba(255,255,255,.08); }
.tv-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #9C7B3C, #E9D18F); transition: width .35s ease; }
.tv-row.doomed .tv-bar i { background: linear-gradient(90deg, #A8342A, #F2A597); }
.tv-row.skip .tv-bar i { background: linear-gradient(90deg, #4c5468, #8a93a8); }
.tv-voters { display: flex; flex-wrap: wrap; gap: 4px; }
.tv-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 26px; padding: 0 8px 0 2px; border-radius: 13px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); font-size: 12px; color: var(--cream); white-space: nowrap; }
.tv-chip .av, .tv-chip .dot { width: 20px !important; height: 20px !important; border-radius: 50%; flex: none; }
.tv-chip .tv-no { font-weight: 700; color: var(--gold2); }
.tv-chip .nm { overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.tv-chip em { font: normal 700 10px/1 var(--ui); color: var(--dark-text); background: var(--gold2); padding: 2px 4px; border-radius: 3px; }
.tv-chip.me { background: rgba(201,165,90,.18); border-color: var(--gold2); }
.tv-chip.new { animation: tvIn .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes tvIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.tv-none { font-size: 12.5px; color: var(--muted); font-style: italic; }
.tv-empty { padding: 10px 8px; font-size: 13px; color: var(--muted); text-align: center; font-style: italic; }
.tv-pend { padding: 12px 4px 2px; border-top: 1px dashed var(--hair); }
.tv-pl { margin-bottom: 8px; font: 600 10.5px/1.2 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.tv-pend .tv-chip { opacity: .65; }

/* ---------- action bar ---------- */
#actionbar { position: absolute; z-index: 7; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: calc(100% - 32px); }
#actionbar:empty { display: none; }
.ym { display: flex; align-items: center; gap: 10px; height: 24px; padding: 0 12px; font: 600 11px/1 var(--ui); letter-spacing: .22em; text-transform: uppercase; color: var(--gold2); background: rgba(10,12,17,.82); white-space: nowrap; }
.abar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 10px; background: rgba(10,12,17,.9); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.6); }
.abtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 136px; height: 76px; padding: 0 8px; background: var(--raised); border: 1px solid rgba(201,165,90,.32); color: var(--cream); font: 600 13px/1.1 var(--ui); letter-spacing: .06em; transition: border-color .15s, background .15s; }
.abtn .ic { font-size: 22px; color: var(--gold2); }
.abtn .sub { font: 400 11.5px/1.2 var(--ui); letter-spacing: 0; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abtn:hover:not(:disabled):not(.info) { border-color: var(--gold); background: #202637; }
.abtn.on { background: linear-gradient(180deg, #2B2517, #1C1910); border-color: var(--gold2); box-shadow: inset 0 0 0 1px var(--gold2); }
.abtn.on .sub { color: var(--gold2); }
.abtn.picking { border-color: var(--gold2); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(233,209,143,.0); } 50% { box-shadow: 0 0 0 4px rgba(233,209,143,.25); } }
.abtn.kill .ic, .abtn.danger .ic { color: var(--fam); }
.abtn:disabled { cursor: not-allowed; color: #7E796D; background: #14161c; border-color: #2c2a24; }
.abtn:disabled .ic { color: #5f5b52; }
.abtn.info { cursor: default; width: auto; min-width: 200px; padding: 0 18px; }
#hint { position: absolute; z-index: 9; left: 50%; bottom: 150px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: rgba(10,12,17,.92); border: 1px solid var(--gold); font-size: 13.5px; color: var(--cream); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
#hint .ic { color: var(--gold2); }

/* ---------- lobby ---------- */
/* Docked low on the stage so the street (and the houses going up) stays in view above it. */
#lobbyPanel { position: absolute; z-index: 9; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(760px, calc(100% - 32px)); max-height: calc(100% - 132px); display: flex; flex-direction: column; overflow: hidden; }
#lobbyPanel .fan { width: 380px; left: 50%; margin-left: -190px; top: -6px; opacity: .4; }
.lb-head { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px 26px 14px; }
.lb-head h2 { margin: 0; font: 400 30px/1 var(--display); letter-spacing: .1em; color: var(--gold2); }
.lb-head p { margin: 6px 0 0; font-size: 14px; color: var(--cream); }
.lb-head p b { font: 400 16px var(--display); letter-spacing: .24em; color: var(--gold2); }
.lb-head .lb-tog { margin-left: auto; align-self: flex-start; }
.lb-body { position: relative; overflow-y: auto; min-height: 0; padding: 0 26px; }
#lobbyPanel.mini .lb-body, #lobbyPanel.mini .lb-foot { display: none; }
#lobbyPanel.mini .lb-tog .ic { transform: rotate(180deg); }
.lobby-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.lt { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 10px 0 12px; background: #141821; border: 1px solid rgba(255,255,255,.07); }
.lt.new { animation: popIn .25s ease-out; }
.lt .av, .lt .dot { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px #141821; }
.lt .ln { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lt .pn { font-size: 15px; font-weight: 500; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt .tags { display: flex; gap: 5px; }
.lt .tags:empty { display: none; }
.lt .tags .tag { height: 17px; font-size: 9.5px; }
.lt.me { border-color: var(--gold); background: #1B1B19; }
.lt.empty { justify-content: center; gap: 8px; border-style: dashed; border-color: rgba(201,165,90,.3); background: transparent; color: var(--muted); font-size: 13.5px; animation: none; }
.lt .x { width: 30px; height: 30px; }
.lt .x .ic { font-size: 13px; }
.lb-foot { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 14px 26px 22px; }
.lb-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 14px; border-top: 1px solid var(--hair); }
.lb-ctrl .lbl { width: 100%; }
.lb-ctrl .grow { flex: 1; }
.lb-pace { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.lb-pace .ic { color: var(--gold); }
.lb-wait { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px; }

/* ---------- role reveal ---------- */
#roleReveal { position: absolute; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 45%, rgba(10,12,17,.5), rgba(10,12,17,.9)); perspective: 1400px; }
.card3d { position: relative; width: 340px; height: 528px; max-height: 86vh; transform-style: preserve-3d; animation: flip 1.4s .3s cubic-bezier(.3,1.4,.5,1) forwards; }
@keyframes flip { from { transform: rotateY(0) scale(.82); } to { transform: rotateY(180deg) scale(1); } }
.card3d .face { --s: 20px; position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; filter: drop-shadow(0 30px 60px #000); }
.card3d .back > .in { display: grid; place-items: center; overflow: hidden; background: repeating-linear-gradient(45deg, #141821 0 8px, #10131a 8px 16px); }
.card3d .back .fan { width: 420px; left: 50%; margin-left: -210px; top: 34%; opacity: .6; }
.card3d .back .vr { position: relative; width: 110px; height: 110px; display: grid; place-items: center; border: 1px solid var(--gold); transform: rotate(45deg); background: var(--ink); box-shadow: 0 0 0 6px #141824, 0 0 0 7px rgba(201,165,90,.35); }
.card3d .back .vr span { transform: rotate(-45deg); font: 400 36px var(--display); letter-spacing: .1em; color: var(--gold2); }
.card3d .front { transform: rotateY(180deg); }
.card3d .front > .in { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 34px 30px 26px; text-align: center; overflow: hidden; background: linear-gradient(180deg, #1B2030, #0D1016); }
.card3d .front .fan { width: 400px; left: 50%; margin-left: -200px; top: -30px; opacity: .55; }
.rv-ic { position: relative; width: 96px; height: 96px; margin: 26px 0 20px; display: grid; place-items: center; border: 1px solid var(--gold2); transform: rotate(45deg); background: #0D1016; box-shadow: 0 0 0 6px #141824, 0 0 0 7px rgba(201,165,90,.35), 0 0 40px rgba(233,209,143,.18); }
.rv-ic .ic { transform: rotate(-45deg); font-size: 44px; color: var(--gold2); }
.rv-name { position: relative; font: 400 40px/1.05 var(--display); letter-spacing: .1em; color: var(--gold2); text-transform: uppercase; }
.rv-team { display: flex; align-items: center; gap: 8px; font: 600 12px/1 var(--ui); letter-spacing: .18em; text-transform: uppercase; }
.rv-desc { margin: 0; font-size: 15px; line-height: 1.5; color: var(--cream); position: relative; }
.rv-goal { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* ---------- verdict ---------- */
/* Centred in the free space between the residents list (left) and the tally (right). */
#verdictCard { position: absolute; z-index: 10; left: 280px; right: 352px; top: 22%; width: auto; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 28px 26px; text-align: center; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, #1E1B16, #10131A 70%); animation: verdictIn .6s cubic-bezier(.2,1.2,.4,1); }
@keyframes verdictIn { from { opacity: 0; transform: scale(1.1); } to { opacity: 1; transform: scale(1); } }
#verdictCard .lbl { color: var(--gold2); text-shadow: 0 1px 6px #000; }
.vd-big { position: relative; font: 400 40px/1.08 var(--display); letter-spacing: .12em; color: #F2A597; text-shadow: 0 2px 24px rgba(224,122,104,.35), 0 2px 6px #000; }
.vd-big.spared { color: #9FD9B6; text-shadow: 0 2px 24px rgba(127,201,160,.3), 0 2px 6px #000; }
#verdictCard .ptw .av, #verdictCard .ptw .dot { width: 96px; height: 96px; border-radius: 50%; display: block; filter: grayscale(.6) brightness(.85); box-shadow: 0 0 0 2px var(--fam), 0 0 0 5px var(--ink); }
#verdictCard .ptw .seat { min-width: 26px; height: 26px; border-radius: 13px; font-size: 13px; border-color: var(--fam); }
.vd-name { font-size: 20px; font-weight: 600; text-shadow: 0 1px 6px #000; }
.vd-role { display: flex; align-items: center; gap: 8px; font-size: 15px; text-shadow: 0 1px 6px #000; }
.vd-role b { color: #F2A597; }
.vd-sub { font-size: 15px; text-shadow: 0 1px 6px #000; }

/* ---------- banner ---------- */
#banner { position: absolute; z-index: 9; left: 0; right: 0; top: 36%; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; pointer-events: none; font: 400 64px/1 var(--display); letter-spacing: .22em; color: var(--gold2); text-shadow: 0 4px 30px rgba(0,0,0,.9), 0 0 2px #000; animation: bannerIn 2.6s ease forwards; }
#banner small { display: flex; align-items: center; gap: 10px; font: 600 13px/1 var(--ui); letter-spacing: .24em; text-transform: uppercase; color: var(--cream); }
#banner small::before, #banner small::after { content: ''; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(1.12); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- game over ---------- */
#gameOver { position: absolute; z-index: 15; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(880px, calc(100% - 32px)); max-height: calc(100% - 140px); margin-top: 30px; display: flex; flex-direction: column; overflow: hidden; }
#gameOver .fan { width: 560px; left: 50%; margin-left: -280px; top: -40px; opacity: .5; }
.go-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 30px 16px; text-align: center; }
.go-head h1 { margin: 0; font: 400 56px/1 var(--display); letter-spacing: .1em; color: var(--gold2); text-shadow: 0 2px 30px rgba(233,209,143,.25); }
.go-head h1.lose { color: var(--cream); }
.go-head p { margin: 0; font-size: 16px; color: var(--cream); }
.go-xp { justify-content: center; margin-top: 4px; font-size: 13.5px; }
.go-xp .gain { font: 400 22px/1 var(--display); letter-spacing: .04em; color: var(--gold2); }
.go-xp .xpbar { width: 140px; }
.go-xp.muted .ic { color: var(--gold); }
.go-list { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 0 30px; overflow-y: auto; min-height: 0; }
.gt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px 14px; background: #141821; border: 1px solid rgba(255,255,255,.07); text-align: center; }
.gt.win { border-color: var(--gold); background: linear-gradient(180deg, #221E14, #141821); }
.gt .av, .gt .dot { width: 54px; height: 54px; border-radius: 50%; display: block; box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px #141821; }
.gt.dead .av, .gt.dead .dot { filter: grayscale(1) brightness(.7); }
.gt .nm { font-size: 14.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt .rl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.gt .rl .ic { font-size: 15px; color: var(--gold2); }
.gt .corner { position: absolute; top: 8px; right: 8px; }
.go-foot { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 20px 30px 26px; }
.go-foot .btn-primary { min-width: 300px; }

/* ---------- side: role card ---------- */
#roleCard { position: relative; overflow: hidden; padding: 20px 20px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #151925, #0E1118); }
#roleCard .fan { width: 300px; right: -90px; top: -60px; opacity: .35; }
#roleCard .lbl { position: relative; margin-bottom: 10px; color: var(--muted); }
.rc-top { position: relative; display: flex; align-items: center; gap: 16px; }
.rc-name { font: 400 25px/1.05 var(--display); letter-spacing: .05em; color: var(--gold2); }
.rc-team { display: flex; align-items: center; gap: 7px; margin-top: 7px; font: 600 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.rc-desc { position: relative; margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--cream); }
.rc-goal { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.rc-ex { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.exchip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px; border: 1px solid var(--line); font-size: 12.5px; color: var(--cream); }
.exchip .ic { color: var(--gold2); }
.exchip.bad { border-color: var(--fam); color: #F8CFC7; }
.exchip.bad .ic { color: var(--fam); }

/* ---------- chat ---------- */
#chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-h { display: flex; align-items: center; gap: 8px; height: 44px; flex: none; padding: 0 16px; border-bottom: 1px solid var(--hair); }
.chat-h > .ic { color: var(--gold); }
.chat-h #chatPhase { margin-left: auto; }
#messages { flex: 1; overflow-y: auto; padding: 14px 16px; font-size: 14px; line-height: 1.45; }
.msg { margin-bottom: 10px; word-wrap: break-word; }
.msg .ic { color: var(--gold); font-size: 15px; }
.msg .who { font-weight: 600; color: var(--gold2); }
.msg.mine .who { color: var(--cream); }
.msg.family { color: #F8CFC7; } .msg.family .who { color: var(--fam); }
.msg.jail { color: #CBD8F5; } .msg.jail .who { color: var(--blue); }
.msg.dead { color: #B5BCCB; font-style: italic; } .msg.dead .who { color: #CDD3E0; }
.msg .tag { margin-right: 6px; color: var(--muted); border: 1px solid rgba(255,255,255,.14); height: 17px; vertical-align: 1px; }
.msg.family .tag { color: var(--fam); border-color: rgba(224,122,104,.5); }
.msg.system { display: flex; gap: 8px; font-size: 13px; color: var(--muted); font-style: italic; }
.msg.system > .ic { margin-top: 2px; }
.msg.system.death { color: #F2A597; font-style: normal; }
.msg.system.death > .ic { color: var(--fam); }
.msg.system.reveal { color: var(--gold2); font-style: normal; }
.msg.system.phase { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); font-style: normal; font: 400 15px/1.35 var(--display); letter-spacing: .04em; color: var(--gold2); }
.msg.system.win { font: 400 18px/1.3 var(--display); color: var(--gold2); font-style: normal; }
.msg.private { padding: 8px 10px; background: rgba(201,165,90,.07); border-left: 2px solid var(--gold); font-size: 13.5px; }
.msg.private.intel { border-color: var(--blue); background: rgba(143,176,232,.08); }
.msg.private.danger { border-color: var(--fam); background: rgba(224,122,104,.1); }
.msg.private.good { border-color: var(--hus); background: rgba(127,201,160,.08); }
.msg.private.family { border-color: var(--fam); background: rgba(224,122,104,.08); }
.msg.private.love { border-color: var(--pink); background: rgba(242,166,200,.08); }
.msg.private.vote { border-color: var(--fam); color: #F8CFC7; font-size: 12.5px; }
.msg .ic.inl { font-size: 1.05em; color: var(--gold2); margin: 0 1px; }
#chatForm { display: flex; gap: 8px; flex: none; padding: 12px; border-top: 1px solid var(--hair); }
#chatForm .select { height: 42px; max-width: 104px; }
#chatInput { flex: 1; min-width: 0; height: 42px; font-size: 14px; }
#chatForm .btn-icon { width: 42px; height: 42px; flex: none; }

/* ---------- toasts & connection ---------- */
#toasts { position: absolute; z-index: 40; top: 116px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 16px; background: rgba(13,16,23,.96); border: 1px solid var(--line); font-size: 14px; color: var(--cream); box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: toast 3.2s forwards; }
.toast .ic { font-size: 18px; color: var(--gold2); }
.toast.ok .ic, .toast.good .ic { color: var(--hus); }
.toast.error { border-color: var(--fam); }
.toast.error .ic { color: var(--fam); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#netChip { position: fixed; z-index: 300; top: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 16px; border-radius: 17px; background: rgba(13,16,23,.96); border: 1px solid var(--fam); font-size: 13px; color: #F8CFC7; box-shadow: 0 6px 20px rgba(0,0,0,.5); animation: popIn .2s ease-out; }
#netChip .spinner { border-color: rgba(242,165,151,.22); border-top-color: #F2A597; }

/* ---------- 3D town: labels & loading ---------- */
.labels3d { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lbl3d { display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; text-align: center; padding-bottom: 2px; }
.lbl3d .nm { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 4px; font: 500 12.5px var(--ui); color: var(--cream); background: rgba(10,12,17,.82); border: 1px solid rgba(201,165,90,.4); white-space: nowrap; text-shadow: 0 1px 2px #000; transition: background .15s, box-shadow .15s, border-color .15s; }
.lbl3d .nm .seat { min-width: 16px; height: 16px; font-size: 10px; text-shadow: none; }
.lbl3d .sub { display: flex; align-items: center; gap: 5px; font: 600 11px var(--ui); color: var(--gold2); background: rgba(10,12,17,.7); padding: 2px 7px; white-space: nowrap; }
.lbl3d .sub .ic { font-size: 12px; }
.lbl3d.me .nm { color: var(--gold2); border-color: var(--gold); }
.lbl3d.fam .nm { color: #F2A597; }
.lbl3d.lover .nm { color: var(--pink); }
.lbl3d.dead .nm { color: var(--muted); opacity: .85; text-decoration: line-through; text-decoration-color: rgba(224,122,104,.8); }
.lbl3d.tgt .nm { --tc: var(--gold2); border-color: var(--tc); box-shadow: 0 0 0 2px rgba(233,209,143,.25), 0 0 12px var(--tc); pointer-events: auto; cursor: pointer; }
.lbl3d.hover .nm { background: rgba(43,37,23,.94); }
.lbl3d .mk { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; font-size: 15px; color: var(--dark-text); background: var(--gold2); box-shadow: 0 2px 8px rgba(0,0,0,.6); }
.lbl3d .mk:empty { display: none; }
.lbl3d .mk .ic { font-size: 15px; }
.lbl3d .vote { display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px; font: 700 12px var(--ui); color: var(--dark-text); background: var(--gold2); box-shadow: 0 2px 10px rgba(0,0,0,.6); }
.lbl3d .vote .ic { font-size: 13px; }
.lbl3d .vote .dots { display: flex; gap: 3px; }
.lbl3d .vote .dots i { min-width: 15px; height: 15px; padding: 0 2px; border-radius: 8px; border: 1px solid rgba(0,0,0,.55); display: block; font: 700 9.5px/13px var(--ui); font-style: normal; color: #fff; text-align: center; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.lbl3d .bub { position: relative; max-width: 230px; width: max-content; background: #F6EFE0; color: #1a1612; font: 500 13px/1.3 var(--ui); padding: 7px 11px 6px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.55); margin-bottom: 7px; white-space: normal; word-wrap: break-word; }
.lbl3d .bub::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #F6EFE0; }
.lbl3d .bub.pop { animation: bubPop .25s ease-out; }
@keyframes bubPop { from { transform: scale(.6) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.lbl3d.pending .nm::before { content: ''; width: 10px; height: 10px; margin-left: 3px; border-radius: 50%; border: 1.5px solid rgba(201,165,90,.25); border-top-color: var(--gold2); animation: spin .8s linear infinite; }

#loading3d { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at center, #171b26, #0A0C11 70%); transition: opacity .8s ease; }
#loading3d.done { opacity: 0; pointer-events: none; }
#loading3d .lt { font: 400 30px/1 var(--display); letter-spacing: .14em; color: var(--gold2); }
#loading3d .lb { width: 280px; height: 3px; background: rgba(201,165,90,.18); overflow: hidden; }
#loading3d .lb i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .25s; }
#loading3d .ls { font: 600 11px/1.4 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); min-height: 1.4em; }
#loading3d .spinner { margin-bottom: 8px; }
#busy3d { position: absolute; z-index: 30; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 13px 0 10px; background: rgba(10,12,17,.88); border: 1px solid var(--line); color: var(--cream); font-size: 12.5px; letter-spacing: .04em; pointer-events: none; transition: opacity .3s; animation: popIn .25s ease-out; }

/* ---------- wardrobe ---------- */
.wd { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(5,6,10,.76); backdrop-filter: blur(3px); }
.wd-card { width: min(1180px, 96vw); height: min(760px, 92vh); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, 1fr); overflow: hidden; }
.wd-card.panel::before { z-index: 3; }
.wd-stage { position: relative; min-height: 0; background: #0b0d12; border-right: 1px solid var(--line); }
.wd-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.wd-canvas:active { cursor: grabbing; }
.wd-night { position: absolute; top: 14px; right: 14px; }
.wd-hint { position: absolute; left: 14px; bottom: 12px; font: 600 10.5px var(--ui); color: rgba(243,235,221,.8); letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 1px 3px #000; pointer-events: none; }
.wd-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--gold2); font: 400 20px var(--display); letter-spacing: .14em; background: radial-gradient(ellipse at center, #171a24, #0b0d12 70%); transition: opacity .5s; }
.wd-loading.done { opacity: 0; pointer-events: none; }
.wd-busy { position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px 0 8px; background: rgba(10,12,17,.86); border: 1px solid var(--line); color: var(--cream); font: 600 10.5px var(--ui); letter-spacing: .14em; text-transform: uppercase; pointer-events: none; opacity: 0; transition: opacity .25s; }
.wd-busy.on { opacity: 1; }
.wd-panel { display: flex; flex-direction: column; min-height: 0; padding: 20px 22px 16px; }
.wd-head { display: flex; align-items: center; }
.wd-head h2 { flex: 1; margin: 0; font: 400 26px var(--display); color: var(--gold2); letter-spacing: .16em; text-transform: uppercase; }
.wd-x { background: none; border: none; color: var(--muted); font-size: 18px; padding: 6px; }
.wd-x:hover { color: var(--cream); }
.wd-tabs { display: flex; margin: 14px 0 12px; border: 1px solid var(--line); }
.wd-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: transparent; border: none; color: var(--muted); height: 40px; letter-spacing: .14em; text-transform: uppercase; font: 600 12px var(--ui); }
.wd-tabs button:hover { color: var(--cream); }
.wd-tabs button.on { background: linear-gradient(180deg, #EED595, #C9A55A 58%, #B38F48); color: var(--dark-text); }
.wd-slots { display: flex; flex-direction: column; gap: 7px; padding-bottom: 12px; border-bottom: 1px solid var(--hair); }
.wd-group { display: flex; align-items: baseline; gap: 10px; }
.wd-gl { flex: none; width: 84px; font: 600 10px var(--ui); color: var(--gold); letter-spacing: .18em; text-transform: uppercase; }
.wd-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.wd-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; background: rgba(15,18,25,.9); border: 1px solid rgba(201,165,90,.25); color: var(--cream); padding: 0 10px; font-size: 12.5px; }
.wd-chip i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(0,0,0,.6); box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.wd-chip:hover { border-color: var(--gold); }
.wd-chip.on { border-color: var(--gold2); background: rgba(201,165,90,.18); box-shadow: inset 0 0 0 1px var(--gold2); }
.wd-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 2px 6px; }
.wd-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.wd-title b { font: 400 18px var(--display); letter-spacing: .1em; color: var(--cream); }
.wd-title span { color: var(--gold2); font-size: 13px; font-style: italic; }
.wd-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.wd-item { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 5px; background: #141821; border: 1px solid rgba(255,255,255,.07); color: var(--cream); }
.wd-item .th { position: relative; aspect-ratio: 1; overflow: hidden; background: radial-gradient(circle at 50% 38%, #3a3f52, #1a1d27 72%); }
.wd-item .th img { width: 100%; height: 100%; display: block; }
.wd-item .th.wait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.09) 50%, transparent 70%); background-size: 200% 100%; animation: wdShimmer 1.2s linear infinite; }
@keyframes wdShimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.wd-item .th.wait::before { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -10px 0 0 -10px; border-radius: 50%; border: 2px solid rgba(201,165,90,.18); border-top-color: rgba(201,165,90,.8); animation: spin .9s linear infinite; }
.wd-item .nm { font-size: 11.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-item:hover { border-color: var(--line); }
.wd-item.on { border-color: var(--gold2); box-shadow: inset 0 0 0 1px var(--gold2), 0 0 14px rgba(201,165,90,.22); background: #1B1B19; }
.wd-colors { margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.wd-sw { display: flex; flex-wrap: wrap; gap: 7px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(0,0,0,.55); box-shadow: 0 0 0 1px rgba(255,255,255,.18); padding: 0; transition: transform .12s; }
.sw:hover { transform: scale(1.12); }
.sw.on { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold2); }
.wd-foot { display: flex; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--hair); }
.wd-foot .sp { flex: 1; }

/* ---------- smaller screens ---------- */
@media (max-width: 1250px) {
  .rchip .nm { display: none; }
  .rchip { padding: 0 8px; }
  .plaque { width: 340px; }
  #phaseTitle { font-size: 28px; }
  .abtn { width: 118px; }
}
@media (max-width: 1100px) {
  #playersPanel { width: 220px; }
  #tally { width: 300px; }
  #verdictCard { left: 252px; right: 332px; padding: 18px 18px 22px; }
  .vd-big { font-size: 32px; }
}
@media (max-width: 900px) {
  #game { flex-direction: column; }
  #side { width: 100%; height: 40%; border-left: none; border-top: 1px solid var(--line); }
  #playersPanel { display: none; }
  #topbar { top: 10px; left: 10px; right: 10px; }
  .plaque { width: auto; flex: 1; min-height: 64px; }
  .plaque > .in { min-height: 62px; padding: 0 12px 0 16px; gap: 10px; }
  #phaseTitle { font-size: 22px; }
  #phaseSub { font-size: 12.5px; margin-top: 4px; }
  .dial, .dial svg { width: 48px; height: 48px; }
  #timerText { font-size: 18px; }
  #roleStrip { top: 84px; left: 10px; right: 10px; }
  .rgroup .glabel { display: none; }
  #banner { font-size: 40px; }
  .abtn { width: 104px; height: 64px; font-size: 12px; }
  #tally, #stage.has-strip #tally { left: 8px; right: 8px; width: auto; top: auto !important; bottom: 148px; max-height: 46% !important; }
  #hint { bottom: 112px; }
  #verdictCard { left: 16px; right: 16px; top: 16%; }
  #verdictCard .ptw .av, #verdictCard .ptw .dot { width: 64px; height: 64px; }
  #stage[data-phase="verdict"] #tally { display: none; }
  .go-head h1 { font-size: 40px; }
  .lb-head { padding: 16px 18px 10px; }
  .lb-body { padding: 0 18px; }
  .lb-foot { padding: 12px 18px 16px; }
}
@media (max-width: 860px) {
  .wd-card { grid-template-columns: 1fr; grid-template-rows: 42% 58%; height: 94vh; }
  .wd-stage { border-right: none; border-bottom: 1px solid var(--line); }
  .wd-panel { padding: 12px 14px 10px; }
  .wd-gl { width: 64px; }
  .wd-foot .btn { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .rain-bg, .abtn.picking { animation: none; }
  .card3d { animation-duration: .01s; }
}

/* ---------- roles guide: every role and what it does (join screen) ---------- */
.roles-link { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: -4px; padding: 14px 0 0; background: none; border: none; border-top: 1px solid var(--hair); color: var(--muted); text-align: left; }
.roles-link .lbl { display: inline-flex; align-items: center; gap: 8px; }
.roles-link .lbl .ic { font-size: 15px; }
.roles-link small { font-size: 12.5px; color: var(--muted); }
.roles-link .go { margin-left: auto; color: var(--gold); font-size: 15px; transition: transform .2s; }
.roles-link:hover .lbl, .roles-link:hover small { color: var(--gold2); }
.roles-link:hover .go { transform: translateX(3px); }
.rg { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; background: rgba(5,6,10,.8); backdrop-filter: blur(3px); }
.rg-card { width: min(1180px, 96vw); height: min(880px, 94vh); display: flex; flex-direction: column; background: #10131A; animation: popIn .18s ease-out; }
.rg-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 26px 0; }
.rg-ht { flex: 1; min-width: 0; }
.rg-head h2 { margin: 8px 0 0; font: 400 28px/1.1 var(--display); color: var(--gold2); letter-spacing: .12em; text-transform: uppercase; }
.rg-bar { display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; padding: 16px 26px 14px; border-bottom: 1px solid var(--hair); }
.rg-tabs { display: flex; border: 1px solid var(--line); }
.rg-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; background: transparent; border: none; border-left: 1px solid var(--hair); color: var(--muted); font: 600 11.5px var(--ui); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.rg-tabs button:first-child { border-left: none; }
.rg-tabs button .ic { font-size: 14px; }
.rg-tabs button i { font-style: normal; font-weight: 500; letter-spacing: 0; opacity: .7; }
.rg-tabs button:hover { color: var(--cream); }
.rg-tabs button.on { color: var(--dark-text); background: linear-gradient(180deg, #EED595, #C9A55A 58%, #B38F48); }
.rg-tabs button.on .tg { background: var(--dark-text); }
.rg-find { position: relative; flex: 1; min-width: 220px; max-width: 360px; margin-left: auto; display: flex; align-items: center; }
.rg-find > .ic { position: absolute; left: 12px; font-size: 15px; color: var(--gold); pointer-events: none; }
.rg-find input { width: 100%; height: 38px; padding: 0 70px 0 36px; background: #0B0D13; border: 1px solid #403928; border-radius: 0; color: var(--cream); font: 400 14px var(--ui); outline: none; -webkit-appearance: none; appearance: none; }
.rg-find input::-webkit-search-cancel-button { display: none; }
.rg-find input::placeholder { color: #8A8576; }
.rg-find input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,165,90,.2); }
.rg-count { position: absolute; right: 12px; font-size: 11.5px; color: var(--muted); pointer-events: none; }
.rg-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 26px 22px; outline: none; }
.rg-team { padding-top: 20px; }
.rg-team + .rg-team { margin-top: 12px; border-top: 1px solid var(--hair); }
.rg-th { margin-bottom: 14px; }
.rg-tn { display: flex; align-items: center; gap: 10px; }
.rg-tn .tg { transform-origin: center; scale: 1.3; }
.rg-tn h3 { margin: 0; font: 400 22px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--tc); }
.rg-n { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.rg-goal, .rg-deal { display: flex; gap: 12px; margin: 8px 0 0; max-width: 920px; font-size: 13.5px; line-height: 1.45; color: var(--cream); }
.rg-deal { margin-top: 4px; color: var(--muted); }
.rg-goal .lbl, .rg-deal .lbl { flex: none; width: 60px; padding-top: 3px; font-size: 10px; }
.rg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.rg-role { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 13px; background: linear-gradient(180deg, #161a24, #11141c); border: 1px solid rgba(201,165,90,.2); transition: border-color .15s; }
.rg-role::before { content: ''; position: absolute; left: 14px; top: -1px; width: 40px; height: 2px; background: var(--tc); }
.rg-role:hover { border-color: var(--line); }
.rg-rh { display: flex; align-items: center; gap: 12px; }
.rg-role .rc-ic { width: 36px; height: 36px; margin: 6px 4px; border-color: var(--tc); box-shadow: 0 0 0 3px #141822, 0 0 0 4px var(--hair); }
.rg-role .rc-ic .ic { font-size: 18px; color: var(--tc); }
.rg-role .rc-ic .emo { font-size: 18px; }
.rg-rn { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rg-rn h4 { margin: 0; font: 400 19px/1.1 var(--display); letter-spacing: .05em; color: var(--cream); }
.rg-rep { display: inline-flex; align-items: center; gap: 5px; font: 600 10px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; }
.rg-rep .ic { font-size: 12px; }
.rg-rep.clean { color: var(--gold2); }
.rg-rep.dirty { color: #F2A597; }
.rg-rep.shady { color: #C9C2B2; }
.rg-role p { flex: 1; margin: 0; font-size: 13.5px; line-height: 1.5; color: #E6DECF; }
.rg-acts { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 10px 0 0; list-style: none; border-top: 1px solid var(--hair); }
.rg-acts li { display: flex; align-items: center; gap: 10px; }
.rg-acts li > .ic { flex: none; font-size: 16px; color: var(--gold2); }
.rg-acts li > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.rg-acts b { font: 600 13px var(--ui); color: var(--cream); }
.rg-acts small { font-size: 12px; color: var(--muted); }
.rg-acts li.none > .ic, .rg-acts li.none b { color: var(--muted); }
.rg-acts li.none b { font-weight: 500; }
.rg-wait, .rg-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 280px; text-align: center; }
.rg-wait { color: var(--gold2); font: 400 18px var(--display); letter-spacing: .12em; }
.rg-empty { color: var(--muted); font-size: 15px; }
.rg-empty .ic { font-size: 28px; color: var(--gold); }
.rg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 26px 15px; border-top: 1px solid var(--hair); font-size: 12.5px; color: var(--muted); }
.rg-foot .lbl { font-size: 10px; }
.rg-foot .rg-rep em { margin-left: 2px; font: 400 12px var(--ui); font-style: normal; letter-spacing: 0; text-transform: none; color: var(--muted); }
.rg-fx { margin-left: auto; font-style: italic; }
@media (max-width: 760px) {
  .rg-card { width: 100vw; height: 100%; }
  .rg-head { padding: 16px 16px 0; }
  .rg-head h2 { font-size: 21px; }
  .rg-bar { padding: 12px 16px; }
  .rg-tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .rg-tabs button { flex: 1 0 auto; padding: 0 10px; }
  .rg-find { max-width: none; margin-left: 0; }
  .rg-body { padding: 0 16px 18px; }
  .rg-grid { grid-template-columns: minmax(0, 1fr); }
  .rg-foot { padding: 10px 16px 12px; }
  .rg-fx { margin-left: 0; }
}
/* narrow phones: the five team tabs become two rows (3 + 2) instead of scrolling off the edge */
@media (max-width: 640px) {
  .rg-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--hair); overflow: visible; }
  .rg-tabs button { grid-column: span 2; padding: 0 6px; height: 36px; border-left: none; background: #10131A; letter-spacing: .1em; }
  .rg-tabs button:nth-child(n+4) { grid-column: span 3; }
  .rg-head h2 { font-size: 19px; letter-spacing: .08em; }
}
@media (prefers-reduced-motion: reduce) { .rg-card { animation: none; } }
