/* ============================================================================
   OBJECTION!  —  styles.css
   Courtroom-drama aesthetic. System fonts only. Mobile-first.
   ========================================================================== */

/* ----------------------------------------------------------------- TOKENS */
:root {
  --navy-900: #0b0e16;
  --navy-850: #10131c;
  --navy-800: #161b27;
  --navy-700: #1d2433;
  --navy-600: #28324a;
  --navy-500: #34405c;
  --wood-700: #3a2a1c;
  --wood-600: #5a3f28;
  --wood-500: #7a5636;
  --brass-600: #b8902f;
  --brass-500: #d4af37;
  --brass-400: #e8c45a;
  --brass-300: #f1d97e;
  --red-700: #8e1f1f;
  --red-600: #b5302a;
  --red-500: #d8413a;
  --red-400: #f25750;
  --green-500: #2faa6a;
  --ink: #ecf0f1;
  --ink-dim: #a8b2c4;
  --ink-faint: #6c768c;
  --line: rgba(212, 175, 55, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 9px;
  --tap: 44px;
  --shake-amt: 6px;
  --maxw: 760px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy-900);
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(212, 175, 55, 0.07), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(181, 48, 42, 0.06), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-850) 40%, var(--navy-900));
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------ HEADER */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: max(env(safe-area-inset-top), 0.4rem) 0.7rem 0.4rem;
  background: linear-gradient(180deg, rgba(11, 14, 22, 0.96), rgba(16, 19, 28, 0.86));
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.brand-mark { color: var(--brass-500); font-size: 1.35rem; line-height: 1; }
.brand-name {
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 1.02rem;
  color: var(--brass-400);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.hud { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.hud-stats { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-end; }
.hud-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.26rem 0.5rem;
  border-radius: 999px;
  background: var(--navy-700);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  white-space: nowrap;
}
.hud-rank { color: var(--brass-400); border-color: var(--line); }

/* injected account button (cloud.js) — keep it on brand */
.hud .account-btn, .hud #accountBtn {
  min-height: 32px;
}

/* -------------------------------------------------------------------- MAIN */
.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.8rem 0.8rem calc(1.4rem + env(safe-area-inset-bottom));
  position: relative;
}

.screen { animation: fadeUp 0.28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ COMMON */
h1, h2, h3 { margin: 0 0 0.5rem; line-height: 1.18; }
h2.screen-title, .topbar-title {
  font-family: var(--serif);
  color: var(--brass-300);
  font-size: 1.4rem;
  letter-spacing: 0.01em;
}
.section-h {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin: 1.1rem 0 0.5rem;
  border-left: 3px solid var(--brass-500);
  padding-left: 0.5rem;
}
.muted { color: var(--ink-dim); }
.panel {
  background: var(--navy-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

/* topbar (back navigation) */
.topbar { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.topbar-title { margin: 0; font-size: 1.2rem; flex: 1; min-width: 0; }
.back-btn { flex: 0 0 auto; }

/* ------------------------------------------------------------------ BUTTONS */
.btn {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--navy-700);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  min-height: var(--tap);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-user-select: none; user-select: none;
}
.btn:hover { background: var(--navy-600); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--brass-500), var(--brass-600));
  color: #2a1d05;
  border-color: var(--brass-400);
  box-shadow: 0 4px 0 #6f5314, var(--shadow);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--brass-400), var(--brass-500)); }
.btn-primary:active { box-shadow: 0 1px 0 #6f5314; }

.btn-ghost { background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); }

.btn-danger { background: var(--red-700); border-color: var(--red-600); color: #fff; }
.btn-danger:hover { background: var(--red-600); }

.big-btn { display: block; width: 100%; margin: 0.5rem 0; font-size: 1.02rem; padding: 0.85rem; }
.chip { padding: 0.4rem 0.7rem; min-height: 38px; font-size: 0.82rem; border-radius: 999px; }

/* =================================================================== TITLE */
.title-screen { text-align: center; padding-top: 1.5rem; }
.title-hero { margin-bottom: 1.5rem; }
.scales { display: flex; justify-content: center; margin-bottom: 0.5rem; filter: drop-shadow(0 4px 10px rgba(212,175,55,0.3)); }
.game-title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 13vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  margin: 0.2rem 0 0;
  color: var(--red-500);
  text-shadow:
    0 2px 0 #5a0f0f,
    0 4px 18px rgba(216, 65, 58, 0.5),
    2px 2px 0 rgba(0, 0, 0, 0.4);
  -webkit-text-stroke: 1.5px rgba(255, 220, 220, 0.18);
}
.tagline {
  color: var(--brass-400);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0.6rem 0 0;
}
.title-menu { max-width: 360px; margin: 0 auto; }
.title-foot { margin-top: 1.4rem; color: var(--ink-faint); font-size: 0.72rem; }

/* ============================================================== CASE SELECT */
.case-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.case-grid { display: grid; gap: 0.7rem; }
.case-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 0.8rem;
  min-height: var(--tap);
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}
.case-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--brass-500);
}
.case-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--line); }
.case-card:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }
.case-card.locked { opacity: 0.6; cursor: not-allowed; filter: grayscale(0.5); }
.case-card.locked::before { background: var(--ink-faint); }
.case-card.cleared::before { background: var(--green-500); }
.case-emoji { font-size: 1.9rem; line-height: 1; }
.case-no { font-size: 0.7rem; letter-spacing: 0.08em; color: var(--brass-400); text-transform: uppercase; }
.case-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; margin: 0.1rem 0; }
.case-charge { font-size: 0.8rem; color: var(--ink-dim); }
.case-diff { margin-top: 0.2rem; }
.stars { color: var(--brass-500); letter-spacing: 0.1em; font-size: 0.85rem; }
.case-badge {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em;
  padding: 0.22rem 0.4rem; border-radius: 6px; white-space: nowrap;
  align-self: flex-start;
}
.case-badge.done { background: rgba(47, 170, 106, 0.18); color: #7ce0a8; border: 1px solid rgba(47,170,106,0.4); }
.case-badge.open { background: rgba(212, 175, 55, 0.16); color: var(--brass-300); border: 1px solid var(--line); }
.case-badge.lock { background: rgba(108, 118, 140, 0.16); color: var(--ink-dim); }

.smallclaims-banner {
  margin-top: 1.2rem; padding: 1rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--wood-700), var(--navy-800));
  border: 1px solid var(--line);
}
.sc-title { font-family: var(--serif); font-size: 1.2rem; color: var(--brass-300); }
.sc-sub { font-size: 0.85rem; color: var(--ink-dim); margin: 0.3rem 0 0.7rem; }

