/* ============================================================
   DEAD MAN'S CROWN — A Court of Liars
   Gothic black-and-gold design system
   ============================================================ */

@font-face {
  font-family: 'Cinzel';
  src: url('../assets/fonts/cinzel-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('../assets/fonts/cinzel-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../assets/fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../assets/fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --gold: #c9a227;
  --gold-bright: #f0d98c;
  --gold-dim: #8a7223;
  --blood: #a31621;
  --blood-dark: #5c0e14;
  --ink: #07080c;
  --panel: rgba(10, 13, 19, 0.86);
  --panel-edge: rgba(201, 162, 39, 0.35);
  --bone: #e8e0cf;
  --muted: #9a917e;
  --shadow-c: #6b4fd8;
  --fool-c: #3f9e6e;
  --font-head: 'Cinzel', serif;
  --font-body: 'Cormorant Garamond', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
body.larger-text { font-size: 21px; }
button { font-family: inherit; cursor: pointer; }
img { -webkit-user-drag: none; }
.hidden { display: none !important; }
.gold { color: var(--gold-bright); }

#app { position: fixed; inset: 0; }

/* ============ FX LAYERS ============ */
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 40;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
}
#fog-layer {
  position: fixed; inset: -20%; pointer-events: none; z-index: 5; opacity: .5;
  background:
    radial-gradient(ellipse 40% 25% at 20% 80%, rgba(120,130,160,.10), transparent 70%),
    radial-gradient(ellipse 45% 30% at 75% 85%, rgba(120,130,160,.08), transparent 70%),
    radial-gradient(ellipse 35% 22% at 50% 95%, rgba(150,140,120,.07), transparent 70%);
  animation: fogDrift 26s ease-in-out infinite alternate;
}
@keyframes fogDrift {
  from { transform: translateX(-3%) translateY(0); }
  to   { transform: translateX(3%) translateY(-2%); }
}
#flash {
  position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 90;
}
#flash.fire { animation: flashFire .5s ease-out; }
@keyframes flashFire { 0% {opacity:.85;} 100% {opacity:0;} }
#fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 45; }

/* ============ TOP BAR ============ */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 22px 12px;
  background: linear-gradient(180deg, rgba(5,6,9,.95), rgba(5,6,9,.72) 70%, transparent);
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.tb-logo {
  height: 74px; margin: -4px 0 -12px;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.95)) drop-shadow(0 0 18px rgba(201,162,39,.18));
  transition: transform .3s;
}
.tb-logo:hover { transform: scale(1.04); }
.tb-right { display: flex; gap: 8px; align-items: center; }
.tb-btn {
  background: rgba(12,15,22,.85); border: 1px solid var(--panel-edge);
  color: var(--bone); padding: 7px 13px; font-family: var(--font-head);
  font-size: 11px; letter-spacing: 1.5px; border-radius: 3px;
  transition: all .2s;
}
.tb-btn:hover { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 0 12px rgba(201,162,39,.25); }
.tb-fs { font-size: 15px; padding: 5px 11px; }
.tb-status { font-family: var(--font-head); font-size: 10px; letter-spacing: 2px; color: var(--muted); margin-left: 6px; }
.tb-status .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3fae6a; margin-right: 6px; box-shadow: 0 0 8px #3fae6a; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* ============ PHASE TRACKER ============ */
#phase-tracker {
  position: fixed; top: 92px; left: 50%; transform: translateX(-50%); z-index: 55;
  display: flex; gap: 4px; align-items: center;
  background: rgba(8,10,15,.85); border: 1px solid var(--panel-edge);
  padding: 6px 18px; border-radius: 3px;
}
.pt-step { display: flex; align-items: center; gap: 7px; padding: 4px 12px; font-family: var(--font-head); font-size: 10px; letter-spacing: 1.5px; color: var(--muted); position: relative; }
.pt-step i { font-style: normal; font-size: 13px; }
.pt-step + .pt-step::before { content: ''; position: absolute; left: -4px; width: 4px; height: 1px; background: var(--gold-dim); }
.pt-step.active { color: var(--gold-bright); text-shadow: 0 0 10px rgba(240,217,140,.5); }
.pt-step.done { color: var(--gold-dim); }

/* ============ LEAVE GAME ============ */
#btn-leave-game {
  position: fixed; left: 22px; bottom: 22px; z-index: 65;
  font-family: var(--font-head); font-size: 11px; letter-spacing: 2px;
  color: #e8b0b0; background: rgba(40,8,11,.85); border: 1px solid rgba(163,22,33,.6);
  padding: 10px 20px; border-radius: 3px; transition: all .2s;
  box-shadow: 0 6px 20px rgba(0,0,0,.6);
}
#btn-leave-game:hover { background: rgba(92,14,20,.9); color: #fff; box-shadow: 0 0 18px rgba(163,22,33,.5); }

/* ============ SCREENS ============ */
.screen {
  position: fixed; inset: 0; display: none; overflow: hidden;
  background-size: cover; background-position: center;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 110px 40px 34px;
}
.screen.active { display: flex; animation: screenIn .7s ease-out; }
.screen.leaving { display: flex; animation: screenOut .45s ease-in forwards; pointer-events: none; }
@keyframes screenIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: scale(1); } }
@keyframes screenOut { to { opacity: 0; transform: scale(.99); } }
.screen::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(5,6,10,.55), rgba(5,6,10,.35) 40%, rgba(5,6,10,.72));
}
.screen > * { position: relative; z-index: 2; }

.screen[data-bg="hall"]     { background-image: url('../assets/bg/hall.jpg'); }
.screen[data-bg="lobby"]    { background-image: url('../assets/bg/lobby.jpg'); }
.screen[data-bg="reveal"]   { background-image: url('../assets/bg/reveal.jpg'); }
.screen[data-bg="night"]    { background-image: url('../assets/bg/night.jpg'); }
.screen[data-bg="council"]  { background-image: url('../assets/bg/council.jpg'); }
.screen[data-bg="vote"]     { background-image: url('../assets/bg/vote.jpg'); }
.screen[data-bg="results"]  { background-image: url('../assets/bg/results.jpg'); }
.screen[data-bg="settings"] { background-image: url('../assets/bg/settings.jpg'); }

.screen-title {
  font-family: var(--font-head); font-weight: 600; font-size: clamp(26px, 3.6vw, 46px);
  letter-spacing: 6px; color: var(--bone); text-align: center;
  text-shadow: 0 0 30px rgba(201,162,39,.35), 0 3px 12px rgba(0,0,0,.9);
}
.screen-subtitle {
  font-family: var(--font-head); font-size: 12px; letter-spacing: 4px;
  color: var(--gold); margin-top: 6px; text-align: center;
}
.screen-footer { position: absolute; bottom: 24px; left: 36px; z-index: 2; }

