
:root {
  --ink: #1a1320; --ink2: #2d2433; --ink3: #4a3f52; --mute: #6f6577;
  --paper: #f3ecdf; --paper2: #e8dcc6; --paper3: #d9c9ab;
  --red: #ae2a32; --red2: #df4a45; --red3: #6e1a22;
  --gold: #f5cf5f; --gold2: #c99532; --green: #4b8a3c; --green2: #7db34a; --blue: #2c5a8c; --blue2: #4f8fc4;
  --night: #120e1a;
  --tex: none;
  --ui-font: 'Pixelify Sans', ui-monospace, monospace;
  --head-font: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --story-font: 'Lora', Georgia, serif;
  /* HUD geometry (narrowed by the compact layout below) */
  --lw: 360px;   /* left panel width */
  --rw: 310px;   /* right column width */
  --mmw: 260px;  /* minimap box (canvas + 2px padding each side) */
  --mmh: 164px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); font-family: var(--ui-font); font-size: 15px; user-select: none; -webkit-user-select: none; }
canvas#view { position: fixed; inset: 0; display: block; cursor: grab; image-rendering: pixelated; }
canvas#view.dragging { cursor: grabbing; }
canvas#view.placing { cursor: crosshair; }
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
button { font-family: var(--ui-font); cursor: pointer; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- paper */
.paper {
  background-color: var(--paper);
  background-image: var(--tex);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold2), 0 0 0 6px var(--ink), 6px 8px 0 6px rgba(0,0,0,0.35);
}
.paper-dark {
  background-color: #231b2b;
  background-image: var(--tex);
  color: var(--paper);
  box-shadow: 0 0 0 2px #0c0810, 0 0 0 4px var(--red), 0 0 0 6px #0c0810, 5px 7px 0 6px rgba(0,0,0,0.4);
}