/* ================================================================ DIALOGUE */
.dialogue-screen { min-height: calc(100dvh - 90px); display: flex; flex-direction: column; }
.dlg-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.dlg-title { font-family: var(--serif); color: var(--brass-300); font-size: 1.05rem; font-weight: 700; }
.dlg-stage {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 180px;
  padding: 1rem 0;
  cursor: pointer;
}
.dlg-portrait { transform: scale(1.4); animation: portraitIn 0.3s ease both; }
@keyframes portraitIn { from { opacity: 0; transform: scale(1.2) translateY(12px); } to { opacity: 1; transform: scale(1.4); } }

.portrait-frame {
  width: 86px; height: 86px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, var(--navy-600), var(--navy-800));
  border: 3px solid var(--brass-500);
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), inset 0 2px 8px rgba(255,255,255,0.06);
}
.portrait-emoji { font-size: 2.7rem; line-height: 1; }

.dlg-box {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-850));
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1.1rem;
  box-shadow: var(--shadow);
  position: relative;
  cursor: pointer;
  min-height: 110px;
}
.dlg-name {
  position: absolute; top: -0.8rem; left: 0.8rem;
  background: linear-gradient(180deg, var(--brass-500), var(--brass-600));
  color: #2a1d05; font-weight: 800; font-size: 0.8rem;
  padding: 0.2rem 0.7rem; border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.dlg-text { font-size: 1.05rem; line-height: 1.55; margin-top: 0.5rem; min-height: 3em; }
.dlg-cue { position: absolute; right: 0.8rem; bottom: 0.5rem; color: var(--brass-400); animation: bob 0.9s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.dlg-help { text-align: center; color: var(--ink-faint); font-size: 0.74rem; margin-top: 0.6rem; cursor: pointer; }

.intro-bg { background: radial-gradient(800px 400px at 50% 0%, rgba(122,86,54,0.12), transparent 70%); }
.court-bg { background: radial-gradient(900px 500px at 50% 0%, rgba(40,50,74,0.35), transparent 70%); }
.verdict-bg { background: radial-gradient(700px 400px at 50% 30%, rgba(212,175,55,0.12), transparent 70%); }

/* =========================================================== INVESTIGATION */
.case-banner, .case-banner.case-banner {
  display: flex; align-items: center; gap: 0.7rem;
  background: linear-gradient(135deg, var(--wood-700), var(--navy-800));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7rem 0.9rem; margin-bottom: 0.7rem;
}
.cb-emoji { font-size: 1.9rem; }
.cb-client { font-size: 0.95rem; }
.cb-charge { font-size: 0.8rem; color: var(--ink-dim); margin-top: 0.15rem; }

.pi-note {
  background: rgba(212,175,55,0.1); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; font-size: 0.86rem; margin-bottom: 0.7rem;
}

.loc-list, .people-list, .topic-list, .hotspot-list { display: grid; gap: 0.55rem; }
.loc-card {
  text-align: left; background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.75rem 0.85rem; cursor: pointer; color: var(--ink);
  min-height: var(--tap); transition: border-color 0.15s ease, transform 0.08s ease;
}
.loc-card:hover { border-color: var(--line); transform: translateX(2px); }
.loc-card:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }
.loc-name { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; color: var(--brass-300); }
.loc-desc { font-size: 0.84rem; color: var(--ink-dim); margin-top: 0.2rem; }
.loc-desc.big { font-size: 0.95rem; color: var(--ink); line-height: 1.5; margin-bottom: 0.8rem; }

.inv-actions { margin-top: 1rem; }
.court-gate { margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid var(--line-soft); }
.gate-hint { font-size: 0.84rem; color: var(--ink-dim); text-align: center; margin-top: 0.4rem; }
.gate-hint.ready { color: #7ce0a8; }

/* hotspots */
.hotspot {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  text-align: left; background: var(--navy-700); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; cursor: pointer; color: var(--ink);
  min-height: var(--tap);
}
.hotspot:hover { border-color: var(--line); }
.hotspot:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }
.hotspot.seen { opacity: 0.82; }
.hs-label { font-size: 0.95rem; }
.hs-tag { font-size: 0.66rem; padding: 0.2rem 0.45rem; border-radius: 999px; background: rgba(255,255,255,0.07); color: var(--ink-dim); white-space: nowrap; }
.hs-tag.new { background: var(--red-600); color: #fff; font-weight: 800; }

/* people / talk */
.person-card {
  display: flex; align-items: center; gap: 0.7rem; text-align: left;
  background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; cursor: pointer; color: var(--ink);
  min-height: var(--tap);
}
.person-card:hover { border-color: var(--line); }
.person-card:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }
.person-emoji { font-size: 1.7rem; }
.person-name { font-weight: 700; }
.person-role { font-size: 0.78rem; color: var(--ink-dim); }
.chev { margin-left: auto; color: var(--brass-400); font-size: 1.3rem; }

.talk-head {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 0.8rem; margin-bottom: 0.5rem;
}
.talk-portrait { flex: 0 0 auto; }
.talk-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--brass-300); }
.talk-role { font-size: 0.8rem; color: var(--ink-dim); }
.talk-profile { font-size: 0.84rem; color: var(--ink-dim); margin-top: 0.4rem; line-height: 1.45; }