/* ============ BUTTONS ============ */
.btn-primary {
  font-family: var(--font-head); font-weight: 600; letter-spacing: 3px;
  color: var(--gold-bright); background: linear-gradient(180deg, #3a0d12, #20070a);
  border: 1px solid var(--gold-dim); border-radius: 3px;
  padding: 13px 34px; font-size: 15px; position: relative;
  box-shadow: inset 0 0 18px rgba(163,22,33,.5), 0 4px 18px rgba(0,0,0,.6);
  transition: all .25s;
}
.btn-primary:hover:not(:disabled) {
  border-color: var(--gold-bright); color: #fff;
  box-shadow: inset 0 0 24px rgba(163,22,33,.7), 0 0 22px rgba(201,162,39,.35);
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-xl { font-size: 17px; padding: 16px 44px; }
.btn-ghost {
  font-family: var(--font-head); letter-spacing: 2.5px; font-size: 13px;
  color: var(--muted); background: rgba(10,13,19,.7); border: 1px solid rgba(154,145,126,.35);
  padding: 11px 26px; border-radius: 3px; transition: all .2s;
}
.btn-ghost:hover { color: var(--bone); border-color: var(--gold); }
.back-btn {
  color: var(--gold-bright); border: 1px solid var(--gold-dim);
  background: rgba(12,15,22,.88); font-size: 14px; padding: 12px 30px;
  box-shadow: 0 6px 22px rgba(0,0,0,.65), 0 0 14px rgba(201,162,39,.12);
}
.back-btn:hover {
  color: #fff; border-color: var(--gold-bright);
  box-shadow: 0 6px 22px rgba(0,0,0,.65), 0 0 22px rgba(201,162,39,.4);
  transform: translateX(-3px);
}
.btn-icon {
  background: rgba(201,162,39,.12); border: 1px solid var(--panel-edge); color: var(--gold-bright);
  width: 42px; height: 42px; border-radius: 3px; font-size: 16px; transition: all .2s;
}
.btn-icon:hover { background: rgba(201,162,39,.3); }

/* ============ PANELS ============ */
.panel {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,.65), inset 0 0 40px rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
  position: relative;
}
.panel::before, .panel::after {
  content: '◆'; position: absolute; color: var(--gold-dim); font-size: 9px;
}
.panel::before { top: -5px; left: 50%; transform: translateX(-50%); }
.panel::after { bottom: -5px; left: 50%; transform: translateX(-50%); }
.panel-title {
  font-family: var(--font-head); font-size: 15px; letter-spacing: 3px;
  color: var(--gold-bright); padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid rgba(201,162,39,.25);
}
.panel-note { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.divider-img { width: 220px; opacity: .8; margin: 14px 0; }

/* transparent card art — no boxes, just shadow */
.card-art { background: none; border: none; filter: drop-shadow(0 12px 26px rgba(0,0,0,.75)); }

/* ============ HOME ============ */
#screen-home { flex-direction: row; justify-content: flex-start; padding: 120px 5vw 40px; gap: 4vw; }
.home-left { display: flex; flex-direction: column; align-items: center; gap: 26px; min-width: 240px; }
.home-logo { width: min(340px, 26vw); filter: drop-shadow(0 6px 24px rgba(0,0,0,.9)); animation: logoFloat 6s ease-in-out infinite; }
@keyframes logoFloat { 50% { transform: translateY(-8px); } }
.home-menu { display: flex; flex-direction: column; gap: 10px; width: 230px; }
.menu-btn {
  font-family: var(--font-head); font-size: 14px; letter-spacing: 3px; text-align: left;
  color: var(--bone); background: linear-gradient(90deg, rgba(12,15,22,.9), rgba(12,15,22,.55));
  border: 1px solid var(--panel-edge); border-left: 3px solid var(--gold-dim);
  padding: 13px 20px; border-radius: 2px; transition: all .22s;
}
.menu-btn i { font-style: normal; margin-right: 12px; color: var(--gold); }
.menu-btn:hover { border-left-color: var(--gold-bright); color: var(--gold-bright); transform: translateX(6px); box-shadow: 0 0 18px rgba(201,162,39,.2); }
.home-center { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.home-tagline {
  font-family: var(--font-body); font-weight: 400; font-size: clamp(36px, 5vw, 68px);
  line-height: 1.05; color: var(--bone); text-shadow: 0 4px 30px rgba(0,0,0,.9);
}
.home-sub { font-family: var(--font-head); font-size: 12px; letter-spacing: 4px; color: var(--gold); line-height: 2; }
.home-quote { font-style: italic; color: var(--muted); font-size: 17px; }
.home-cards { display: flex; gap: 20px; align-items: center; perspective: 1200px; }
.home-card {
  width: clamp(120px, 11vw, 170px); transition: transform .35s, filter .35s;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,.8));
}
.home-card img { width: 100%; display: block; }
.home-card:nth-child(1) { transform: rotateY(14deg) rotate(-4deg); }
.home-card:nth-child(2) { transform: scale(1.12); z-index: 2; }
.home-card:nth-child(3) { transform: rotateY(-14deg) rotate(4deg); }
.home-card:hover { transform: scale(1.18) translateY(-10px); filter: drop-shadow(0 20px 40px rgba(0,0,0,.85)) drop-shadow(0 0 26px rgba(201,162,39,.4)); z-index: 3; }

/* ============ MODE SELECT ============ */
.mode-grid { display: flex; gap: 30px; margin-top: 38px; }
.mode-card {
  width: 300px; padding: 30px 26px 22px; text-align: center;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px;
  color: var(--bone); transition: all .3s; position: relative; overflow: hidden;
}
.mode-card::after {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,162,39,.18), transparent 65%);
}
.mode-card:hover { transform: translateY(-8px); border-color: var(--gold); box-shadow: 0 18px 50px rgba(0,0,0,.7), 0 0 30px rgba(201,162,39,.25); }
.mode-card:hover::after { opacity: 1; }
.mode-icon { font-size: 40px; color: var(--gold); margin-bottom: 12px; text-shadow: 0 0 20px rgba(201,162,39,.6); }
.mode-card h3 { font-family: var(--font-head); font-size: 19px; letter-spacing: 3px; color: var(--bone); }
.mode-tag { display: block; font-family: var(--font-head); font-size: 10px; letter-spacing: 2.5px; color: var(--gold); margin: 8px 0 12px; }
.mode-card p { font-size: 15.5px; color: var(--muted); line-height: 1.5; min-height: 72px; }
.mode-meta { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(201,162,39,.2); font-family: var(--font-head); font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.mode-grid-4 { gap: 20px; flex-wrap: wrap; justify-content: center; max-width: 1280px; }
.mode-grid-4 .mode-card { width: 258px; padding: 24px 18px 18px; }
.mode-grid-4 .mode-card p { font-size: 15px; min-height: 92px; }

/* ============ SETUP ============ */
.setup-wrap { display: flex; gap: 26px; margin-top: 24px; width: min(1180px, 94vw); max-height: calc(100vh - 280px); }
.setup-left { flex: 0 0 320px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.setup-right { flex: 1; padding: 24px; overflow-y: auto; }
.field-label { font-family: var(--font-head); font-size: 11px; letter-spacing: 2.5px; color: var(--muted); margin-top: 8px; }
.text-input {
  background: rgba(5,7,11,.8); border: 1px solid var(--panel-edge); color: var(--bone);
  font-family: var(--font-body); font-size: 20px; padding: 10px 14px; border-radius: 3px; outline: none;
}
.text-input:focus { border-color: var(--gold); box-shadow: 0 0 12px rgba(201,162,39,.25); }
.slider { -webkit-appearance: none; height: 4px; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 2px; outline: none; margin: 14px 0; }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-bright), var(--gold-dim));
  border: 1px solid var(--gold-bright); box-shadow: 0 0 12px rgba(201,162,39,.6); cursor: pointer;
}
.setup-deck-count { display: flex; gap: 10px; align-items: baseline; font-family: var(--font-head); font-size: 11px; letter-spacing: 1.5px; color: var(--muted); }
.setup-deck-count b { font-size: 22px; }
.valid { color: #5fc98a; }
.invalid { color: #d95f5f; }
#btn-begin-night { margin-top: auto; }
.role-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.rp-card {
  position: relative; background: none; border: none; padding: 0;
  transition: transform .2s, filter .2s;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.6)) grayscale(.55) brightness(.6);
}
.rp-card img { width: 100%; display: block; }
.rp-card .rp-count {
  position: absolute; top: 4px; right: 4px; min-width: 26px; height: 26px; border-radius: 50%;
  background: rgba(5,7,11,.92); border: 1px solid var(--gold-dim); color: var(--gold-bright);
  font-family: var(--font-head); font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.rp-card .rp-align {
  position: absolute; bottom: 8px; left: 0; right: 0; text-align: center;
  font-family: var(--font-head); font-size: 9px; letter-spacing: 2px;
  text-shadow: 0 2px 6px #000, 0 0 10px #000;
}
.rp-card.in-deck { filter: drop-shadow(0 10px 22px rgba(0,0,0,.7)) drop-shadow(0 0 14px rgba(201,162,39,.35)); }
.rp-card:hover { transform: translateY(-4px); }
.rp-align.align-shadow { color: #b79bf5; }
.rp-align.align-crown { color: var(--gold-bright); }
.rp-align.align-independent { color: #6fd3a1; }

/* ============ REVEAL ============ */
.reveal-wrap { display: flex; gap: 6vw; align-items: center; }
.reveal-card-zone { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.flip-card { width: clamp(240px, 24vw, 330px); aspect-ratio: 460/713; perspective: 1400px; cursor: pointer; }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.2,.7,.25,1); }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-back, .flip-front { position: absolute; inset: 0; backface-visibility: hidden; }
.flip-back img, .flip-front img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 50px rgba(0,0,0,.85)); }
.flip-front { transform: rotateY(180deg); }
.flip-front img { filter: drop-shadow(0 20px 50px rgba(0,0,0,.85)) drop-shadow(0 0 34px rgba(240,217,140,.3)); }
.flip-card:not(.flipped):hover .flip-inner { transform: rotateY(12deg) scale(1.03); }
.reveal-hint { font-family: var(--font-head); font-size: 11px; letter-spacing: 3px; color: var(--gold); animation: pulse 2.2s infinite; }
.reveal-info { max-width: 480px; display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateX(30px); transition: all .8s .4s; }
.reveal-info.shown { opacity: 1; transform: translateX(0); }
.reveal-kicker { font-family: var(--font-head); font-size: 12px; letter-spacing: 5px; color: var(--muted); }
.reveal-role-name { font-family: var(--font-head); font-weight: 600; font-size: clamp(34px, 4vw, 54px); letter-spacing: 4px; color: var(--gold-bright); text-shadow: 0 0 30px rgba(240,217,140,.4); }
.reveal-role-tag { font-family: var(--font-head); font-size: 13px; letter-spacing: 4px; color: var(--gold); }
.reveal-role-desc { font-size: 20px; line-height: 1.55; color: var(--bone); }
.reveal-role-goal { font-size: 17px; font-style: italic; color: var(--muted); }
.reveal-quote { font-style: italic; color: var(--gold-dim); margin-top: 6px; }

