/* Aaron's Ruin — parchment, ink and torchlight */
:root {
  --ink: #241709;
  --ink-soft: #5a4630;
  --parch: #e9dab7;
  --parch-2: #dcc79c;
  --parch-edge: #b8965e;
  --gold: #e2b75a;
  --gold-hi: #f6d98c;
  --blood: #a3281c;
  --night: #120d09;
  --leather: rgba(26, 18, 12, 0.88);
  --leather-solid: #1d140d;
  --trim: rgba(205, 160, 85, 0.55);
  --text: #eadfc4;
  --muted: #a8977a;
  --good: #7fcf6a;
  --bad: #ef6f5a;
  --magic: #b49cff;
  --loot: #f2c95c;
  --quest: #ffd36a;
  --lore: #c9b48a;
  --sys: #8fb4d8;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "IM Fell English", Georgia, "Times New Roman", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* window kit: iron rim, bevelled brass band, corner plates, tooled inner line (see "game windows") */
  --iron: #0b0705;
  --brass-hi: #f0d488; --brass: #a8802f; --brass-lo: #4a3212;
  --rivet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0 16 8 8 16 0 8z' fill='%23120a05'/%3E%3Cpath d='M8 1.6 14.4 8 8 14.4 1.6 8z' fill='%23b0843a'/%3E%3Cpath d='M8 1.6 14.4 8H1.6z' fill='%23f0d488' fill-opacity='.45'/%3E%3Cpath d='M8 4.4 11.6 8 8 11.6 4.4 8z' fill='%234e3414'/%3E%3Ccircle cx='8' cy='8' r='1.8' fill='%23f6dc8e'/%3E%3C/svg%3E");
  --win-frame:
    var(--rivet) left top / 14px 14px no-repeat, var(--rivet) right top / 14px 14px no-repeat,
    var(--rivet) left bottom / 14px 14px no-repeat, var(--rivet) right bottom / 14px 14px no-repeat,
    linear-gradient(#f0d488, #a8802f 45%, #3a2610) left top / 100% 3px no-repeat,
    linear-gradient(#3a2610, #a8802f 55%, #d8b468) left bottom / 100% 3px no-repeat,
    linear-gradient(90deg, #f0d488, #a8802f 45%, #3a2610) left top / 3px 100% no-repeat,
    linear-gradient(90deg, #3a2610, #a8802f 55%, #d8b468) right top / 3px 100% no-repeat,
    linear-gradient(rgba(205,160,85,.3), rgba(205,160,85,.3)) left 8px top 8px / calc(100% - 16px) 1px no-repeat,
    linear-gradient(rgba(205,160,85,.3), rgba(205,160,85,.3)) left 8px bottom 8px / calc(100% - 16px) 1px no-repeat,
    linear-gradient(rgba(205,160,85,.3), rgba(205,160,85,.3)) left 8px top 8px / 1px calc(100% - 16px) no-repeat,
    linear-gradient(rgba(205,160,85,.3), rgba(205,160,85,.3)) right 8px top 8px / 1px calc(100% - 16px) no-repeat;
  --win-surface:
    radial-gradient(90% 55% at 50% 0%, rgba(226,183,90,.08), transparent 70%),
    radial-gradient(ellipse at 50% 45%, transparent 50%, rgba(0,0,0,.42)),
    repeating-linear-gradient(118deg, rgba(255,232,190,.018) 0 1px, transparent 1px 4px),
    linear-gradient(#2a1e13, #1d150d 55%, #150f09);
  /* content colours: parchment by default (title screen), torchlit inside windows */
  --c-ink: var(--ink); --c-soft: var(--ink-soft); --c-head: #4a2410; --c-sub: #6a3a18;
  --c-good: #2f6a1c; --c-bad: #9a2214; --c-magic: #4b2a9a; --c-coin: #8a5a0a;
  --c-line: rgba(90,60,25,.25); --c-line-strong: rgba(90,60,25,.4);
  --c-well: rgba(255,250,235,.3); --c-well-hi: rgba(255,250,235,.5);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--text); font-family: var(--body); font-size: 16px; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; touch-action: manipulation; }
#view { position: fixed; inset: 0; display: block; touch-action: none; cursor: crosshair; }
.hidden { display: none !important; }
.subtle { color: var(--muted); }
.small { font-size: 0.86em; }
.gold { color: var(--gold-hi); }
button { font-family: var(--body); color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
kbd { font-family: var(--display); font-size: 0.62em; opacity: 0.55; margin-left: 0.4em; border: 1px solid currentColor; border-radius: 3px; padding: 0 0.25em; }
body.touch kbd { display: none; }

.btn { background: linear-gradient(#3a2a1a, #23180f); border: 1px solid var(--trim); color: var(--text); padding: 0.45em 1em; border-radius: 4px; font-size: 1em; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.25); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(#9b3a1e, #5d1c0e); border-color: var(--gold); color: #fff3d6; font-family: var(--display); letter-spacing: .06em; box-shadow: 0 0 18px rgba(200, 80, 30, .35); }
.btn.big { font-size: 1.2em; padding: .7em 2em; }
.btn.tiny { font-size: .8em; padding: .15em .55em; margin: 0 .15em; }
.btn.ghost { background: transparent; }

/* ------------------------------------------------------------ plates / HUD */
.plate { background: var(--leather); border: 1px solid var(--trim); border-radius: 6px; box-shadow: 0 4px 18px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,150,.08); padding: 8px 12px; backdrop-filter: blur(2px); }
#hud { position: fixed; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: flex; justify-content: space-between; pointer-events: none; z-index: 5; }
#hud .plate { pointer-events: auto; }
#hud-left { width: 260px; }
#hud-right { min-width: 200px; text-align: right; }
#hud-rcol { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
#hud-rcol > * { pointer-events: auto; }
#minimap-box { padding: 4px; width: 172px; height: 172px; }
#minimap-box.off { display: none; }
#minimap { display: block; width: 100%; height: 100%; border-radius: 3px; cursor: pointer; }
#menu button.off .ico { color: var(--muted); text-decoration: line-through; opacity: .6; }
#menu #mm-btn.on .ico { color: var(--gold-hi); }
.who { font-family: var(--display); font-weight: 700; font-size: 1.05em; color: var(--gold-hi); letter-spacing: .03em; display: flex; justify-content: space-between; gap: 8px; }
.lvl { color: var(--muted); font-weight: 500; font-size: .85em; }
.bar { position: relative; height: 15px; margin-top: 5px; background: #0d0806; border: 1px solid rgba(0,0,0,.8); border-radius: 3px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.8); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .25s ease-out; }
.bar.hp i { background: linear-gradient(#d4473a, #7c1810); }
.bar.mp i { background: linear-gradient(#5a7cf0, #22337e); }
.bar span { position: absolute; inset: 0; font-size: 11px; line-height: 14px; text-align: center; color: #fff; text-shadow: 0 1px 2px #000; font-family: var(--display); }
.row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 6px; flex-wrap: wrap; }
.st { font-size: .74em; padding: 1px 6px; border-radius: 9px; margin-left: 3px; border: 1px solid; }
.st-rest { color: #b8c8ff; } .st-bad { color: var(--bad); } .st-magic { color: var(--magic); } .st-busy { color: var(--muted); } .st-good { color: var(--good); animation: pulse 1.6s infinite; }
.clock { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#h-sun { width: 36px; height: 36px; }
#h-clock { font-family: var(--display); font-size: 1.25em; color: var(--gold-hi); letter-spacing: .05em; }
#h-loc { font-family: var(--display); font-weight: 700; margin-top: 4px; color: var(--text); max-width: 280px; margin-left: auto; }
body.danger #hud-left { border-color: rgba(230, 60, 40, .8); animation: dangerglow 1.2s infinite alternate; }
@keyframes dangerglow { from { box-shadow: 0 0 6px rgba(220,40,20,.3); } to { box-shadow: 0 0 22px rgba(220,40,20,.7); } }
@keyframes pulse { 50% { opacity: .55; } }

/* ------------------------------------------------------------ menu */
#menu { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 6; background: var(--leather); border: 1px solid var(--trim); border-radius: 6px; padding: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.6); }
#menu button { background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 4px 8px; display: flex; flex-direction: column; align-items: center; min-width: 52px; color: var(--text); position: relative; }
#menu button:hover, #menu button.on { border-color: var(--trim); background: rgba(226,183,90,.1); }
#menu .ico { font-size: 1.2em; line-height: 1.1; color: var(--gold); }
#menu .lbl { font-size: .72em; font-family: var(--display); letter-spacing: .04em; }
#menu kbd { position: absolute; top: 1px; right: 2px; font-size: .55em; border: 0; }
#menu .menu-sep { width: 1px; background: var(--trim); margin: 4px 2px; }
#menu #z-in, #menu #z-out { min-width: 30px; }
#menu button.alert::after { content: ''; position: absolute; top: 3px; left: 5px; width: 8px; height: 8px; border-radius: 50%; background: #ff6040; box-shadow: 0 0 8px #ff6040; }

/* ------------------------------------------------------------ log */
#log { position: fixed; left: 8px; bottom: calc(8px + var(--safe-b)); width: min(460px, 44vw); height: 158px; overflow-y: auto; z-index: 4; padding: 8px 10px; font-size: .92em; line-height: 1.32; background: linear-gradient(rgba(14,10,7,.35), rgba(14,10,7,.82)); border: 1px solid rgba(205,160,85,.25); border-radius: 6px; scrollbar-width: thin; scrollbar-color: #5a4630 transparent; -webkit-mask-image: linear-gradient(transparent, #000 28px); mask-image: linear-gradient(transparent, #000 28px); cursor: pointer; }
#log.expanded { height: 46vh; background: rgba(14,10,7,.94); }
#log .ln { text-shadow: 0 1px 2px #000; animation: lnin .35s ease-out; }
@keyframes lnin { from { opacity: 0; transform: translateY(4px); } }
.c-info { color: var(--text); } .c-good { color: var(--good); } .c-bad { color: var(--bad); } .c-loot { color: var(--loot); } .c-magic { color: var(--magic); } .c-quest { color: var(--quest); font-style: italic; } .c-lore { color: var(--lore); font-style: italic; } .c-sys { color: var(--sys); } .c-chat { color: #9fe0d0; }

/* ------------------------------------------------------------ actions */
#actions { position: fixed; right: 8px; bottom: calc(8px + var(--safe-b)); z-index: 4; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#actions button { background: var(--leather); border: 1px solid var(--trim); color: var(--text); border-radius: 2px; padding: 6px 12px; font-size: .95em; box-shadow: 0 2px 10px rgba(0,0,0,.5); }
#actions button:hover { filter: brightness(1.3); }
#actions .act-row button { font-family: var(--display); font-size: .8em; letter-spacing: .05em; background: linear-gradient(#2e2015, #1a120b); border: 1px solid var(--iron); box-shadow: inset 0 0 0 1px rgba(205,160,85,.42), inset 0 1px 0 rgba(255,225,160,.1), 0 2px 8px rgba(0,0,0,.55); }
#actions .act-row button:hover { filter: none; color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold), 0 0 10px rgba(226,183,90,.25), 0 2px 8px rgba(0,0,0,.55); }
/* the context button ("Look about" / what is here) is a small framed plaque with a brass gem */
#a-here { position: relative; font-family: var(--display); font-weight: 700; font-size: 1.02em; min-width: 200px; padding: 10px 18px 10px 30px; letter-spacing: .05em; color: var(--muted); background: linear-gradient(#2e2015, #170f09); border: 1px solid var(--iron);
  box-shadow: inset 0 0 0 1px rgba(255,225,150,.22), inset 0 0 0 3px #7a5a28, inset 0 0 0 4px rgba(0,0,0,.8), 0 3px 12px rgba(0,0,0,.6); }
#a-here::before { content: ''; position: absolute; left: 13px; top: 50%; width: 7px; height: 7px; margin-top: -4px; transform: rotate(45deg); background: #5a4630; box-shadow: 0 0 0 1px var(--iron); transition: background .2s; }
#a-here { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 34px; max-width: 320px; } /* long labels never run under the gem */
#a-here.lit { color: var(--gold-hi); text-shadow: 0 0 10px rgba(226,183,90,.35), 0 1px 0 #000; box-shadow: inset 0 0 0 1px rgba(255,235,170,.4), inset 0 0 0 3px #b0843a, inset 0 0 0 4px rgba(0,0,0,.8), 0 3px 12px rgba(0,0,0,.6); }
#a-here.lit::before { background: linear-gradient(135deg, #fff0b8, #e2b75a 50%, #8a5a1a); box-shadow: 0 0 0 1px var(--iron), 0 0 8px rgba(255,210,110,.8); }
#a-here.lit::after { content: ''; position: absolute; inset: -1px; pointer-events: none; box-shadow: 0 0 18px rgba(226,183,90,.45); animation: herepulse 2.4s ease-in-out infinite; }
@keyframes herepulse { 50% { opacity: .3; } }
.act-row { display: flex; gap: 6px; }
#slots { display: grid; grid-template-columns: repeat(6, 54px); gap: 4px; }
#slots .slot { position: relative; height: 46px; padding: 2px !important; display: flex; align-items: flex-end; justify-content: center; background: radial-gradient(circle at 50% 35%, #3b2a4e, #17101f) !important; border-color: rgba(180,156,255,.45) !important; }
#slots .slot.empty { background: rgba(20,14,10,.6) !important; border-color: rgba(205,160,85,.2) !important; }
#slots .slot.nomana { filter: grayscale(.8) brightness(.6); }
.slot-n { position: absolute; top: 1px; left: 4px; font-family: var(--display); font-size: .7em; color: var(--gold); }
.slot-name { font-size: .68em; line-height: 1.05; color: #e8dcff; text-align: center; overflow: hidden; max-height: 2.2em; }

/* ------------------------------------------------------------ d-pad (touch) */
#dpad { display: none; position: fixed; left: 10px; bottom: calc(12px + var(--safe-b)); z-index: 6; grid-template-columns: repeat(6, 27px); grid-template-rows: repeat(3, 52px); gap: 3px 0; user-select: none; -webkit-user-select: none; }
body.touch #dpad { display: grid; }
#dpad button { width: 52px; height: 52px; margin: 0 1px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(70,52,34,.92), rgba(22,15,10,.92)); border: 1px solid var(--trim); color: var(--gold); font-size: 18px; box-shadow: 0 3px 10px rgba(0,0,0,.6); touch-action: none; }
#dpad button:active { background: radial-gradient(circle, #7a5a30, #2a1c10); }
#dpad .d-nw { grid-column: 2 / span 2; grid-row: 1; } #dpad .d-ne { grid-column: 4 / span 2; grid-row: 1; }
#dpad .d-w { grid-column: 1 / span 2; grid-row: 2; } #dpad .d-c { grid-column: 3 / span 2; grid-row: 2; color: #fff1c8; } #dpad .d-e { grid-column: 5 / span 2; grid-row: 2; }
#dpad .d-sw { grid-column: 2 / span 2; grid-row: 3; } #dpad .d-se { grid-column: 4 / span 2; grid-row: 3; }

/* ------------------------------------------------------------ game windows
   Every pop-up (panels, NPC dialogs, help, trade, party, the phone sheet) is the same object: dark tooled
   leather in an iron rim with a bevelled brass band, brass corner plates and a tooled inner line. The frame
   is drawn as background layers (no image files, no pseudo-elements), so it stays put on windows that scroll
   themselves and costs one static paint. Colours inside windows come from the --c-* tokens: parchment
   values on :root (title screen), torchlit values inside windows. */
.parchment, .create, .defcard {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,250,230,.55), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(150,110,60,.28), transparent 55%),
    linear-gradient(135deg, #ecdcb6, #dcc496 60%, #d2b682);
  box-shadow: inset 0 0 60px rgba(110,70,25,.45), inset 0 0 8px rgba(80,50,15,.6), 0 12px 40px rgba(0,0,0,.75);
  border: 1px solid #7a5a2c;
}
#panel, .dlg-card, .help-card, #tradewin, #party .party-body, #tp-sheet, .itip, .ivt {
  --c-ink: #e8dcc0; --c-soft: #b3a283; --c-head: var(--gold-hi); --c-sub: #d9b266;
  --c-good: #93d47e; --c-bad: #f2836c; --c-magic: #bca6ff; --c-coin: #f2c95c;
  --c-line: rgba(205,160,85,.2); --c-line-strong: rgba(205,160,85,.38);
  --c-well: rgba(0,0,0,.3); --c-well-hi: rgba(226,183,90,.1);
}
#panel, .dlg-card, .help-card, #tradewin, #party .party-body {
  color: var(--c-ink);
  background: var(--win-frame), var(--win-surface);
  border: 1px solid var(--iron);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 14px 38px rgba(0,0,0,.7);
}
#p-body, .dlg-card, #dlg-text, .help-card, #tradewin, #party .party-body, .chat-lines { scrollbar-width: thin; scrollbar-color: #7a5a2c rgba(0,0,0,.25); }
#p-body::-webkit-scrollbar, .dlg-card::-webkit-scrollbar, #dlg-text::-webkit-scrollbar, .help-card::-webkit-scrollbar, #tradewin::-webkit-scrollbar, #party .party-body::-webkit-scrollbar, .chat-lines::-webkit-scrollbar { width: 9px; }
#p-body::-webkit-scrollbar-thumb, .dlg-card::-webkit-scrollbar-thumb, #dlg-text::-webkit-scrollbar-thumb, .help-card::-webkit-scrollbar-thumb, #tradewin::-webkit-scrollbar-thumb, #party .party-body::-webkit-scrollbar-thumb, .chat-lines::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #8a6a32, #4e3818); border: 2px solid transparent; background-clip: padding-box; }
#p-body::-webkit-scrollbar-track, .dlg-card::-webkit-scrollbar-track, #dlg-text::-webkit-scrollbar-track, .help-card::-webkit-scrollbar-track, #tradewin::-webkit-scrollbar-track, #party .party-body::-webkit-scrollbar-track, .chat-lines::-webkit-scrollbar-track { background: rgba(0,0,0,.22); }

/* open / close: a short rise and fade; .closing is set by ui.js for ~150 ms before the window hides */
@keyframes winrise { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes winsink { to { opacity: 0; transform: translateY(6px) scale(.99); } }
@keyframes winfade { from { opacity: 0; } }
@keyframes winfadeout { to { opacity: 0; } }
@keyframes panelin { from { opacity: 0; transform: translate(-50%, -48%) scale(.985); } }
@keyframes panelout { to { opacity: 0; transform: translate(-50%, -49%) scale(.99); } }

#panel { position: fixed; z-index: 20; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(880px, 94vw); max-height: min(82vh, 900px); display: flex; flex-direction: column; animation: panelin .18s ease-out; }
#panel.closing { animation: panelout .14s ease-in forwards; pointer-events: none; }
.p-head { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 12px; padding: 15px 8px 11px 10px;
  background: linear-gradient(90deg, transparent, var(--c-line-strong) 12%, var(--c-line-strong) 88%, transparent) left bottom / 100% 1px no-repeat; }
.p-head::after { content: ''; position: absolute; left: 50%; bottom: -3px; width: 7px; height: 7px; margin-left: -4px; transform: rotate(45deg); background: linear-gradient(135deg, var(--brass-hi), var(--brass) 55%, var(--brass-lo)); box-shadow: 0 0 0 1px var(--iron); }
.p-head h2, .dlg-card h2, .help-card h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.22em; letter-spacing: .09em; line-height: 1.2; color: var(--gold-hi); text-shadow: 0 1px 0 #000, 0 0 14px rgba(226,183,90,.2); }
.close { flex: none; width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; color: var(--gold); cursor: pointer;
  background: linear-gradient(#3a2a1a, #1a120b); border: 1px solid var(--iron); border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(205,160,85,.45), inset 0 1px 0 rgba(255,225,160,.16), 0 1px 2px rgba(0,0,0,.6); transition: color .12s, box-shadow .12s; }
.close:hover, .close:focus-visible { color: var(--gold-hi); background: linear-gradient(#4e3820, #24180e); box-shadow: inset 0 0 0 1px var(--gold), 0 0 10px rgba(226,183,90,.3); outline: none; }
.close:active { transform: translateY(1px); }
#p-body { overflow-y: auto; padding: 12px 24px 22px; }
#panel .subtle, .dlg-card .subtle, .help-card .subtle { color: var(--c-soft); }
.create .subtle, .defcard .subtle { color: var(--ink-soft); }
#panel h4 { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font-family: var(--display); font-weight: 700; font-size: .8em; letter-spacing: .16em; text-transform: uppercase; color: var(--c-sub); }
#panel h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--c-line-strong), transparent); }
#panel .btn, .dlg-card .btn, .help-card .btn:not(.primary) { font-family: var(--display); font-size: .84em; letter-spacing: .04em; color: var(--c-ink); background: linear-gradient(#3a2a1a, #1f160d); border: 1px solid var(--iron); border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(205,160,85,.38), inset 0 1px 0 rgba(255,225,160,.12); }
#panel .btn:hover, .dlg-card .btn:hover { filter: none; color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold), 0 0 8px rgba(226,183,90,.25); }
#panel .btn.tiny { font-size: .76em; }
#panel .btn.ghost { background: transparent; }
#panel .btn.on { color: #1c1108; background: linear-gradient(#ecc877, #a87e32 55%, #6a4a1a); box-shadow: inset 0 1px 0 rgba(255,245,205,.6), 0 0 0 1px var(--iron); }
#panel .gold, .dlg-card .gold { color: var(--c-coin); font-weight: bold; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 18px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dotted var(--c-line); }
.kv .k { color: var(--c-soft); }
.kv .v { text-align: right; }
.kv.good .v, .chip.good, .good { color: var(--c-good); }
.kv.bad .v, .kv.bad .k, .chip.bad, .bad { color: var(--c-bad); }
.chip.magic { color: var(--c-magic); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.chip { font-size: .82em; border: 1px solid var(--c-line-strong); border-radius: 2px; padding: 1px 8px; background: var(--c-well); }
.callout { padding: 6px 12px; margin: 6px 0; border-radius: 2px; background: linear-gradient(90deg, rgba(110,170,70,.16), rgba(110,170,70,.04)); border: 1px solid rgba(120,180,80,.35); border-left: 3px solid #6aa84a; }
.tabs { display: flex; gap: 2px; margin: 12px 0 6px; border-bottom: 1px solid var(--c-line-strong); }
.tab { margin-bottom: -1px; padding: 6px 14px 5px; font-family: var(--display); font-size: .82em; letter-spacing: .06em; color: var(--c-soft); background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 2px 2px 0 0; }
.tab:hover { color: var(--c-ink); }
.tab.on { color: var(--gold-hi); font-weight: 700; background: linear-gradient(rgba(226,183,90,.16), rgba(226,183,90,.02)); border-color: var(--c-line-strong); box-shadow: inset 0 2px 0 var(--gold); }

/* inventory (the live pack is inventory.js; these serve the old list view and item details) */
.inv-top { font-size: 1.05em; }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.eq-slot { border: 1px solid var(--c-line-strong); border-radius: 2px; padding: 5px 8px; background: var(--c-well); min-height: 58px; }
.eq-slot.full { background: var(--c-well-hi); }
.eq-label { font-family: var(--display); font-size: .7em; letter-spacing: .08em; text-transform: uppercase; color: var(--c-soft); }
.eq-slot .btn { margin-top: 3px; }
.inv-list { display: flex; flex-direction: column; }
.inv-row { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 8px; padding: 4px 6px; border-bottom: 1px dotted var(--c-line); cursor: pointer; }
.inv-row:hover, .inv-row.sel { background: var(--c-well-hi); }
.inv-glyph { font-family: Georgia, serif; font-weight: bold; text-align: center; color: var(--c-sub); font-size: 1.1em; }
.inv-meta { font-size: .8em; white-space: nowrap; }
.inv-detail { padding: 6px 12px 10px 40px; background: var(--c-well); border-bottom: 1px solid var(--c-line); font-size: .92em; }
.iname.unique { color: var(--c-coin); font-weight: bold; }
.iname.magic { color: var(--c-magic); }
.iname.flawed { color: #d8a088; }
.cond { color: var(--c-coin); font-size: .8em; }
.cond.bad { color: var(--c-bad); }
.itip { position: fixed; z-index: 60; max-width: 340px; pointer-events: none; display: none; padding: 8px 12px; color: var(--text); background: linear-gradient(#22170e, #130c07); border: 1px solid var(--iron); border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(205,160,85,.45), 0 6px 22px rgba(0,0,0,.7); font-size: .9em; line-height: 1.35; }
.itip .tip-title { font-family: var(--display); font-weight: 700; margin-bottom: 3px; }
.itip .iname.unique { color: var(--gold-hi); } .itip .iname.magic { color: var(--magic); } .itip .iname.flawed { color: #e0a080; } .itip .iname.plain { color: var(--text); }
.itip .tip-ln.bad { color: var(--bad); font-weight: bold; } .itip .tip-ln.good { color: var(--good); }
.inv-detail .tip-ln.bad { color: var(--c-bad); font-weight: bold; } .inv-detail .tip-ln.good { color: var(--c-good); }

/* character */
.char-head { text-align: center; padding-top: 4px; }
.char-name { font-family: var(--display); font-weight: 900; font-size: 1.6em; letter-spacing: .06em; color: var(--c-head); text-shadow: 0 2px 0 #000, 0 0 18px rgba(226,183,90,.25); }
.char-title { font-style: italic; color: var(--c-sub); }
.lvlbar { height: 7px; margin: 7px auto 0; max-width: 300px; overflow: hidden; background: rgba(0,0,0,.5); border: 1px solid var(--iron); box-shadow: 0 0 0 1px rgba(205,160,85,.3); }
.lvlbar i { display: block; height: 100%; background: linear-gradient(90deg, #8a6420, #f2cc68); }
.attr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin-top: 8px; }
.attr { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 10px; border: 1px solid var(--c-line); border-left: 3px solid var(--c-line-strong); border-radius: 2px; background: var(--c-well); }
.attr-name { font-family: var(--display); font-size: .88em; letter-spacing: .03em; }
.attr-v { font-weight: bold; font-size: 1.15em; margin-left: auto; color: var(--c-head); }
.btn.plus { font-weight: bold; color: var(--c-good) !important; }
.skills .skill { display: grid; grid-template-columns: 1fr 50px; gap: 0 10px; padding: 3px 0; }
.skill-v { text-align: right; font-weight: bold; }
.skill-bar { grid-column: 1 / -1; height: 4px; margin-top: 2px; background: rgba(0,0,0,.45); box-shadow: 0 0 0 1px rgba(205,160,85,.18); overflow: hidden; }
.skill-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5a7a22, #b8d060); }
.deeds { margin: 4px 0; padding-left: 20px; }

/* spells */
.spell { border: 1px solid var(--c-line); border-left: 3px solid rgba(180,156,255,.45); border-radius: 2px; padding: 8px 10px; margin: 8px 0; background: var(--c-well); }
.spell .spell-ico { border-radius: 2px; box-shadow: 0 0 0 1px var(--iron), 0 0 0 2px rgba(205,160,85,.45), 0 2px 6px rgba(0,0,0,.6); }
.spell-head b { font-family: var(--display); letter-spacing: .03em; color: var(--c-head); }
.spell-desc { margin: 4px 0; }
.spell-side { font-weight: bold; }
.spell-acts { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }

/* journal */
.quest { border: 1px solid var(--c-line); border-left: 3px solid var(--brass); padding: 8px 12px; margin: 10px 0; background: var(--c-well); border-radius: 2px; }
.quest.q-done { border-left-color: #6aa84a; } .quest.q-failed { border-left-color: #c8432c; opacity: .7; }
.quest-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.quest-head b { font-family: var(--display); letter-spacing: .03em; color: var(--c-head); }
.quest-text { margin: 4px 0; }
.quest-meta { font-size: .9em; color: var(--c-soft); }
.badge { font-size: .72em; font-family: var(--display); letter-spacing: .04em; padding: 1px 8px; border-radius: 2px; border: 1px solid currentColor; white-space: nowrap; margin-left: 6px; background: rgba(0,0,0,.25); }
.badge.q-done { color: var(--c-good); } .badge.q-failed { color: var(--c-bad); } .badge.q-active { color: var(--c-sub); }

/* map */
.map-wrap { position: relative; }
.map-canvas { width: 100%; height: min(62vh, 640px); display: block; border: 1px solid var(--iron); box-shadow: 0 0 0 1px rgba(205,160,85,.45), inset 0 0 30px rgba(0,0,0,.8); cursor: grab; touch-action: none; }
.map-canvas:active { cursor: grabbing; }
.map-ctrls { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
.map-legend { margin-top: 6px; font-size: .85em; }

/* chronicle */
.chron-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.chron-card { border: 1px solid var(--c-line); border-top: 2px solid var(--c-line-strong); border-radius: 2px; padding: 8px 10px; background: var(--c-well); font-size: .92em; }
.chron-card.dead { opacity: .6; filter: sepia(.6); }
.chron-title { font-family: var(--display); font-weight: 700; color: var(--c-head); margin-bottom: 3px; }
.chron-sub { font-style: italic; color: var(--c-soft); margin-bottom: 3px; }
.meter { display: inline-block; width: 110px; height: 7px; background: rgba(0,0,0,.5); box-shadow: 0 0 0 1px rgba(205,160,85,.25); overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #6a1a0a, #d0402a); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 4px 0 4px 14px; border-left: 2px solid var(--c-line-strong); margin-left: 4px; }
.tl-time { display: block; font-size: .78em; color: var(--c-soft); font-family: var(--display); }

/* chat */
.chat-wrap { display: grid; grid-template-columns: 1fr 220px; gap: 12px; min-height: 50vh; }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-lines { flex: 1; overflow-y: auto; min-height: 240px; max-height: 52vh; padding: 6px 10px; background: rgba(0,0,0,.34); border: 1px solid var(--iron); box-shadow: 0 0 0 1px var(--c-line), inset 0 2px 10px rgba(0,0,0,.6); }
.chat-ln { padding: 2px 0; }
.chat-ln.c-sys { color: var(--sys); } .chat-ln.c-bad { color: var(--c-bad); } .chat-ln.c-good { color: var(--c-good); }
#chat-in { margin-top: 6px; padding: 8px 10px; font-family: var(--body); font-size: 1em; color: var(--c-ink); background: rgba(0,0,0,.45); border: 1px solid var(--iron); border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(205,160,85,.3), inset 0 2px 6px rgba(0,0,0,.6); outline: none; }
#chat-in:focus { box-shadow: inset 0 0 0 1px var(--gold), inset 0 2px 6px rgba(0,0,0,.6), 0 0 8px rgba(226,183,90,.2); }
#chat-in::placeholder { color: var(--c-soft); font-style: italic; opacity: .8; }
.chat-players h4 { margin-top: 0 !important; }
.player { padding: 4px 0; border-bottom: 1px dotted var(--c-line); }

/* ------------------------------------------------------------ NPC dialog
   No backdrop: the scene stays visible and clickable around the window (it never pins you). */
#dlg { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 12px; pointer-events: none; }
#dlg .dlg-card { pointer-events: auto; }
#dlg.closing .dlg-card { animation: winsink .14s ease-in forwards; pointer-events: none; }
.dlg-card { position: relative; width: min(620px, 96vw); max-height: 88vh; overflow-y: auto; padding: 22px 26px 14px; animation: winrise .18s ease-out; }
.dlg-card .close { position: absolute; top: 14px; right: 14px; }
#dlg-title { padding-right: 44px; }
#dlg-sub { margin-top: 2px; font-style: italic; }
#dlg-sub:empty { display: none; }
#dlg-text { margin: 10px 0; padding-top: 12px; line-height: 1.48; font-size: 1.05em; background: linear-gradient(90deg, var(--c-line-strong), transparent 75%) left top / 100% 1px no-repeat; }
#dlg-text p { margin: 0 0 .6em; }
#dlg-text p:first-child::first-letter { font-family: var(--display); font-weight: 700; font-size: 1.9em; float: left; line-height: 1; margin: 2px 7px 0 0; color: var(--gold); text-shadow: 0 1px 0 #000, 0 0 10px rgba(226,183,90,.3); }
#dlg-gold:not(:empty) { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: .8em; letter-spacing: .04em; }
#dlg-gold:not(:empty)::before { content: ''; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #e0a820 55%, #7a4a0a); box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
#dlg-opts { display: flex; flex-direction: column; gap: 3px; margin: 12px 0 8px; }
.opt { position: relative; width: 100%; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 12px; text-align: left; padding: 7px 12px 7px 9px; font-size: 1em; color: var(--c-ink);
  background: linear-gradient(90deg, rgba(0,0,0,.34), rgba(0,0,0,.14)); border: 1px solid rgba(0,0,0,.55); border-left: 3px solid rgba(205,160,85,.28); border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255,225,160,.05), 0 1px 0 rgba(255,225,160,.04); transition: background .12s, border-color .12s, color .12s; }
.opt:hover:not(.dis), .opt:focus-visible { color: #fff4da; background: linear-gradient(90deg, rgba(226,183,90,.22), rgba(226,183,90,.05) 75%); border-color: rgba(226,183,90,.4); outline: none; }
.opt:active:not(.dis) { transform: translateY(1px); }
.opt-n { width: 24px; height: 24px; line-height: 22px; text-align: center; font-family: var(--display); font-weight: 700; font-size: .82em; color: var(--gold-hi); text-shadow: 0 1px 0 #000;
  background: radial-gradient(circle at 40% 30%, #4a3520, #1a110a 75%); border: 1px solid #9a7434; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.65), 0 1px 2px rgba(0,0,0,.6); transition: background .12s, color .12s; }
.opt:hover:not(.dis) .opt-n, .opt:focus-visible .opt-n { color: #1c1108; text-shadow: 0 1px 0 rgba(255,240,200,.45); background: linear-gradient(#f0d488, #b88a36 60%, #7a5420); border-color: #f0d488; }
.opt.dis .opt-n { color: var(--c-soft); border-color: rgba(205,160,85,.25); }
.opt-main { display: flex; flex-direction: column; }
.opt-hint { font-size: .86em; color: var(--c-soft); font-style: italic; }
.opt-why { font-size: .82em; color: var(--c-bad); }
.opt-price { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; font-family: var(--display); font-weight: 700; font-size: .86em; color: var(--c-coin); white-space: nowrap; background: rgba(0,0,0,.4); border: 1px solid rgba(226,183,90,.35); border-radius: 2px; }
.opt-price::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #e0a820 55%, #7a4a0a); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.opt-price.short { color: var(--c-bad); text-decoration: line-through; border-color: rgba(240,120,100,.35); }
.opt.dis { opacity: .55; }
.opt.tone-good, .opt.tone-buy, .opt.tone-gain { border-left-color: #6aa84a; }
.opt.tone-bad, .opt.tone-danger, .opt.tone-risk, .opt.tone-cost { border-left-color: #c8432c; }
.opt.tone-magic { border-left-color: #8a6ad8; }
.opt.tone-quest { border-left-color: #e0b040; }
.opt.tone-gold, .opt.tone-trade, .opt.tone-sell { border-left-color: #c8963a; }
.opt.tone-leave, .opt.tone-back, .opt.tone-close { font-style: italic; color: var(--c-soft); border-left-color: rgba(205,160,85,.14); background: linear-gradient(90deg, rgba(0,0,0,.22), rgba(0,0,0,.06)); }
.dlg-help { margin-top: 6px; padding-top: 9px; text-align: center; font-family: var(--display); font-size: .68em; letter-spacing: .14em; text-transform: uppercase; color: var(--c-soft);
  background: linear-gradient(90deg, transparent, var(--c-line-strong), transparent) center top / 80% 1px no-repeat; }
.dlg-help kbd, .help-grid kbd { display: inline-block; min-width: 1.7em; margin: 0 .15em; padding: 1px 4px; font-family: var(--display); font-size: .95em; line-height: 1.3; text-align: center; letter-spacing: 0; text-transform: none; opacity: 1;
  color: var(--gold-hi); background: linear-gradient(#33251a, #160f09); border: 1px solid var(--iron); border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(205,160,85,.4), 0 1px 0 rgba(0,0,0,.7); }
body.touch .dlg-help { display: none; }

/* ------------------------------------------------------------ zone card, toasts, conn */
#zonecard { position: fixed; left: 50%; top: 23%; transform: translate(-50%, -50%); z-index: 8; text-align: center; pointer-events: none; opacity: 0; width: min(760px, 92vw); }
#zonecard.show { animation: zc 4.6s ease-in-out forwards; }
@keyframes zc { 0% { opacity: 0; transform: translate(-50%, -42%); } 14% { opacity: 1; transform: translate(-50%, -50%); } 78% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -54%); } }
#zonecard::before { content: ''; position: absolute; inset: -18px -40px; z-index: -1; background: radial-gradient(ellipse at center, rgba(8,5,3,.62), rgba(8,5,3,0) 70%); }
.zc-kicker { font-family: var(--body); font-style: italic; color: #d8c8a4; font-size: 1.05em; letter-spacing: .06em; text-shadow: 0 2px 6px #000; }
.zc-name { font-family: var(--display); font-weight: 900; font-size: clamp(1.7em, 5vw, 3.2em); color: var(--gold-hi); letter-spacing: .1em; line-height: 1.1; margin-top: 2px; text-shadow: 0 0 24px rgba(240,170,60,.5), 0 3px 8px #000; }
#zonecard.show .zc-name { animation: zcname 1.1s ease-out; }
@keyframes zcname { from { letter-spacing: .32em; opacity: .2; } }
.zc-rule { height: 2px; width: 0; margin: 8px auto 6px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
#zonecard.show .zc-rule { animation: zcrule 1.4s .2s ease-out forwards; }
@keyframes zcrule { to { width: 62%; } }
.zc-sub { font-family: var(--body); font-style: italic; color: #e8dcc0; font-size: 1.05em; text-shadow: 0 1px 4px #000; max-width: 620px; margin: 0 auto; }
.zc-extra { font-family: var(--display); color: var(--muted); font-size: .78em; letter-spacing: .28em; text-transform: uppercase; margin-top: 6px; text-shadow: 0 1px 4px #000; }
#zonecard.dg .zc-name { color: #f0d6b0; text-shadow: 0 0 22px rgba(200,60,30,.55), 0 3px 8px #000; }
#zonecard.ow .zc-name { font-size: clamp(1.3em, 3.6vw, 2.2em); }
#zonecard.ow .zc-kicker { font-size: .92em; }
#toast { position: fixed; top: calc(76px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.toast-item { position: relative; max-width: 90vw; padding: 6px 16px 6px 27px; color: var(--text); background: linear-gradient(#2a1d12, #160f09); border: 1px solid var(--iron); border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(205,160,85,.42), inset 0 1px 0 rgba(255,225,160,.08), 0 4px 16px rgba(0,0,0,.6); transition: opacity .5s, transform .5s; animation: lnin .25s ease-out; }
.toast-item::before { content: ''; position: absolute; left: 11px; top: 50%; width: 6px; height: 6px; margin-top: -3px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 6px rgba(226,183,90,.6); }
.toast-item.bad { color: #ffc0b0; box-shadow: inset 0 0 0 1px rgba(230,90,70,.6), 0 4px 16px rgba(0,0,0,.6); }
.toast-item.bad::before { background: #e8503a; box-shadow: 0 0 6px rgba(240,80,60,.7); }
.toast-item.good { color: #cdf0b6; box-shadow: inset 0 0 0 1px rgba(130,200,100,.55), 0 4px 16px rgba(0,0,0,.6); }
.toast-item.good::before { background: #7fcf6a; box-shadow: 0 0 6px rgba(127,207,106,.7); }
.toast-item.out { opacity: 0; transform: translateY(-8px); }
#conn { position: fixed; top: 0; left: 0; right: 0; z-index: 100; text-align: center; padding: 6px; background: linear-gradient(#5d1c0e, #3a1008); color: #ffe6c0; font-family: var(--display); letter-spacing: .08em; border-bottom: 1px solid #b0843a; box-shadow: 0 1px 0 var(--iron), 0 2px 12px rgba(0,0,0,.6); }

/* ------------------------------------------------------------ title screen */
#title { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background:
    radial-gradient(ellipse at 50% 0%, rgba(160,70,20,.35), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(60,20,10,.6), transparent 60%),
    linear-gradient(#0c0806, #140d08 50%, #0a0705); }
#title::before { content: ''; position: fixed; inset: -50%; background:
    radial-gradient(circle at 20% 30%, rgba(255,150,60,.06), transparent 18%),
    radial-gradient(circle at 75% 65%, rgba(255,120,40,.05), transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(255,200,120,.03), transparent 30%);
  animation: drift 26s linear infinite alternate; pointer-events: none; }
@keyframes drift { to { transform: translate(6%, -4%) rotate(4deg); } }
.title-inner { position: relative; max-width: 1080px; margin: 0 auto; padding: calc(28px + var(--safe-t)) 16px 40px; }
.title-mast { text-align: center; margin-bottom: 18px; }
.title-kicker { font-family: var(--display); text-transform: uppercase; letter-spacing: .45em; font-size: .78em; color: var(--muted); }
#title h1 { margin: 6px 0 0; font-family: var(--display); font-weight: 900; font-size: clamp(2.6em, 9vw, 5.6em); letter-spacing: .08em; line-height: 1;
  background: linear-gradient(180deg, #fff1c0 0%, #e8b850 45%, #9a5a18 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(230,140,40,.45)) drop-shadow(0 4px 2px rgba(0,0,0,.8)); animation: flicker 5s infinite; }
@keyframes flicker { 0%, 100% { filter: drop-shadow(0 0 22px rgba(230,140,40,.45)) drop-shadow(0 4px 2px rgba(0,0,0,.8)); } 47% { filter: drop-shadow(0 0 30px rgba(240,160,50,.6)) drop-shadow(0 4px 2px rgba(0,0,0,.8)); } 52% { filter: drop-shadow(0 0 16px rgba(220,120,30,.35)) drop-shadow(0 4px 2px rgba(0,0,0,.8)); } }
.title-rule { width: min(420px, 70%); height: 2px; margin: 12px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.title-world { font-family: var(--display); font-size: 1.15em; color: var(--text); letter-spacing: .08em; }
.seed { opacity: .6; margin-left: .5em; }
.resume { max-width: 520px; margin: 0 auto 18px; text-align: center; padding: 14px; background: var(--leather); border: 1px solid var(--gold); border-radius: 6px; box-shadow: 0 0 30px rgba(226,183,90,.2); }
.resume-who { font-family: var(--display); font-size: 1.2em; color: var(--gold-hi); }
.resume .btn { margin-top: 10px; }
.create { border-radius: 4px; padding: 18px 22px 22px; }
.create h2 { font-family: var(--display); font-weight: 900; color: #4a2410; margin: 0 0 10px; text-align: center; letter-spacing: .06em; }
.name-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.name-row span { font-family: var(--display); color: #6a3a18; }
#t-name { font-family: var(--display); font-size: 1.2em; padding: 6px 12px; width: min(340px, 80vw); border: 1px solid #7a5a2c; background: rgba(255,250,235,.7); color: var(--ink); border-radius: 3px; text-align: center; }
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.picker h3 { font-family: var(--display); color: #6a3a18; margin: 4px 0 6px; letter-spacing: .1em; text-transform: uppercase; font-size: .95em; border-bottom: 1px solid rgba(90,60,25,.3); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 5px; }
.pick { text-align: left; padding: 6px 8px; border: 1px solid rgba(90,60,25,.4); border-radius: 4px; background: rgba(255,250,235,.35); color: var(--ink); display: flex; flex-direction: column; gap: 1px; transition: background .12s; }
.pick:hover { background: rgba(255,250,235,.7); }
.pick.on { background: linear-gradient(#7a2c14, #4e180a); color: #fff1d0; border-color: #e2b75a; box-shadow: 0 0 10px rgba(200,120,40,.4); }
.pick-name { font-family: var(--display); font-weight: 700; font-size: .92em; }
.pick-tag { font-size: .72em; opacity: .85; }
.pick.on .pick-tag { color: #d8f0b8; }
.pick-detail { margin-top: 8px; }
.defcard { border-radius: 4px; padding: 10px 14px; box-shadow: inset 0 0 30px rgba(110,70,25,.35); font-size: .95em; }
.defcard h3 { margin: 0 0 4px; font-family: var(--display); color: #4a2410; }
.defcard .desc { margin: 2px 0 6px; font-style: italic; }
.t-err { min-height: 1.4em; text-align: center; color: #9a2214; font-weight: bold; margin: 10px 0 4px; opacity: 0; transition: opacity .2s; }
.t-err.show { opacity: 1; }
#t-begin { display: block; margin: 6px auto 0; }
.law { text-align: center; font-style: italic; margin-bottom: 0; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  #menu .lbl { display: none; }
  #menu button { min-width: 38px; }
}
@media (max-width: 900px) {
  #menu { top: auto; bottom: calc(6px + var(--safe-b)); left: 50%; }
  #log { bottom: calc(66px + var(--safe-b)); }
  #actions { bottom: calc(66px + var(--safe-b)); }
  #toast { top: calc(110px + var(--safe-t)); }
}
@media (max-width: 760px), (pointer: coarse) and (max-height: 600px) {
  html, body { font-size: 14px; }
  #hud-left { width: 46vw; max-width: 230px; padding: 6px 8px; }
  #hud-right { min-width: 0; max-width: 46vw; padding: 6px 8px; }
  #h-date, #h-title { display: none; }
  #h-loc { font-size: .9em; max-width: 44vw; }
  #h-sun { width: 26px; height: 26px; }
  #menu { left: 0; right: 0; transform: none; border-radius: 0; justify-content: space-around; bottom: 0; padding: 3px 3px calc(3px + var(--safe-b)); gap: 0; }
  #menu .menu-sep { display: none; }
  #menu kbd { display: none; }
  #menu button { min-width: 0; flex: 1 1 0; padding: 4px 2px; }
  #menu #z-in, #menu #z-out { display: none; }
  #minimap-box { width: 104px; height: 104px; padding: 3px; }
  #log { top: calc(96px + var(--safe-t)); bottom: auto; left: 6px; width: 62vw; height: 74px; font-size: .82em; padding: 4px 6px; }
  #log.expanded { height: 46vh; width: calc(100vw - 12px); z-index: 15; }
  #actions { right: 6px; bottom: calc(52px + var(--safe-b)); gap: 4px; }
  #a-here { min-width: 0; max-width: 46vw; font-size: .95em; padding: 9px 10px 9px 24px; }
  #a-here::before { left: 10px; }
  #actions .act-row button { padding: 6px 8px; }
  #slots { grid-template-columns: repeat(3, 46px); }
  #slots .slot { height: 40px; }
  #dpad { bottom: calc(56px + var(--safe-b)); }
  #panel { left: 0; top: 0; transform: none; width: 100vw; height: calc(100% - 46px - var(--safe-b)); max-height: none; border-radius: 0; animation: winfade .14s ease-out; }
  #panel.closing { animation: winfadeout .12s ease-in forwards; }
  #p-body { padding: 10px 14px 18px; }
  .p-head { margin: 0 8px; }
  .dlg-card, .help-card { padding: 18px 16px 12px; }
  .dlg-card .close, .help-card .close { top: 10px; right: 10px; }
  .chat-wrap { grid-template-columns: 1fr; }
  .pickers { grid-template-columns: 1fr; }
  .pick-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .zc-name { white-space: normal; }
  #toast { top: calc(176px + var(--safe-t)); }
}
@media (min-width: 761px) {
  body.touch #log { left: 190px; width: min(420px, calc(100vw - 440px)); }
}
@media (max-width: 760px) {
  body.touch #actions .act-row { flex-direction: column; align-items: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ------------------------------------------------------------ server-shape extras */
.traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 8px; font-size: .9em; }
.trait b { font-family: var(--display); font-size: .85em; letter-spacing: .04em; }
.opt-cost { color: var(--c-bad); font-style: normal; font-weight: bold; }
.opt.tone-warn { border-left-color: #d04a2a; background: linear-gradient(90deg, rgba(150,30,15,.38), rgba(0,0,0,.14)); }
.opt.tone-muted { opacity: .8; font-style: italic; }
body.dead #view { filter: grayscale(.85) brightness(.6); transition: filter 1.2s; }
body.dead #zonecard { opacity: 0; }
body.dead #a-here, body.dead #actions .act-row { opacity: .4; pointer-events: none; }

/* ------------------------------------------------------------ world crossing title card */
#worldcard { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; text-align: center; pointer-events: none; opacity: 0; visibility: hidden;
  background: radial-gradient(ellipse at center, var(--wc-glow, rgba(226,183,90,.3)) 0%, rgba(6,4,3,.9) 55%, rgba(0,0,0,.97) 100%); }
#worldcard.show { visibility: visible; pointer-events: auto; cursor: pointer; animation: wcin 6s ease-in-out forwards; }
@keyframes wcin { 0% { opacity: 0; } 12% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; } }
.wc-inner { padding: 20px; max-width: 900px; }
.wc-kicker { font-family: var(--body); font-style: italic; color: #d8c8a4; font-size: clamp(1em, 2.6vw, 1.35em); letter-spacing: .08em; }
.wc-name { font-family: var(--display); font-weight: 900; font-size: clamp(2em, 7vw, 4.6em); line-height: 1.05; margin: 8px 0 4px; letter-spacing: .08em; color: #fff4dc;
  text-shadow: 0 0 34px var(--wc-accent, #e2b75a), 0 0 12px var(--wc-accent, #e2b75a), 0 4px 10px #000; }
#worldcard.show .wc-name { animation: wcname 2.2s ease-out; }
@keyframes wcname { from { letter-spacing: .4em; opacity: 0; filter: blur(6px); } 60% { filter: blur(0); } }
.wc-rule { height: 2px; width: min(520px, 70vw); margin: 12px auto; background: linear-gradient(90deg, transparent, var(--wc-accent, #e2b75a), transparent); }
.wc-genre { font-family: var(--display); text-transform: uppercase; letter-spacing: .4em; font-size: clamp(.8em, 2vw, 1.05em); color: var(--wc-accent, #e2b75a); }
.wc-tag { font-family: var(--body); font-style: italic; color: #eadfc4; font-size: clamp(1em, 2.4vw, 1.3em); margin-top: 10px; }
.wc-note { font-family: var(--body); color: var(--muted); font-size: .9em; margin-top: 18px; }

/* ------------------------------------------------------------ death */
#death { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transition: opacity .9s ease-out; visibility: hidden;
  background: radial-gradient(ellipse at center, rgba(60,0,0,0) 30%, rgba(30,0,0,.6) 72%, rgba(0,0,0,.88)); }
#death.show { opacity: 1; visibility: visible; }
.death-inner { position: relative; text-align: center; width: 100%; padding: 22px 16px 20px; background: linear-gradient(90deg, rgba(20,3,2,0), rgba(20,3,2,.82) 18%, rgba(20,3,2,.82) 82%, rgba(20,3,2,0)); }
.death-inner::before, .death-inner::after { content: ''; position: absolute; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, #a3281c 25%, #e2b75a 50%, #a3281c 75%, transparent); }
.death-inner::before { top: 0; } .death-inner::after { bottom: 0; }
.death-title { font-family: var(--display); font-weight: 900; font-size: clamp(2.2em, 8vw, 4.8em); letter-spacing: .14em; color: #e8392a; text-shadow: 0 0 30px rgba(200,20,10,.7), 0 4px 10px #000; }
#death.show .death-title { animation: deathin 2.4s ease-out; }
@keyframes deathin { from { letter-spacing: .5em; opacity: 0; } }
.death-rule { height: 2px; width: min(420px, 60vw); margin: 10px auto; background: linear-gradient(90deg, transparent, #a3281c, transparent); }
.death-sub { font-style: italic; color: #e0c8b0; text-shadow: 0 2px 6px #000; }

/* ------------------------------------------------------------ help */
#help { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; padding: 12px; } /* clear backdrop: a click outside closes it */
#help.closing { pointer-events: none; }
#help.closing .help-card { animation: winsink .14s ease-in forwards; }
.help-card { position: relative; width: min(640px, 96vw); max-height: 90vh; overflow-y: auto; padding: 22px 26px 18px; animation: winrise .18s ease-out; }
.help-card h2 { margin: 0 0 12px; padding: 0 44px 10px 0; background: linear-gradient(90deg, var(--c-line-strong), transparent 75%) left bottom / 100% 1px no-repeat; }
.help-card .close { position: absolute; top: 14px; right: 14px; }
.help-grid { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 6px 14px; align-items: baseline; }
.help-grid > div:nth-child(odd) { font-family: var(--display); font-size: .85em; color: var(--c-sub); white-space: nowrap; }
.help-grid kbd { margin: 0 2px 1px 0; font-size: .78em; }
.help-law { margin: 14px 0 12px; font-style: italic; text-align: center; }
#help-ok { display: block; margin: 0 auto; }
.touch-only { display: none; }
body.touch .touch-only { display: grid; }
body.touch .kb-only { display: none; }
.help-card .btn.primary { color: #fff3d6; border-radius: 2px; border: 1px solid var(--iron); box-shadow: inset 0 0 0 1px var(--gold), 0 0 16px rgba(200,80,30,.3); }

/* ------------------------------------------------------------ book reader (book: true dialogs)
   The window is a tooled leather binding in the same brass frame; the pages stay parchment. */
#dlg.book .dlg-card { width: min(940px, 97vw); padding: 18px 24px 12px;
  background: var(--win-frame), radial-gradient(ellipse at 50% 0%, rgba(120,70,30,.35), transparent 60%), repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 2px, transparent 2px 5px), linear-gradient(#4a2c18, #2c180b);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 20px 56px rgba(0,0,0,.85); }
#dlg.book #dlg-title { text-align: center; padding: 0 44px; font-size: 1em; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-hi); text-shadow: 0 1px 3px #000; }
#dlg.book #dlg-sub { text-align: center; font-style: italic; color: #c9b088; font-size: .86em; margin-top: 2px; }
#dlg.book #dlg-text { position: relative; margin: 12px 0 10px; padding: 26px 34px 18px; color: #2a1a0c; font-size: 1.1em; line-height: 1.62; text-align: justify; hyphens: auto; white-space: normal; max-height: 60vh; overflow-y: auto; border: 0; border-radius: 2px;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,252,240,.6), transparent 70%), linear-gradient(90deg, #d4bd90 0%, #ecdfbd 5%, #f3e8cc 50%, #ecdfbd 95%, #d4bd90 100%);
  box-shadow: inset 0 0 36px rgba(110,70,25,.38), 0 2px 0 #c9ae7c, 0 4px 0 #b4976a, 0 6px 0 #a08458, 0 9px 14px rgba(0,0,0,.6); scrollbar-color: #9a7a4a transparent; }
#dlg.book #dlg-text.spread { column-count: 2; column-gap: 72px; column-fill: balance; overflow: visible; max-height: none; padding: 30px 40px 18px;
  background: linear-gradient(90deg, rgba(0,0,0,0) 46%, rgba(90,60,25,.32) 49.6%, rgba(60,36,12,.5) 50%, rgba(90,60,25,.32) 50.4%, rgba(0,0,0,0) 54%), radial-gradient(ellipse at 25% 40%, rgba(255,252,240,.55), transparent 60%), radial-gradient(ellipse at 75% 40%, rgba(255,252,240,.55), transparent 60%), linear-gradient(90deg, #cdb588 0%, #ecdfbd 4%, #f3e8cc 30%, #e8d9b4 48%, #d9c59a 50%, #e8d9b4 52%, #f3e8cc 70%, #ecdfbd 96%, #cdb588 100%); }
#dlg.book #dlg-text p { margin: 0 0 .7em; text-indent: 1.2em; }
#dlg.book #dlg-text p.dropcap { text-indent: 0; }
#dlg.book #dlg-text p:first-child::first-letter, #dlg.book #dlg-text p.dropcap::first-letter { float: left; font-family: var(--display); font-weight: 900; font-size: 3.3em; line-height: .82; margin: 6px 8px 0 0; color: #8a1a0a; text-shadow: 1px 1px 0 rgba(226,183,90,.55); }
#dlg.book .folio { column-span: all; text-align: center; font-family: var(--display); font-size: .78em; color: #7a5a30; letter-spacing: .2em; margin-top: 10px; text-indent: 0; }
#dlg.book #dlg-text.turned { animation: pagein .55s ease-out; }
@keyframes pagein { from { opacity: .25; } }
.dlg-card .leaf { position: absolute; z-index: 3; pointer-events: none; transform-origin: left center; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #d8c39a, #f4ead0 40%, #efe2c2); box-shadow: -4px 0 18px rgba(0,0,0,.35); animation: leafturn .62s cubic-bezier(.45,.05,.55,.95) forwards; }
.dlg-card .leaf.full { animation-name: leafturnfull; }
@keyframes leafturn { 0% { transform: perspective(1600px) rotateY(0deg); } 100% { transform: perspective(1600px) rotateY(-180deg); opacity: .35; } }
@keyframes leafturnfull { 0% { transform: perspective(1600px) rotateY(0deg); opacity: 1; } 100% { transform: perspective(1600px) rotateY(-100deg); opacity: 0; } }
#dlg.book .opt.tone-warn { margin: 6px 0; padding: 12px 14px; color: #fff0d0; border: 1px solid #f0c060; border-left: 1px solid #f0c060; font-family: var(--display); font-size: 1.12em; letter-spacing: .06em;
  background: linear-gradient(90deg, #4a0c06, #8e2412 50%, #4a0c06); box-shadow: 0 0 18px rgba(240,140,60,.45), inset 0 0 12px rgba(0,0,0,.5); animation: warnglow 2.2s ease-in-out infinite; }
#dlg.book .opt.tone-warn:hover:not(.dis) { background: linear-gradient(90deg, #5a1008, #a82c16 50%, #5a1008); }
#dlg.book .opt.tone-warn .opt-hint { color: #f2d4ac; font-family: var(--body); letter-spacing: 0; font-size: .74em; }
#dlg.book .opt.tone-warn .opt-n { color: #ffe0a0; border-color: #f0c060; }
@keyframes warnglow { 50% { box-shadow: 0 0 30px rgba(255,160,70,.7), inset 0 0 12px rgba(0,0,0,.5); } }
#dlg.book .dlg-help { color: #a8977a; }
@media (max-width: 760px) {
  #dlg.book #dlg-text { padding: 18px 16px 14px; font-size: 1.02em; text-align: left; }
  #dlg.book .dlg-card { padding: 16px 12px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #zonecard.show, #worldcard.show { animation: none !important; opacity: 1; }
  .dlg-card .leaf { display: none; }
}

/* ---- talk (overheard speech) & party ---- */
.c-talk { color: #f0d9a8; }
#party { position: fixed; left: 8px; top: 150px; z-index: 30; width: 260px; font-family: var(--body); pointer-events: none; }
#party > * { pointer-events: auto; }
#party .party-toggle { color: var(--gold-hi); background: linear-gradient(#33241a, #1a120b); border: 1px solid var(--iron); border-radius: 2px; padding: 4px 11px; font-family: var(--display); font-size: 12px; letter-spacing: .08em; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(205,160,85,.45), inset 0 1px 0 rgba(255,225,160,.12), 0 2px 8px rgba(0,0,0,.55); }
#party .party-toggle:hover { box-shadow: inset 0 0 0 1px var(--gold), 0 0 10px rgba(226,183,90,.3); }
#party .party-toggle.has-invite { box-shadow: inset 0 0 0 1px #ffd36a, 0 0 10px #ffb43a; animation: partyPulse 1.2s ease-in-out infinite; }
@keyframes partyPulse { 50% { box-shadow: inset 0 0 0 1px #ffd36a, 0 0 2px #ffb43a; } }
#party .party-body { margin-top: 6px; padding: 14px 16px 14px; max-height: 60vh; overflow: auto; animation: winrise .16s ease-out; }
#party .party-h { margin-bottom: 6px; padding-bottom: 7px; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .1em; color: var(--gold-hi); text-shadow: 0 1px 0 #000;
  background: linear-gradient(90deg, var(--c-line-strong), transparent 80%) left bottom / 100% 1px no-repeat; }
#party .party-sec { font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c-sub); margin: 10px 0 4px; border-bottom: 1px solid var(--c-line); }
#party .party-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; border-bottom: 1px dotted var(--c-line); }
#party .party-row em { color: var(--c-soft); font-size: 12px; }
#party .party-row small { color: var(--c-soft); font-size: 11px; }
#party .party-loc { font-size: 12px; color: var(--c-soft); text-align: right; }
#party button { font-family: var(--display); font-size: 11px; letter-spacing: .03em; color: #fff0d0; background: linear-gradient(#8a3018, #561a0c); border: 1px solid var(--iron); border-radius: 2px; padding: 3px 8px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(240,190,110,.45), inset 0 1px 0 rgba(255,220,180,.18); }
#party button:hover { box-shadow: inset 0 0 0 1px var(--gold-hi), 0 0 8px rgba(226,183,90,.3); }
#party button.muted { color: var(--c-ink); background: linear-gradient(#33251a, #1c140c); box-shadow: inset 0 0 0 1px rgba(205,160,85,.35); }
#party .party-actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
#party .party-note { font-size: 12px; color: var(--c-soft); margin-top: 8px; font-style: italic; }
#party .party-frames { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
#party .pf { background: linear-gradient(#24180f, #150e08); border: 1px solid var(--iron); border-radius: 2px; padding: 4px 7px; color: #e8dcc0; font-size: 12px; box-shadow: inset 0 0 0 1px rgba(205,160,85,.25), 0 2px 6px rgba(0,0,0,.5); }
#party .pf.near { box-shadow: inset 0 0 0 1px rgba(226,183,90,.6), 0 2px 6px rgba(0,0,0,.5); }
#party .pf.dead { opacity: .5; filter: grayscale(1); }
#party .pf-name { font-family: var(--display); font-size: 12px; }
#party .pf-lv { color: #a89878; font-size: 10px; }
#party .pf-bar { height: 4px; background: rgba(0,0,0,.6); margin-top: 2px; overflow: hidden; }
#party .pf-bar i { display: block; height: 100%; }
#party .pf-bar.hp i { background: linear-gradient(90deg, #8a1a10, #d8402a); }
#party .pf-bar.mp i { background: linear-gradient(90deg, #1a3a8a, #3a6ad8); }
#party .pf-where { color: #a89878; font-size: 10px; }
@media (max-width: 700px) { #party { top: auto; bottom: 170px; width: 200px; } }

/* ---- touch: thumb-sized targets in panels, dialogs and the trade window (body.touch = coarse pointer, tp-on = touch panel) ---- */
body.touch .close, body.tp-on .close { width: 44px; height: 44px; font-size: 1.15em; }
body.touch .opt, body.tp-on .opt { min-height: 52px; padding: 10px 12px; }
body.touch #dlg-opts, body.tp-on #dlg-opts { gap: 8px; }
body.touch .dlg-card, body.tp-on .dlg-card, body.touch #p-body, body.tp-on #p-body, body.touch .help-card, body.tp-on .help-card { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
body.touch #panel .btn, body.tp-on #panel .btn, body.touch .dlg-card .btn, body.tp-on .dlg-card .btn { min-height: 40px; }
body.touch #panel .btn.tiny, body.tp-on #panel .btn.tiny { min-height: 34px; min-width: 34px; }
body.touch .tab, body.tp-on .tab { padding: 10px 14px; }
body.touch .inv-row, body.tp-on .inv-row { min-height: 46px; }
body.touch #chat-in, body.tp-on #chat-in { min-height: 46px; font-size: 16px; }
body.touch #tradewin, body.tp-on #tradewin { max-height: 94vh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
body.touch .tw-x, body.tp-on .tw-x { width: 44px; height: 44px; font-size: 18px; }
body.touch .tw-pi, body.tp-on .tw-pi { width: 54px; height: 54px; }
body.touch .tw-pi img, body.tp-on .tw-pi img { width: 44px; height: 44px; }
body.touch .tw-it button, body.tp-on .tw-it button { min-width: 40px; min-height: 40px; font-size: 18px; }
body.touch .tw-ok, body.tp-on .tw-ok { min-height: 48px; padding: 10px 22px; font-size: 16px; }
body.touch .tw-gold, body.tp-on .tw-gold { min-height: 40px; font-size: 16px; }
#hud { align-items: flex-start; } /* the left plate must not stretch to the height of the clock + minimap column */

/* ------------------------------------------------------------ bleeding out (banner built by ui.js) */
#bleedout { position: fixed; left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); z-index: 55; display: flex; align-items: center; gap: 12px; white-space: nowrap; padding: 7px 42px; color: #f4e0c8; font-family: var(--body); pointer-events: auto;
  background: linear-gradient(90deg, rgba(50,4,2,0), rgba(70,6,4,.9) 14%, rgba(70,6,4,.9) 86%, rgba(50,4,2,0)); animation: bannerin .3s ease-out; }
#bleedout::before, #bleedout::after { content: ''; position: absolute; left: 6%; right: 6%; height: 1px; background: linear-gradient(90deg, transparent, #d8a048 30%, #f2d488 50%, #d8a048 70%, transparent); pointer-events: none; }
#bleedout::before { top: 0; } #bleedout::after { bottom: 0; }
@keyframes bannerin { from { opacity: 0; transform: translateX(-50%) translateY(-6px); } }
#bleedout .bo-t { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: #ff9a8a; text-shadow: 0 0 10px rgba(255,60,40,.5), 0 1px 0 #000; }
#bleedout .bo-s { min-width: 38px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 20px; color: #fff; text-shadow: 0 0 10px rgba(255,80,60,.7), 0 1px 0 #000; }
#bleedout .bo-h { font-size: 13px; opacity: .9; font-style: italic; }
#bleedout button { font-family: var(--display); font-size: 12px; letter-spacing: .05em; color: #f4d0c0; background: linear-gradient(#3a1410, #1e0a08); border: 1px solid #0c0403; border-radius: 2px; padding: 3px 11px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(220,110,90,.6); }
#bleedout button:hover { color: #fff; box-shadow: inset 0 0 0 1px #ffb0a0, 0 0 8px rgba(255,90,70,.4); }
@media (max-width: 700px) { #bleedout .bo-h { display: none; } #bleedout { padding: 6px 28px; } }
body.downed #view, body.downed canvas { filter: saturate(.35) brightness(.8); }

/* readability pass (Kyle 2026-11-19: "text is too small"): bigger dialog text, hints and costs, wider card */
.dlg-card { width: min(720px, 96vw); font-size: 17px; }
#dlg-text { font-size: 1.1em; line-height: 1.5; }
.opt { font-size: 1.06em; padding: 9px 14px 9px 10px; }
.opt-n { width: 28px; height: 28px; line-height: 26px; font-size: .9em; }
.opt { grid-template-columns: 30px 1fr auto; }
.opt-hint { font-size: .95em; line-height: 1.4; color: #cdb990; font-style: normal; }
.opt-why { font-size: .92em; }
#dlg-gold:not(:empty) { font-size: .9em; }
.dlg-foot, #dlg-foot { font-size: .85em; }
@media (max-width: 520px) { .dlg-card { font-size: 15px; } }