.topic-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  text-align: left; background: var(--navy-700); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; cursor: pointer; color: var(--ink);
  min-height: var(--tap);
}
.topic-btn:hover { border-color: var(--line); }
.topic-btn:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }
.topic-btn.seen { opacity: 0.82; }

/* ============================================================ COURT RECORD */
.rec-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.7rem; }
.rec-tab {
  flex: 1; background: var(--navy-700); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.6rem; cursor: pointer; color: var(--ink-dim);
  font-weight: 700; min-height: 40px;
}
.rec-tab.active { background: var(--navy-600); color: var(--brass-300); border-color: var(--line); }
.rec-tab:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }

.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.55rem; }
.ev-card {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 0.7rem 0.4rem; cursor: pointer; color: var(--ink); text-align: center;
  min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.ev-card:hover { transform: translateY(-2px); border-color: var(--brass-500); }
.ev-card:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }
.ev-icon { font-size: 1.8rem; line-height: 1; }
.ev-name { font-size: 0.72rem; font-weight: 700; line-height: 1.2; }
.ev-type { font-size: 0.62rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }

.profile-list { display: grid; gap: 0.6rem; }
.profile-card {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.7rem;
}
.profile-emoji { font-size: 1.7rem; }
.profile-name { font-weight: 700; color: var(--brass-300); }
.profile-role { font-size: 0.78rem; color: var(--ink-dim); }
.profile-desc { font-size: 0.84rem; color: var(--ink-dim); margin-top: 0.3rem; line-height: 1.45; }