/* ============ NIGHT ============ */
#screen-night { justify-content: flex-start; padding-top: 150px; }
.night-narrator { display: flex; align-items: center; gap: 18px; padding: 14px 28px; max-width: 720px; margin-top: 16px; }
.nn-moon { font-size: 30px; color: var(--gold-bright); text-shadow: 0 0 18px rgba(240,217,140,.7); animation: pulse 3s infinite; }
#narrator-text { font-size: 21px; font-style: italic; line-height: 1.45; }
.center-seals { display: flex; gap: 34px; margin-top: 30px; position: relative; padding-bottom: 32px; }
.seal-card {
  width: clamp(150px, 14vw, 205px); aspect-ratio: 460/713; position: relative;
  transition: transform .25s, filter .25s;
  filter: drop-shadow(0 14px 32px rgba(0,0,0,.75));
}
.seal-card img { width: 100%; height: 100%; object-fit: contain; }
.seal-card.selectable { cursor: pointer; animation: sealGlow 1.6s infinite; }
.seal-card.selectable:hover { transform: translateY(-10px) scale(1.05); }
.seal-card.selected { transform: translateY(-10px) scale(1.07); filter: drop-shadow(0 16px 34px rgba(0,0,0,.8)) drop-shadow(0 0 26px rgba(240,217,140,.55)); }
@keyframes sealGlow {
  50% { filter: drop-shadow(0 14px 32px rgba(0,0,0,.75)) drop-shadow(0 0 22px rgba(201,162,39,.5)); }
}
.seals-label { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-family: var(--font-head); font-size: 10px; letter-spacing: 4px; color: var(--muted); white-space: nowrap; }
/* night action panel docks to the bottom — narrator stays on top, seals in the middle */
.night-action {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6;
  margin-top: 0; padding: 12px 26px; width: min(980px, 94vw); text-align: center;
  max-height: 52vh; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  box-shadow: 0 18px 60px rgba(0,0,0,.75), 0 0 34px rgba(201,162,39,.1);
}
.night-action::-webkit-scrollbar { display: none; }
#night-action-desc { font-size: 18px; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }
.night-targets { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 4px; }
.target-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: rgba(5,7,11,.75); border: 1px solid var(--panel-edge); border-radius: 8px;
  padding: 10px; width: 112px; color: var(--bone); transition: all .2s;
}
.target-btn img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-dim); background: #0a0d13; }
.target-btn span { font-family: var(--font-head); font-size: 10.5px; letter-spacing: 1px; }
.target-btn:hover { border-color: var(--gold); transform: translateY(-3px); }
.target-btn.selected { border-color: var(--gold-bright); box-shadow: 0 0 22px rgba(240,217,140,.5); background: rgba(201,162,39,.12); }
.target-btn:disabled { opacity: .35; cursor: not-allowed; }
/* many targets (9+ courtiers): compact grid that fits without scrolling */
.night-targets.many { gap: 9px; }
.night-targets.many .target-btn { width: 92px; padding: 7px; gap: 5px; }
.night-targets.many .target-btn img { width: 48px; height: 48px; }
.night-targets.many .target-btn span { font-size: 9px; }
.night-result { margin: 6px auto 10px; padding: 12px 18px; max-width: 560px; background: rgba(201,162,39,.08); border: 1px solid var(--panel-edge); border-radius: 6px; font-size: 18px; line-height: 1.45; animation: screenIn .5s; }
.night-result img { width: 110px; display: block; margin: 10px auto; filter: drop-shadow(0 10px 24px rgba(0,0,0,.75)); }
.night-result .res-role { font-family: var(--font-head); color: var(--gold-bright); letter-spacing: 2px; }

/* card swap flight animation */
.fly-card { position: fixed; width: 90px; aspect-ratio: 460/713; z-index: 80; pointer-events: none; background-image: url('../assets/ui/card-back.webp'); background-size: contain; background-repeat: no-repeat; filter: drop-shadow(0 10px 26px rgba(0,0,0,.8)) drop-shadow(0 0 20px rgba(201,162,39,.5)); transition: transform .9s cubic-bezier(.3,.6,.3,1), opacity .9s; }

/* ============ DISCUSSION ============ */
#screen-discussion { padding: 76px 0 110px; }
.council-head { text-align: center; }
.council-timer { position: absolute; top: 128px; right: 34px; padding: 12px 22px; text-align: center; display: flex; flex-direction: column; z-index: 3; }
.ct-label { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; color: var(--muted); }
.ct-time { font-family: var(--font-head); font-weight: 600; font-size: 34px; color: var(--gold-bright); text-shadow: 0 0 16px rgba(240,217,140,.4); }
.ct-time.urgent { color: #e06060; animation: pulse .8s infinite; }
.ct-sub { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; color: var(--muted); }
/* council / vote / results fill the window: content scales with the
   viewport and stays vertically centered on every resolution */
#screen-discussion, #screen-vote, #screen-results { justify-content: safe center; }
.council-table { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: min(1400px, 94vw); margin-top: 14px; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 7px; width: clamp(100px, 13.5vh, 168px); transition: transform .2s; }
.seat-portrait { width: clamp(84px, 11.5vh, 144px); height: clamp(84px, 11.5vh, 144px); border-radius: 50%; overflow: hidden; border: 3px solid var(--gold-dim); box-shadow: 0 6px 20px rgba(0,0,0,.7); position: relative; transition: transform .25s, box-shadow .25s; }
.seat-portrait img { width: 100%; height: 100%; object-fit: cover; }
.seat:hover .seat-portrait { transform: scale(1.08); box-shadow: 0 0 26px rgba(201,162,39,.45); }
.seat.you .seat-portrait { border-color: var(--gold-bright); box-shadow: 0 0 22px rgba(240,217,140,.5); }
.seat.speaking .seat-portrait { border-color: #7ec8f5; box-shadow: 0 0 22px rgba(126,200,245,.6); }
.seat-name { font-family: var(--font-head); font-size: clamp(11px, 1.5vh, 14px); letter-spacing: 1px; color: var(--bone); }
.seat-tag { font-family: var(--font-head); font-size: clamp(8px, 1vh, 10px); letter-spacing: 2px; color: var(--muted); }
.seat.you .seat-tag { color: var(--gold); }
.council-vote-btn { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 3; }
.council-vote-btn:hover:not(:disabled) { transform: translateX(-50%) translateY(-2px); }

/* council arena (round table) */
.council-arena { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.4vh, 16px); margin-top: 6px; }
.council-row { display: flex; gap: clamp(16px, 2.6vh, 34px); justify-content: center; align-items: flex-end; }
.council-row.top { margin-bottom: -6px; }
.council-row.bottom { margin-top: -6px; }
.council-center { display: flex; gap: clamp(12px, 2vh, 22px); align-items: center; padding: 6px 18px; }
.council-center .cc-seal { width: clamp(76px, 12vh, 140px); aspect-ratio: 460/713; filter: drop-shadow(0 8px 20px rgba(0,0,0,.65)); }
.council-center .cc-seal img { width: 100%; height: 100%; object-fit: contain; }
.council-center .cc-label { font-family: var(--font-head); font-size: 8px; letter-spacing: 3px; color: var(--muted); writing-mode: vertical-rl; }

/* floating messenger chat */
#chat-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 70;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(180deg, #3a0d12, #20070a);
  border: 1px solid var(--gold-dim); color: var(--gold-bright); font-size: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.7), 0 0 20px rgba(201,162,39,.25);
  transition: all .25s;
}
#chat-fab:hover { transform: scale(1.1); box-shadow: 0 10px 30px rgba(0,0,0,.7), 0 0 30px rgba(201,162,39,.5); }
.fab-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px;
  background: var(--blood); color: #fff; font-size: 11px; font-family: var(--font-head);
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
  box-shadow: 0 0 12px rgba(163,22,33,.9); animation: pulse 1.4s infinite;
}
.council-chat {
  position: fixed; right: 26px; bottom: 100px; z-index: 70;
  width: 370px; height: min(470px, 56vh);
  display: flex; flex-direction: column; padding: 14px 16px;
  transform-origin: bottom right; transition: transform .28s cubic-bezier(.2,.8,.3,1), opacity .28s;
  box-shadow: 0 24px 70px rgba(0,0,0,.8), 0 0 30px rgba(201,162,39,.12);
}
.council-chat.collapsed { transform: scale(.5) translateY(90px); opacity: 0; pointer-events: none; }
.cc-tabs { border-bottom: 1px solid rgba(201,162,39,.25); padding-bottom: 8px; margin-bottom: 10px; display: flex; gap: 14px; align-items: center; }
.cc-tabs .cc-collapse { margin-left: auto; }
.cc-collapse { background: none; border: 1px solid var(--panel-edge); color: var(--muted); width: 26px; height: 22px; border-radius: 3px; font-size: 13px; line-height: 1; transition: all .2s; }
.cc-collapse:hover { color: var(--gold-bright); border-color: var(--gold); }
.cc-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding-right: 6px; }
.chat-msg { display: flex; gap: 9px; animation: msgIn .35s ease-out; font-size: 15.5px; line-height: 1.35; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.chat-msg .cm-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gold-dim); flex-shrink: 0; }
.chat-msg .cm-name { font-family: var(--font-head); font-size: 10px; letter-spacing: 1px; color: var(--gold); display: block; }
.chat-msg .cm-text { color: var(--bone); }
.chat-msg.mine .cm-name { color: #7ec8f5; }
.chat-msg.system { justify-content: center; font-style: italic; color: var(--muted); font-size: 14px; text-align: center; }
.cc-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; border-top: 1px solid rgba(201,162,39,.15); }
.quick-chip { font-family: var(--font-head); font-size: 9.5px; letter-spacing: 1px; background: rgba(201,162,39,.1); border: 1px solid var(--panel-edge); color: var(--bone); padding: 5px 10px; border-radius: 20px; transition: all .15s; }
.quick-chip:hover { background: rgba(201,162,39,.3); color: var(--gold-bright); }
.cc-input-row { display: flex; gap: 8px; }
.cc-input-row input { flex: 1; background: rgba(5,7,11,.8); border: 1px solid var(--panel-edge); color: var(--bone); font-family: var(--font-body); font-size: 16px; padding: 9px 12px; border-radius: 3px; outline: none; }
.cc-input-row input:focus { border-color: var(--gold); }