/* ---------------------------------------------------------------- top bar */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 50px; z-index: 20;
  background: linear-gradient(#2a1f33, #1a1320); border-bottom: 3px solid var(--red);
  box-shadow: 0 3px 0 #0c0810, 0 6px 14px rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--paper);
}
#logo { display: flex; align-items: center; gap: 8px; padding-right: 10px; border-right: 2px solid #3d3147; height: 100%; }
#logo .star { width: 28px; height: 28px; }
#logo .t1 { font-family: var(--head-font); font-weight: 700; font-size: 20px; letter-spacing: 1.5px; line-height: 1; color: var(--paper); text-shadow: 2px 2px 0 var(--red3); }
#logo .t2 { font-size: 11.5px; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; }
#datebox { min-width: 150px; line-height: 1.15; cursor: default; }
#datebox .d1 { font-family: var(--head-font); font-size: 16px; letter-spacing: 1px; text-transform: uppercase; }
#datebox .d2 { font-size: 12px; color: #bfb3c6; }
#dayring { width: 30px; height: 30px; }
#resbar { display: flex; gap: 3px; flex: 1; overflow: hidden; min-width: 0; }
.res {
  display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 4px; border-radius: 2px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08); min-width: 0; cursor: default; flex-shrink: 1;
}
.res:hover { background: rgba(255,255,255,0.13); }
.res img { width: 24px; height: 24px; flex-shrink: 0; }
.res .v { font-size: 14px; font-weight: 600; color: var(--paper); white-space: nowrap; }
.res .r { font-size: 11.5px; white-space: nowrap; }
.res .r .wbi { display: none; width: 11px; height: 11px; margin-right: 2px; vertical-align: -1px; }
.res .r.pos { color: #9fd67a; } .res .r.neg { color: #ff8a80; } .res .r.zero { color: #9a90a6; }
.res.warn { background: rgba(223,74,69,0.25); border-color: var(--red2); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 rgba(223,74,69,0); } to { box-shadow: 0 0 10px rgba(223,74,69,0.8); } }
#speed { display: flex; gap: 2px; }
.tbtn {
  background: #3a2e44; color: var(--paper); border: 2px solid #0c0810; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.1);
  padding: 4px 8px; font-size: 13px; font-weight: 600; min-width: 32px; height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.tbtn:hover { background: #4d3e5a; }
.tbtn.on { background: var(--red); color: #fff; }
.tbtn img { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- panels */
#left { position: fixed; left: 14px; top: 64px; bottom: 110px; width: var(--lw); z-index: 15; display: flex; flex-direction: column; }
#left .paper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
/* bottom clears the minimap (bottom 40px + its height + frame + gap) at every size */
#right { position: fixed; right: 14px; top: 64px; width: var(--rw); z-index: 15; display: flex; flex-direction: column; gap: 12px; bottom: calc(var(--mmh) + 58px); overflow-y: auto; overflow-x: hidden; padding: 6px 8px 8px 6px; }
#right > .alerts { order: -1; } /* urgent alerts first, never scrolled out of sight */
#right > .alerts:empty { display: none; }
/* collapse tab on the right column's edge */
#rtoggle { position: fixed; top: 72px; right: calc(var(--rw) + 14px); z-index: 16; width: 20px; height: 48px; padding: 0; background: #231b2b; color: var(--gold); border: 2px solid #0c0810; border-right: none; box-shadow: -3px 3px 0 rgba(0,0,0,0.35); font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; }
#rtoggle:hover { background: var(--red); color: var(--paper); }
body.rcollapsed #right { display: none; }
body.rcollapsed #rtoggle { right: 0; }
#right::-webkit-scrollbar { width: 6px; } #right::-webkit-scrollbar-thumb { background: #4a3f52; }
.phead {
  background: var(--red); color: var(--paper); padding: 8px 10px 6px; position: relative;
  border-bottom: 3px solid var(--ink); display: flex; align-items: center; gap: 8px;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 6px, transparent 6px 12px);
}
.phead h2 { margin: 0; font-family: var(--head-font); font-weight: 700; font-size: 22px; letter-spacing: 1px; text-transform: uppercase; line-height: 1; text-shadow: 2px 2px 0 var(--red3); }
.phead .sub { font-size: 12px; color: #ffd9c9; margin-top: 3px; }
.phead .x { margin-left: auto; background: var(--red3); border: 2px solid var(--ink); color: var(--paper); width: 26px; height: 26px; font-weight: 700; }
.phead .x:hover { background: var(--ink); }
.pbody { padding: 10px 12px 12px; overflow-y: auto; flex: 1; }
.pbody::-webkit-scrollbar, .scroll::-webkit-scrollbar { width: 10px; }
.pbody::-webkit-scrollbar-thumb, .scroll::-webkit-scrollbar-thumb { background: var(--paper3); border: 2px solid var(--paper); }
.tabs { display: flex; border-bottom: 3px solid var(--ink); background: var(--paper2); }
.tab { flex: 1; padding: 6px 2px 5px; font-family: var(--head-font); font-weight: 500; font-size: 13px; letter-spacing: 0.5px; text-transform: uppercase; background: none; border: none; border-right: 2px solid var(--paper3); color: var(--ink3); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tab img { width: 20px; height: 20px; }
.tab:last-child { border-right: none; }
.tab:hover { background: var(--paper); color: var(--ink); }
.tab.on { background: var(--paper); color: var(--red); box-shadow: inset 0 -3px 0 var(--red); }
.tab .badge { position: absolute; }
h3 { font-family: var(--head-font); font-weight: 700; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; margin: 12px 0 6px; color: var(--red3); border-bottom: 2px dashed var(--paper3); padding-bottom: 3px; display: flex; align-items: center; gap: 6px; }
h3:first-child { margin-top: 2px; }
h3 .aside { margin-left: auto; font-family: var(--ui-font); font-weight: 400; font-size: 12px; color: var(--mute); letter-spacing: 0; text-transform: none; }
.row { display: flex; align-items: center; gap: 6px; }
.muted { color: var(--mute); }
.small { font-size: 12px; }
.story { font-family: var(--story-font); font-size: 14px; line-height: 1.5; }
.good { color: var(--green); } .bad { color: var(--red); } .warn { color: #b85a2a; }

.btn {
  background: var(--paper2); color: var(--ink); border: 2px solid var(--ink); padding: 6px 10px; font-size: 13px; font-weight: 600;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15), 2px 2px 0 var(--ink); display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  transition: transform 0.05s;
}
.btn:hover { background: #fff8ea; }
.btn:active { transform: translate(2px, 2px); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15); }
.btn.red { background: var(--red); color: var(--paper); }
.btn.red:hover { background: var(--red2); }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #ffe08a; }
.btn.dark { background: var(--ink2); color: var(--paper); }
.btn[disabled] { opacity: 0.45; pointer-events: none; filter: grayscale(0.4); }
.btn.disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.btn.disabled:hover { transform: none; }
.btn.sm { padding: 3px 6px; font-size: 12px; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15), 1px 1px 0 var(--ink); }
.btn img { width: 18px; height: 18px; }
.btn.wide { width: 100%; }

.bar { height: 10px; background: var(--paper3); border: 2px solid var(--ink); position: relative; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green2); transition: width 0.3s; }
.bar.red > i { background: var(--red2); } .bar.gold > i { background: var(--gold2); } .bar.blue > i { background: var(--blue2); }
.bar.big { height: 14px; }

/* stock rows */
.stock { display: grid; grid-template-columns: 22px 64px 1fr 56px; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px dotted var(--paper3); }
.stock img { width: 22px; height: 22px; }
.stock .nm { font-size: 13px; }
.stock .amt { font-size: 11.5px; color: var(--mute); margin-top: 2px; }
.stock .rt { text-align: right; font-size: 13px; font-weight: 600; }
.pos { color: var(--green); } .neg { color: var(--red); }
.kv { display: flex; justify-content: space-between; padding: 2px 0; font-size: 13px; border-bottom: 1px dotted var(--paper3); }
.chip { display: inline-flex; align-items: center; gap: 3px; background: var(--paper2); border: 1px solid var(--paper3); padding: 1px 5px; font-size: 12px; margin: 1px; }
.chip img { width: 14px; height: 14px; }
.chip.red { background: #f4d0cd; border-color: #d69894; }
.chip.green { background: #dcebc8; border-color: #a8c68a; }
.chip.dark { background: var(--ink2); color: var(--paper); border-color: var(--ink); }

/* labor */
.job { display: grid; grid-template-columns: 30px 1fr 64px; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px dotted var(--paper3); }
.job img { width: 28px; height: 28px; }
.job .jn { font-size: 13px; font-weight: 600; }
.job .jo { font-size: 11.5px; color: var(--mute); }
.job .ctl { display: flex; align-items: center; gap: 3px; justify-content: flex-end; font-weight: 700; }
.job .ctl button { width: 20px; height: 20px; padding: 0; border: 2px solid var(--ink); background: var(--paper2); font-weight: 700; line-height: 1; }
.prio { display: grid; grid-template-columns: 22px 70px 1fr; gap: 6px; align-items: center; padding: 3px 0; }
.prio img { width: 20px; height: 20px; }
.seg { display: flex; border: 2px solid var(--ink); }
.seg button { flex: 1; border: none; border-right: 1px solid var(--ink); background: var(--paper2); font-size: 11.5px; padding: 3px 0; color: var(--ink3); }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--red); color: var(--paper); font-weight: 700; }
.seg button.on.l1 { background: #b89a6a; } .seg button.on.l0 { background: var(--ink3); } .seg button.on.l3 { background: #c86b2a; } .seg button.on.l4 { background: var(--red3); }
.laborsum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 6px; }
.laborsum div { background: var(--paper2); border: 2px solid var(--ink); text-align: center; padding: 4px 2px; }
.laborsum b { display: block; font-size: 18px; }
.laborsum span { font-size: 11.5px; color: var(--mute); text-transform: uppercase; }

/* build cards */
.cats { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px; }
.cats button { font-size: 12px; padding: 3px 6px; background: var(--paper2); border: 2px solid var(--ink); display: inline-flex; align-items: center; gap: 3px; }
.cats button img { width: 16px; height: 16px; }
.cats button.on { background: var(--ink2); color: var(--paper); }
.bcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bcard { background: #fff9ee; border: 2px solid var(--ink); padding: 6px; cursor: pointer; position: relative; box-shadow: 2px 2px 0 var(--ink); display: flex; flex-direction: column; gap: 3px; }
.bcard:hover { background: #fff; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.bcard .bimg { height: 52px; display: flex; align-items: flex-end; justify-content: center; background: linear-gradient(#cfe3d0, #9cc48a); border: 1px solid var(--paper3); }
.bcard .bimg img { max-height: 48px; }
.bcard .bn { font-size: 13px; font-weight: 700; line-height: 1.1; }
.bcard .bc { font-size: 11.5px; display: flex; flex-wrap: wrap; gap: 2px; }
.bcard .bc span { display: inline-flex; align-items: center; gap: 1px; }
.bcard .bc img { width: 12px; height: 12px; }
.bcard .bc .no { color: var(--red); font-weight: 700; }
.bcard .bt { font-size: 11.5px; color: var(--mute); }
.bcard.locked { opacity: 0.55; cursor: not-allowed; }
.bcard.locked .bimg { filter: grayscale(1); }
.bcard .cnt { position: absolute; top: 4px; right: 4px; background: var(--ink); color: var(--paper); font-size: 11.5px; padding: 0 4px; }

/* queue */
.qitem { display: grid; grid-template-columns: 26px 1fr 20px; gap: 6px; align-items: center; margin: 3px 0; }
.qitem img { width: 24px; height: 24px; }
.qitem .qn { font-size: 12px; }
.qitem button { width: 20px; height: 20px; padding: 0; border: 2px solid var(--ink); background: var(--paper2); font-size: 11.5px; }

/* right column */
.card { padding: 0; }
.card .phead h2 { font-size: 16px; }
.goal { display: grid; grid-template-columns: 18px 1fr; gap: 6px; padding: 6px 10px; border-bottom: 1px dotted var(--paper3); }
.goal img { width: 16px; height: 16px; margin-top: 2px; }
.goal .gt { font-weight: 700; font-size: 13px; }
.goal .gh { font-size: 12px; color: var(--ink3); line-height: 1.3; margin-top: 2px; font-family: var(--story-font); }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 8px; align-items: center; padding: 8px 10px; cursor: pointer; }
.alert img { width: 28px; height: 28px; }
.alert b { font-family: var(--head-font); letter-spacing: 0.5px; text-transform: uppercase; font-size: 14px; display: block; }
.alert span { font-size: 12px; }
.alert.council { background: var(--gold); animation: glow 1.4s infinite alternate; }
.alert.danger { background: #f6c6c1; animation: glow2 0.8s infinite alternate; }
.alert.event { background: #dfe9f4; }
@keyframes glow { from { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold2), 0 0 0 6px var(--ink); } to { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold2), 0 0 0 6px var(--ink), 0 0 18px 6px rgba(245,207,95,0.7); } }
@keyframes glow2 { from { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--red), 0 0 0 6px var(--ink); } to { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--red), 0 0 0 6px var(--ink), 0 0 18px 6px rgba(223,74,69,0.7); } }

#toasts { position: fixed; left: 50%; transform: translateX(-50%); top: 60px; width: 460px; z-index: 30; display: flex; flex-direction: column; gap: 6px; pointer-events: none; align-items: center; transition: top 0.2s; }
#toasts.low { top: 128px; }
.toast .cnt { margin-left: auto; background: var(--ink); color: var(--paper); font-size: 11.5px; padding: 0 5px; }
.toast { width: 100%; pointer-events: auto; display: flex; gap: 8px; align-items: center; padding: 7px 10px; font-size: 13px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); animation: tin 0.25s ease-out; cursor: pointer; border-left: 6px solid var(--ink3); }
.toast img { width: 22px; height: 22px; flex-shrink: 0; }
.toast.good { border-left-color: var(--green); } .toast.bad, .toast.danger { border-left-color: var(--red); background: #fbe3e0; } .toast.council, .toast.goal { border-left-color: var(--gold2); background: #fdf3d6; } .toast.event { border-left-color: var(--blue); }
.toast.out { animation: tout 0.4s forwards; }
@keyframes tin { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tout { to { transform: translateY(-10px); opacity: 0; } }

/* bottom bar */
#bottombar { position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: 6px; padding: 6px; background: #231b2b; border: 2px solid #0c0810; box-shadow: 0 0 0 2px var(--red), 0 0 0 4px #0c0810, 4px 6px 0 4px rgba(0,0,0,0.4); }
.bbtn { position: relative; width: 74px; height: 58px; background: #3a2e44; border: 2px solid #0c0810; color: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.08); }
.bbtn img { width: 28px; height: 28px; }
.bbtn:hover { background: #4d3e5a; transform: translateY(-2px); }
.bbtn.on { background: var(--red); }
.bbtn .key { position: absolute; top: 2px; left: 4px; font-size: 11px; color: #8e8298; }
.badge { position: absolute; top: -8px; right: -8px; background: var(--red2); color: #fff; border: 2px solid var(--ink); min-width: 20px; height: 20px; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 3px; animation: bounce 1s infinite; }
@keyframes bounce { 50% { transform: translateY(-3px); } }

#ticker { position: fixed; bottom: 0; left: 0; right: 0; height: 26px; background: var(--paper); border-top: 3px solid var(--ink); z-index: 19; display: flex; align-items: center; overflow: hidden; }
#ticker .mast { background: var(--red); color: var(--paper); font-family: var(--head-font); font-weight: 700; letter-spacing: 1px; padding: 0 12px; height: 100%; display: flex; align-items: center; white-space: nowrap; border-right: 3px solid var(--ink); z-index: 1; }
#ticker .roll { white-space: nowrap; font-family: var(--head-font); font-weight: 500; letter-spacing: 0.5px; font-size: 13px; color: var(--ink); padding-left: 100%; animation: roll 70s linear infinite; }
#ticker .roll span { margin-right: 60px; }
#ticker .roll span::before { content: '★ '; color: var(--red); }
@keyframes roll { to { transform: translateX(-100%); } }

#minimap { position: fixed; right: 14px; bottom: 40px; z-index: 16; width: var(--mmw); height: var(--mmh); padding: 2px; background: #0c0810; box-shadow: 0 0 0 2px var(--gold2), 0 0 0 4px #0c0810, 4px 6px 0 4px rgba(0,0,0,0.4); cursor: pointer; }
#minimap canvas { width: calc(var(--mmw) - 4px); height: calc(var(--mmh) - 4px); image-rendering: pixelated; display: block; }

/* centered between the side panels so it never covers them */
#hintbar { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 25; padding: 8px 12px; display: flex; gap: 10px; align-items: center; font-size: 13px; max-width: min(680px, calc(100vw - 2 * var(--lw) - 64px)); }
#hintbar img { width: 32px; height: 32px; }

#tooltip { position: fixed; z-index: 100; pointer-events: none; max-width: 300px; background: var(--ink); color: var(--paper); border: 2px solid var(--gold2); padding: 7px 9px; font-size: 13px; line-height: 1.35; box-shadow: 3px 3px 0 rgba(0,0,0,0.5); }
#tooltip b { color: var(--gold); }
#tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; }
#tooltip hr { border: none; border-top: 1px dashed #5a4d66; margin: 4px 0; }
#tooltip .story { font-size: 13px; color: #d9cfe0; font-style: italic; }

/* ---------------------------------------------------------------- modals */
#modal-root { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; background: rgba(8,6,14,0.72); }
#modal-root.open { display: flex; animation: fadein 0.2s; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(920px, 94vw); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; animation: pop 0.22s ease-out; }
.modal.wide { width: min(1180px, 96vw); }
.modal.narrow { width: min(560px, 94vw); }
@keyframes pop { from { transform: scale(0.94) translateY(10px); opacity: 0; } }
.modal .pbody { padding: 14px 18px 18px; }
.mfoot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 3px solid var(--ink); background: var(--paper2); }

/* council */
.hall { position: relative; background: #3b2618; border-bottom: 4px solid var(--ink); }
.hall canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.seats { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 6px; padding: 0 10px; flex-wrap: nowrap; }
.hall canvas { display: block; width: 100%; height: 250px; object-fit: cover; object-position: 50% 0; }
.hotspot { position: absolute; cursor: help; }
.seat { position: relative; flex: 0 1 86px; min-width: 0; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform 0.15s; }
.seat:hover { transform: translateY(-4px); }
.seat .pf { width: 100%; max-width: 84px; aspect-ratio: 1; border: 4px solid var(--ink); background: var(--ink); box-shadow: 0 0 0 2px var(--gold2); position: relative; }
.seat .pf img { width: 100%; height: 100%; display: block; }
.seat .pf.st-aye2 { border-color: #4b8a3c; } .seat .pf.st-aye1 { border-color: #9cc44f; } .seat .pf.st-nay1 { border-color: #e58a82; } .seat .pf.st-nay2 { border-color: #ae2a32; } .seat .pf.st-und { border-color: #d9c9ab; }
.seat.sel .pf { box-shadow: 0 0 0 3px var(--gold), 0 0 16px 4px rgba(245,207,95,0.8); }
.seat .nm { margin-top: 3px; background: var(--ink); color: var(--paper); font-size: 11.5px; padding: 1px 4px; white-space: nowrap; }
.seat .st { font-size: 11px; padding: 1px 4px; margin-top: 2px; border: 1px solid var(--ink); white-space: nowrap; font-weight: 700; text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.st.aye2 { background: #4b8a3c; color: #fff; } .st.aye1 { background: #b8d56a; } .st.und { background: #e8dcc6; } .st.nay1 { background: #f2a7a0; } .st.nay2 { background: #ae2a32; color: #fff; }
.seat .vote { position: absolute; top: 14px; left: 50%; transform: translateX(-50%) scale(0); font-family: var(--head-font); font-weight: 700; font-size: 20px; padding: 2px 8px; border: 3px solid var(--ink); transition: transform 0.25s cubic-bezier(.5,1.8,.5,1); z-index: 2; }
.seat .vote.show { transform: translateX(-50%) scale(1) rotate(-6deg); }
.vote.aye { background: var(--green2); } .vote.nay { background: var(--red2); color: #fff; }
.bubble { position: absolute; bottom: 118px; left: 50%; transform: translateX(-50%); width: 230px; background: var(--paper); border: 3px solid var(--ink); padding: 7px 9px; font-family: var(--story-font); font-size: 13.5px; line-height: 1.35; box-shadow: 3px 3px 0 rgba(0,0,0,0.4); z-index: 5; animation: pop 0.2s; pointer-events: none; }
.bubble::after { content: ''; position: absolute; bottom: -12px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.bubble b { font-family: var(--ui-font); font-size: 12px; color: var(--red); display: block; }
.bubble.yes { border-color: var(--green); } .bubble.no { border-color: var(--red); }
.cgrid { display: grid; grid-template-columns: 1fr 250px; gap: 16px; }
.motion { --mpy: 12px; --mpx: 14px; background: #fff9ee; border: 3px solid var(--ink); padding: var(--mpy) var(--mpx); box-shadow: 4px 4px 0 var(--ink); position: relative; }
/* The item's action row (Call the vote / Next item / Adjourn) is a sticky footer: it stays
   on screen while the Council body scrolls, whatever the window height. */
#citem > .motion > .row:last-child { position: sticky; bottom: 0; z-index: 3; margin: 10px calc(-1 * var(--mpx)) calc(-1 * var(--mpy)); padding: 8px var(--mpx) var(--mpy); background: #fff9ee; border-top: 2px dashed var(--paper3); }
.motion .mt { font-family: var(--head-font); font-weight: 700; font-size: 24px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--red3); line-height: 1.05; }
.motion .mp { font-size: 12px; color: var(--mute); margin: 4px 0 8px; }
.motion .mx { font-family: var(--story-font); font-size: 15px; line-height: 1.5; }
.motion .stamp { position: absolute; right: 14px; top: 10px; font-family: var(--head-font); font-weight: 700; font-size: 26px; border: 4px solid currentColor; padding: 2px 10px; transform: rotate(8deg); opacity: 0.85; }
.stamp.pass { color: var(--green); } .stamp.fail { color: var(--red); }
.tally { display: flex; height: 22px; border: 3px solid var(--ink); margin: 10px 0 4px; font-size: 12px; font-weight: 700; }
.tally div { display: flex; align-items: center; justify-content: center; transition: flex 0.4s; overflow: hidden; white-space: nowrap; }
.tally .a { background: var(--green2); } .tally .u { background: var(--paper2); } .tally .n { background: var(--red2); color: #fff; }
.chairpos { display: flex; gap: 6px; margin-top: 8px; }
.chairpos .btn { flex: 1; }
.chairpos .btn.on { background: var(--ink); color: var(--paper); }
.args { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.args .btn { flex-direction: column; align-items: flex-start; text-align: left; padding: 6px 8px; }
.args .btn small { font-weight: 400; font-size: 11.5px; color: var(--ink3); }
.agenda .ai { padding: 5px 8px; border: 2px solid var(--ink); margin-bottom: 4px; font-size: 12px; background: var(--paper2); }
.agenda .ai.cur { background: var(--gold); }
.agenda .ai.done { opacity: 0.7; }
.effects { margin-top: 8px; font-size: 13px; }
.axis { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; padding: 1px 5px; border: 1px solid var(--ink); margin: 2px 2px 0 0; background: #fff; text-transform: uppercase; }
.axis.up { background: #dcebc8; } .axis.down { background: #f4d0cd; }
.dele-card { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px; border: 2px solid var(--ink); background: #fff9ee; margin-bottom: 8px; box-shadow: 2px 2px 0 var(--ink); }
.dele-card > img { width: 68px; height: 68px; border: 2px solid var(--ink); }
.dele-card .btn img { width: 16px; height: 16px; }
.dele-card .dn { font-family: var(--head-font); font-weight: 700; font-size: 16px; text-transform: uppercase; }
.dele-card .dr { font-size: 12px; color: var(--red3); }
.dele-card .db { font-family: var(--story-font); font-size: 13px; margin-top: 3px; line-height: 1.35; }

/* research */
.ttree { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 30px; position: relative; }
.tlines { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; }
.tcol { position: relative; z-index: 1; }
.tcol h4 { font-family: var(--head-font); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 8px; font-size: 15px; background: var(--ink); color: var(--gold); padding: 4px 8px; }
.tech { border: 2px solid var(--ink); background: #fff9ee; padding: 6px 8px; margin-bottom: 8px; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); position: relative; }
.tech:hover { background: #fff; }
.tech .tn { font-family: var(--head-font); font-weight: 700; font-size: 15px; letter-spacing: 0.3px; text-transform: uppercase; color: var(--ink); }
.tech .td { font-family: var(--story-font); font-size: 13.5px; color: var(--ink); margin: 2px 0 4px; line-height: 1.35; }
.tech.done { background: #dcebc8; }
.tech.done::after { content: '✔'; position: absolute; top: 4px; right: 6px; color: var(--green); font-weight: 700; }
.tech.cur { background: var(--gold); box-shadow: 0 0 0 2px var(--red), 2px 2px 0 var(--ink); }
.tech.locked { opacity: 0.5; cursor: not-allowed; }
.tech .req { font-size: 12px; color: var(--red3); font-weight: 700; }

/* story / event */
.storyart { background: radial-gradient(ellipse at center 80%, #f5cf5f 0%, #e89243 30%, #ae2a32 70%, #6e1a22 100%); border-bottom: 4px solid var(--ink); display: flex; justify-content: center; align-items: flex-end; min-height: 220px; position: relative; overflow: hidden; }
.storyart::before { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 100%, rgba(255,255,255,0.08) 0deg 8deg, transparent 8deg 16deg); }
.storyart img { position: relative; image-rendering: pixelated; margin-bottom: 10px; filter: drop-shadow(4px 4px 0 rgba(0,0,0,0.35)); }
.evgrid { display: grid; grid-template-columns: 110px 1fr; gap: 16px; }
.evgrid .portrait { width: 104px; height: 104px; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choices .btn { justify-content: space-between; text-align: left; padding: 9px 12px; font-size: 13px; }
.choices .btn small { font-weight: 400; color: var(--ink3); font-size: 12px; }
.outcome { margin-top: 12px; padding: 10px 12px; background: #fff9ee; border: 2px dashed var(--ink3); }

/* title */
#title { position: fixed; inset: 0; z-index: 60; background: #120e1a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#title canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#title .tcard { position: relative; text-align: center; color: var(--paper); margin-top: -34vh; }
#title .ttl { font-family: var(--head-font); font-weight: 700; font-size: clamp(42px, 8vw, 110px); letter-spacing: 4px; line-height: 0.95; text-shadow: 4px 4px 0 var(--red3), 8px 8px 0 rgba(0,0,0,0.4); color: var(--paper); }
#title .ttl span { color: var(--gold); }
#title .tsub { font-family: var(--head-font); font-size: clamp(14px, 1.6vw, 20px); letter-spacing: 6px; text-transform: uppercase; margin: 14px 0 26px; color: #ffe2c9; text-shadow: 2px 2px 0 rgba(0,0,0,0.6); }
#title .tbtns { display: flex; gap: 14px; justify-content: center; }
#title .btn { font-size: 18px; padding: 12px 26px; font-family: var(--head-font); letter-spacing: 2px; text-transform: uppercase; }
#title .foot { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(243,236,223,0.6); }
.intro { max-width: 640px; margin: 0 auto; }
.intro p { font-family: var(--story-font); font-size: 17px; line-height: 1.6; margin: 0 0 14px; animation: fadein 0.8s both; }
.intro p:last-child { font-style: italic; color: var(--red3); font-weight: 600; }

.eracard { text-align: center; padding: 30px 20px; }
.eracard .en { font-family: var(--head-font); font-size: 14px; letter-spacing: 6px; color: var(--red); text-transform: uppercase; }
.eracard .et { font-family: var(--head-font); font-weight: 700; font-size: 54px; text-transform: uppercase; letter-spacing: 2px; line-height: 1; margin: 6px 0 10px; }
.eracard .es { font-family: var(--story-font); font-size: 17px; font-style: italic; }

.log { font-size: 13px; }
.log .le { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px dotted var(--paper3); line-height: 1.35; }
.log .ld { color: var(--mute); font-size: 12px; }
.log.nodate .le { grid-template-columns: 1fr; }
.log .le.good .lt { color: #2e5b35; } .log .le.bad .lt { color: var(--red); } .log .le.council .lt { color: #6e4a10; }
.filters { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.chart { width: 100%; height: 140px; border: 2px solid var(--ink); background: #fff9ee; }

textarea.save { width: 100%; height: 110px; font-family: monospace; font-size: 12px; border: 2px solid var(--ink); background: #fff9ee; }

.advice { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 6px 8px; background: #fdf3d6; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); margin-bottom: 6px; }
.advice > img { width: 22px; height: 22px; }
.advice .btn img { width: 16px; height: auto; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.plancard { border: 3px solid var(--ink); background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 5px; box-shadow: 3px 3px 0 var(--ink); border-top: 8px solid var(--pc); }
.plancard.champ { background: #fdf3d6; box-shadow: 0 0 0 3px var(--gold), 3px 3px 0 var(--ink); }
.plancard.won { background: #e6f2d6; transform: scale(1.02); }
.plancard.lost { opacity: 0.55; }
.plancard .pn { font-family: var(--head-font); font-weight: 700; font-size: 17px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.plancard .px2 { font-size: 13px; line-height: 1.35; }
.plancard .pf2 { font-size: 12px; }
.plancard .fans { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-height: 26px; }
.plancard .fans img { width: 24px; height: 24px; border: 1px solid var(--ink); }
.plancard .fans span { margin-left: 4px; color: var(--mute); }
.vote.aye { font-size: 16px; }

.cardbody { padding: 8px 10px; }
.camps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 8px; }
.camp { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px 4px; background: #fff9ee; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-size: 11.5px; color: var(--ink); }
.camp img { width: 24px; height: 24px; }
.camp i { font-style: normal; font-size: 11px; background: var(--red); color: var(--paper); padding: 0 4px; margin-top: 1px; }
.camp:hover { background: var(--gold); transform: translate(-1px, -1px); }
.camp.off { opacity: 0.5; filter: grayscale(0.6); }
.camp.off i { background: var(--ink3); }

/* ---- tutorial ---- */
#tutor { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); z-index: 26; display: flex; gap: 10px; padding: 10px 12px; align-items: flex-start; }
#tutor > img { width: 64px; height: 64px; border: 3px solid var(--ink); background: #3a2f45; flex: none; }
#tutor .tt { font-family: var(--head-font); font-weight: 700; font-size: 14px; letter-spacing: 0.5px; color: var(--red); display: flex; justify-content: space-between; }
#tutor .tt span { color: var(--ink); opacity: 0.6; }
#tutor .story { font-size: 14.5px; line-height: 1.4; }
#tutring { position: fixed; z-index: 45; pointer-events: none; border: 3px solid #f5cf5f; border-radius: 4px; box-shadow: 0 0 0 3px #0c0810, 0 0 22px 4px rgba(245,207,95,0.8); animation: tutpulse 0.8s ease-in-out infinite alternate; }
@keyframes tutpulse { from { opacity: 0.55; transform: scale(1); } to { opacity: 1; transform: scale(1.03); } }

/* ---- council: preview, speech strip, lean meter (fix round 2) ---- */
.motion .mhead { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.motion .mhead .stamp { position: static; flex: none; margin: 2px 4px 0 0; font-size: 22px; }
.motion .preview { margin-top: 10px; padding: 8px 10px; background: #f6edd6; border: 2px dashed var(--ink3); font-size: 13px; line-height: 1.45; }
.motion .preview b { font-family: var(--head-font); letter-spacing: 0.5px; text-transform: uppercase; font-size: 12.5px; color: var(--red3); }
.plancard .proj { font-weight: 700; }
.plancard .proj.good { color: var(--green); } .plancard .proj.warn { color: #9a6b12; } .plancard .proj.bad { color: var(--red); }
#speech { background: #231b2b; border-bottom: 4px solid var(--ink); }
.speech { display: flex; gap: 10px; align-items: center; padding: 7px 14px; min-height: 52px; color: var(--paper); animation: pop 0.18s; }
.speech img { width: 40px; height: 40px; border: 2px solid var(--gold2); background: var(--ink); flex: none; }
.speech b { display: block; font-family: var(--head-font); letter-spacing: 0.5px; text-transform: uppercase; font-size: 13px; color: var(--gold); }
.speech span { font-family: var(--story-font); font-size: 15px; line-height: 1.35; }
.speech.idle span { color: #cdc4c2; font-size: 14px; }
.speech.yes img { border-color: #6fbf5a; } .speech.no img { border-color: #e0574f; }
.seat.speaking .pf { box-shadow: 0 0 0 2px var(--gold2), 0 0 16px 4px rgba(245,207,95,0.85); }
.seat.speaking { transform: translateY(-4px); }
.leanm { margin: 8px 0 2px; }
.leanm .lz { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); }
.leanm .lt { position: relative; height: 12px; border: 2px solid var(--ink); background: linear-gradient(90deg, #e0877f 0%, #efe3c8 50%, #9cc44f 100%); }
.leanm .lt::after { content: ''; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--gold2); }
.leanm .lt i { position: absolute; top: -5px; width: 6px; height: 18px; margin-left: -3px; background: var(--ink); border: 1px solid var(--paper); transition: left 0.6s cubic-bezier(.5,1.6,.5,1); }
.leanm .lt i.ghost { background: transparent; border: 2px dashed var(--ink3); }
.args .btn.ctx { box-shadow: inset 0 0 0 2px var(--gold2); }
.tech.locked { cursor: pointer; opacity: 0.6; }
.tech.queued { background: #efe3c8; box-shadow: 0 0 0 2px var(--blue), 2px 2px 0 var(--ink); }
.tech .qn { position: absolute; top: -9px; right: -7px; background: var(--blue); color: #fff; border: 2px solid var(--ink); font-size: 11px; font-weight: 700; padding: 0 4px; }
.tech .now { position: absolute; bottom: 4px; right: 4px; padding: 1px 6px; font-size: 11px; }
.tqueue { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; padding: 6px 8px; border: 2px dashed var(--ink3); background: #f6edd6; font-size: 13px; }
.wfore { margin: 6px 0 4px; }
.wfore .bar i { transition: width 0.4s; }
.autobuild { display: flex; gap: 6px; align-items: center; font-size: 13px; margin: 2px 0 8px; padding: 5px 7px; background: #f6edd6; border: 2px solid var(--paper3); cursor: pointer; }
/* ---- war room & battles ---- */
.wr-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
.wr-art { background: linear-gradient(#2d2433, #5b3920); border: 3px solid var(--ink); display: flex; justify-content: center; padding: 8px; margin-bottom: 8px; }
.wr-art img { width: 144px; height: 144px; }
.wr-bar { margin: 6px 0; }
.wr-log { max-height: 190px; overflow-y: auto; border: 2px solid var(--paper3); background: #fbf4e4; padding: 6px 8px; font-family: var(--story-font); font-size: 13.5px; line-height: 1.4; margin-top: 6px; }
.wr-log div + div { border-top: 1px dashed var(--paper3); margin-top: 4px; padding-top: 4px; }
.seg.tactics button { font-size: 12px; }
.bar.red i { background: var(--red2); } .bar.green i { background: var(--green2); }
@media (max-width: 1000px) { .wr-grid { grid-template-columns: 1fr; } }
.gwork { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 7px 8px; border: 2px solid var(--ink); background: #fff9ee; margin-bottom: 6px; box-shadow: 2px 2px 0 var(--ink); }
.gwork .dn { font-family: var(--head-font); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 0.4px; }
.gwork.done { background: #dcebc8; }
/* tutorial.js sets left/width so the box sits between the side panels */
@media (max-width: 1500px), (max-height: 820px) {
  #tutor { padding: 8px 10px; gap: 8px; }
  #tutor > img { width: 52px; height: 52px; }
  #tutor .story { font-size: 13.5px; line-height: 1.35; }
}

/* Breakpoints last, so they override every base rule above. */
/* ---------------------------------------------------------------- compact layout
   Laptops (≤1500px wide or ≤820px tall, e.g. 1280×720, 1366×768, 1440×900). */
@media (max-width: 1500px) {
  :root { --lw: 300px; --rw: 260px; }
  #topbar { gap: 6px; padding: 0 8px; }
  #logo { gap: 6px; padding-right: 8px; }
  #logo .star { width: 24px; height: 24px; }
  #logo .t1 { font-size: 16px; letter-spacing: 1px; }
  #logo .t2 { display: none; }
  #datebox { min-width: 0; }
  #datebox .d1 { font-size: 14px; letter-spacing: 0.5px; }
  #datebox .d2 { font-size: 11px; }
  #resbar { gap: 2px; }
  .res { gap: 3px; padding: 2px 4px 2px 3px; }
  .res img { width: 20px; height: 20px; }
  .res .v { font-size: 13px; }
  .res .r { font-size: 11px; }
  .res .r .wbl { display: none; }
  .res .r .wbi { display: inline-block; }
  #speed { gap: 1px; }
  .tbtn { padding: 3px 5px; min-width: 28px; height: 28px; font-size: 12px; }
  /* right column cards */
  #right { gap: 10px; }
  .card .phead { padding: 6px 8px 5px; gap: 6px; }
  .card .phead h2 { font-size: 15px; }
  .card .phead .sub { font-size: 11px; margin-top: 2px; }
  .card .phead > img { width: 18px; height: 18px; }
  .cardbody { padding: 6px 8px; }
  .camps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px; }
  .camp { font-size: 11px; padding: 4px 1px 3px; }
  .camp > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .camp img { width: 20px; height: 20px; }
  .goal { padding: 5px 8px; }
  .goal .gt { font-size: 12.5px; }
  .goal .gh { font-size: 12px; }
  .alert { padding: 6px 8px; }
  .alert img { width: 24px; height: 24px; }
  .alert b { font-size: 13px; }
  .alert span { font-size: 11.5px; }
  /* left panel */
  #left .phead h2 { font-size: 20px; }
  .tab { font-size: 12px; letter-spacing: 0.3px; }
  .prio { grid-template-columns: 20px 62px 1fr; gap: 5px; }
  .seg button { font-size: 11px; letter-spacing: -0.2px; }
}
@media (max-width: 1340px) {
  /* 1280/1366: the title stacks on two lines so every resource chip fits */
  #logo .t1 { font-size: 14px; width: min-content; line-height: 1.05; }
  #datebox .d2 { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-height: 820px) {
  :root { --mmw: 212px; --mmh: 134px; }
  #minimap canvas { image-rendering: auto; }
  #left { bottom: 104px; }
  #right { gap: 8px; }
  #right .cardbody.story { font-size: 12.5px; line-height: 1.35; }
  .goal { padding: 4px 8px; }
  .goal .gh { line-height: 1.25; }
  .modal { max-height: calc(100vh - 24px); }
  .modal .pbody { padding: 10px 14px 14px; }
  /* Council: a shorter hall so the motion and its vote fit on screen */
  .hall canvas { height: 168px; }
  .seat { flex-basis: 72px; }
  .seat .pf { max-width: 64px; border-width: 3px; }
  .bubble { bottom: 96px; }
  .motion { --mpy: 10px; --mpx: 12px; }
  .motion .mt { font-size: 21px; }
  .motion .mx { font-size: 14px; line-height: 1.45; }
  .plancard { padding: 6px 8px; gap: 4px; }
  .storyart { min-height: 170px; }
}
/* Right column that would overflow (ui.js fitRight adds .tight): campaigns become one row of
   icon + cost tiles (name and details stay in each tile's tooltip) so the Goals stay in view. */
#right.tight .camps { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 3px; padding: 5px 6px; }
#right.tight .camp { padding: 3px 0 2px; }
#right.tight .camp > span { display: none; }
#right.tight .card:has(.goal) .phead .sub { display: none; } /* "The road to the Commonwealth" */
@media (max-width: 1100px) {
  :root { --lw: 290px; --rw: 240px; }
  .bbtn { width: 60px; }
  #logo .t2 { display: none; }
}
@media (max-width: 820px) {
  #right, #rtoggle { display: none; }
  #left { width: calc(100% - 28px); bottom: 180px; top: auto; height: 45vh; }
  #hintbar { max-width: calc(100vw - 32px); }
  #minimap { display: none; }
  .res .r { display: none; }
  .cgrid { grid-template-columns: 1fr; }
  .ttree { grid-template-columns: 1fr 1fr; }
}
.bcard.noroom { opacity: 0.6; cursor: help; }
.bcard .nr { position: absolute; top: 4px; left: 4px; background: var(--ink); color: var(--paper); font-size: 11px; padding: 0 4px; z-index: 1; }
.alert.proposal { background: #f6edd6; border-color: var(--gold2); }
.alert.proposal span { display: block; }