/* ==================================================================== TRIAL */
.trial-screen { display: flex; flex-direction: column; min-height: calc(100dvh - 90px); }
.trial-top { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.witness-plate {
  flex: 1; display: flex; align-items: center; gap: 0.4rem; justify-content: flex-end;
  background: var(--navy-700); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.7rem; min-width: 0;
}
.wp-emoji { font-size: 1.1rem; }
.wp-name { font-weight: 800; color: var(--brass-300); font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-role { font-size: 0.7rem; color: var(--ink-dim); white-space: nowrap; }

.cred-bar { margin-bottom: 0.7rem; }
.cred-label { font-size: 0.68rem; letter-spacing: 0.14em; color: var(--ink-dim); text-transform: uppercase; margin-bottom: 0.25rem; }
.cred-pips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.pip {
  font-size: 1.25rem; line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}
.pip.on { color: var(--red-500); text-shadow: 0 0 8px rgba(216,65,58,0.6); }
.pip.off { color: var(--navy-500); }

.witness-stage {
  display: flex; align-items: center; justify-content: center;
  padding: 0.6rem 0 1rem;
}
.witness-portrait { transform: scale(1.5); }

.testimony-panel {
  background: linear-gradient(180deg, rgba(40,50,74,0.55), rgba(16,19,28,0.9));
  border: 2px solid var(--brass-600);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem 1rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
}
.testimony-label { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.tm-tag { font-size: 0.66rem; letter-spacing: 0.16em; color: var(--brass-400); font-weight: 800; }
.tm-count { font-size: 0.72rem; color: var(--ink-dim); }
.testimony-text {
  font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; min-height: 3.2em;
  color: #fff; letter-spacing: 0.005em;
}
.testimony-text.admin-reveal { box-shadow: inset 0 0 0 2px rgba(216,65,58,0.5); border-radius: 8px; padding: 0.3rem; }

.testimony-nav { display: flex; gap: 0.5rem; margin: 0.7rem 0; }
.nav-btn { flex: 1; }

.trial-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 0.2rem; }
.btn-press, .btn-present {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 64px; font-size: 1.05rem; font-weight: 900; letter-spacing: 0.03em;
  border-radius: var(--radius); line-height: 1.1;
}
.btn-press .sub, .btn-present .sub { font-size: 0.66rem; font-weight: 700; opacity: 0.8; margin-top: 0.15rem; letter-spacing: 0.06em; }
.btn-press { background: linear-gradient(180deg, var(--navy-500), var(--navy-600)); border-color: var(--navy-500); color: #fff; box-shadow: 0 4px 0 #1a2233, var(--shadow); }
.btn-press:hover { background: linear-gradient(180deg, var(--navy-600), var(--navy-500)); }
.btn-press:active { box-shadow: 0 1px 0 #1a2233; }
.btn-present { background: linear-gradient(180deg, var(--red-500), var(--red-700)); border-color: var(--red-500); color: #fff; box-shadow: 0 4px 0 #4d0f0f, var(--shadow); }
.btn-present:hover { background: linear-gradient(180deg, var(--red-400), var(--red-600)); }
.btn-present:active { box-shadow: 0 1px 0 #4d0f0f; }

.hint-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.admin-flag { font-size: 0.7rem; color: var(--red-400); border: 1px dashed var(--red-600); padding: 0.2rem 0.45rem; border-radius: 6px; }

.breakdown-screen { display: flex; align-items: center; justify-content: center; min-height: calc(100dvh - 90px); }
.breakdown-portrait { transform: scale(2); }
.breakdown-screen.shaking .breakdown-portrait { animation: hardshake 0.35s linear infinite; }
@keyframes hardshake {
  0%,100% { transform: scale(2) translate(0,0); }
  25% { transform: scale(2) translate(-5px, 3px) rotate(-2deg); }
  50% { transform: scale(2) translate(5px, -2px) rotate(2deg); }
  75% { transform: scale(2) translate(-3px, -3px) rotate(-1deg); }
}

/* ================================================================= VERDICT */
.verdict-screen { text-align: center; padding-top: 1.5rem; position: relative; overflow: hidden; min-height: calc(100dvh - 120px); }
.verdict-stamp {
  display: inline-block; font-family: var(--serif); font-weight: 900;
  font-size: clamp(1.8rem, 9vw, 3rem); letter-spacing: 0.06em;
  padding: 0.4rem 1.2rem; border: 5px solid currentColor; border-radius: 12px;
  transform: rotate(-7deg); margin-bottom: 1rem;
  animation: stampIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.verdict-stamp.win { color: var(--green-500); text-shadow: 0 2px 12px rgba(47,170,106,0.4); }
.verdict-stamp.lose { color: var(--red-500); text-shadow: 0 2px 12px rgba(216,65,58,0.4); }
.verdict-stamp.settled { color: var(--brass-400); text-shadow: 0 2px 12px rgba(212,175,55,0.4); }
@keyframes stampIn { 0% { opacity: 0; transform: rotate(-7deg) scale(2.4); } 100% { opacity: 1; transform: rotate(-7deg) scale(1); } }
.verdict-h { font-family: var(--serif); color: var(--brass-300); }
.verdict-sub { color: var(--ink-dim); margin-bottom: 1rem; }
.reward-box {
  max-width: 360px; margin: 1rem auto; background: var(--navy-800);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem;
}
.reward-row { display: flex; justify-content: space-between; padding: 0.35rem 0; font-size: 0.95rem; border-bottom: 1px solid var(--line-soft); }
.reward-row:last-child { border-bottom: none; }
.reward-row b { color: var(--brass-300); }
.reward-row.bonus b { color: #7ce0a8; }
.reward-row.penalty b { color: var(--red-400); }
.reward-row.muted-row { color: var(--ink-faint); }
.rankup, .campaign-done {
  max-width: 420px; margin: 1rem auto; padding: 0.9rem 1rem; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(212,175,55,0.16), var(--navy-800));
  border: 1px solid var(--line); font-size: 0.92rem; line-height: 1.5;
}
.verdict-btns { max-width: 360px; margin: 1.2rem auto 0; }

/* ==================================================================== FIRM */
.firm-card {
  text-align: center; background: linear-gradient(135deg, var(--wood-700), var(--navy-800));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 0.8rem;
}
.firm-crest { display: flex; justify-content: center; margin-bottom: 0.3rem; }
.firm-rank { font-family: var(--serif); font-size: 1.5rem; font-weight: 900; color: var(--brass-300); }
.firm-blurb { font-size: 0.85rem; color: var(--ink-dim); margin-top: 0.3rem; }
.firm-stats { background: var(--navy-800); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.4rem 0.9rem; }
.firm-stat-row { display: flex; justify-content: space-between; padding: 0.45rem 0; border-bottom: 1px solid var(--line-soft); font-size: 0.92rem; }
.firm-stat-row:last-child { border-bottom: none; }
.firm-stat-row b { color: var(--brass-300); }

.rank-progress, .ach-progress { margin: 0.8rem 0; }
.rp-bar { height: 12px; background: var(--navy-700); border-radius: 999px; overflow: hidden; border: 1px solid var(--line-soft); }
.rp-fill { height: 100%; background: linear-gradient(90deg, var(--brass-600), var(--brass-400)); transition: width 0.4s ease; }
.rp-label { font-size: 0.76rem; color: var(--ink-dim); margin-top: 0.25rem; text-align: center; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.stat-cell { background: var(--navy-800); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 0.7rem; text-align: center; }
.sc-num { font-size: 1.5rem; font-weight: 900; color: var(--brass-300); }
.sc-lbl { font-size: 0.72rem; color: var(--ink-dim); margin-top: 0.1rem; }

.owned-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.owned-chip { background: var(--navy-700); border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.7rem; font-size: 0.82rem; }

/* ================================================================== MARKET */
.market-intro { color: var(--ink-dim); font-size: 0.9rem; }
.market-balance { font-size: 1.05rem; margin-bottom: 0.8rem; }
.market-balance b { color: var(--brass-300); }
.upgrade-grid { display: grid; gap: 0.7rem; }
.upgrade-card {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.85rem;
  display: grid; gap: 0.35rem;
}
.upgrade-card.owned { border-color: rgba(47,170,106,0.4); }
.up-icon { font-size: 1.8rem; }
.up-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; color: var(--brass-300); }
.up-desc { font-size: 0.85rem; color: var(--ink-dim); line-height: 1.45; }
.up-effect { font-size: 0.78rem; color: var(--brass-400); }
.upgrade-card .btn { margin-top: 0.4rem; }

/* ============================================================ ACHIEVEMENTS */
.ach-grid { display: grid; gap: 0.55rem; }
.ach-card {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.7rem;
}
.ach-card.locked { opacity: 0.62; }
.ach-card.unlocked { border-color: var(--line); background: linear-gradient(135deg, rgba(212,175,55,0.08), var(--navy-800)); }
.ach-icon { font-size: 1.7rem; flex: 0 0 auto; }
.ach-name { font-weight: 700; color: var(--brass-300); }
.ach-desc { font-size: 0.82rem; color: var(--ink-dim); }
.ach-reward { font-size: 0.72rem; color: var(--brass-400); margin-top: 0.15rem; }
.ach-check { margin-left: auto; color: var(--green-500); font-size: 1.3rem; font-weight: 900; }

/* ================================================================ SETTINGS */
.settings-box { background: var(--navy-800); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.4rem 0.9rem; margin-bottom: 0.6rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 0.95rem; }
.toggle {
  width: 52px; height: 30px; border-radius: 999px; background: var(--navy-600);
  border: 1px solid var(--line-soft); position: relative; cursor: pointer; flex: 0 0 auto; padding: 0;
  transition: background 0.2s ease;
}
.toggle.on { background: var(--green-500); }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.toggle.on .knob { transform: translateX(22px); }
.toggle:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }

.segmented { display: flex; gap: 0.25rem; background: var(--navy-700); border-radius: 999px; padding: 0.2rem; }
.seg-btn { background: transparent; border: none; color: var(--ink-dim); padding: 0.4rem 0.7rem; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 0.82rem; min-height: 36px; }
.seg-btn.active { background: var(--brass-500); color: #2a1d05; }
.seg-btn:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }

/* ==================================================================== HELP */
.help-box { display: grid; gap: 0.6rem; }
.help-section { background: var(--navy-800); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 0.8rem; }
.help-section h3 { color: var(--brass-300); font-size: 1rem; margin-bottom: 0.3rem; }
.help-section p { margin: 0; font-size: 0.88rem; color: var(--ink-dim); line-height: 1.5; }

/* =========================================================== SMALL CLAIMS */
.sc-court { font-family: var(--serif); font-size: 1.3rem; color: var(--brass-300); margin-bottom: 0.3rem; }
.sc-record { margin-top: 0.6rem; font-size: 0.95rem; }
.sc-record b { color: var(--brass-300); }
.sc-ev-grid { margin-top: 0.5rem; }

/* =================================================================== MODAL */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 7, 12, 0.7); backdrop-filter: blur(3px);
  padding: 1rem; animation: fadeIn 0.18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  width: 100%; max-width: 440px; max-height: 86vh; overflow: auto;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-850));
  border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: popUp 0.22s cubic-bezier(0.2,1.3,0.4,1) both;
}
@keyframes popUp { from { opacity: 0; transform: scale(0.92) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.8rem 1rem 0.4rem; border-bottom: 1px solid var(--line-soft); }
.modal-title { font-family: var(--serif); color: var(--brass-300); font-size: 1.1rem; margin: 0; }
.modal-x { background: transparent; border: none; color: var(--ink-dim); font-size: 1.2rem; cursor: pointer; min-width: 36px; min-height: 36px; border-radius: 8px; }
.modal-x:hover { color: #fff; background: rgba(255,255,255,0.06); }
.modal-x:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }
.modal-body { padding: 0.9rem 1rem; }
.modal-body-text { font-size: 0.95rem; line-height: 1.55; white-space: pre-wrap; color: var(--ink); }
.modal-body-text.selectable { -webkit-user-select: all; user-select: all; word-break: break-all; font-size: 0.8rem; background: var(--navy-900); padding: 0.6rem; border-radius: 8px; border: 1px solid var(--line-soft); }
.modal-foot { display: flex; gap: 0.5rem; justify-content: flex-end; padding: 0.4rem 1rem 1rem; flex-wrap: wrap; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.55rem; }
.pick-card {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 0.7rem 0.4rem; cursor: pointer; color: var(--ink); text-align: center;
  min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
}
.pick-card:hover { border-color: var(--brass-500); }
.pick-card:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }

/* ========================================================= OVERLAY DIALOGUE */
.dlg-overlay { align-items: flex-end; }
.ov-dlg {
  width: 100%; max-width: var(--maxw); display: flex; gap: 0.7rem; align-items: flex-end;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-850));
  border: 2px solid var(--brass-600); border-top-left-radius: var(--radius); border-top-right-radius: var(--radius);
  padding: 0.9rem 1rem 1.1rem; box-shadow: var(--shadow); cursor: pointer;
  animation: slideUp 0.22s ease both; position: relative;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ov-portrait { flex: 0 0 auto; transform: scale(1.05); }
.ov-right { flex: 1; min-width: 0; position: relative; padding-bottom: 0.4rem; }
.ov-name {
  display: inline-block; background: linear-gradient(180deg, var(--brass-500), var(--brass-600));
  color: #2a1d05; font-weight: 800; font-size: 0.78rem; padding: 0.15rem 0.6rem; border-radius: 6px; margin-bottom: 0.4rem;
}
.ov-text { font-size: 1.02rem; line-height: 1.5; min-height: 2.6em; }
.ov-cue { right: 0; bottom: -0.1rem; }

/* ============================================================ BIG SPEECH */
.speech-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer;
  background: rgba(0,0,0,0.25);
}
.speech-bubble {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(3rem, 17vw, 6rem); letter-spacing: 0.01em;
  color: #fff; text-align: center; padding: 0.3rem 1rem;
  -webkit-text-stroke: 3px #000;
  text-shadow: 5px 5px 0 rgba(0,0,0,0.55);
  transform: rotate(-5deg);
}
.speech-objection .speech-bubble { color: var(--red-500); -webkit-text-stroke: 3px #fff; text-shadow: 0 0 24px rgba(216,65,58,0.7), 5px 6px 0 rgba(0,0,0,0.5); }
.speech-holdit .speech-bubble { color: var(--brass-400); -webkit-text-stroke: 3px #2a1d05; }
.speech-takethat .speech-bubble { color: #5fa8ff; -webkit-text-stroke: 3px #fff; }
.speech-bubble.pop { animation: speechPop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes speechPop {
  0% { transform: rotate(-5deg) scale(0.2); opacity: 0; }
  60% { transform: rotate(-5deg) scale(1.18); opacity: 1; }
  100% { transform: rotate(-5deg) scale(1); }
}

/* shake the whole app */
#app.shake { animation: appshake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes appshake {
  10%, 90% { transform: translate(calc(var(--shake-amt) * -0.3), 0); }
  20%, 80% { transform: translate(calc(var(--shake-amt) * 0.5), 0); }
  30%, 50%, 70% { transform: translate(calc(var(--shake-amt) * -1), 0); }
  40%, 60% { transform: translate(var(--shake-amt), 0); }
}

.damage-flash {
  position: fixed; inset: 0; z-index: 150; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(216,65,58,0.45), rgba(216,65,58,0.0) 70%);
  animation: dmgFlash 0.45s ease both;
}
@keyframes dmgFlash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

.gavel-overlay {
  position: fixed; inset: 0; z-index: 180; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,7,12,0.65);
  animation: fadeIn 0.12s ease both;
}
.gavel-icon { font-size: 5rem; animation: gavelHit 0.6s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes gavelHit {
  0% { transform: rotate(-50deg) translateY(-30px); opacity: 0; }
  45% { transform: rotate(8deg) translateY(0); opacity: 1; }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); opacity: 0; }
}
.gavel-line { position: absolute; left: 0; right: 0; height: 4px; background: var(--brass-500); top: 50%; transform: scaleX(0); animation: gavelLine 0.6s ease 0.3s both; }
@keyframes gavelLine { from { transform: scaleX(0); opacity: 0.8; } to { transform: scaleX(1); opacity: 0; } }