/* ============ VOTE ============ */
#screen-vote { padding: 76px 0 40px; }
.vote-timer { top: 132px; }
.vote-grid { display: flex; flex-wrap: wrap; gap: clamp(12px, 2vh, 22px); justify-content: center; max-width: min(1400px, 94vw); margin-top: 22px; }
.vote-card { width: clamp(124px, 17vh, 196px); display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 10px; padding: clamp(10px, 1.6vh, 16px) 10px; transition: all .22s; }
.vote-card img { width: clamp(80px, 11.5vh, 136px); height: clamp(80px, 11.5vh, 136px); border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-dim); }
.vote-card .vc-name { font-family: var(--font-head); font-size: clamp(11px, 1.5vh, 14px); letter-spacing: 1px; color: var(--bone); }
.vote-card .vc-votes { font-family: var(--font-head); font-size: 10px; color: var(--muted); min-height: 14px; }
.vote-card:not(.self):hover { border-color: var(--gold); transform: translateY(-5px); }
.vote-card.selected { border-color: var(--blood); box-shadow: 0 0 28px rgba(163,22,33,.65); background: rgba(163,22,33,.14); }
.vote-card.self { opacity: .55; }
.vote-card.ineligible { opacity: .35; filter: grayscale(.8); pointer-events: none; }
.vote-card .vc-btn { font-family: var(--font-head); font-size: 10px; letter-spacing: 2px; background: linear-gradient(180deg,#3a0d12,#20070a); color: var(--gold-bright); border: 1px solid var(--gold-dim); padding: 6px 16px; border-radius: 3px; }
.vote-card.selected .vc-btn { background: var(--blood); color: #fff; }
#btn-seal-vote { margin-top: 24px; }
.vote-note { margin-top: 12px; font-family: var(--font-head); font-size: 10px; letter-spacing: 3px; color: var(--muted); }

/* ============ JUDGMENT ============ */
.judgment-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.judgment-stage { display: flex; gap: 26px; margin-top: 20px; min-height: 300px; align-items: center; }
.judged-card { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: judgedIn .8s cubic-bezier(.2,.8,.3,1); }
@keyframes judgedIn { from { opacity: 0; transform: translateY(-60px) scale(1.3); filter: brightness(3); } }
.judged-card img { width: 190px; filter: drop-shadow(0 0 44px rgba(163,22,33,.55)) drop-shadow(0 16px 34px rgba(0,0,0,.8)); }
.judged-card .jc-name { font-family: var(--font-head); font-size: 18px; letter-spacing: 2px; color: #e8b0b0; }
.judged-card .jc-role { font-family: var(--font-head); font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.judged-none { font-family: var(--font-body); font-style: italic; font-size: 26px; color: var(--muted); animation: screenIn 1s; }

/* ============ RESULTS ============ */
#screen-results { padding: 70px 0 30px; }
.results-banner { text-align: center; margin-top: 4px; animation: bannerIn 1s cubic-bezier(.2,.8,.3,1); }
@keyframes bannerIn { from { opacity: 0; transform: scale(1.25); filter: brightness(2.5); } }
#results-title { font-family: var(--font-head); font-weight: 600; font-size: clamp(30px, 4vw, 50px); letter-spacing: 7px; text-shadow: 0 0 40px rgba(201,162,39,.5), 0 4px 16px #000; }
#results-title.shadow-win { color: #b79bf5; text-shadow: 0 0 40px rgba(107,79,216,.7), 0 4px 16px #000; }
#results-title.fool-win { color: #6fd3a1; text-shadow: 0 0 40px rgba(63,158,110,.7), 0 4px 16px #000; }
#results-subtitle { font-family: var(--font-head); font-size: 12px; letter-spacing: 5px; color: var(--gold); margin-top: 6px; }
.results-cards { display: flex; flex-wrap: wrap; gap: clamp(10px, 1.8vh, 18px); justify-content: center; margin-top: 20px; max-width: min(1400px, 94vw); }
.result-card { width: clamp(100px, 14vh, 164px); text-align: center; animation: screenIn .6s backwards; }
.result-card img { width: 100%; filter: drop-shadow(0 10px 22px rgba(0,0,0,.75)); transition: transform .3s, filter .3s; }
.result-card.condemned img { filter: grayscale(.5) brightness(.7) drop-shadow(0 0 20px rgba(163,22,33,.55)); }
.result-card:hover img { transform: translateY(-6px) scale(1.06); }
.result-card .rc-name { font-family: var(--font-head); font-size: 10.5px; letter-spacing: 1px; margin-top: 6px; color: var(--bone); text-shadow: 0 2px 6px #000; }
.result-card .rc-badge { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; margin-top: 3px; }
.rc-badge.winner { color: var(--gold-bright); }
.rc-badge.loser { color: var(--muted); }
.rc-badge.condemned { color: #e06060; }
.rc-badge.was { color: var(--muted); font-size: 8px; letter-spacing: 1px; }
.result-card.lost img { filter: grayscale(.65) brightness(.62) drop-shadow(0 10px 22px rgba(0,0,0,.75)); }
.result-card.lost .rc-name { color: var(--muted); }
.match-summary { margin-top: 20px; padding: 14px 30px; display: flex; gap: 36px; flex-wrap: wrap; justify-content: center; }
.ms-item { text-align: center; }
.ms-item .ms-label { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; color: var(--muted); display: block; }
.ms-item .ms-value { font-family: var(--font-head); font-size: 18px; color: var(--gold-bright); }
.results-actions { display: flex; gap: 20px; margin-top: 20px; }

/* ============ MODAL ============ */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(3,4,6,.8); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; animation: screenIn .3s; }
.modal { width: min(760px, 92vw); max-height: 84vh; overflow-y: auto; padding: 34px 40px; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 20px; transition: color .2s; z-index: 2; }
.modal-close:hover { color: var(--gold-bright); }
.modal h2 { font-family: var(--font-head); letter-spacing: 3px; color: var(--gold-bright); font-size: 24px; margin-bottom: 16px; }
.modal h3 { font-family: var(--font-head); letter-spacing: 2px; color: var(--gold); font-size: 15px; margin: 18px 0 8px; }
.modal p, .modal li { font-size: 17.5px; line-height: 1.55; color: var(--bone); }
.modal ul { padding-left: 22px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(201,162,39,.12); gap: 14px; }
.lobby-panel .settings-row { padding: 9px 0; }
.settings-row label { font-family: var(--font-head); font-size: 13px; letter-spacing: 2px; }
.toggle { width: 52px; height: 26px; border-radius: 13px; background: rgba(154,145,126,.25); border: 1px solid var(--panel-edge); position: relative; transition: background .2s; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: all .2s; }
.toggle.on { background: rgba(201,162,39,.35); }
.toggle.on::after { left: 27px; background: var(--gold-bright); box-shadow: 0 0 10px rgba(240,217,140,.6); }
.set-select {
  background: #0a0d13; color: var(--bone); border: 1px solid var(--panel-edge);
  padding: 8px 12px; font-family: var(--font-head); font-size: 12px; border-radius: 3px; letter-spacing: 1px;
}
.set-range { -webkit-appearance: none; width: 170px; height: 4px; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 2px; outline: none; }
.set-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-bright), var(--gold-dim));
  border: 1px solid var(--gold-bright); cursor: pointer;
}

/* scrollbars */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(5,7,11,.5); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; }

/* shake for execution */
.shake { animation: shake .6s; }
@keyframes shake { 0%,100%{transform:translate(0)} 20%{transform:translate(-8px,4px)} 40%{transform:translate(7px,-5px)} 60%{transform:translate(-5px,-3px)} 80%{transform:translate(4px,3px)} }

/* reduced drift */
body.no-drift .screen.active { animation: screenIn .7s ease-out !important; }
body.no-drift .screen.active::after { animation: none !important; transform: scale(1.06); }
body.no-tutorials .reveal-hint, body.no-tutorials .panel-note, body.no-tutorials .lobby-code-hint { display: none; }

/* toast */
#toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 120;
  background: rgba(8,10,15,.95); border: 1px solid var(--gold-dim); color: var(--bone);
  font-family: var(--font-head); font-size: 12px; letter-spacing: 1.5px;
  padding: 12px 26px; border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.7), 0 0 20px rgba(201,162,39,.2);
  animation: toastIn .3s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } }

