:root {
  --bg: #17150f; --panel: #211e16; --panel2: #2b2719; --ink: #efe9d8; --mute: #b9b19c; --line: #4a4433;
  --gold: #f5d76e; --green: #7ccf8a; --red: #e5484d; --violet: #b18cff; --paper: #f3ecd9; --paperInk: #2a261c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
.hidden { display: none !important; }
.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 80px; }
.top { display: flex; justify-content: space-between; align-items: center; }
.tag { display: inline-block; background: var(--gold); color: #222; font-weight: 800; letter-spacing: .12em; padding: 6px 12px; font-size: 13px; }
.langbtn { border-radius: 999px; padding: 4px 12px; border: 1px solid currentColor; background: transparent; color: inherit; }
h1 { font-size: clamp(30px, 7vw, 48px); line-height: 1.1; margin: 14px 0 10px; }
h2 { font-size: 24px; margin: 34px 0 10px; }
.lead { opacity: .9; font-size: 17px; }
.box { border: 2px solid var(--ink); padding: 16px; margin: 18px 0; box-shadow: 6px 6px 0 var(--line); background: var(--panel); }
.stage { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.status { flex: 1; min-width: 220px; }
.meta { font-size: 14px; opacity: .85; }
.mood { font-size: 18px; font-weight: 600; margin: 8px 0; }
.lives { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.lives span { font-size: 22px; line-height: 1; }
.lives .lost { filter: grayscale(1); opacity: .35; }
.lives small { opacity: .75; margin-left: 6px; }

/* patrons ticker: right to left, content doubled for a seamless loop */
.patrons { display: flex; margin: 16px 0 4px; border: 2px solid var(--gold); background: var(--panel2); font-size: 15px; }
.patrons .plbl { flex: none; background: var(--gold); color: #222; font-weight: 800; padding: 8px 12px; display: flex; align-items: center; white-space: nowrap; }
.patrons .track { overflow: hidden; flex: 1; display: flex; align-items: center; }
.patrons .run { display: inline-block; white-space: nowrap; padding: 8px 0; animation: tick 45s linear infinite; }
.patrons:hover .run { animation-play-state: paused; }
.patrons .pt { margin-right: 36px; }
.patrons .amt { color: var(--gold); font-weight: 700; }
.patrons .badge { font-size: 13px; opacity: .85; font-style: italic; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .patrons .run { animation: none; } .patrons .track { overflow-x: auto; } }

.meter { margin: 10px 0; }
.meter .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; gap: 8px; }
.bar { height: 12px; overflow: hidden; background: #3a352a; }
.fill { height: 100%; transition: width .4s; }
.fill.money { background: var(--gold); } .fill.cases { background: var(--green); } .fill.busy { background: var(--violet); transition: width 1s linear; }
details.costs { margin-top: 8px; font-size: 14px; }
details.costs table { width: 100%; border-collapse: collapse; margin-top: 6px; }
details.costs td { padding: 2px 0; } details.costs td:last-child { text-align: right; white-space: nowrap; }
details.costs .sum td { border-top: 1px solid var(--line); font-weight: 700; padding-top: 4px; }
.busy { margin: 18px 0 0; background: var(--bg); border: 1px dashed var(--line); padding: 12px 14px; }
.busy .k { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.busy ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; } .busy li { margin: 4px 0; }
.rules { margin: 18px 0 0; background: rgba(229,72,77,.1); border: 2px solid var(--red); padding: 12px 16px; line-height: 1.6; }
.rules h3 { margin: 0 0 6px; }
.rules .bad { color: #ff9aa5; font-weight: 700; } .rules .ok { color: var(--green); font-weight: 700; }
#dead { background: #000; border: 2px solid var(--red); padding: 16px; margin-bottom: 12px; font-size: 18px; text-align: center; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.item { text-align: left; padding: 10px; background: var(--panel2); color: var(--ink); border: 1px solid #6b6248; }
.item:hover:not(:disabled) { border-color: var(--gold); }
.item:disabled { opacity: .45; cursor: not-allowed; }
.item b, .item small { display: block; } .item small { opacity: .75; margin-top: 2px; }
.note { font-size: 13px; opacity: .75; }

.form label { display: block; font-size: 14px; margin: 10px 0 4px; }
.form input[type=text], .form textarea, .form select { width: 100%; padding: 8px; border: 1px solid #6b6248; background: var(--bg); color: var(--ink); }
.form textarea { min-height: 100px; }
.form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 6px 0; }
.err { color: #ff9aa5; font-size: 15px; margin: 8px 0; }
.btn { background: var(--gold); color: #222; border: 0; padding: 10px 16px; font-weight: 700; }
.btn:disabled { opacity: .5; }
.thumb { display: flex; gap: 10px; align-items: center; }
.thumb img { width: 72px; height: 72px; object-fit: cover; }

.verdict { background: var(--paper); color: var(--paperInk); padding: 14px; margin-bottom: 12px; }
.verdict.serious { outline: 3px solid #e0a100; }
.verdict .head { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.verdict .charge { font-weight: 700; margin: 6px 0; }
.verdict .quote { font-style: italic; opacity: .8; margin: 6px 0; }
.verdict .ruling { font-weight: 700; }
.verdict .appeal { margin-top: 10px; padding: 10px; border: 2px dashed currentColor; }
.verdict .actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.verdict .actions button { background: #fff; border: 1px solid var(--paperInk); color: var(--paperInk); padding: 4px 10px; }
.verdict figure { margin: 8px 0; text-align: center; }
.verdict figure img { max-width: 160px; max-height: 160px; object-fit: cover; border: 3px solid #222; }
.verdict figcaption { font-size: 12px; opacity: .7; }
.mineTag { display: inline-block; background: var(--gold); color: #222; font-size: 12px; font-weight: 700; padding: 2px 6px; margin-bottom: 6px; }

.diary li { margin: 6px 0; } .diary p { margin: 6px 0; }
.obit { padding: 10px; border-left: 3px solid #888; margin: 8px 0; background: var(--panel); }
footer { margin-top: 40px; font-size: 13px; opacity: .7; }

#alert { position: fixed; top: 16px; left: 50%; transform: translate(-50%, -160%); transition: transform .4s; z-index: 50;
  background: var(--gold); color: #222; border: 3px solid #222; padding: 12px 18px; max-width: min(520px, 92vw); box-shadow: 6px 6px 0 #222; font-weight: 600; text-align: center; }
#alert.show { transform: translate(-50%, 0); }
#alert .big { font-size: 20px; display: block; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal { background: #fff; color: #222; padding: 18px; width: min(440px, 100%); max-height: 92vh; overflow: auto; }
.modal h3 { margin-top: 0; }
.modal .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.modal .row button { flex: 1; padding: 10px; border: 1px solid #222; background: #fff; color: #222; }
.modal .row button.primary { background: #222; color: #fff; }
.modal input { width: 100%; padding: 8px; border: 1px solid #aaa; }
.modal label { display: block; margin: 10px 0 4px; font-size: 14px; }
.modal .qr { display: block; width: 240px; max-width: 100%; margin: 10px auto; }
.modal .code { font: 700 22px ui-monospace, Consolas, monospace; letter-spacing: .08em; background: #f5d76e; padding: 4px 10px; display: inline-block; }
.modal .small { font-size: 13px; color: #555; }

/* live viewer line */
.viewers { margin-top: 10px; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.viewers .vtoday { opacity: .75; margin-left: auto; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 0 0 rgba(255,59,59,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255,59,59,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* fonts loaded in index.html */
body { font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ======================================================================
   Theme: Báo lá cải — newsprint tabloid, three columns on wide screens (chosen from the layout prototype, 2026-10-26)
   ====================================================================== */
body {
  --bg: #f2eee3; --panel: #fbf8f0; --panel2: #fff; --ink: #161616; --mute: #555; --line: #161616;
  --gold: #d7261e; --green: #1d6b3a; --red: #d7261e; --violet: #555; --paper: #fff; --paperInk: #161616;
  background: var(--bg) repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.015) 3px 4px);
  font-family: "Noto Serif", Georgia, serif;
}
body .wrap { max-width: 1180px; display: grid; gap: 0 28px;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  /* three independent columns: a long run of rulings in the middle never pushes "Feed Miu" or the diary down */
  grid-template-areas: "hero hero hero" "patrons patrons patrons" "jump jump jump" "left rulings side" "foot foot foot"; }
body #s-hero { grid-area: hero; text-align: center; border-bottom: 6px double var(--ink); padding-bottom: 10px; }
body #s-patrons { grid-area: patrons; }
body #s-jump { grid-area: jump; }
body #s-left { grid-area: left; align-self: start; }
body #s-rulings { grid-area: rulings; align-self: start; }
body #s-side { grid-area: side; align-self: start; }
body #s-foot { grid-area: foot; }
/* jump bar: sticks to the top so every section is one tap away */
#s-jump { position: sticky; top: 0; z-index: 20; display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: center;
  background: var(--bg); border-bottom: 1px solid var(--ink); padding: 8px 4px; font-size: 14px; font-weight: 700; }
#s-jump a { color: var(--ink); text-decoration: none; white-space: nowrap; }
#s-jump a:hover { text-decoration: underline; }
section[id^="s-"], aside[id^="s-"] { scroll-margin-top: 52px; }
/* older rulings collapse to one line */
.vbrief { border-bottom: 1px solid var(--ink); padding: 8px 0; }
.vbrief > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.vbrief > summary::-webkit-details-marker { display: none; }
.vbrief > summary::before { content: "▸"; }
.vbrief[open] > summary::before { content: "▾"; }
.vbrief .vno { font-size: 12px; opacity: .65; white-space: nowrap; }
.vbrief .vcharge { font-weight: 700; }
.vbrief .vtag { font-size: 11px; font-weight: 900; padding: 1px 6px; background: var(--red); color: #fff; white-space: nowrap; }
.vbrief .vtag.urgent { background: #e0a100; color: #1a1a1a; }
.vbrief .verdict { margin-top: 10px; }
.olderhead { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin: 18px 0 4px; }
body .top { border-bottom: 1px solid var(--ink); padding-bottom: 6px; font-size: 13px; gap: 8px; }
body .dateline { display: inline; font-style: italic; }
body .tag { background: var(--ink); color: #fff; }
body h1 { font-weight: 900; font-size: clamp(40px, 9vw, 96px); letter-spacing: -.02em; text-transform: uppercase; margin: 8px 0 0; }
body .lead { font-size: 19px; font-style: italic; max-width: 820px; margin: 6px auto 0; }
body h2 { font-weight: 900; text-transform: uppercase; font-size: 20px; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 4px 0; margin: 22px 0 12px; }
body .patrons { border: 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: #fff; }
body .patrons .plbl { background: var(--red); color: #fff; text-transform: uppercase; letter-spacing: .08em; }
body .patrons .amt { color: var(--red); }
body .box { border: 0; border-top: 3px solid var(--ink); box-shadow: none; background: transparent; padding: 12px 0; }
body #s-status .stage { flex-direction: column; text-align: center; }
body #miu svg { filter: grayscale(1) contrast(1.2); border: 2px solid var(--ink); background: #fff; padding: 6px; }
body .mood { font-size: 22px; font-weight: 900; font-style: italic; }
body .bar { background: #ddd8c8; }
body .busy { background: #fff; border: 1px solid var(--ink); }
body .rules { background: #fff; border: 2px solid var(--red); }
body .verdict { background: transparent; border-bottom: 1px solid var(--ink); padding: 0 0 16px; margin-bottom: 16px; }
body .verdict .charge { font-size: 26px; font-weight: 900; line-height: 1.15; }
body .verdict .actions button { background: var(--ink); color: #fff; }
body .item { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
body .form input[type=text], body .form textarea, body .form select { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
body .btn { background: var(--red); color: #fff; text-transform: uppercase; }
body .obit { background: #fff; border-left: 4px solid var(--ink); }
body .err, body .rules .bad { color: var(--red); }
@media (max-width: 980px) {
  /* one column on phones: the column wrappers dissolve so each section can be placed on its own */
  body .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "patrons" "jump" "file" "status" "feed" "rulings" "diary" "obits" "foot"; }
  body #s-left, body #s-side { display: contents; }
  body #s-status { grid-area: status; } body #s-feed { grid-area: feed; } body #s-file { grid-area: file; }
  body #s-diary { grid-area: diary; } body #s-obits { grid-area: obits; }
}


.verdict .summary { font-size: 14px; opacity: .8; margin: -2px 0 8px; }

#trial { border: 2px dashed currentColor; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; font-weight: 700; }

/* cruelty: the one case where the plaintiff is convicted */
.verdict.cruelty { outline: 4px solid #d7261e; background: #fff1f0; }
.verdict .fury { display: inline-block; background: #d7261e; color: #fff; font-weight: 900; letter-spacing: .06em; padding: 4px 10px; margin: 6px 0 2px; }
.verdict .urgent { display: inline-block; background: #e0a100; color: #1a1a1a; font-weight: 900; letter-spacing: .06em; padding: 4px 10px; margin: 6px 0 2px; }

/* history: busy work and diary days */
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; font: inherit; font-size: 14px; }
.linkbtn:disabled { opacity: .35; text-decoration: none; cursor: default; }
.morebar { display: flex; gap: 16px; margin-top: 8px; }
.busy .busylist { max-height: 420px; overflow-y: auto; padding-right: 6px; }
.busy .when { font-size: 12px; opacity: .6; margin-right: 4px; white-space: nowrap; }
.diarynav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.diarynav h3 { margin: 0; text-align: center; white-space: nowrap; }
.diarynav .linkbtn { white-space: nowrap; }
.diary .daysum { border-left: 3px solid currentColor; padding-left: 10px; }
.diary .pastdays { margin-top: 12px; border-top: 1px solid rgba(127,127,127,.4); padding-top: 8px; }

/* full revival: gold banner and pinned thank-you */
#alert.revive { background: linear-gradient(90deg, #ffd84d, #fff3b0, #ffd84d); border-color: #b8860b; }
.diary li.thanks { background: rgba(232,184,74,.18); border-left: 3px solid #e8b84a; padding: 6px 10px; list-style: none; margin-left: -18px; }
details.costs .feerow td { padding-top: 4px; }
details.costs .feerow small { opacity: .65; }

/* report button: quiet, so it doesn't compete with share/appeal */
body .verdict .actions .reportbtn { background: transparent; color: inherit; border: 0; text-decoration: underline; opacity: .6; margin-left: auto; padding: 4px 0; }
body .verdict .actions .reportbtn:disabled { text-decoration: none; opacity: .4; }