/* confetti */
.confetti {
  position: absolute; top: -20px; width: 9px; height: 14px; opacity: 0.9;
  animation: confettiFall 2.4s linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* =================================================================== TOAST */
.toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom));
  translate: -50% 200%;
  z-index: 300; max-width: calc(100% - 2rem);
  background: var(--navy-700); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--brass-500);
  border-radius: var(--radius-sm); padding: 0.7rem 1rem; font-size: 0.9rem; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: translate 0.3s cubic-bezier(0.2,1.2,0.4,1), opacity 0.3s ease;
}
.toast.show { translate: -50% 0; opacity: 1; }
.toast-ach { border-left-color: var(--brass-400); }
.toast-ev { border-left-color: #5fa8ff; }
.toast-error { border-left-color: var(--red-500); }
.toast-info { border-left-color: var(--ink-dim); }

/* ========================================================= CASE DECISION */
.decision-lede { text-align: center; color: var(--ink-dim); margin: 0.6rem 0 0.9rem; }
.decision-grid { display: grid; gap: 0.8rem; }
.decision-card {
  background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
}
.decision-trial { border-color: var(--line); }
.decision-settle { border-color: var(--line-soft); }
.decision-nosettle { border-style: dashed; opacity: 0.92; }
.dc-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; }
.dc-emoji { font-size: 1.4rem; }
.dc-title { font-family: var(--serif); font-weight: 800; font-size: 1.15rem; color: var(--brass-300); }
.dc-desc { font-size: 0.9rem; line-height: 1.5; color: var(--ink-dim); margin-bottom: 0.8rem; }
.dc-desc b { color: var(--ink); }
.decision-card .big-btn { margin: 0; }

