/* Alliars v0 app layout on top of the take A kit. Phone: map + bottom sheet. Desktop: map + side panel. */
html, body { height:100%; }
body { display:block; overflow:hidden; background:#15191B; overscroll-behavior:none; }
#app { position:fixed; inset:0; }
.stage { position:absolute; inset:0; overflow:hidden; overflow:clip; isolation:isolate; border-radius:0; box-shadow:none;
  background: radial-gradient(130% 80% at 40% 40%, #2F6C73 0%, #1F515D 45%, #143843 100%); }
.hud-top { padding: calc(env(safe-area-inset-top) + 14px) 20px 0; }
.rail { top: calc(env(safe-area-inset-top) + 62px); }
.num.season span { opacity:.5; font-size:15px; margin-left:1px; }
#timer.low { color:#F08A7E; }
.head .nm { position:absolute; top:62px; left:50%; transform:translateX(-50%); font:500 9.5px/1 var(--text); color:rgba(251,247,239,.7); white-space:nowrap; max-width:52px; overflow:hidden; text-overflow:ellipsis; }
.head.you .nm { color:var(--brass-hi); }
.head.you::after { display:none; }
.rail { padding-bottom:16px; }
.head { height:72px; }
/* panel = bottom sheet on phone: peek (sentence + seal), half (crews, table, last season), full (talk) */
.panel { position:absolute; left:0; right:0; bottom:0; z-index:8; height:var(--sheet-h, 128px); display:flex; flex-direction:column;
  border-radius:22px 22px 0 0; padding:0 0 env(safe-area-inset-bottom);
  background: var(--grain), linear-gradient(180deg, rgba(30,35,39,.98), rgba(20,24,27,.98));
  box-shadow: 0 -12px 40px rgba(0,0,0,.35), inset 0 0 0 1px var(--hair);
  transition: height .38s var(--out); }
body[data-sheet="peek"] .panel { --sheet-h: calc(var(--peek, 120px) + env(safe-area-inset-bottom)); }
body[data-sheet="half"] .panel { --sheet-h: 56vh; }
body[data-sheet="full"] .panel { --sheet-h: 64vh; }
body[data-sheet="peek"] #panel { visibility:hidden; }
.grab { height:20px; flex:none; cursor:grab; position:relative; touch-action:none; }
.grab::before { content:''; position:absolute; left:50%; top:7px; width:40px; height:4px; margin-left:-20px; border-radius:2px; background:rgba(251,247,239,.25); }
#panel { flex:1; min-height:0; display:flex; flex-direction:column; }
/* the one sticky sentence + the Ready seal */
.status { flex:none; display:flex; align-items:center; gap:12px; padding:2px 14px 12px 18px; min-height:84px; border-bottom:1px solid var(--line); cursor:default; }
.stxt { flex:1; min-width:0; }
.s1 { font:560 18px/1.25 var(--serif); font-variation-settings:'opsz' 36; color:var(--white); letter-spacing:-.005em; }
.s2 { font:400 13.5px/1.4 var(--text); color:var(--mist); margin-top:4px; min-height:1.4em; }
.status.warnline .s2 { color:var(--dangerText); font-weight:600; }
.s1 .links { white-space:nowrap; }
.s1 .links a { font:600 14px/1 var(--display); color:var(--gold); cursor:pointer; text-decoration:underline; text-underline-offset:3px; margin-left:6px; padding:8px 2px; }
.seal { flex:none; width:72px; height:72px; border-radius:50%; border:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; color:#F3EADB;
  background: var(--grain), radial-gradient(120% 120% at 30% 20%, #2A3034 0%, #181C1F 60%, #121517 100%);
  box-shadow: inset 0 0 0 2px rgba(226,194,124,.75), inset 0 0 0 5px rgba(10,12,13,.9), 0 8px 18px rgba(0,0,0,.35); transition: transform .18s var(--pop), background .2s; }
.seal:active { transform:scale(.94); }
.seal .sc { display:flex; height:24px; align-items:center; }
.seal .sc svg { width:22px; height:22px; }
.seal .sl { font:600 10px/1 var(--text); letter-spacing:.14em; text-transform:uppercase; }
.seal.on { background: linear-gradient(180deg, #F0C266 0%, #E2AA45 100%); color:#21180A; box-shadow: inset 0 1px 0 rgba(255,244,214,.6), 0 8px 18px rgba(0,0,0,.35); }
.seal.on svg path { stroke:#21180A; }
.seal:disabled { opacity:.4; cursor:default; }
.seal.glow { animation: sealglow 1.6s ease-in-out infinite; }
@keyframes sealglow { 0%,100% { box-shadow: inset 0 0 0 2px rgba(226,194,124,.75), inset 0 0 0 5px rgba(10,12,13,.9), 0 0 0 0 rgba(233,178,76,.0); } 50% { box-shadow: inset 0 0 0 2px rgba(240,200,110,1), inset 0 0 0 5px rgba(10,12,13,.9), 0 0 0 8px rgba(233,178,76,.22); } }
/* crest rail: + the Fire */
.head .nm { position:absolute; top:62px; left:50%; transform:translateX(-50%); font:500 9.5px/1 var(--text); color:rgba(251,247,239,.7); white-space:nowrap; max-width:52px; overflow:hidden; text-overflow:ellipsis; }
.head.you .nm { color:var(--brass-hi); }
.head.you::after { display:none; }
.head.on .disc { filter: drop-shadow(0 0 6px rgba(233,178,76,.8)); }
.head.offer .disc { animation: offerbob 1.2s ease-in-out infinite; }
@keyframes offerbob { 0%,100% { transform:none; } 50% { transform:translateY(-3px); } }
.head.fire .disc.fired { width:36px; height:36px; margin-top:3px; border-radius:50%; background:rgba(251,247,239,.1) !important; box-shadow: inset 0 0 0 1.5px rgba(226,194,124,.45) !important; }
.head.fire .disc svg { width:20px; height:20px; }
.rail { padding-bottom:16px; }
.head { height:72px; }
/* incoming offer: paper card under the rail (phone) or top right of the map (desktop) */
.offers { position:absolute; z-index:9; left:14px; right:14px; top: calc(env(safe-area-inset-top) + 156px); pointer-events:none; }
.offers .pcard { pointer-events:auto; width:100%; max-width:none; margin:0; box-shadow: 0 14px 30px rgba(0,0,0,.35); animation: drop .45s var(--pop); }
.offers .more { pointer-events:auto; display:block; margin:8px auto 0; height:34px; padding:0 14px; border:none; border-radius:17px; cursor:pointer; font:600 12.5px/1 var(--display); color:var(--white); background:rgba(20,24,27,.82); box-shadow: inset 0 0 0 1px rgba(226,194,124,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes drop { from { transform:translateY(-24px) rotate(-1.5deg); opacity:0; } to { transform:none; opacity:1; } }
.betray { position:absolute; inset:0; z-index:12; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(10,12,13,.45); opacity:0; pointer-events:none; transition:opacity .25s; }
.betray.show { opacity:1; pointer-events:auto; }
.betray .pcard { width:100%; max-width:360px; transform:rotate(-1.2deg); }
.grow { flex:1; min-width:0; }
.pbody { flex:1; min-height:0; overflow-y:auto; padding:12px 16px 20px; -webkit-overflow-scrolling:touch; }
.pbody.thread { display:flex; flex-direction:column; padding:0; overflow:hidden; }
.sec { margin-bottom:18px; }
.sec > .lbl { margin:4px 0 8px; }
.row { display:flex; align-items:center; gap:12px; padding:10px 8px; border-radius:12px; }
.row.crew, .row.seat { cursor:pointer; }
.row.crew:active, .row.seat:active { background:rgba(251,247,239,.05); }
.row.crew.sel { background:rgba(233,178,76,.12); }
.row .t { font:600 15px/1.25 var(--display); color:var(--white); }
.row .s, .s { font:400 13.5px/1.4 var(--text); color:var(--mist); }
.dim { color:var(--dim) !important; }
.one { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.warn { color:var(--dangerText) !important; font-weight:600; }
.gold { color:var(--gold); }
.crack { color:var(--dangerText); font-size:11px; }
.pin { width:10px; height:10px; border-radius:50%; flex:none; box-shadow:0 0 0 2px rgba(251,247,239,.2); }
.bub { font-style:normal; min-width:20px; height:20px; border-radius:10px; background:var(--gold); color:#2A1D06; font:600 11.5px/20px var(--display); text-align:center; padding:0 6px; }
.fireic { width:36px; height:36px; border-radius:50%; background:rgba(251,247,239,.08); display:flex; align-items:center; justify-content:center; flex:none; }
.note { background:rgba(233,178,76,.12); border-radius:12px; padding:12px 14px; font:400 14px/1.4 var(--text); margin-bottom:14px; }
.foot { margin-top:18px; font:400 12px/1.4 var(--text); color:var(--dim); }
.foot a, .link { color:var(--mist); }
.center { text-align:center; padding:12px; }
.btn.wide { width:100%; margin-top:8px; }
.btn.small { height:40px; min-width:0; padding:0 16px; font-size:14px; }
.btn.ghost.dark { color:var(--inkp); box-shadow: inset 0 0 0 1px rgba(35,30,23,.3); }
.btn:disabled { opacity:.55; }
.desk-only { display:none; }

/* thread */
.thead { display:flex; align-items:center; gap:10px; padding:4px 12px 10px; border-bottom:1px solid var(--line); flex:none; }
.thead .t { font:560 18px/1.2 var(--serif); }
.msgs { flex:1; min-height:0; overflow-y:auto; padding:12px 14px; display:flex; flex-direction:column; gap:8px; -webkit-overflow-scrolling:touch; }
.msg { align-self:flex-start; max-width:82%; background:rgba(251,247,239,.09); border-radius:16px 16px 16px 6px; padding:9px 13px; font:400 15px/1.4 var(--text); color:var(--white); user-select:text; -webkit-user-select:text; }
.msg.me { align-self:flex-end; background:#E9B24C; color:#21180A; border-radius:16px 16px 6px 16px; }
.msg .who { font:600 11.5px/1 var(--text); margin-bottom:4px; }
.sep { align-self:center; font:600 10px/1 var(--text); letter-spacing:.14em; text-transform:uppercase; color:var(--dim); margin:8px 0 2px; }
.empty { padding:24px 8px; text-align:center; font:400 14px/1.4 var(--text); }
.compose { flex:none; padding:8px 12px 10px; border-top:1px solid var(--line); }
.chips { display:flex; gap:6px; overflow-x:auto; padding-bottom:8px; scrollbar-width:none; }
.chips::-webkit-scrollbar { display:none; }
.chipb { flex:none; height:34px; padding:0 12px; border-radius:17px; border:none; background:rgba(242,234,219,.1); color:var(--white); font:500 13px/1 var(--text); cursor:pointer; white-space:nowrap; box-shadow: inset 0 0 0 1px rgba(226,194,124,.25); }
.chipb.on { background:var(--paper); color:var(--inkp); box-shadow: inset 0 0 0 1.5px var(--gold2); }
.crow { display:flex; gap:8px; }
.crow input { flex:1; min-width:0; height:44px; border-radius:22px; border:none; padding:0 16px; background:rgba(251,247,239,.08); color:var(--white); font:400 16px/1 var(--text); outline:none; box-shadow: inset 0 0 0 1px var(--line); }
.crow input:focus { box-shadow: inset 0 0 0 1.5px rgba(233,178,76,.6); }
.crow .btn { height:44px; border-radius:22px; }

/* promise card */
.pcard { position:relative; border-radius:14px; padding:12px 14px; margin:4px 0; max-width:92%; align-self:center; width:92%; }
.sec .pcard { width:100%; max-width:none; }
.pcard .ph { display:flex; align-items:center; gap:8px; font:600 12px/1 var(--text); letter-spacing:.06em; text-transform:uppercase; color:var(--inkp2); margin-bottom:8px; }
.pcard .ph img { width:20px; height:20px; }
.pcard .term { font:560 16.5px/1.3 var(--serif); color:var(--inkp); margin:4px 0; }
.pcard .pnote { font:italic 400 13.5px/1.4 var(--text); color:var(--inkp2); margin-top:6px; }
.pcard .acts { display:flex; gap:8px; margin-top:12px; }
.pcard .acts .btn { flex:1; }
.pcard .stamp { position:absolute; right:12px; top:10px; transform:rotate(-8deg); font:700 11px/1 var(--display); letter-spacing:.14em; text-transform:uppercase; padding:5px 8px; border-radius:4px; border:2px solid currentColor; color:#3E7A3A; }
.pcard .stamp.declined, .pcard .stamp.expired { color:#8A7B66; }
.pcard .stamp.countered { color:#A0702A; }
.pcard.declined, .pcard.expired { opacity:.7; }
.pill { color:#14181B; background:var(--mist); }
.pill.kept { background:var(--gold); }
.pill.broken { background:var(--danger); color:#fff; }
.pill.untestable { background:rgba(251,247,239,.25); color:var(--white); }
.pill.active { background:rgba(251,247,239,.25); color:var(--white); }

/* result */
.moment { font:560 15.5px/1.35 var(--serif); padding:10px 12px; border-radius:12px; background:rgba(251,247,239,.06); margin-bottom:6px; }
.moment.promise_broken, .moment.stab { background:rgba(224,87,74,.16); }
.moment.alliance_formed { background:rgba(233,178,76,.14); }
.beat { border-radius:12px; padding:8px 10px; margin-bottom:4px; background:rgba(251,247,239,.04); }
.beat.mine { background:rgba(233,178,76,.1); }
.beat .bh { display:flex; align-items:center; gap:8px; font:400 14px/1.35 var(--text); }
.beat .bh b { font-weight:600; color:var(--white); }
.beat .bt { display:none; font:400 13.5px/1.45 var(--text); color:var(--mist); margin-top:6px; }
.beat.open .bt { display:block; }
.why { flex:none; height:28px; padding:0 10px; border-radius:14px; border:none; background:rgba(251,247,239,.1); color:var(--white); font:600 12px/1 var(--display); cursor:pointer; }

/* full screens: home, join, lobby, end */
.screen { position:absolute; inset:0; z-index:30; display:none; overflow-y:auto; padding: calc(env(safe-area-inset-top) + 24px) 16px calc(env(safe-area-inset-bottom) + 24px);
  background: var(--topo), radial-gradient(1200px 700px at 50% 30%, #23292B 0%, #15191B 60%, #0E1112 100%); }
.screen.show { display:flex; align-items:flex-start; justify-content:center; }
.card { width:100%; max-width:440px; margin:auto; }
.home h1 { font:560 54px/1 var(--serif); font-variation-settings:'opsz' 144; letter-spacing:-.02em; margin:18px 0 10px; text-align:center; }
.home .body { text-align:center; margin:0 0 24px; }
.home .crests { display:flex; justify-content:center; gap:6px; margin-top:24px; }
.home .sub { text-align:center; font:400 12.5px/1.4 var(--text); color:var(--dim); margin:8px 0 18px; display:block; }
.field { display:block; margin-bottom:16px; }
.field .lbl { display:block; margin-bottom:8px; }
.field input { width:100%; height:50px; border-radius:12px; border:none; padding:0 16px; background:rgba(251,247,239,.08); color:var(--white); font:500 17px/1 var(--text); outline:none; box-shadow: inset 0 0 0 1px var(--line); user-select:text; }
.linkbox { display:flex; gap:8px; margin-bottom:18px; }
.linkbox input { flex:1; min-width:0; height:44px; border-radius:12px; border:none; padding:0 12px; background:rgba(251,247,239,.08); color:var(--white); font:400 14px/1 var(--text); }
.seatlist { margin-bottom:18px; }
.seatlist .row { padding:6px 4px; }
.endcard h1 { font:560 38px/1.05 var(--serif); margin:8px 0 16px; }
.tally { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:22px; }
.tl { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:10px; background:rgba(251,247,239,.05); font:500 14px/1 var(--text); }
.tl.win { background:rgba(233,178,76,.18); }
.gs { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.gcard { border-radius:14px; padding:12px; background:rgba(251,247,239,.06); text-align:center; display:flex; flex-direction:column; align-items:center; gap:4px; }
.gcard.right { box-shadow: inset 0 0 0 2px var(--gold); }
.gcard.wrong { box-shadow: inset 0 0 0 2px rgba(224,87,74,.6); }
.gcard .t { font:600 15px/1.2 var(--display); }
.gbtns { display:flex; gap:4px; margin-top:6px; }
.gbtns button { height:32px; padding:0 10px; border-radius:8px; border:none; background:rgba(251,247,239,.1); color:var(--white); font:600 12.5px/1 var(--display); cursor:pointer; }
.gbtns button.on { background:var(--white); color:#14181B; }
.truth { margin-top:6px; font:600 14px/1.2 var(--display); }
.truth.ai { color:var(--gold); }
.truth span { display:block; font:400 11px/1.3 var(--text); color:var(--dim); margin-top:2px; word-break:break-all; }
.score { margin-top:12px; font:560 18px/1.3 var(--serif); text-align:center; }
.ledger { max-height:260px; overflow-y:auto; border-radius:12px; background:rgba(251,247,239,.04); }
.ledger table { width:100%; border-collapse:collapse; font:400 13px/1.35 var(--text); }
.ledger td { padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:middle; }
.ledger td img { vertical-align:middle; margin-right:-4px; }
.endbtns { display:flex; gap:10px; margin-top:20px; }
.endbtns .btn { flex:1; text-decoration:none; }
a.btn { text-decoration:none; }
.net { position:absolute; left:50%; top: calc(env(safe-area-inset-top) + 8px); transform:translateX(-50%); z-index:40; background:#E0574A; color:#fff; font:600 12px/1 var(--text); padding:6px 10px; border-radius:8px; display:none; }
.net.show { display:block; }
.toast { z-index:35; top: calc(env(safe-area-inset-top) + 150px); }
#app:not(.in-game) .stage > *:not(.world) { visibility:hidden; }

/* ---------- desktop: big map + 400 px side panel. Also phone landscape and desktop zoom 200% (short and wide): the
   bottom sheet left a 100 px strip of map there. Tall portrait screens (iPad) keep the phone layout. Keep in sync with WIDE in main.ts. */
@media (min-width: 900px) and (min-aspect-ratio: 4/5), (min-width: 600px) and (max-height: 520px) {
  #app { display:grid; grid-template-columns: 1fr min(400px, 46vw); }
  .stage { position:relative; inset:auto; height:100vh; height:100dvh; }
  .panel { position:relative; inset:auto; height:100vh !important; height:100dvh !important; padding-right:env(safe-area-inset-right); border-radius:0; padding-top:10px; transition:none;
    box-shadow: inset 1px 0 0 var(--hair); }
  .grab { display:none; }
  .rail { display:none; }
  .status { min-height:96px; padding:10px 16px 16px 20px; }
  .s1 { font-size:20px; }
  .offers { left:auto; right:20px; top:76px; width:min(340px, calc(100% - 40px)); }
  .toast { left:auto; right:calc(min(400px, 46vw) + 16px); width:min(380px, calc(54vw - 32px)); top:76px; }
  .gs { grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .card.endcard { max-width:620px; }
  #panel .pbody.thread { display:flex; }
}
@media (hover: hover) and (pointer: fine) { .row.crew:hover, .row.seat:hover { background:rgba(251,247,239,.05); } }
@media (width < 600px), (width < 900px) and (height > 520px), (aspect-ratio < 4/5) and (height > 520px) {
  body[data-sheet="full"] .offers, body[data-sheet="half"] .offers { display:none; }
  /* tablet portrait uses the phone layout: keep the sheet, the offer and the toast at a readable width */
  .panel, .offers, .toast { max-width:600px; margin-left:auto; margin-right:auto; }
}
/* narrow phones: 7 crests + the Fire must fit (at 320 px they were cut off at both ends) */
@media (max-width: 380px) { .rail { gap:2px; left:4px; right:4px; padding-left:3px; padding-right:3px; }
  .head { width:calc((100vw - 28px) / 8); }
  .head .disc, .head .disc img { width:min(42px, calc((100vw - 28px) / 8)) !important; height:min(42px, calc((100vw - 28px) / 8)) !important; }
  .head .nm { max-width:calc((100vw - 28px) / 8 + 4px); } }

.thead .icon { background:none; border:none; cursor:pointer; height:40px; border-radius:10px; }
.nextb { margin:0 0 16px; position:sticky; top:0; z-index:2; }
#app { overflow:hidden; overflow:clip; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-iteration-count:1 !important; } }

/* panel rows */
.row.tight { padding:6px 4px; }
.row .key { flex:none; width:22px; height:22px; border-radius:6px; background:rgba(251,247,239,.08); color:var(--dim); font:600 11.5px/22px var(--display); text-align:center; }
.row .tn { font:400 12.5px/1 var(--text); }
.towns { flex:none; text-align:right; display:flex; flex-direction:column; align-items:flex-end; }
.towns b { font:600 17px/1 var(--display); color:var(--white); }
.towns span { font:500 9.5px/1.2 var(--text); color:var(--dim); text-transform:uppercase; letter-spacing:.1em; }
.result .headline { font:560 17px/1.3 var(--serif); margin:2px 0 8px; }
.result .why { font:400 13.5px/1.45 var(--text); color:var(--mist); padding:8px 10px; border-radius:10px; background:rgba(233,178,76,.08); margin-bottom:6px; }
.btn.big { height:56px; font-size:18px; }
.btn.ghost.wide svg { margin-right:8px; }
.pcard .btn.shake { background:var(--gold); color:#21180A; }
.crow .btn.offer { background:var(--gold); color:#21180A; }
.field.small input { height:44px; font-size:16px; }
.field.small { margin-top:18px; }
.endcard .sub2 { font:400 14px/1.4 var(--text); color:var(--mist); margin:-8px 0 18px; }
.endcard h2.q { font:560 24px/1.2 var(--serif); margin:6px 0 6px; }
.endcard .tight { padding:0 0 12px; text-align:left; }
.gcard { cursor:pointer; }
.gcard.win { box-shadow: inset 0 0 0 1.5px rgba(233,178,76,.5); }
.gtoggle { display:flex; gap:4px; margin-top:6px; }
.gtoggle button { height:30px; padding:0 9px; border-radius:8px; border:none; background:rgba(251,247,239,.08); color:var(--dim); font:600 12px/1 var(--display); cursor:pointer; }
.gtoggle button.on { background:var(--white); color:#14181B; }
.endcard #reveal, .endcard #again { margin-top:18px; }
.ledgerline { margin-top:16px; font:400 13px/1.4 var(--text); color:var(--mist); text-align:center; }
.ledgerline a { color:var(--gold); cursor:pointer; text-decoration:underline; }
.ledger { margin-top:10px; }
#app:not(.in-game) .panel { display:none; }
.hspark { position:absolute; left:0; top:0; pointer-events:none; z-index:6; }
.hspark .hs-in { transform:translate(-50%, -100%); animation: hsbob .9s var(--inout) infinite alternate; filter: drop-shadow(0 4px 5px rgba(0,0,0,.35)); }
.hspark.ring .hs-in svg { width:20px; height:25px; }
@keyframes hsbob { from { transform:translate(-50%, -100%); } to { transform:translate(-50%, calc(-100% - 8px)); } }
.head .pm { position:absolute; top:30px; left:-4px; width:16px; height:16px; border-radius:50%; display:none; background:var(--gold); box-shadow:0 0 0 1.5px #161A1D;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='none' stroke='%2321180A' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='6' cy='8' r='2.6'/%3E%3Ccircle cx='10' cy='8' r='2.6'/%3E%3C/g%3E%3C/svg%3E"); background-size:16px 16px; }
.head.bound .pm { display:block; animation: pop .3s var(--pop); }
.head.cracked .disc::after { content:""; position:absolute; left:74%; top:2px; width:2.5px; height:15px; margin-left:-1px; background:#E0574A; transform:rotate(28deg); border-radius:1px; box-shadow:0 0 0 1px rgba(22,26,29,.7); }
.head.cracked .disc { position:relative; }
.result .standing { margin:-4px 0 10px; }
.pcard .stamp.broken { color:#B8432F; }
.pcard.broken { box-shadow: inset 0 0 0 2px rgba(224,87,74,.55), 0 14px 30px rgba(0,0,0,.35); }
.gcard .rec { font-size:12px; color:var(--mist); }
.gcard .rec b { font-weight:600; color:var(--white); }
.gcard .rec b.warn { color:var(--dangerText); }
.truth span.miss { color:var(--dangerText); }
.gcard .wcrown svg { width:14px; height:8px; margin-right:5px; vertical-align:2px; display:inline-block; }
.gcard .wcrown svg.crown { position:static; transform:none; }
/* labels and markers on the map never take a tap: it goes to the hex under them */
.tlabel, .tlabel *, .hspark, .hspark * { pointer-events:none !important; }
/* phone: the dropped offer is compact (the map under it stays useful); the note shows in one line */
@media (width < 600px), (width < 900px) and (height > 520px), (aspect-ratio < 4/5) and (height > 520px), (max-height: 520px) {
  .offers .pcard { padding:10px 12px; }
  .offers .pcard .ph { margin-bottom:4px; }
  .offers .pcard .term { font-size:15px; margin:2px 0; }
  .offers .pcard .pnote { margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .offers .pcard .acts { margin-top:8px; }
  .offers .pcard .acts .btn { height:38px; }
}
/* final-1: a parked offer waits on the sender's crest as a small pulsing chip (phone) */
.head .ochip { display:none; position:absolute; top:-7px; left:50%; transform:translateX(-50%); padding:2px 6px 2px; border-radius:8px; background:var(--gold); color:#21180A; font:700 8.5px/1.25 var(--display); letter-spacing:.07em; text-transform:uppercase; font-style:normal; box-shadow:0 0 0 1.5px #161A1D; pointer-events:none; z-index:2; }
.head.parked .ochip { display:block; animation: ochip 1.3s ease-in-out infinite; }
.head.parked .dot { display:none; }
@keyframes ochip { 0%,100% { box-shadow:0 0 0 1.5px #161A1D, 0 0 0 0 rgba(242,195,91,.65); } 50% { box-shadow:0 0 0 1.5px #161A1D, 0 0 0 7px rgba(242,195,91,0); } }

/* ---------- stress fixes (fix/stress-ui) ---------- */
/* a 160-character line with no spaces (a pasted link, "NOOOO...") ran out of its bubble and off the panel */
.msg, .pcard .term, .pcard .pnote, .toast .b, .note, .why, .moment, .s1, .s2 { overflow-wrap:anywhere; }
/* taps: no double-tap zoom wait on iOS (it ignores user-scalable=no), no long-press text selection on controls */
button, a, [data-act], .head, .gcard, .grab { touch-action:manipulation; -webkit-touch-callout:none; }
/* hit areas: 44 px where a finger has to land */
.thead .icon { min-width:44px; height:44px; display:flex; align-items:center; justify-content:center; color:var(--white); }
.chipb { height:40px; border-radius:20px; }
.pcard .acts .btn, .offers .pcard .acts .btn { height:44px; }
.s1 .links a { display:inline-block; padding:12px 4px; margin:-12px -2px -12px 4px; }
.ledgerline a { display:inline-block; padding:14px 6px; margin:-14px -6px; }
.gtoggle button { height:36px; }
.offers .more { height:40px; border-radius:20px; }
/* slow network: something to look at while app.js loads (was 3.5 s of an empty teal screen on 3G); shows only after 400 ms */
.boot { position:absolute; inset:0; z-index:31; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; pointer-events:none; opacity:0; animation:bootin .3s var(--out) .4s forwards; }
.boot .bt { font:560 44px/1 var(--serif); letter-spacing:-.02em; color:var(--white); }
.boot .bl { font:600 10px/1 var(--text); letter-spacing:.16em; text-transform:uppercase; color:var(--dim); }
@keyframes bootin { to { opacity:1; } }
/* short phones (iPhone SE): the talk sheet takes all the room under the crest rail, the thread had space for one message */
@media (width < 600px) and (max-height: 700px), (width < 900px) and (height > 520px) and (max-height: 700px) {
  html body[data-sheet="full"] .panel { --sheet-h: calc(100% - 152px - env(safe-area-inset-top)); }
}
/* end screen at 320 px: the Human / Machine toggle pushed each card 18 px past the grid */
@media (max-width: 360px) { .gcard { padding:12px 8px; } .gtoggle button { padding:0 8px; } }
/* crew rows start with a place name; "your land by Cinder Ford" reads as a title with a capital */
.row.crew .t::first-letter { text-transform:uppercase; }
/* sheet heights track the visible viewport (the URL bar), not the largest one */
body[data-sheet="half"] .panel { --sheet-h: 56dvh; }
body[data-sheet="full"] .panel { --sheet-h: 64dvh; }
/* landscape phones: keep the season dial and the timer out of the notch */
.hud-top { padding-left:max(20px, env(safe-area-inset-left)); padding-right:max(20px, env(safe-area-inset-right)); }
/* iOS zooms into any input under 16 px on focus, readonly included */
.linkbox input { font-size:16px; }
/* motion: toasts land in 300 ms (were 500); the Ready glow pulses a composited ring (opacity) instead of repainting box-shadow every frame */
.toast { transition: transform .3s var(--out), opacity .2s; }
.seal { position:relative; }
.seal.glow { animation:none; }
.seal.glow::after { content:''; position:absolute; inset:0; border-radius:50%; pointer-events:none; box-shadow:0 0 0 8px rgba(233,178,76,.22), inset 0 0 0 2px rgba(240,200,110,1); opacity:0; animation:sealpulse 1.6s ease-in-out infinite; }
@keyframes sealpulse { 50% { opacity:1; } }
/* short and wide (phone landscape, desktop zoom 200%): a compact sentence and seal, so the talk thread keeps its room */
@media (min-width: 600px) and (max-height: 520px) {
  .status { min-height:0; padding:4px 12px 10px 16px; gap:10px; }
  .s1 { font-size:16px; }
  .s2 { font-size:12.5px; margin-top:2px; }
  .seal { width:56px; height:56px; }
  .seal .sl { font-size:9px; }
  .thead { padding:2px 10px 6px; }
  .hud-top { padding-top:calc(env(safe-area-inset-top) + 8px); }
}
/* ledger at 320 px: "not tested" broke onto two lines inside its pill */
.pill { white-space:nowrap; flex:none; }
