/* Dark arcade look, in the same family as NameAPlayer: near-black panels, Barlow type, yellow accents. */
:root {
  --bg: #0b0f14;
  --panel: rgba(19, 26, 35, .95);
  --panel-2: #1c2633;
  --line: #2e3b4d;
  --text: #edf1f5;
  --muted: #8d9aab;
  --yellow: #ffc62b;
  --red: #ff4d4f;
  --blue: #3b8cff;
  --green: #2fd07a;
  --shadow: rgba(0, 0, 0, .55);
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--body); font-weight: 500; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }
h1, h2, h3 { font: italic 800 26px var(--display); margin: 0; letter-spacing: .5px; text-transform: uppercase; }
p { margin: 0; }
b { font-weight: 700; }

/* ---------- building blocks ---------- */
.card, .panel { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 6px 0 var(--shadow); backdrop-filter: blur(6px); }
.btn {
  font: italic 800 18px var(--display); letter-spacing: .6px; text-transform: uppercase; color: var(--text);
  background: var(--panel-2); border: 2px solid var(--line); border-radius: 12px; padding: 9px 16px;
  box-shadow: 0 4px 0 var(--shadow); cursor: pointer; transition: transform .06s, box-shadow .06s, filter .1s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: #14100a; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn.small { font-size: 15px; padding: 5px 10px; border-radius: 10px; box-shadow: 0 3px 0 var(--shadow); }
.btn.ghost.small { box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .btn { flex: 1; }
input, textarea { font: 700 16px var(--body); color: var(--text); background: #0d131a; border: 2px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
input::placeholder, textarea::placeholder { color: #566375; }
.field { display: block; }
.field > span, .label { display: block; font: italic 700 14px var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ---------- home / lobby / game over card ---------- */
.side-card { position: absolute; left: 20px; top: 20px; width: 380px; max-height: calc(100% - 46px); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.logo { font-size: 64px; line-height: .9; color: #fff; text-shadow: 0 4px 0 var(--shadow); }
.logo span { color: var(--yellow); }
.tagline { font: italic 700 18px var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: -4px; }
#code { width: 110px; text-align: center; text-transform: uppercase; font: italic 800 22px var(--display); letter-spacing: 4px; flex: none; }
#customizer { display: grid; gap: 6px; }
.cz { display: grid; grid-template-columns: 86px 34px 1fr 34px; align-items: center; gap: 6px; }
.cz .label { margin: 0; }
.cz button { font-size: 13px; height: 30px; border: 2px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); cursor: pointer; padding: 0; }
.cz button:active { background: var(--yellow); color: #000; }
.cz .val { display: flex; align-items: center; justify-content: center; height: 30px; background: #0d131a; border-radius: 8px; font-size: 14px; font-weight: 700; }
.swatch { width: 44px; height: 16px; border-radius: 5px; border: 2px solid rgba(255, 255, 255, .25); }

.roomcode { font: italic 800 60px var(--display); letter-spacing: 12px; text-align: center; background: #0d131a; color: var(--yellow); border: 2px solid var(--line); border-radius: 12px; padding: 2px 0; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-left: 4px solid var(--yellow); border-radius: 8px; padding: 7px 12px; font-weight: 700; }
.players li.empty { border-left-color: var(--line); color: var(--muted); background: transparent; font-weight: 500; }
.players .tag { margin-left: auto; font: italic 800 13px var(--display); letter-spacing: 1px; background: var(--yellow); color: #14100a; border-radius: 5px; padding: 1px 7px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; font: italic 800 16px var(--display); text-transform: uppercase; border: 2px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--text); padding: 4px 0; cursor: pointer; }
.seg button.on { background: var(--yellow); border-color: var(--yellow); color: #14100a; }
.seg button:disabled { cursor: default; opacity: .75; }
.micline { display: flex; align-items: center; gap: 10px; font-size: 14px; background: #0d131a; border-radius: 10px; padding: 8px 10px; }
.micline .btn { flex: none; }
.winner { font: italic 800 34px var(--display); color: var(--yellow); text-transform: uppercase; }
table.history { width: 100%; border-collapse: collapse; font-size: 13px; }
table.history td, table.history th { text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.history th { font: italic 700 13px var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- the trial ---------- */
#hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: center; align-items: stretch; gap: 10px; pointer-events: none; }
.chip { min-width: 190px; max-width: 270px; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 5px 0 var(--shadow); padding: 6px 12px; display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center; }
.chip.pros { border-left: 6px solid var(--red); } .chip.def { border-left: 6px solid var(--blue); }
.chip .role { grid-column: 1 / -1; font: italic 800 13px var(--display); letter-spacing: 1.5px; }
.chip.pros .role { color: var(--red); } .chip.def .role { color: var(--blue); }
.chip .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .score { font: italic 800 28px var(--display); }
.chip.speaking { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 198, 43, .35), 0 5px 0 var(--shadow); }
#clock { background: #05080b; border: 2px solid var(--line); border-radius: 14px; padding: 4px 18px; text-align: center; min-width: 180px; display: flex; flex-direction: column; justify-content: center; }
#round { font: italic 700 13px var(--display); letter-spacing: 1.5px; color: var(--yellow); }
#phase { font: italic 800 18px var(--display); text-transform: uppercase; }
#timer { font: italic 800 32px var(--display); line-height: 1; }
#timer.urgent { color: var(--red); animation: pulse .5s infinite alternate; }
#timer.frozen { color: var(--muted); }
@keyframes pulse { to { transform: scale(1.18); } }
#tools { position: fixed; top: 14px; right: 14px; display: flex; gap: 6px; z-index: 8; }
#tools .btn { padding: 5px 8px; font-style: normal; }
#tools .btn.off { opacity: .5; }

#casefile, #guide { position: absolute; top: 100px; bottom: 16px; width: 300px; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
#casefile { left: 12px; } #guide { right: 12px; }
.panel h3 { font-size: 24px; line-height: 1; }
.crime { display: inline-block; font: italic 800 15px var(--display); text-transform: uppercase; letter-spacing: .5px; background: var(--yellow); color: #14100a; border-radius: 6px; padding: 1px 9px; }
.tilt { font: italic 700 13px var(--display); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.exhibits { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; line-height: 1.35; }
.exhibits li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; background: var(--panel-2); border-radius: 9px; padding: 7px 9px; }
.exhibits .tag { font: italic 800 20px var(--display); color: var(--yellow); line-height: 1; }
.job { border-left: 5px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 14px; line-height: 1.4; background: #0d131a; }
.job.prosecution { border-left-color: var(--red); } .job.defense { border-left-color: var(--blue); } .job.juror { border-left-color: var(--green); }
.job b { font: italic 800 17px var(--display); text-transform: uppercase; }
.job.prosecution b { color: var(--red); } .job.defense b { color: var(--blue); } .job.juror b { color: var(--green); }
.judgecard { background: #0d131a; border-left: 5px solid var(--yellow); border-radius: 9px; padding: 9px 11px; font-size: 13px; line-height: 1.45; }
.judgecard b { font: italic 800 20px var(--display); color: var(--yellow); display: block; text-transform: uppercase; }
.judgecard .up { color: #86efac; } .judgecard .down { color: #ff9c9e; }
.tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; line-height: 1.35; }
.tips li { background: var(--panel-2); border-radius: 9px; padding: 6px 9px; }
.tips b { color: var(--yellow); }

#podium { position: absolute; left: 324px; right: 324px; bottom: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; max-height: 62%; overflow-y: auto; }
#podium textarea { height: 80px; resize: none; }
#podium .lead { font-size: 15px; line-height: 1.4; }
#podium .lead b { font: italic 800 19px var(--display); text-transform: uppercase; letter-spacing: .4px; }
.onair { display: flex; align-items: center; gap: 10px; font: italic 800 22px var(--display); text-transform: uppercase; color: var(--red); }
.onair .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.level { height: 10px; background: #0d131a; border-radius: 6px; overflow: hidden; }
.level i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--yellow)); transition: width .08s; }
.objrow .row { gap: 6px; }
.objrow .btn { background: var(--red); border-color: var(--red); color: #fff; font-size: 16px; padding: 6px 8px; }
.objrow .btn small { display: block; font: 500 11px var(--body); text-transform: none; letter-spacing: 0; opacity: .9; }
.votes .btn { font-size: 20px; padding: 14px; }
.votes .btn.p { border-color: var(--red); } .votes .btn.d { border-color: var(--blue); }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.bubble { position: absolute; transform: translate(-50%, -100%); max-width: 250px; background: #fff; color: #14100a; border-radius: 14px; padding: 7px 11px; font-size: 14px; font-weight: 500; line-height: 1.3; box-shadow: 0 4px 0 var(--shadow); pointer-events: none; overflow-wrap: anywhere; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.bubble.judge { max-width: 330px; background: var(--yellow); font-weight: 700; }

#objection { position: absolute; left: 50%; top: 104px; transform: translateX(-50%) rotate(-2deg); text-align: center; background: var(--red); color: #fff; border: 3px solid #fff; border-radius: 14px; padding: 6px 22px 8px; box-shadow: 0 6px 0 var(--shadow); animation: stamp .3s cubic-bezier(.2, 2, .4, 1); z-index: 4; pointer-events: none; }
#objection .shout { font: italic 800 46px var(--display); line-height: 1; letter-spacing: 1px; }
#objection .what { font-weight: 700; font-size: 14px; }
#objection .ruling { font: italic 800 20px var(--display); text-transform: uppercase; margin-top: 2px; }
#objection.sustained { background: var(--green); color: #05230f; } #objection.overruled { background: #44505f; }

/* ---------- the verdict ---------- */
#after { display: flex; flex-direction: column; gap: 10px; }
.sentence { display: flex; align-items: center; gap: 18px; padding: 4px 6px 0; }
.sentence .meter { flex: 1; }
.stamp { font: italic 800 34px var(--display); letter-spacing: 2px; color: var(--red); border: 4px solid var(--red); border-radius: 10px; padding: 0 16px 2px; transform: rotate(-4deg); text-align: center; animation: stamp .3s cubic-bezier(.2, 2, .4, 1); }
.stamp.free { color: var(--green); border-color: var(--green); }
.stamp small { display: block; font-size: 16px; letter-spacing: 1px; color: var(--text); }
@keyframes stamp { from { transform: rotate(-4deg) scale(2.6); opacity: 0; } }
.ladder { display: flex; gap: 3px; }
.ladder span { flex: 1; height: 14px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); position: relative; }
.ladder span.fair { background: #fff; }
.ladder span.hit { background: var(--red); border-color: var(--red); }
.ladder span.fair::after { content: "FAIR"; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font: italic 700 11px var(--display); color: var(--muted); }
.ladder span.hit::before { content: "▼"; position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--red); }
.ladder-ends { display: flex; justify-content: space-between; font: italic 700 11px var(--display); color: var(--muted); letter-spacing: 1px; margin-top: 12px; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.award { background: #0d131a; border-left: 5px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 13px; line-height: 1.4; }
.award.prosecution { border-left-color: var(--red); } .award.defense { border-left-color: var(--blue); }
.award .big { font: italic 800 28px var(--display); float: right; color: var(--yellow); }
.award b { font-size: 15px; }
.award ul { margin: 4px 0 0; padding-left: 16px; }
.award details, .said { margin-top: 4px; color: var(--muted); font-size: 13px; }
.award summary, .said summary { cursor: pointer; }
.said ul { margin: 6px 0 0; padding-left: 16px; color: var(--text); display: grid; gap: 4px; }
.pts-plus { color: var(--green); font-weight: 700; } .pts-minus { color: var(--red); font-weight: 700; }

.drawer-btns { display: none; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #14100a; border-radius: 10px; padding: 10px 18px; font-weight: 700; z-index: 20; max-width: 90vw; box-shadow: 0 4px 0 var(--shadow); }

/* ---------- small screens / phones ---------- */
@media (max-width: 1180px) {
  #casefile, #guide { width: 250px; }
  #podium { left: 274px; right: 274px; }
  #tools { top: auto; bottom: 16px; right: auto; left: 50%; transform: translateX(-50%); display: none; }
}
@media (max-width: 1180px) and (min-width: 901px) { #tools { display: flex; top: 100px; bottom: auto; left: auto; right: 274px; transform: none; } }
@media (max-width: 900px) {
  .side-card { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 60%; border-radius: 18px 18px 0 0; border-bottom: 0; box-shadow: none; }
  .logo { font-size: 46px; }
  #hud { gap: 6px; top: 8px; left: 8px; right: 8px; }
  .chip { min-width: 0; flex: 1; padding: 4px 8px; } .chip .score { font-size: 22px; }
  #clock { min-width: 104px; padding: 4px 8px; } #phase { font-size: 14px; } #timer { font-size: 26px; }
  #casefile, #guide { display: none; top: 126px; left: 8px; right: 8px; width: auto; bottom: 8px; z-index: 5; }
  #casefile.open, #guide.open { display: flex; }
  #podium { left: 8px; right: 8px; bottom: 8px; max-height: 55%; }
  .drawer-btns { display: flex; gap: 6px; position: absolute; top: 86px; left: 8px; z-index: 6; }
  #tools { display: flex; top: 86px; bottom: auto; left: auto; right: 8px; transform: none; }
  #objection { top: 130px; }
  .awards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