.verdict-settled .settled-note { max-width: 420px; margin: 0.8rem auto 0; font-size: 0.88rem; line-height: 1.5; }

/* ============================================================== LAW FIRM */
.lawfirm-box { display: flex; flex-direction: column; gap: 0.7rem; }
.lawfirm-card {
  background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 0.9rem 1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.lawfirm-pitch { font-size: 0.92rem; line-height: 1.5; color: var(--ink-dim); margin: 0; }
.lawfirm-loading { margin: 0.3rem 0; }
.lf-section-h { font-family: var(--serif); font-weight: 800; color: var(--brass-300); font-size: 1.05rem; }
.lawfirm-card .btn { align-self: flex-start; }

/* form inputs (firm creation) */
.lf-input {
  width: 100%; box-sizing: border-box;
  background: var(--navy-900); color: var(--ink);
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem; font-size: 0.95rem; font-family: var(--font);
  min-height: var(--tap);
}
.lf-input::placeholder { color: var(--ink-faint); }
.lf-input:focus { border-color: var(--brass-500); outline: none; }
.lf-err { color: var(--red-400); font-size: 0.85rem; font-weight: 600; }

/* firm hall */
.lawfirm-hall-head {
  background: linear-gradient(135deg, var(--wood-700), var(--navy-800));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem;
}
.lf-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 900; color: var(--brass-300); }
.lf-tag { color: var(--brass-500); font-size: 0.78em; }
.lf-motto { font-style: italic; color: var(--ink-dim); font-size: 0.9rem; margin-top: 0.2rem; }
.lf-meta { font-size: 0.82rem; color: var(--ink-dim); margin-top: 0.4rem; }
.lf-meta b { color: var(--brass-300); }