/* update banner */
#update-banner {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 130;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, rgba(20,16,8,.97), rgba(8,10,15,.97));
  border: 1px solid var(--gold); border-radius: 6px;
  padding: 12px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.8), 0 0 30px rgba(201,162,39,.35);
  font-family: var(--font-head); font-size: 12px; letter-spacing: 1.5px; color: var(--bone);
  animation: toastIn .35s ease-out; max-width: min(92vw, 640px);
}
#update-banner .ub-icon { color: var(--gold-bright); font-size: 18px; animation: pulse 2s infinite; }
#update-banner .btn-gold {
  background: linear-gradient(180deg, #d4af37, #8a6d1f); color: #0a0a0a; border: none;
  font-family: var(--font-head); font-size: 11px; letter-spacing: 1.5px; font-weight: 700;
  padding: 9px 16px; border-radius: 4px; cursor: pointer; white-space: nowrap;
}
#update-banner .btn-gold:hover { filter: brightness(1.15); }
#update-banner .ub-later {
  background: none; border: none; color: var(--bone-dim, #8a8578); cursor: pointer; font-size: 13px; padding: 4px;
}
#update-banner .ub-later:hover { color: var(--bone); }

/* bell + account */
.tb-bell { position: relative; font-size: 14px; }
.bell-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--blood); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; box-shadow: 0 0 10px rgba(163,22,33,.8); animation: pulse 1.6s infinite;
}
.tb-account { border-color: var(--gold-dim); color: var(--gold-bright); }
.active-tab { border-color: var(--gold) !important; color: var(--gold-bright) !important; background: rgba(201,162,39,.12) !important; }

/* friends & notifications */
.friend-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid rgba(201,162,39,.12); }
.fr-dot { width: 9px; height: 9px; border-radius: 50%; background: #555; flex-shrink: 0; }
.fr-dot.on { background: #3fae6a; box-shadow: 0 0 8px #3fae6a; }
.fr-name { font-family: var(--font-head); font-size: 13px; letter-spacing: 1px; flex: 1; }
.fr-status { font-family: var(--font-head); font-size: 9px; letter-spacing: 1.5px; color: var(--muted); }
.fr-actions .btn-ghost { padding: 5px 10px; font-size: 10px; margin-left: 4px; }
.notif-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid rgba(201,162,39,.12); }
.notif-row.read { opacity: .55; }
.nt-icon { color: var(--gold); font-size: 16px; }
.nt-text { flex: 1; font-size: 16px; }
.nt-join { padding: 6px 16px; font-size: 11px; }
.nt-time { font-size: 12px; color: var(--muted); }

/* ============ LOBBY ============ */
#screen-lobby { justify-content: flex-start; padding-top: 104px; }
.lobby-head { display: flex; align-items: center; gap: 34px; flex-wrap: wrap; justify-content: center; }
.lobby-code-panel { display: flex; align-items: center; gap: 16px; padding: 8px 24px; }
.lobby-code { font-family: var(--font-head); font-size: 26px; letter-spacing: 7px; color: var(--gold-bright); text-shadow: 0 0 18px rgba(240,217,140,.4); }
.lobby-wrap { display: flex; gap: 20px; margin-top: 14px; width: min(1240px, 96vw); flex: 1; min-height: 0; align-items: stretch; }
.lobby-seats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: start; overflow-y: auto; padding-right: 4px; }
.lobby-seat { position: relative; min-height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(8,10,15,.9); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 12px; transition: all .25s; }
.lobby-seat.filled { border-color: var(--gold-dim); box-shadow: 0 8px 26px rgba(0,0,0,.55), inset 0 0 30px rgba(201,162,39,.05); }
.lobby-seat.is-host { border-color: var(--gold); box-shadow: 0 0 22px rgba(201,162,39,.3); }
.lobby-seat.is-you { background: rgba(201,162,39,.08); }
.lobby-seat.empty { border-style: dashed; opacity: .75; }
.lobby-seat.empty:hover { opacity: 1; border-color: var(--gold); }
.ls-num { position: absolute; top: 8px; left: 12px; font-family: var(--font-head); font-size: 11px; color: var(--gold-dim); }
.ls-plus { font-size: 26px; color: var(--gold-dim); }
.ls-name { font-family: var(--font-head); font-size: 14px; letter-spacing: 1.5px; color: var(--bone); }
.lobby-seat.empty .ls-name { font-size: 10px; color: var(--muted); letter-spacing: 2px; }
.ls-sub { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; color: var(--gold); }
.ls-you { position: absolute; top: 8px; right: 10px; font-family: var(--font-head); font-size: 9px; letter-spacing: 1px; color: #7ec8f5; }
.ls-invite { font-size: 10px; padding: 6px 14px; margin-top: 4px; }
.lobby-right { flex: 0 0 370px; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.lobby-panel { padding: 14px 18px; }
.lobby-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; position: sticky; bottom: 0; padding-top: 4px; background: linear-gradient(180deg, transparent, rgba(5,6,10,.85) 30%); }
.deck-list { max-height: 148px; overflow-y: auto; }
.deck-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 4px; border-bottom: 1px solid rgba(201,162,39,.08); opacity: .45; }
.deck-row.has { opacity: 1; }
.dr-name { font-size: 15.5px; }
.dr-ctrl { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); }
.dr-btn, .step-btn { width: 26px; height: 26px; background: rgba(201,162,39,.1); border: 1px solid var(--panel-edge); color: var(--gold-bright); border-radius: 3px; font-size: 15px; }
.dr-btn:hover:not(:disabled), .step-btn:hover:not(:disabled) { background: rgba(201,162,39,.3); }
.dr-btn:disabled, .step-btn:disabled { opacity: .3; cursor: not-allowed; }
.stepper { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); color: var(--gold-bright); }
.lobby-chat { width: min(1240px, 96vw); margin-top: 12px; padding: 10px 16px 12px; display: flex; flex-direction: column; flex-shrink: 0; }
.lobby-chat .cc-log { flex: none; height: 128px; overflow-y: auto; }
.lobby-chat .cc-tabs { margin-bottom: 6px; padding-bottom: 6px; }

/* ============ PROFILE PAGE ============ */
#screen-profile { justify-content: center; }
.profile-wrap { width: min(1060px, 94vw); height: min(690px, calc(100vh - 190px)); display: flex; flex-direction: column; padding: 26px 32px; }
.pf-header { display: flex; gap: 22px; align-items: center; }
.pf-portrait { width: 108px; height: 108px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold-dim); box-shadow: 0 0 26px rgba(201,162,39,.3); flex-shrink: 0; }
.pf-portrait img { width: 100%; height: 100%; object-fit: cover; }
.pf-id { flex: 1; min-width: 0; }
.pf-name-row { display: flex; align-items: center; gap: 12px; }
.pf-name-row h2 { font-family: var(--font-head); font-size: 30px; letter-spacing: 3px; color: var(--bone); }
.pf-you { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; color: #7ec8f5; border: 1px solid rgba(126,200,245,.5); padding: 3px 8px; border-radius: 3px; }
.pf-title { font-family: var(--font-head); font-size: 12px; letter-spacing: 3px; color: var(--gold); margin-top: 4px; }
.pf-motto { font-style: italic; color: var(--muted); font-size: 17px; margin-top: 4px; }
.pf-chips { display: flex; gap: 10px; margin-top: 10px; }
.pf-chip { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; color: var(--muted); border: 1px solid var(--panel-edge); padding: 4px 10px; border-radius: 3px; }
.pf-chip.online { color: #5fc98a; border-color: rgba(95,201,138,.4); }
.pf-actions { display: flex; flex-direction: column; gap: 10px; }
.pf-tabs { display: flex; gap: 6px; margin-top: 20px; border-bottom: 1px solid rgba(201,162,39,.25); }
.pf-tab { font-family: var(--font-head); font-size: 12px; letter-spacing: 2.5px; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 18px; transition: all .2s; }
.pf-tab:hover { color: var(--bone); }
.pf-tab.active { color: var(--gold-bright); border-bottom-color: var(--gold); }
.pf-content { flex: 1; overflow-y: auto; padding-top: 18px; min-height: 0; }
.pf-stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pf-stat-card { background: rgba(201,162,39,.06); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 16px; text-align: center; }
.pf-stat-card .psc-val { font-family: var(--font-head); font-size: 30px; color: var(--gold-bright); }
.pf-stat-card .psc-label { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; color: var(--muted); margin-top: 4px; }
.pf-rows { margin-top: 18px; }
.pf-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 4px; border-bottom: 1px solid rgba(201,162,39,.1); }
.pf-row .pfr-label { font-family: var(--font-head); font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.pf-row .pfr-val { font-family: var(--font-head); font-size: 14px; color: var(--bone); display: flex; align-items: center; gap: 8px; }
.pf-row .pfr-val img { width: 26px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.pf-rolebars { margin-top: 8px; }
.pf-rolebar { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.pf-rolebar img { width: 34px; filter: drop-shadow(0 3px 8px rgba(0,0,0,.6)); }
.pf-rolebar .prb-name { width: 150px; font-family: var(--font-head); font-size: 11px; letter-spacing: 1px; }
.pf-rolebar .prb-bar { flex: 1; height: 8px; background: rgba(154,145,126,.15); border-radius: 4px; overflow: hidden; }
.pf-rolebar .prb-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright)); border-radius: 4px; }
.pf-rolebar .prb-val { width: 110px; text-align: right; font-family: var(--font-head); font-size: 11px; color: var(--muted); }
.pf-ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pf-ach { display: flex; gap: 14px; align-items: center; background: rgba(201,162,39,.05); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 13px 16px; }
.pf-ach.locked { opacity: .45; filter: grayscale(.7); }
.pf-ach .pa-icon { font-size: 24px; color: var(--gold); width: 34px; text-align: center; }
.pf-ach .pa-name { font-family: var(--font-head); font-size: 12px; letter-spacing: 1.5px; color: var(--gold-bright); }
.pf-ach .pa-desc { font-size: 14.5px; color: var(--muted); }
.pf-ach .pa-date { font-family: var(--font-head); font-size: 9px; letter-spacing: 1px; color: #5fc98a; margin-top: 2px; }
.pf-hist-row { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px solid rgba(201,162,39,.1); }
.pf-hist-row .ph-roles { display: flex; align-items: center; gap: 6px; width: 210px; }
.pf-hist-row .ph-roles img { width: 34px; filter: drop-shadow(0 3px 8px rgba(0,0,0,.6)); }
.pf-hist-row .ph-arrow { color: var(--gold-dim); font-size: 14px; }
.pf-hist-row .ph-meta { flex: 1; font-family: var(--font-head); font-size: 10px; letter-spacing: 1.5px; color: var(--muted); line-height: 1.8; }
.pf-badge { font-family: var(--font-head); font-size: 9px; letter-spacing: 2px; padding: 4px 10px; border-radius: 3px; }
.pf-badge.win { color: var(--gold-bright); border: 1px solid var(--gold-dim); }
.pf-badge.lose { color: #d95f5f; border: 1px solid rgba(217,95,95,.4); }
.pf-badge.condemned { color: #e06060; border: 1px solid rgba(163,22,33,.6); margin-left: 6px; }
.pf-empty { color: var(--muted); font-style: italic; padding: 30px 0; text-align: center; }

/* edit profile modal */
.ep-portraits { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 12px 0 18px; }
.ep-port { border-radius: 50%; overflow: hidden; border: 2px solid var(--panel-edge); cursor: pointer; transition: all .2s; aspect-ratio: 1; }
.ep-port img { width: 100%; height: 100%; object-fit: cover; }
.ep-port:hover { border-color: var(--gold); transform: scale(1.06); }
.ep-port.selected { border-color: var(--gold-bright); box-shadow: 0 0 16px rgba(240,217,140,.5); }
.ep-row { margin-bottom: 14px; }
.ep-row label { display: block; margin-bottom: 6px; }
.ep-row textarea { width: 100%; resize: none; height: 64px; }
.ep-btns { display: flex; gap: 12px; margin-top: 18px; }
.ep-btns button { flex: 1; }

/* ============ SETTINGS PAGE ============ */
#screen-settings { justify-content: center; }
.settings-wrap { width: min(1020px, 94vw); height: min(640px, calc(100vh - 190px)); display: flex; overflow: hidden; }
.set-side { flex: 0 0 210px; border-right: 1px solid rgba(201,162,39,.2); padding: 24px 16px; display: flex; flex-direction: column; gap: 6px; }
.set-side-title { font-family: var(--font-head); font-size: 16px; letter-spacing: 4px; color: var(--gold-bright); margin-bottom: 14px; padding-left: 10px; }
.set-tab { font-family: var(--font-head); font-size: 12px; letter-spacing: 2.5px; text-align: left; color: var(--muted); background: none; border: none; border-left: 3px solid transparent; padding: 12px 14px; transition: all .2s; }
.set-tab:hover { color: var(--bone); }
.set-tab.active { color: var(--gold-bright); border-left-color: var(--gold); background: rgba(201,162,39,.08); }
.set-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.set-content { flex: 1; overflow-y: auto; padding: 26px 32px; }
.set-content h3 { font-family: var(--font-head); font-size: 15px; letter-spacing: 3px; color: var(--gold); margin: 4px 0 8px; }
.set-footer { display: flex; gap: 12px; padding: 16px 32px; border-top: 1px solid rgba(201,162,39,.2); }
.set-note { color: var(--muted); font-size: 14.5px; font-style: italic; margin-top: 12px; }
.set-account-box { display: flex; align-items: center; gap: 18px; background: rgba(201,162,39,.05); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 18px; margin-top: 8px; }
.set-account-box img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-dim); }
.set-account-box .sa-name { font-family: var(--font-head); font-size: 18px; letter-spacing: 2px; }
.set-account-box .sa-sub { font-family: var(--font-head); font-size: 10px; letter-spacing: 2px; color: var(--muted); margin-top: 4px; }

/* ============ HOW TO PLAY PAGE ============ */
#screen-howto { justify-content: center; }
.howto-wrap { display: flex; gap: 20px; width: min(1260px, 96vw); height: min(700px, calc(100vh - 180px)); }
.howto-main { flex: 1; padding: 22px 30px; overflow-y: auto; }
.howto-intro { font-size: 17px; line-height: 1.5; color: var(--bone); margin-bottom: 14px; }
.howto-phases { display: flex; flex-direction: column; gap: 8px; }
.howto-phase { display: flex; gap: 14px; align-items: center; background: rgba(201,162,39,.05); border: 1px solid rgba(201,162,39,.15); border-radius: 8px; padding: 9px 14px; }
.howto-phase .hp-num { font-family: var(--font-head); font-weight: 600; font-size: 22px; color: var(--gold-dim); width: 38px; }
.howto-phase .hp-name { font-family: var(--font-head); font-size: 13px; letter-spacing: 2.5px; color: var(--gold-bright); width: 140px; flex-shrink: 0; }
.howto-phase .hp-desc { font-size: 14.5px; color: var(--muted); line-height: 1.35; }
.howto-h3 { font-family: var(--font-head); font-size: 13px; letter-spacing: 3px; color: var(--gold); margin: 14px 0 8px; }
.howto-wins { padding-left: 22px; }
.howto-wins li { font-size: 15.5px; line-height: 1.5; }
.howto-remember { margin-top: 12px; font-style: italic; color: var(--muted); font-size: 14.5px; }
.howto-side { flex: 0 0 350px; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.howto-panel { padding: 13px 18px; }
.howto-panel .panel-title { margin-bottom: 8px; padding-bottom: 7px; }
.howto-order { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.howto-order .ho-step { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.howto-order .ho-num { font-family: var(--font-head); font-size: 9.5px; color: var(--gold-dim); width: 20px; }
.howto-order .ho-role { font-family: var(--font-head); font-size: 10.5px; letter-spacing: 1px; color: var(--bone); }
.howto-seals { display: flex; gap: 10px; justify-content: center; }
.howto-seals img { width: 58px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.7)); }
.howto-note { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 8px; text-align: center; }
.howto-sizes { display: flex; flex-wrap: wrap; gap: 5px; }
.howto-sizes .hs-chip { font-family: var(--font-head); font-size: 9.5px; letter-spacing: 1px; color: var(--bone); background: rgba(201,162,39,.1); border: 1px solid var(--panel-edge); padding: 4px 9px; border-radius: 20px; }
.howto-btns { display: flex; flex-direction: column; gap: 8px; }
.howto-btns .btn-primary { width: 100%; }
.howto-btns .back-btn { width: 100%; text-align: center; }

/* ============ ROLES / CODEX PAGE ============ */
#screen-roles { justify-content: center; }
.roles-wrap { display: flex; gap: 20px; width: min(1300px, 96vw); height: min(700px, calc(100vh - 180px)); }
.roles-main { flex: 1; padding: 20px 24px; display: flex; flex-direction: column; min-width: 0; }
.roles-filter { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.rf-tab { font-family: var(--font-head); font-size: 11px; letter-spacing: 2px; color: var(--muted); background: rgba(201,162,39,.06); border: 1px solid var(--panel-edge); padding: 8px 16px; border-radius: 20px; transition: all .2s; }
.rf-tab:hover { color: var(--bone); border-color: var(--gold); }
.rf-tab.active { color: var(--gold-bright); border-color: var(--gold); background: rgba(201,162,39,.16); box-shadow: 0 0 14px rgba(201,162,39,.2); }
.roles-grid { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 1fr; gap: 12px; min-height: 0; }
.rg-card { background: none; border: none; padding: 0; position: relative; transition: transform .25s, filter .25s; filter: drop-shadow(0 8px 18px rgba(0,0,0,.65)); min-height: 0; }
.rg-card img { width: 100%; height: 100%; object-fit: contain; }
.rg-card:hover { transform: translateY(-6px) scale(1.05); filter: drop-shadow(0 14px 28px rgba(0,0,0,.75)) drop-shadow(0 0 18px rgba(201,162,39,.35)); z-index: 2; }
.rg-card.selected { filter: drop-shadow(0 14px 28px rgba(0,0,0,.75)) drop-shadow(0 0 22px rgba(240,217,140,.55)); transform: translateY(-4px); }
.roles-detail { flex: 0 0 320px; padding: 22px 24px; overflow-y: auto; text-align: center; }
.roles-detail .rd-card { width: 170px; margin: 0 auto 12px; filter: drop-shadow(0 14px 30px rgba(0,0,0,.8)); }
.roles-detail .rd-card img { width: 100%; }
.rd-align { font-family: var(--font-head); font-size: 10px; letter-spacing: 3px; }
.rd-name { font-family: var(--font-head); font-weight: 600; font-size: 22px; letter-spacing: 2px; color: var(--gold-bright); margin-top: 6px; }
.rd-tag { font-family: var(--font-head); font-size: 10px; letter-spacing: 3px; color: var(--gold); margin-top: 2px; }
.rd-desc { font-size: 15.5px; color: var(--bone); line-height: 1.5; margin-top: 12px; text-align: left; }
.rd-goal { font-size: 14px; font-style: italic; color: var(--muted); margin-top: 10px; text-align: left; }
.rd-meta { margin-top: 14px; text-align: left; border-top: 1px solid rgba(201,162,39,.2); padding-top: 12px; }
.rd-meta .rdm-row { display: flex; justify-content: space-between; font-family: var(--font-head); font-size: 10.5px; letter-spacing: 1.5px; color: var(--muted); padding: 5px 0; }
.rd-meta .rdm-row b { color: var(--bone); }
.rd-play { width: 100%; margin-top: 16px; }

/* ken-burns drift on screen backgrounds — GPU-accelerated transform on a
   dedicated layer (animating background-position causes visible repaint jank) */
.screen::after {
  content: ''; position: absolute; inset: -5%; z-index: 0;
  background-image: inherit; background-size: cover; background-position: center;
  transform: scale(1.06);
}
.screen.active::after { animation: bgDrift 60s ease-in-out infinite alternate; will-change: transform; }
@keyframes bgDrift {
  from { transform: scale(1.06) translate(-1.1%, -0.7%); }
  to   { transform: scale(1.06) translate(1.1%, 0.7%); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1400px) {
  .mode-grid-4 .mode-card { width: 240px; }
  .home-logo { width: min(300px, 24vw); }
}
@media (max-width: 1180px) {
  .home-cards { display: none; }
  .roles-grid { grid-template-columns: repeat(4, 1fr); }
  .roles-detail { flex-basis: 280px; }
  .tb-btn span { display: none; }
  .tb-btn { font-size: 14px; padding: 7px 10px; }
  .tb-logo { height: 56px; }
}
@media (max-width: 900px) {
  #screen-home { flex-direction: column; justify-content: center; gap: 18px; padding-top: 100px; }
  .home-left { flex-direction: column; gap: 16px; }
  .home-menu { flex-direction: row; flex-wrap: wrap; width: auto; justify-content: center; }
  .menu-btn { padding: 10px 14px; font-size: 12px; }
  .mode-grid { flex-direction: column; gap: 14px; margin-top: 20px; }
  .mode-grid-4 .mode-card { width: min(340px, 88vw); }
  .mode-grid-4 .mode-card p { min-height: 0; }
  .setup-wrap { flex-direction: column; }
  .reveal-wrap { flex-direction: column; gap: 18px; }
  .reveal-info { max-width: 92vw; }
  .howto-wrap, .roles-wrap { flex-direction: column; height: calc(100vh - 170px); }
  .howto-side, .roles-detail { flex: none; width: 100%; }
  .settings-wrap { flex-direction: column; height: calc(100vh - 170px); }
  .set-side { flex: none; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid rgba(201,162,39,.2); padding: 12px; }
  .set-side-title { display: none; }
  .profile-wrap { height: calc(100vh - 170px); padding: 18px; }
  .pf-stat-cards { grid-template-columns: repeat(2, 1fr); }
  .pf-ach-grid { grid-template-columns: 1fr; }
  .lobby-wrap { flex-direction: column; overflow-y: auto; }
  .lobby-right { flex: none; width: 100%; }
  .lobby-seats { grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .council-chat { width: min(370px, 92vw); }
  .council-timer { right: 14px; }
}
@media (max-height: 840px) {
  .screen { padding-top: 96px; }
  #screen-night { padding-top: 120px; }
  #screen-discussion { padding: 60px 0 100px; }
  #screen-vote { padding: 60px 0 30px; }
  #screen-results { padding: 56px 0 24px; }
  .screen-title { font-size: clamp(22px, 3vw, 36px); }
  .seal-card { width: clamp(120px, 12vw, 160px); }
  .center-seals { margin-top: 18px; gap: 26px; }
  .night-narrator { margin-top: 8px; padding: 10px 22px; }
  #narrator-text { font-size: 18px; }
  .night-action { margin-top: 14px; padding: 16px 22px; }
  .home-tagline { font-size: clamp(30px, 4vw, 52px); }
  .home-logo { width: min(240px, 20vw); }
  .home-menu { gap: 7px; }
  .menu-btn { padding: 10px 16px; font-size: 12.5px; }
  .judged-card img { width: 150px; }
  .judgment-stage { min-height: 220px; }
  .match-summary { margin-top: 12px; padding: 10px 22px; gap: 26px; }
  .results-cards { margin-top: 12px; }
  .results-actions { margin-top: 12px; }
  .mode-card p { min-height: 60px; }
  .council-timer { top: 104px; padding: 8px 16px; }
  .ct-time { font-size: 26px; }
  .flip-card { width: clamp(200px, 20vw, 280px); }
  .lobby-seat { min-height: 88px; }
  .profile-wrap, .settings-wrap { height: calc(100vh - 160px); }
  .howto-wrap, .roles-wrap { height: calc(100vh - 160px); }
  .howto-seals img { width: 48px; }
  .howto-side { gap: 10px; }
  .howto-phase { padding: 7px 12px; }
  .howto-phase .hp-num { font-size: 19px; }
  .howto-wins li { font-size: 14.5px; line-height: 1.4; }
  .deck-list { max-height: 110px; }
}
@media (max-height: 700px) {
  .seat-name { font-size: 10.5px; }
  .seal-card { width: 110px; }
  .home-cards { display: none; }
  .results-cards { max-width: 1000px; }
  .result-card .rc-name { font-size: 9px; }
  .council-chat { height: min(400px, 60vh); }
}

/* ============ PRELOADER ============ */
#preloader {
  position: fixed; inset: 0; z-index: 200; background: #07080c;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity .8s ease;
}
#preloader.done { opacity: 0; pointer-events: none; }
.pre-skull { width: 190px; filter: drop-shadow(0 0 44px rgba(201,162,39,.3)); animation: preFloat 3s ease-in-out infinite; }
@keyframes preFloat { 50% { transform: translateY(-10px); } }
.pre-title { font-family: var(--font-head); font-weight: 600; font-size: 26px; letter-spacing: 8px; color: var(--gold-bright); text-shadow: 0 0 24px rgba(240,217,140,.4); }
.pre-sub { font-family: var(--font-head); font-size: 10px; letter-spacing: 5px; color: var(--muted); }
.pre-bar { width: 300px; height: 3px; background: rgba(201,162,39,.15); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.pre-fill { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright)); border-radius: 2px; animation: preLoad 1.4s ease-in-out infinite; }
@keyframes preLoad { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ============ SPLASH (before a game begins) ============ */
#splash {
  position: fixed; inset: 0; z-index: 150; background: radial-gradient(ellipse at center, #0d0f16 0%, #05060a 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  opacity: 0; transition: opacity .55s ease;
}
#splash.show { opacity: 1; }
#splash { pointer-events: none; }
#splash.show { pointer-events: auto; }
.sp-skull { width: 240px; filter: drop-shadow(0 0 60px rgba(201,162,39,.35)); animation: spEnter 2.2s ease; }
@keyframes spEnter { 0% { transform: scale(.6); opacity: 0; } 30% { transform: scale(1.06); opacity: 1; } 45% { transform: scale(1); } 100% { transform: scale(1); } }
.sp-title { font-family: var(--font-head); font-weight: 600; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: 10px; color: var(--gold-bright); text-shadow: 0 0 34px rgba(240,217,140,.5); animation: spText 2.2s ease; }
.sp-sub { font-family: var(--font-head); font-size: 11px; letter-spacing: 6px; color: var(--muted); animation: spText 2.2s ease; }
@keyframes spText { 0%, 25% { opacity: 0; transform: translateY(12px); } 55%, 100% { opacity: 1; transform: translateY(0); } }
.sp-bar { width: 340px; }

/* ============ LEFT / LOST-CONNECTION BADGES ============ */
.seat.is-left .seat-portrait { filter: grayscale(.9) brightness(.55); border-color: #5a4a3a; }
.seat-left-badge, .seat-conn-badge {
  position: absolute; inset: auto 0 0; left: 0; right: 0; bottom: 0;
  font-family: var(--font-head); font-size: 8px; letter-spacing: 1.5px; text-align: center;
  padding: 3px 0; color: #ffd9d9; background: rgba(92,14,20,.92);
}
.seat-conn-badge { background: rgba(40,40,46,.92); color: #cfcfcf; }
.vote-card.is-left { opacity: .55; filter: grayscale(.7); }
.vc-left { font-family: var(--font-head); font-size: 8px; letter-spacing: 1px; color: #e8b0b0; }
.rc-badge.left { background: rgba(92,14,20,.85); color: #ffd9d9; border-color: rgba(163,22,33,.6); }

/* ============ AVATARS IN TOPBAR & LOBBY ============ */
.tb-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gold-dim); vertical-align: -6px; margin-right: 2px; }
.ls-avatar img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-dim); box-shadow: 0 4px 14px rgba(0,0,0,.6); background: #0a0d13; }
.lobby-seat.is-host .ls-avatar img { border-color: var(--gold-bright); box-shadow: 0 0 16px rgba(240,217,140,.4); }

/* ============ AUTH LINKS ============ */
.auth-link { color: var(--gold); cursor: pointer; text-align: center; margin-top: 12px; font-size: 15px; font-style: italic; transition: color .2s; }
.auth-link:hover { color: var(--gold-bright); text-decoration: underline; }
.auth-tab.active-tab { border-color: var(--gold); color: var(--gold-bright); background: rgba(201,162,39,.12); }

/* ============ DESKTOP QUIT ============ */
.tb-quit { border-color: rgba(163,22,33,.55); color: #e8b0b0; }
.tb-quit:hover { border-color: var(--blood); color: #fff; box-shadow: 0 0 12px rgba(163,22,33,.5); }

/* ============ WIDE MODAL (profile) ============ */
.modal.wide { width: min(980px, 94vw); }
.modal .profile-wrap { width: 100%; height: auto; padding: 0; background: none; border: none; box-shadow: none; }
.modal .pf-content { max-height: 46vh; overflow-y: auto; padding-right: 6px; }

/* ============ FRIENDS LETTERS (inside the one unified chat) ============ */
.fc-back {
  background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 2px 6px;
}
.fc-back:hover { color: var(--gold-bright); }

.fc-list, .fc-list-embed { flex: 1; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.fc-friend {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px;
  border-radius: 6px; cursor: pointer; transition: background .15s;
}
.fc-friend:hover { background: rgba(201,162,39,.08); }
.fc-ava { position: relative; flex: 0 0 auto; }
.fc-ava img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--panel-edge); display: block; }
.fc-dot {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: #5a5a5a; border: 2px solid #10121a;
}
.fc-dot.on { background: #58c777; box-shadow: 0 0 8px rgba(88,199,119,.8); }
.fc-meta { flex: 1; min-width: 0; }
.fc-name { font-family: var(--font-head); font-size: 12.5px; letter-spacing: 1px; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-status { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fc-unread {
  min-width: 19px; height: 19px; border-radius: 10px; background: var(--blood); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.fc-empty { color: var(--muted); font-style: italic; text-align: center; padding: 26px 12px; font-size: 13.5px; line-height: 1.6; }

.fc-convo, .fc-convo-embed { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.fc-messages { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 7px; scrollbar-width: thin; }
.fc-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.fc-msg.mine { align-self: flex-end; align-items: flex-end; }
.fc-bubble {
  padding: 7px 11px; border-radius: 12px; font-size: 13.5px; line-height: 1.4;
  background: rgba(201,162,39,.1); border: 1px solid rgba(201,162,39,.18); color: var(--bone);
  border-bottom-left-radius: 3px; word-break: break-word;
}
.fc-msg.mine .fc-bubble {
  background: rgba(163,22,33,.16); border-color: rgba(163,22,33,.3);
  border-bottom-left-radius: 12px; border-bottom-right-radius: 3px;
}
.fc-time { font-size: 9.5px; color: var(--muted); margin-top: 2px; letter-spacing: .5px; }
.fc-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--panel-edge); flex: 0 0 auto; }
.fc-input-row input {
  flex: 1; background: rgba(0,0,0,.35); border: 1px solid var(--panel-edge); border-radius: 6px;
  color: var(--bone); padding: 8px 10px; font-size: 13px; outline: none;
}
.fc-input-row input:focus { border-color: var(--gold-dim); }

/* council chat tabs + embed */
.cc-tab {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  font-family: var(--font-head); font-size: 10.5px; letter-spacing: 2px; color: var(--muted);
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.cc-tab:hover { color: var(--bone); }
.cc-tab.active { color: var(--gold-bright); border-bottom-color: var(--gold); }
#fc-embed { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.fc-convo-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-bottom: 1px solid var(--panel-edge); }
.fc-convo-name { font-family: var(--font-head); font-size: 11px; letter-spacing: 2px; color: var(--gold-bright); }

/* ============ STUDIO SPLASH (Purrtex) ============ */
#studio-splash {
  position: fixed; inset: 0; z-index: 300; background: #07080c;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity .8s ease;
}
#studio-splash.done { opacity: 0; pointer-events: none; }
.studio-logo { width: min(360px, 42vw); filter: drop-shadow(0 0 50px rgba(201,162,39,.35)); animation: studioIn 1.9s ease; }
@keyframes studioIn { 0% { opacity: 0; transform: scale(.82); } 45% { opacity: 1; transform: scale(1.03); } 65%, 100% { opacity: 1; transform: scale(1); } }
.studio-sub { font-family: var(--font-head); font-size: 11px; letter-spacing: 7px; color: var(--muted); animation: studioSub 1.9s ease; }
@keyframes studioSub { 0%, 35% { opacity: 0; transform: translateY(10px); } 70%, 100% { opacity: 1; transform: translateY(0); } }

/* ============ REVEAL READY GATE ============ */
.reveal-ready-status { font-family: var(--font-head); font-size: 11px; letter-spacing: 2px; color: var(--muted); min-height: 16px; margin-top: 10px; text-align: center; }
.reveal-ready-status.all-ready { color: var(--gold-bright); text-shadow: 0 0 12px rgba(240,217,140,.5); }

/* ============ JOIN COURT (unified browser) ============ */
.jc-wrap { width: min(1020px, 94vw); margin-top: 18px; padding: 20px 26px; max-height: calc(100vh - 210px); display: flex; flex-direction: column; }
.jc-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.jc-filters { display: flex; gap: 10px; }
.jc-filter.active { border-color: var(--gold); color: var(--gold-bright); background: rgba(201,162,39,.12); }
.jc-code-row { display: flex; gap: 8px; align-items: center; }
#jc-code { width: 130px; text-transform: uppercase; letter-spacing: 3px; text-align: center; }
.jc-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.jc-row {
  display: flex; align-items: center; gap: 16px; padding: 12px 16px;
  background: rgba(5,7,11,.6); border: 1px solid var(--panel-edge); border-radius: 6px;
  transition: border-color .2s, background .2s;
}
.jc-row:hover { border-color: var(--gold-dim); background: rgba(201,162,39,.05); }
.jc-mode { font-family: var(--font-head); font-size: 9.5px; letter-spacing: 2px; padding: 4px 10px; border-radius: 3px; flex-shrink: 0; }
.jc-mode.public { color: #6fd3a1; border: 1px solid rgba(63,158,110,.5); background: rgba(63,158,110,.1); }
.jc-mode.locked { color: #e8b0b0; border: 1px solid rgba(163,22,33,.55); background: rgba(163,22,33,.12); }
.jc-host { font-family: var(--font-head); font-size: 13px; letter-spacing: 1px; color: var(--bone); min-width: 110px; }
.jc-type { font-family: var(--font-head); font-size: 9.5px; letter-spacing: 2px; color: var(--muted); flex: 1; }
.jc-count { font-family: var(--font-head); font-size: 13px; color: var(--gold); }
.jc-join { padding: 8px 20px; font-size: 11px; }
.jc-join:disabled { opacity: .4; cursor: not-allowed; }
.jc-empty { color: var(--muted); font-style: italic; text-align: center; padding: 40px 10px; font-size: 16px; line-height: 1.7; }

/* ============ MODE GRID — 3 CARDS ============ */
.mode-grid-3 { gap: 24px; flex-wrap: wrap; justify-content: center; max-width: 1080px; }
.mode-grid-3 .mode-card { width: 300px; padding: 26px 20px 20px; }
.mode-grid-3 .mode-card p { font-size: 15px; min-height: 92px; }
@media (max-width: 1060px) {
  .mode-grid-3 .mode-card { width: min(340px, 88vw); }
  .mode-grid-3 .mode-card p { min-height: 0; }
}

/* ============ QUIT GAME (home menu, desktop) ============ */
.menu-btn-quit { border-left-color: rgba(163,22,33,.7); }
.menu-btn-quit i { color: #e06060; }
.menu-btn-quit:hover { border-left-color: var(--blood); color: #e8b0b0; box-shadow: 0 0 18px rgba(163,22,33,.35); }

/* ============ PROFILE — FRIENDS TAB ============ */
.pf-friends-add { display: flex; gap: 10px; margin-bottom: 6px; }
.pf-friends-add .text-input { flex: 1; }
.pf-friend-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px;
  border-bottom: 1px solid rgba(201,162,39,.1); transition: background .15s;
}
.pf-friend-row:hover { background: rgba(201,162,39,.05); }
.pff-ava { position: relative; flex-shrink: 0; }
.pff-ava img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-dim); display: block; }
.pff-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: #5a5a5a; border: 2px solid #10121a; }
.pff-dot.on { background: #58c777; box-shadow: 0 0 9px rgba(88,199,119,.8); }
.pff-dot.pending { background: var(--gold-dim); }
.pff-meta { flex: 1; min-width: 0; }
.pff-name { font-family: var(--font-head); font-size: 13px; letter-spacing: 1.5px; color: var(--bone); }
.pff-status { font-family: var(--font-head); font-size: 9.5px; letter-spacing: 1.5px; color: var(--muted); margin-top: 3px; }
.pff-status.on { color: #58c777; }
.pff-status.pending { color: var(--gold); }
.pff-actions { display: flex; gap: 8px; }
.pff-actions .btn-ghost { padding: 6px 12px; font-size: 10px; }
.pf-empty { color: var(--muted); font-style: italic; text-align: center; padding: 30px 10px; font-size: 15px; }

/* ============ FRAMELESS DESKTOP WINDOW — DRAG REGION ============ */
#topbar { -webkit-app-region: drag; }
#topbar button, #topbar a, #topbar input, #topbar .tb-menu, #topbar select { -webkit-app-region: no-drag; }