.lf-board { display: flex; flex-direction: column; gap: 0.3rem; }
.lf-row {
  display: grid; grid-template-columns: 1.6rem 1fr auto auto; gap: 0.5rem; align-items: center;
  background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.5rem 0.6rem; font-size: 0.86rem;
}
.lf-row.lf-me { border-color: var(--brass-500); background: rgba(212,175,55,0.08); }
.lf-pos { color: var(--ink-faint); font-weight: 700; text-align: center; }
.lf-who { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-rep { color: var(--brass-300); white-space: nowrap; }
.lf-won { color: var(--ink-dim); white-space: nowrap; font-size: 0.8rem; }

/* join list */
.lf-firmlist { display: flex; flex-direction: column; gap: 0.4rem; }
.lf-firm-row {
  display: flex; align-items: center; gap: 0.6rem; justify-content: space-between;
  background: var(--navy-800); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.55rem 0.7rem;
}
.lf-firm-info { min-width: 0; }
.lf-firm-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-firm-sub { font-size: 0.78rem; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-join-btn { flex: 0 0 auto; }

/* =============================================================== RESPONSIVE */
@media (min-width: 560px) {
  .trial-actions { gap: 0.8rem; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .decision-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  :root { --radius: 12px; }
  .app-main { padding-left: 0.6rem; padding-right: 0.6rem; }
  .game-title { font-size: clamp(2.2rem, 14vw, 3rem); }
  .btn { font-size: 0.9rem; }
  .testimony-text { font-size: 1.05rem; }
  .hud-pill { font-size: 0.68rem; padding: 0.22rem 0.4rem; }
  .brand-name { font-size: 0.92rem; }
}

/* ============================================================ A11Y / MOTION */
:focus-visible { outline: 3px solid var(--brass-400); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .dlg-cue { display: none !important; }
}

/* reduced-motion in-game class hook (set on <html> by app when setting on) */
html.rm *, html.rm *::before, html.rm *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
html.rm .dlg-cue { display: none !important; }
