:root{--wood:#6b4423;--wood-d:#3e2614;--wood-l:#9a6a3a;--parch:#f3e2b8;--parch-d:#d9bf86;--ink:#2a1a0e;--gold:#ffd23f;--red:#c8352a;--blue:#3b6fe0}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:#2b1a10 repeating-linear-gradient(90deg,#3a2414 0 6px,#33200f 6px 12px);color:var(--ink);font:14px/1.35 "Trebuchet MS",Verdana,sans-serif}
h1,h2,h3,.px{font-family:"Courier New",monospace;font-weight:900;letter-spacing:.5px;text-transform:uppercase}
.panel{background:var(--parch);border:4px solid var(--wood-d);box-shadow:inset 0 0 0 3px var(--parch-d),0 0 0 3px var(--wood-l),4px 6px 0 #0006;padding:14px;border-radius:2px}
.woodbar{background:linear-gradient(#8a5a30,#5a3518);border-bottom:4px solid var(--wood-d);color:#ffeec0;padding:8px 14px;display:flex;align-items:center;gap:14px;box-shadow:0 3px 0 #0005;text-shadow:2px 2px 0 #000}
.woodbar .logo{font:900 22px "Courier New",monospace;color:var(--gold);letter-spacing:2px}
.woodbar .sp{flex:1}
/* a1v108: game top bar — left (logo, Beta, Online), centred links, right (Discord, account) */
.topbar.woodbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;column-gap:10px;row-gap:4px}
.topbar .bar-left,.topbar .bar-right{display:flex;align-items:center;gap:10px;min-width:0}
.topbar .bar-left{justify-self:start;flex-wrap:wrap}
.topbar .bar-right{justify-self:end;justify-content:flex-end}
.topbar .bar-center{justify-self:center;min-width:0}
.topbar .nav-online{flex:none;font:bold 12px var(--px-font),"Courier New",monospace;color:#ffeec0;letter-spacing:.3px;white-space:nowrap;cursor:help;text-transform:none;text-shadow:1px 1px 0 #000}
button,.btn{font:900 13px "Courier New",monospace;text-transform:uppercase;background:linear-gradient(#ffe27a,#e0a52a);color:#3a2200;border:3px solid #3a2200;box-shadow:inset -2px -3px 0 #b07a10,inset 2px 2px 0 #fff6c0,2px 3px 0 #0007;padding:7px 12px;cursor:pointer;border-radius:2px}
button:hover{filter:brightness(1.08)} button:active{transform:translateY(2px);box-shadow:inset 2px 2px 0 #b07a10}
button.sec{background:linear-gradient(#e8d8b0,#c4a870);box-shadow:inset -2px -3px 0 #9a7a40,inset 2px 2px 0 #fff,2px 3px 0 #0007}
button.danger{background:linear-gradient(#ff8a7a,#c8352a);color:#fff;text-shadow:1px 1px 0 #000}
button:disabled{opacity:.45;cursor:not-allowed}
input,select,textarea{font:14px Verdana;background:#fffaf0;border:2px solid var(--wood);padding:6px;border-radius:2px;width:100%}
label{display:block;margin:8px 0 3px;font-weight:bold;font-size:12px}
.wrap{max-width:1100px;margin:24px auto;padding:0 12px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.err{color:#a01010;font-weight:bold;min-height:1.2em}
.ok{color:#1a6a1a;font-weight:bold}
.muted{opacity:.7;font-size:12px}
table{border-collapse:collapse;width:100%} td,th{border-bottom:1px solid var(--parch-d);padding:4px 6px;text-align:left;font-size:13px}
a{color:#6b2a00}
.gamewrap{display:flex;height:calc(100vh - 52px)}
.board{flex:1;overflow:auto;position:relative;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px}
#cv{image-rendering:pixelated;image-rendering:crisp-edges;display:block;margin:10px;cursor:pointer}
.side{width:330px;overflow:auto;padding:10px;display:flex;flex-direction:column;gap:10px}
.side .panel{padding:10px}
.stat{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px}
.preview{background:#fff4d4;border:2px dashed var(--wood);padding:6px;font-size:12px}
.preview b.big{font-size:18px}
.recruit{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.recruit button{display:flex;align-items:center;gap:6px;padding:4px;font-size:11px;text-align:left}
.log{max-height:170px;overflow:auto;font-size:12px}
.chip{display:inline-block;padding:1px 7px;border:2px solid #0006;border-radius:2px;color:#fff;font-weight:bold;text-shadow:1px 1px 0 #000}
.overlay{position:fixed;inset:0;background:#000a;display:flex;align-items:center;justify-content:center;z-index:9}
.overlay .panel{min-width:320px;text-align:center}
.toast{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);background:#2a1a0e;color:#ffe;padding:8px 14px;border:3px solid var(--gold);z-index:10;font-weight:bold;animation:toastin .15s ease-out}
.toast.out{opacity:0;transition:opacity .15s ease-out}
@keyframes toastin{from{opacity:0}to{opacity:1}}
.tabs button{margin-right:4px}
.list li{margin:6px 0}
.yourturn{background:var(--gold);padding:0 5px;font-weight:bold}
/* a1v95 (t270u): whose-turn marker on Your Battles rows; wrap cleanly on phones (the · stays with the previous token) */
.lobby2 .otherbattles .list li{overflow-wrap:anywhere}
.lobby2 .turnwho{font-weight:bold}
.lobby2 .turnmark{font-size:.85em;margin-left:1px}
.lobby2 .turnphrase{font-weight:bold;white-space:nowrap}
@media (max-width:800px){.gamewrap{flex-direction:column;height:auto}.side{width:auto}.grid2{grid-template-columns:1fr}}
/* ---------- A1 game screen: full viewport board in a chunky wood frame ---------- */
.pix{image-rendering:pixelated;image-rendering:crisp-edges}
canvas{image-rendering:pixelated}
.gamescreen{position:fixed;inset:0;background:#1a0f08;padding:0}
.gamescreen .frame{position:absolute;inset:0;padding:14px;background:#7a4a22 url(sprites/ui_wood.png) repeat;background-size:128px;
  box-shadow:inset 0 0 0 4px #2a170a,inset 0 0 0 7px #b07840,inset 0 0 0 10px #4a2a12}
.gamescreen .frame::before{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,#0000 0 6px,#0000001a 6px 8px)}
.gamescreen .board{position:absolute;inset:14px;overflow:hidden;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;border:4px solid #1c1a12;box-shadow:0 0 0 3px #c08a48,0 0 0 6px #2a170a}
.gamescreen #cv{position:absolute;inset:0;width:100%;height:100%;margin:0;cursor:pointer;touch-action:none}
.hud{position:absolute;z-index:3}
.hud:empty{display:none}
.parch,.plaque,.recruit{background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;color:var(--ink);border:4px solid #1c1a12;
  box-shadow:inset 0 0 0 3px #c89a58,inset 0 0 0 5px #f8ecc4,0 0 0 4px #6b4423,0 0 0 7px #1c1a12,5px 7px 0 7px #0006;padding:10px 12px;border-radius:3px}
.hud.tl{top:12px;left:12px;display:flex;flex-direction:column;gap:4px;padding:8px 14px}
.hud.tl .row{display:flex;align-items:center;gap:10px}
.turn-who{display:inline-flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0;line-height:1.15}
.turn-elapsed{font:900 11px var(--px-font), "Courier New",monospace;color:#5a3214;letter-spacing:0;font-variant-numeric:tabular-nums;white-space:nowrap}
.capstat{margin-top:6px}
.capstat .capline{font-weight:900;color:#3a1e08}
.capbar{display:block;width:100%;max-width:220px;height:8px;background:#3a382e;border:2px solid #1c1a12;margin:4px 0;border-radius:1px;overflow:hidden}
.capbar>span{display:block;height:100%;background:#e0a52a}
.capleft{font-weight:bold;color:#3a1e08}
.capint{margin-top:2px}
.base-card .blist{margin-top:6px;display:flex;flex-direction:column;gap:3px}
.base-card .bline{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}
.base-card .bmeta{display:none}
.base-card .chead{flex-wrap:wrap}
.base-card .bowner{flex:1 0 100%;order:3}
.base-card .card-tools{order:2}
.recruit-meta{margin:0 0 6px;font-size:12px;color:var(--ink);opacity:1}
.recruit-note{margin:0 0 6px;font-size:12px;line-height:1.35;color:var(--ink);opacity:1}
.recruit .recruit-meta,.recruit .recruit-note{color:var(--ink);opacity:1}
.hud .inc{font:900 12px "Courier New",monospace;color:#5a3214}
.hud.tr{top:12px;right:12px;display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.hud.tr .btns{display:flex;gap:6px}
.hud.tr .btns>*{min-width:38px;font-size:16px;padding:5px 9px;text-decoration:none}
button.endturn{padding:10px 18px;background:linear-gradient(#5ad04a,#2a8a2a);border:4px solid #1c1a12;box-shadow:inset -3px -4px 0 #1f6a1f,inset 3px 3px 0 #b8ffa0,0 0 0 3px #c08a48,3px 5px 0 3px #0007}
.hud.bl{left:12px;bottom:12px;max-width:min(520px,60vw)}
.card{display:flex;gap:12px;align-items:stretch;position:relative}
.card .chead{display:flex;align-items:flex-start;gap:6px}
.card .cname{flex:1;min-width:0}
.card-tools{display:flex;align-items:center;flex:0 0 auto;gap:2px;margin:-6px -6px 0 0}
.card-tools .qhelp{margin:0;flex:0 0 auto}
.card-close{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;width:44px;height:44px;padding:0;margin:0;font:900 22px var(--px-font);line-height:1;color:#3a1e08;background:linear-gradient(#e8d29a,#c9a660);border:3px solid #1c1a12;box-shadow:inset 2px 2px 0 #fff2c8,inset -2px -2px 0 #8a6a30;cursor:pointer}
.card-close:hover{filter:brightness(1.06)}
.card .port{background:#7cc843 repeating-linear-gradient(45deg,#86d64c 0 6px,#74c03e 6px 12px);border:4px solid #1c1a12;box-shadow:inset 0 0 0 3px #4a9a26;width:116px;min-height:116px;display:flex;align-items:center;justify-content:center}
.card .cname{font:900 18px "Courier New",monospace;text-transform:uppercase;color:#3a1e08}
.card .stats{display:grid;grid-template-columns:1fr 1fr;gap:2px 12px;margin:6px 0}.card .satk{grid-column:1/-1;flex-wrap:wrap}.card .atkv{display:grid;grid-template-columns:repeat(4,auto);gap:0 10px;margin-left:6px}@media(max-width:700px){.card .atkv{grid-template-columns:auto auto;gap:0 10px}}
.srow{display:flex;align-items:center;gap:6px;font-size:12px}
.srow .sl{opacity:.75}
.srow b{font:900 14px "Courier New",monospace}
.acts{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.hud.right{right:12px;top:118px}
.recruit{display:flex;flex-direction:column;gap:6px;align-items:stretch;max-height:calc(100vh - 250px);overflow:auto;padding:12px;width:260px}
.recruit>canvas{align-self:center;margin-bottom:4px}
.rtile{display:grid;grid-template-columns:56px 1fr;grid-template-rows:auto auto;gap:0 8px;align-items:center;text-align:left;padding:4px 8px 4px 4px;background:linear-gradient(#e8d29a,#c9a660);box-shadow:inset -2px -3px 0 #8a6a30,inset 2px 2px 0 #fff2c8,2px 3px 0 #0006}
.rtile>canvas:first-child{grid-row:span 2;background:#6cc23a;border:3px solid #1c1a12;width:56px;height:56px;object-fit:contain}
.rtile .rn{font-size:11px}
.rtile .rc{display:flex;align-items:center;gap:4px}
.rtile.off{filter:grayscale(.7)}
.rtile{position:relative;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.rtile .rhold{position:absolute;left:4px;right:4px;bottom:0;height:3px;background:#3a382e;border-radius:1px;overflow:hidden;pointer-events:none;opacity:0}
.rtile.holding .rhold{opacity:1}
.rtile.holding .rhold>span{display:block;height:100%;width:0;background:#e0a52a;animation:rholdfill 450ms linear forwards}
@keyframes rholdfill{to{width:100%}}
html.reduce-motion .rtile.holding .rhold>span{animation:none;width:70%}
.overlay.recinfo{z-index:12;align-items:center;padding:8px}
.recinfo-card{max-width:min(420px,94vw);max-height:min(88vh,640px);overflow:auto;text-align:left;padding:10px 12px}
.recinfo-head{display:flex;gap:10px;align-items:stretch;margin-bottom:6px}
.recinfo-head .port{width:80px;min-height:80px;flex:0 0 auto}
.recinfo-head .port canvas{zoom:.67}
.recinfo-cost{display:flex;align-items:center;gap:4px;margin-top:4px}
.recinfo-bits{margin:4px 0;font:600 13px var(--px-font),"Courier New",monospace;color:#3a1e08}
.recinfo-lore{margin:4px 0 6px;line-height:1.35}
.recinfo-reason{margin:4px 0;font-weight:bold;color:#8c1a11}
.recinfo-acts{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-top:8px}
.recinfo-card .stats{display:grid;grid-template-columns:1fr 1fr;gap:2px 12px;margin:6px 0}
.recinfo-card .satk{grid-column:1/-1}
.recinfo-card .atkv{display:grid;grid-template-columns:repeat(2,auto);gap:2px 14px;margin-left:6px}
@media (max-width:800px){
  .recinfo-card{padding:8px 10px}
  .recinfo-head .port{width:56px;min-height:56px}
  .recinfo-card .cname{font-size:15px}
  .recinfo-card .stats{margin:2px 0}
}
.hud.bc{left:50%;bottom:12px;transform:translateX(-50%)}
.hud.bl:not(:empty)~.hud.bc{left:auto;right:12px;transform:none;bottom:150px}
.preview .pvrow{display:flex;align-items:center;gap:10px;margin:6px 0}
.preview .vs{font:900 20px "Courier New",monospace;color:#8c1a11}
.preview b.big{font:900 24px "Courier New",monospace} .preview b.red{color:#b0122b}
.parch.big{text-align:center;padding:16px 24px}
.hud.br{right:12px;bottom:12px;display:flex;flex-direction:column;gap:8px;max-width:340px}
.parch.small{font-size:12px;padding:8px 10px}
.parch.log{max-height:300px;overflow:auto}
.overlay .parch{min-width:320px;text-align:center}
@media (max-width:800px){.hud.bl{max-width:94vw}.card .port{width:80px;min-height:80px}.hud.right{top:auto;bottom:170px;transform:none}}
.hud.banner{top:12px;left:50%;transform:translateX(-50%)}
.thinking{display:flex;align-items:center;gap:8px;font:900 14px "Courier New",monospace;padding:6px 10px}
.thinking select{width:auto;padding:2px 4px}
/* ---------- a1v10 polish pass: consistent pixel UI, crisp scaling, touch-friendly ---------- */
:root{--px-font:"Courier New",ui-monospace,monospace;--ink-l:#5a3214;--frame:#1c1a12}
.hud canvas,.rtile canvas,.card canvas,.preview canvas,.overlay canvas{image-rendering:pixelated;image-rendering:crisp-edges}
button,.btn,.chip,.cname,.hud .inc,.thinking,.srow b,.rtile .rn{font-family:var(--px-font)}
button,.btn{transition:filter .08s,transform .05s;letter-spacing:.5px}
button:focus-visible,.btn:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.hud.tr .btns>*{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:38px;line-height:1}
button.endturn{display:inline-flex;align-items:center;justify-content:center;min-height:48px}
button.endturn[hidden]{display:none!important}
button.endturn:hover{filter:brightness(1.1) saturate(1.1)}
.chip{border:2px solid var(--frame);box-shadow:inset 0 -2px 0 #0004,inset 0 2px 0 #fff4;padding:1px 8px;font-size:12px}
.parch.small,.hazardtip{font-size:12px;line-height:1.4}
.hazardtip{border-color:var(--frame)} .hazardtip b{font-family:var(--px-font)}
.parch.log{scrollbar-width:thin;scrollbar-color:#8a5a30 #e8d29a}
.card .cname{letter-spacing:1px;text-shadow:1px 1px 0 #f8ecc4}
.card .port{image-rendering:pixelated}
.rtile{transition:transform .06s,filter .08s} .rtile:hover:not(.off){transform:translateY(-1px);filter:brightness(1.06)}
.rtile .rn{font-weight:900;text-transform:uppercase;letter-spacing:.3px}
.panel h1,.panel h2,.panel h3,.parch h3{color:#3a1e08;text-shadow:1px 1px 0 #f8ecc4;margin:.2em 0 .5em}
.overlay{backdrop-filter:none;background:#0a0604b8}
.overlay .parch,.overlay .panel{max-width:min(460px,92vw)}
.toast{font-family:var(--px-font);box-shadow:0 0 0 3px var(--frame),4px 6px 0 3px #0006;border-radius:2px}
/* In-game Less motion (html.reduce-motion) is the single switch; it defaults to the OS prefers-reduced-motion flag. */
html.reduce-motion *,html.reduce-motion *::before,html.reduce-motion *::after,body.reduce-motion *,body.reduce-motion *::before,body.reduce-motion *::after{transition:none!important;animation:none!important}
@media (pointer:coarse){button,.btn{min-height:44px}.hud.tr .btns>*{min-width:44px;min-height:44px}select,input{min-height:44px;font-size:16px}}
/* Compact battle HUD is width-driven (not a phone UA): at ~800px the gold plaque and top-right
   toolbar would overlap, and hover tooltips would sit on END TURN. Same layout as a 390px phone. */
@media (max-width:800px){
  .gamescreen .frame{padding:6px}.gamescreen .board{inset:6px;border-width:3px}
  .hud.tr{top:8px;right:8px;left:8px;align-items:stretch}
  .hud.tr .btns{justify-content:space-between;gap:clamp(2px,.7vw,6px);width:100%;min-width:0;flex-wrap:nowrap}
  .hud.tr .btns>*{flex:1 1 0;min-width:0;font-size:15px;padding:4px 0}
  .hud.tr .btns .surr{margin-left:clamp(0px,1vw,8px)}
  .hud.tr .endcluster{position:fixed;right:12px;bottom:12px;z-index:4;flex-direction:row;align-items:center;gap:8px}
  .hud.tr button.endturn{position:static;padding:8px 14px}
  .hud.tr .ready-badge{max-width:min(140px,42vw);text-align:center}
  .hud.tl{top:64px;left:8px;padding:5px 9px;gap:2px}
  .hud.tl canvas,.hud.tr button.endturn canvas{zoom:.67}
  .hud.tl .row{gap:6px;flex-wrap:wrap}
  .turn-elapsed{font-size:10px}
  .turn-who .chip{max-width:34vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .hud.bl:not(:empty)~.hud.right:not(:empty){bottom:unset;top:118px;max-height:min(30vh,220px);overflow:auto}
  .hud.bl{left:8px;right:8px;bottom:76px;max-width:none}
  .card{gap:8px}.card .port{width:64px;min-height:64px}.card .port canvas{zoom:.67}
  .card-tools{margin:-4px -4px 0 0}
  .card .cname{font-size:15px}.card .stats{gap:0 8px}.srow{font-size:11px}
  .hud.br{right:8px;left:8px;bottom:76px;max-width:none}.hud.br .parch.small:last-child:only-child:not(.log){display:none}
  .hud.bl:not(:empty)~.hud.br:not(:has(.log)){display:none}
  .hud.right{right:8px;left:8px;top:auto;bottom:76px}.recruit{width:auto;max-height:46vh}
  .hud.bc,.hud.bl:not(:empty)~.hud.bc{left:8px;right:8px;bottom:76px;transform:none}
  .hud.banner{top:118px}
  /* a1v78: compact phone building inspect card — desktop layout is unchanged */
  .base-card.card{gap:0;align-items:stretch;padding:6px 8px;max-height:min(42vh,280px);min-height:0;overflow:hidden}
  .base-card .port{display:none}
  .base-card .cinfo{min-width:0;flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}
  .base-card .chead{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;width:100%;flex:0 0 auto}
  .base-card .cname{font-size:14px;flex:0 1 auto}
  .base-card .card-tools{order:3;margin:0;flex:0 0 auto}
  .base-card .bowner{flex:1 1 auto;order:2;flex-basis:auto;margin:0;min-width:0}
  .base-card .bowner .chip{font-size:10px;padding:0 6px;max-width:42vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .base-card .stats{display:none}
  .base-card .bmeta,.base-card .capstat{flex:0 0 auto;width:100%}
  .base-card .cinfo>.muted:not(.viewonly){flex:0 0 auto}
  .base-card .bmeta{display:flex;flex-wrap:wrap;align-items:center;gap:1px 5px;margin:1px 0 3px;font:600 11px var(--px-font),"Courier New",monospace;color:#3a1e08;line-height:1.25}
  .base-card .bmeta canvas{width:12px;height:12px;flex:0 0 auto}
  .base-card .bmeta .bdot{opacity:.7;margin:0 1px}
  .base-card .blist{display:grid;grid-template-columns:1fr 1fr;gap:0 8px;margin-top:2px;min-height:0;flex:1 1 auto;width:100%;overflow:auto;scrollbar-width:thin;scrollbar-color:#8a5a30 #e8d29a}
  .base-card .blist .sl{grid-column:1/-1;font-size:10px;margin:0 0 1px;opacity:.75}
  .base-card .bline{font-size:10px;gap:4px;min-width:0;line-height:1.25;padding:1px 0}
  .base-card .bline .bn{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
  .base-card .bline .rc{gap:2px;flex:0 0 auto;zoom:.75}
  .base-card .viewonly{margin:2px 0 0;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:0 0 auto;width:100%}
  .base-card.on-turn .blist{display:none} /* on-turn shop stays in the recruit panel */
  .card[data-card="unit"]{padding:6px 8px}
  .card[data-card="unit"] .stats{margin:2px 0}
  .capstat{margin-top:4px}
  .capbar{height:6px;margin:2px 0}
  .capleft,.capint{font-size:11px}
}
@media (max-width:360px){
  .base-card.card{padding:5px 6px;max-height:min(36vh,200px)}
  .base-card .blist{gap:0 6px}
  .base-card .bline{font-size:9px}
  .card[data-card="unit"]{padding:5px 6px;gap:6px}
  .card[data-card="unit"] .port{width:48px;min-height:48px}
  .card[data-card="unit"] .port canvas{zoom:.55}
  .card[data-card="unit"] .cname{font-size:13px}
  .capstat{margin-top:2px}
  .hud.bl:not(:empty)~.hud.right:not(:empty){max-height:min(26vh,150px)}
}

@media (max-width:600px){
  .wrap{margin:10px auto}.panel{padding:10px}
}

.preview .pvn{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:12px}
.chev{color:#e8a800;font-weight:bold;letter-spacing:-2px;text-shadow:0 1px 0 #3a2400}
/* ---------- a1v19 player Rules screen (public/player-rules.js) ---------- */
.prules{display:grid;grid-template-columns:240px 1fr;gap:14px;align-items:start}
.rside{position:sticky;top:8px;display:flex;flex-direction:column;gap:8px}
.rsearch{font-family:var(--px-font)}
.rtoc{display:flex;flex-direction:column;gap:2px;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;border:3px solid var(--frame);padding:6px;box-shadow:3px 3px 0 #0005}
.rtoc a{display:flex;align-items:center;gap:6px;padding:4px 6px;color:var(--ink);text-decoration:none;font:bold 13px var(--px-font);border:2px solid transparent}
.rtoc a:hover,.rtoc a.on{background:#ffeec0;border-color:var(--wood)}
.rsec{background:#fff6dc;border:3px solid var(--frame);box-shadow:inset 0 0 0 2px var(--parch-d),3px 4px 0 #0004;padding:10px 14px;margin-bottom:14px}
.rsec h3{display:flex;align-items:center;gap:8px;margin:0 0 8px;color:var(--ink-l);border-bottom:3px solid var(--parch-d);padding-bottom:6px}
.rsec h4{font:900 13px var(--px-font);text-transform:uppercase;margin:12px 0 4px;color:var(--wood)}
.rsec p,.rsec li{font-size:15px;line-height:1.45}
.rimg{image-rendering:pixelated;vertical-align:middle;object-fit:contain}
.prt td,.prt th{font-size:13px;vertical-align:middle} .prt th{background:var(--wood);color:#ffeec0;font-family:var(--px-font)}
.prt tr:nth-child(odd) td{background:#0000000a}
.tblwrap{overflow-x:auto}
.formula{font:bold 14px var(--px-font);background:#2a1a0e;color:var(--gold);padding:8px 10px;border:3px solid var(--frame);margin:6px 0}
.example{padding:10px 12px;margin:8px 0}
.minibw{margin:6px 0;display:inline-block;border:3px solid var(--frame);box-shadow:3px 3px 0 #0005;line-height:0;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px}
.minib{image-rendering:pixelated}
kbd{display:inline-block;min-width:22px;text-align:center;font:bold 13px var(--px-font);background:#fffaf0;border:2px solid var(--wood-d);border-bottom-width:4px;padding:1px 6px;border-radius:3px}
.sw{display:inline-block;width:12px;height:12px;border:2px solid var(--frame);vertical-align:middle}
.qhelp{display:inline-block;width:18px;height:18px;line-height:16px;text-align:center;border-radius:50%;background:var(--gold);color:var(--ink);border:2px solid var(--frame);font:900 12px var(--px-font);text-decoration:none;margin-left:4px;vertical-align:middle;pointer-events:auto}
.rulesov{position:fixed;inset:0;background:#000a;z-index:50;display:flex;align-items:center;justify-content:center;padding:12px}
.rulesbox{width:min(1100px,100%);height:min(92vh,100%);display:flex;flex-direction:column;padding:10px}
.rhead{display:flex;align-items:center;gap:8px;margin-bottom:8px} .rhead h2{margin:0} .rhead .sp{flex:1}
.rbodywrap{flex:1;overflow:auto;padding-right:4px}
.rulesbtn{display:inline-block;text-decoration:none}
@media (max-width:700px){.prules{grid-template-columns:1fr}.rside{position:static}.rtoc{flex-direction:row;flex-wrap:wrap}.rtoc a{font-size:12px;padding:3px 5px}.rsec{padding:8px 10px}.rsec p,.rsec li{font-size:14px}.rulesov{padding:0}.rulesbox{height:100vh;border-width:2px}}
.wrap > h2{color:var(--gold);text-shadow:2px 2px 0 #000}
.prules>*,.rbody,.rsec{min-width:0}.formula{white-space:normal;overflow-wrap:anywhere}.rsec p{overflow-wrap:anywhere}
/* map editor (shared by CMS + My Maps) */
.meditor .palette button{margin:2px;padding:4px 6px;font-size:11px}.meditor .palette button.on{outline:3px solid #c8352a}.meditor .palette select,.meditor .palette input,.mtools input{width:auto}
/* labeled tool rows: shared left edge after widest label ("Start Units"); undo/mirror .mtools row unchanged */
.prows{display:grid;grid-template-columns:max-content 1fr;column-gap:10px;row-gap:4px;align-items:start}
.prow{display:contents}
.plab{grid-column:1;justify-self:start;align-self:start;white-space:nowrap;font:bold 12px var(--px-font);line-height:26px;color:var(--ink);padding-top:8px}
.pctrls{grid-column:2;display:flex;flex-wrap:wrap;gap:4px;align-items:center;min-width:0}
.pctrls .popt{display:inline-flex;align-items:center;gap:4px}
@media (max-width:700px){
  .prows{grid-template-columns:1fr;row-gap:6px}
  .prow{display:flex;flex-direction:column;gap:3px;min-width:0}
  .plab,.pctrls{grid-column:auto;justify-self:stretch}
  .mtray .tbody.prow{display:flex;flex-direction:column;gap:4px}
  .mtray .tbody .plab{display:block}
  .mtray .tbody .pctrls{display:flex;flex-wrap:wrap;gap:5px;min-width:0}
}
.mtools{margin:6px 0;display:flex;flex-wrap:wrap;gap:4px;align-items:center}.mtools button{padding:4px 8px;font-size:12px}
.meditor .mapwrap{overflow:auto;max-height:68vh;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;border:3px solid #3e2614}.meditor canvas{display:block;touch-action:none;cursor:crosshair}
.mvalid{margin-top:6px;font-size:13px}.mvalid ul{margin:2px 0 4px 18px;padding:0}.mvalid .err{font-weight:normal}
.warnbox{background:#fff3c4;border:2px solid #b8860b;padding:4px 8px;margin-top:4px;color:#5a3d00}
.pill.st-draft{background:#ddd}.pill.st-pending{background:#ffe27a}.pill.st-approved{background:#9fe07a}.pill.st-rejected,.pill.st-unpublished{background:#f2a49a}
.pill{padding:1px 6px;border:2px solid #3a2200;font:900 10px monospace;text-transform:uppercase}
.mmhead{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.mmhead .sp{flex:1}
.mmprops{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:flex-end}.mmprops label{margin:0}.mmprops input{width:auto}.mmprops label input:not([type=checkbox]){display:block;min-width:120px}
.mmbtns{margin:8px 0;display:flex;flex-wrap:wrap;gap:6px}
.meditor .mapwrap,.mapwrap.fit{width:fit-content;max-width:100%}
/* ---- usability pass (a1v25) ---- */
.woodbar{position:relative;flex-wrap:nowrap}
.woodbar .logo{text-decoration:none}
.navlinks{display:flex;gap:14px}.navlinks a{color:#ffeec0}.navlinks a.on{color:var(--gold);text-decoration:none;border-bottom:2px solid var(--gold)}
.burger{display:none;padding:4px 9px;font-size:16px}
.topbar .navlinks{flex-wrap:wrap;justify-content:center;row-gap:2px}
.umenu{position:relative;display:flex;align-items:center;gap:8px;flex-wrap:nowrap}.ubtn{display:flex;gap:6px;align-items:center;max-width:220px;text-transform:none}.ubtn .uname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:130px}.urate{opacity:.75}.gtag{background:#5a3214;color:#ffeec0;padding:0 4px;font-size:10px}
.udrop{display:none;position:absolute;right:0;top:calc(100% + 6px);z-index:30;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;border:3px solid #1c1a12;box-shadow:3px 4px 0 #0007;min-width:180px;flex-direction:column;padding:6px;gap:4px;text-shadow:none}
.umenu.open .udrop{display:flex}.udrop a{color:var(--ink);font:bold 14px var(--px-font);padding:6px 8px;text-decoration:none}.udrop a:hover{background:#ffeec0}
@media (max-width:1100px){
  .topbar.woodbar{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"left right" "center center";column-gap:8px;row-gap:4px}
  .topbar .bar-left{grid-area:left}.topbar .bar-right{grid-area:right}.topbar .bar-center{grid-area:center;justify-self:stretch;width:100%}
  .topbar .navlinks{justify-content:center;gap:8px 12px}
}
@media (max-width:700px){.woodbar{gap:8px;padding:6px 8px}.woodbar .logo{font-size:18px;letter-spacing:1px}
 .topbar.woodbar{padding:6px 8px;column-gap:6px}
 .topbar .bar-left,.topbar .bar-right{gap:6px}
 .topbar .nav-online{font-size:11px}
 .topbar .navlinks{gap:6px 10px}
 .topbar .navlinks a{padding:6px 2px;font-size:14px}
 .ubtn{max-width:150px;padding:5px 7px}.ubtn .uname{max-width:80px}.urate{display:none}.umenu{gap:4px;flex:1 1 auto;min-width:0;max-width:none;justify-content:flex-end}.umenu>.btn,.umenu>button{padding:4px 6px;font-size:11px;line-height:1.15;text-align:center}.umenu:has(>:nth-child(2))>button{white-space:normal;max-width:58%}.umenu:has(>:nth-child(2))>.btn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:42%}}
.hero{display:grid;grid-template-columns:1fr 1.2fr;gap:18px;align-items:center;max-width:1000px;margin:10px auto 16px}
.hero h1{font:900 40px var(--px-font);color:#ffd23f;text-shadow:3px 3px 0 #3a2200;margin:0}.hero .tag{font-weight:bold;margin-bottom:8px}.hero ul{padding-left:18px}.hero li{margin:6px 0;font-size:15px}
.heroboard{overflow:hidden;border:3px solid #1c1a12;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;max-height:360px;display:flex;justify-content:center}.herocv{image-rendering:pixelated;max-width:100%;height:auto}
button.bigplay{font-size:18px;padding:12px 22px;margin:8px 0 4px;background:linear-gradient(#5ad04a,#2a8a2a);color:#fff;text-shadow:2px 2px 0 #000}
@media (max-width:700px){.hero{grid-template-columns:1fr}.heroboard{max-height:220px}.hero h1{font-size:30px}}
.mapcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px;max-height:330px;overflow:auto;padding:2px}
.mapcard{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-transform:none;text-align:left;padding:6px;font-size:12px;background:#fff6dc;box-shadow:2px 2px 0 #0005;border:2px solid #7a5a30}
.mapcard.on{border-color:#c8352a;box-shadow:0 0 0 2px #ffd23f,2px 2px 0 #0005;background:#ffeec0}.mapcard b{font-size:12px}.mmeta{font:11px sans-serif;color:#5a3214}.mby{font:italic 11px sans-serif;color:#7a3a9a}
canvas.thumb{image-rendering:pixelated;border:1px solid #1c1a12;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;max-width:100%}
details.adv{margin-top:10px;border:2px dashed #b08a50;padding:4px 8px}details.adv summary{cursor:pointer;font:bold 13px var(--px-font)}
.emptycta{border:2px dashed #b08a50;padding:10px;text-align:center;display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.emptycta p{width:100%}.emptycta p{margin:0 0 8px}
.tplrow{display:flex;gap:10px;flex-wrap:wrap;align-items:stretch;margin:8px 0}.btn.tpl{display:flex;flex-direction:column;text-align:left;padding:10px 14px}.btn.tpl span{font:11px sans-serif;text-transform:none;letter-spacing:0}
.mymapgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px;margin-top:10px}.mymap{display:flex;flex-direction:column;gap:4px;padding:8px;background:#fff6dc;border:2px solid #7a5a30;color:var(--ink);text-decoration:none;box-shadow:2px 2px 0 #0005}
.pill.st-dirty{background:#ffe07a;color:#3a2200}.stepper{display:inline-flex;align-items:center;gap:6px}.stepper button{padding:2px 9px}.pnum{min-width:16px;text-align:center}.presets button{padding:3px 7px;font-size:11px;margin-right:3px}
.why{font-size:12px;margin-left:6px}.warnbox.restore{margin:6px 0}
.pbtn{display:inline-flex;align-items:center;gap:5px;padding:3px 7px 3px 3px}.swatch{width:20px;height:20px;image-rendering:pixelated;border:1px solid #1c1a12}.popt{white-space:nowrap}
.meditor.compact{padding-bottom:38vh}.meditor.compact .mapwrap{overflow:auto;max-height:70vh}
.mtray{position:fixed;left:0;right:0;bottom:0;z-index:25;max-height:36vh;overflow:auto;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;border-top:4px solid #1c1a12;box-shadow:0 -3px 0 #0006;padding:6px 8px}
.mtray.folded{max-height:none}.ttabs{display:flex;gap:4px;overflow-x:auto;position:sticky;top:-6px;background:inherit;padding-bottom:4px}.ttabs button{padding:5px 8px;font-size:11px;white-space:nowrap}.ttabs .tfold{margin-left:auto}
.tbody{display:flex;flex-wrap:wrap;gap:5px}.mtray .mtools{display:flex;flex-wrap:wrap;gap:5px}
.hud.tut{top:84px;left:50%;transform:translateX(-50%);max-width:min(460px,92vw)}.tutbox{font-size:14px;padding:10px 12px;border-color:#ffd23f;box-shadow:0 0 0 3px #1c1a12,3px 5px 0 3px #0007}.tutbox b{color:#8c1a11}.tutbox button{margin-top:6px;padding:4px 10px;font-size:11px}
@media (max-width:700px){.hud.tut{top:150px}}
/* a1v71: 14px Concede gap is desktop-only. Narrow overrides live in the max-width:800px HUD block
   (and again below) so they win over this rule and over the coarse 44px min-width. */
@media (min-width:801px){.hud.tr .btns .surr{margin-left:14px}}
/* a1v76: Undo sits in the toolbar; disabled when nothing can be undone */
.hud.tr .btns .undo:disabled{opacity:.45;cursor:default}
@media (max-width:800px){
  .hud.tr .btns{justify-content:space-between;gap:clamp(2px,.7vw,6px);width:100%;min-width:0;flex-wrap:nowrap}
  .hud.tr .btns>*{flex:1 1 0;min-width:0;font-size:15px;padding:4px 0}
  .hud.tr .btns .surr{margin-left:clamp(0px,1vw,8px)}
}
.tipfloat{position:fixed;z-index:60;background:#2a1a0e;color:#ffe;border:2px solid var(--gold);padding:4px 8px;font:bold 13px var(--px-font);pointer-events:none;white-space:nowrap;text-transform:none}
.recap{min-width:min(460px,92vw)}.rct{margin:8px auto;border-collapse:collapse;font-size:13px}.rct th,.rct td{padding:3px 8px;border-bottom:1px solid #b08a50;text-align:center}.rct td:first-child{text-align:left;font-weight:bold}
.rcbtns{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:8px}button.rematch{background:linear-gradient(#5ad04a,#2a8a2a);color:#fff;text-shadow:1px 1px 0 #000}
.hud.bc:has(.recap){left:50%!important;right:auto!important;transform:translateX(-50%)!important;bottom:auto!important;top:50%;transform:translate(-50%,-50%)!important}
.hint{font-size:12px;margin:2px 0 6px}details.danger-zone{margin-top:22px;border:2px solid #c8352a;padding:6px 10px}details.danger-zone summary{cursor:pointer;color:#8c1a11;font:bold 13px var(--px-font)}
.rsec h3.rfold{cursor:pointer}.rsec .fchev{margin-left:auto;font-size:14px;transition:transform .1s}.rsec.folded .rsecb{display:none}.rsec.folded .fchev{transform:rotate(-90deg)}.rsec.folded h3{margin:0;border:0;padding:0}
@media (max-width:700px){.rside{position:sticky;top:0;z-index:5}.rtoc{flex-wrap:nowrap;overflow-x:auto}.rtoc a{white-space:nowrap}}
/* a1v26: phone map maker fills the viewport */
.meditor.compact{position:fixed;inset:0;z-index:45;padding:0!important;display:flex;flex-direction:column;background:#1e3f6e}
.meditor.compact.away{display:none}
.meditor.compact .mtop{display:flex;gap:4px;align-items:center;padding:4px 6px;background:linear-gradient(#8a5a30,#5a3518);border-bottom:3px solid #1c1a12;flex:0 0 auto}
.meditor.compact .mtop button{padding:5px 8px;font-size:12px}.meditor.compact .mtop .sp{flex:1}.meditor.compact .mtop button.on{outline:3px solid #ffd23f}
.vstat{font:bold 13px var(--px-font);padding:2px 6px;border:2px solid #1c1a12;cursor:pointer}.vstat.good{background:#8fe07a}.vstat.bad{background:#ff8a7a}
.meditor.compact .mapwrap{flex:1 1 auto;align-self:stretch;width:100%!important;display:block!important;position:relative;overflow:hidden;max-height:none!important;touch-action:none}
.meditor.compact .mapwrap canvas{position:absolute;left:0;top:0;transform-origin:0 0}
.meditor.compact .mtray{position:absolute;left:0;right:0;bottom:0;max-height:38%;overflow:auto}
.meditor.compact .mtray.folded{max-height:none}
.backmap{position:fixed;right:10px;bottom:10px;z-index:46;background:linear-gradient(#5ad04a,#2a8a2a);color:#fff;text-shadow:1px 1px 0 #000}
/* a1v27: marketing landing (signed-out root) */
.landing{max-width:1060px;margin:0 auto;padding:0 10px 30px;color:#ffeec0}
.landing section{margin:26px 0}.landing h2{font:900 26px var(--px-font);color:#ffd23f;text-shadow:3px 3px 0 #3a2200;text-align:center;margin:0 0 14px}
.lhero{display:grid;grid-template-columns:1fr 1.15fr;gap:20px;align-items:center;margin-top:14px!important}
.lhero h1{font:900 56px var(--px-font);color:#ffd23f;text-shadow:4px 4px 0 #3a2200;margin:0;letter-spacing:2px}
.lvp{font:bold 22px/1.3 var(--px-font);margin:6px 0;text-shadow:2px 2px 0 #000}.lsub{font-size:17px;line-height:1.45;text-shadow:1px 1px 0 #000}
.lsec{margin-top:8px;font-size:14px;text-shadow:1px 1px 0 #000}.lsec a,.lfoot a{color:#ffd23f}
.landing .bigplay{font-size:22px;padding:14px 26px}.btnlink{display:inline-block;text-decoration:none;border:3px solid #1c1a12}
.landing .heroboard{max-height:420px;border-radius:2px;box-shadow:6px 6px 0 #0008}
.lband{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:center;background:#0006;padding:10px;border:3px solid #1c1a12}
.socbtns{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
a.soc{display:inline-flex;gap:6px;align-items:center;padding:10px 16px;font:bold 15px var(--px-font);color:#fff;text-decoration:none;border:3px solid #1c1a12;box-shadow:3px 3px 0 #000;text-shadow:1px 1px 0 #000}
a.soc.sx{background:#111}a.soc.sd{background:#4752c4}a.soc:hover,a.soc:focus-visible{filter:brightness(1.25)}
.landing a:focus-visible,.landing button:focus-visible,.faq summary:focus-visible{outline:3px solid #ffd23f;outline-offset:2px}
.feats{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.feat{background:url(sprites/ui_parchment.png),#f3e2b6;color:#2a1a0a;border:3px solid #1c1a12;padding:14px;box-shadow:4px 4px 0 #0008}
.feat img{image-rendering:pixelated;width:48px;height:48px}.feat h3{font:900 17px var(--px-font);margin:6px 0}.feat p{margin:0;line-height:1.4}
.steps{list-style:none;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.steps li{background:#0007;border:3px solid #1c1a12;padding:14px;display:flex;flex-direction:column;gap:4px}
.steps b{font:900 18px var(--px-font);color:#ffd23f}
.lmaps{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}.lmap{display:flex;flex-direction:column;align-items:center;gap:4px;background:#0006;padding:10px;border:3px solid #1c1a12}
.lmap .mmeta{color:#e9d9a8}
.lcomm{text-align:center;background:#0006;border:3px solid #1c1a12;padding:16px}.lcomm p{font-size:16px}
.faq{background:#f3e2b6;color:#2a1a0a;border:3px solid #1c1a12;margin:8px auto;max-width:760px;padding:0 12px}.faq summary{cursor:pointer;font-weight:bold;padding:12px 0;font-size:16px}.faq p{margin:0 0 12px;line-height:1.45}
.lfinal{text-align:center}.lfoot{text-align:center;display:flex;flex-direction:column;gap:10px;border-top:3px solid #0008;padding-top:16px}
@media (max-width:700px){.lhero{grid-template-columns:1fr;text-align:center}.lhero h1{font-size:42px}.lvp{font-size:19px}.steps{grid-template-columns:1fr}.landing h2{font-size:22px}}
.opengames{display:flex;flex-direction:column;gap:8px}
.opengame{display:flex;gap:10px;align-items:center;padding:8px;border:1px solid rgba(0,0,0,.25);background:rgba(255,255,255,.06)}
.opengame .thumb{flex:none;max-width:84px;height:auto}
.ogbody{flex:1;min-width:0}.ogline{font-size:.88em;margin-top:2px}.ogseats{font-weight:bold}
.ogtag{margin-left:6px;font-size:.75em;background:var(--gold);padding:0 4px}
.ogjoin{flex:none}
@media (max-width:600px){.opengame{flex-wrap:wrap}.opengame .ogjoin{width:100%}}

/* turn-start banner */
.turnbanner{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:#0006;cursor:pointer;animation:tbfade .2s ease-out}
.turnbanner .tbin{min-width:min(520px,90vw);max-width:94vw;text-align:center;padding:18px 26px;box-shadow:0 0 0 4px #c08a48,6px 8px 0 4px #000a;animation:tbpop .35s cubic-bezier(.2,1.4,.4,1)}
.tbtitle{font-size:clamp(40px,11vw,72px);font-weight:900;letter-spacing:3px;line-height:1;color:#fff4c8;text-shadow:3px 3px 0 #1c1a12,-2px -2px 0 #1c1a12,2px -2px 0 #1c1a12,-2px 2px 0 #1c1a12,0 6px 0 #0008}
.tbsub{margin-top:8px;font-size:clamp(18px,5vw,26px);font-weight:bold;text-shadow:2px 2px 0 #1c1a12,-1px -1px 0 #1c1a12,1px -1px 0 #1c1a12,-1px 1px 0 #1c1a12}
.tbline{margin-top:8px;font-size:clamp(15px,4.2vw,19px);font-weight:bold;color:var(--ink)}
.tbhint{margin-top:6px;font-size:12px;opacity:.65}
.turnbanner.out{opacity:0;transition:opacity .2s}
.turnbanner.still,.turnbanner.still .tbin{animation:none}
@keyframes tbpop{from{transform:translateY(-40px) scale(.7);opacity:0}to{transform:none;opacity:1}}
@keyframes tbfade{from{opacity:0}}
button.endturn.myturn{animation:etpulse 1.4s ease-in-out infinite}
@keyframes etpulse{50%{box-shadow:inset -3px -4px 0 #1f6a1f,inset 3px 3px 0 #b8ffa0,0 0 0 3px #ffd23f,0 0 14px 6px #ffd23f99}}
html.reduce-motion .turnbanner,html.reduce-motion .turnbanner .tbin,html.reduce-motion button.endturn.myturn,html.reduce-motion .toast,html.reduce-motion .toast.out{animation:none;transition:none}
/* map picker player-count badge + filter */
.mapcard{position:relative}
.mapcard[hidden]{display:none}
.pbadge{position:absolute;top:4px;left:4px;z-index:1;background:#1c1a12;color:#ffd23f;font-weight:900;font-size:12px;padding:1px 6px;border:2px solid #c08a48;text-shadow:1px 1px 0 #000}
.pfilter{display:flex;gap:6px;flex-wrap:wrap;margin:4px 0 8px}
.pfilter .pf{padding:6px 14px;min-height:36px;background:#3a2c1a;color:#f1dca6;border:3px solid #1c1a12;font-weight:bold}
.pfilter .pf.on{background:#ffd23f;color:#1c1a12}

.resbadge{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:3px;font-weight:bold;font-size:.85em;color:#fff;white-space:nowrap}.res-win{background:#2f8a3a}.res-loss{background:#a8322a}.res-neutral{background:#7a5a1c}.res-draw{background:#5a5a7a}.res-expired,.res-cancelled{background:#777}
@media (max-width:600px){.resbadge{white-space:normal}}

.seatbox{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.hpick{display:flex;align-items:center;gap:6px}.hpick select{flex:1;min-width:0}.hsw{width:16px;height:16px;flex:none;border:2px solid #000;image-rendering:pixelated}

.htrait{display:block;font-size:12px;opacity:.85;margin:2px 0 6px 0;line-height:1.3}

.udrop .btn.usave{display:block;text-align:center;font:900 13px "Courier New",monospace;color:#3a2200;padding:8px 10px;margin-bottom:2px}.udrop .btn.usave:hover{background:linear-gradient(#fff0a0,#f0b838);filter:brightness(1.05)}.udrop .btn.usave:focus-visible,.udrop button:focus-visible{outline:3px solid #fff;outline-offset:1px}.udrop .btn.usave:active{transform:translateY(2px);box-shadow:inset 2px 2px 0 #b07a10}.udrop button{width:100%}
.woodbar .btn,.woodbar button,.woodbar a.btn{text-shadow:none} /* a1v39: no doubled text on top-bar buttons */
.ogown{background:var(--gold);font-weight:bold}.ogacts{display:flex;gap:6px;align-items:center}
.invite{display:inline-flex;gap:6px;flex-wrap:wrap;align-items:center}.invite .btn,.invite button{font-size:.8em;padding:3px 8px}.ogacts{flex-wrap:wrap;justify-content:flex-end}.joinpage .btn,.joinpage button{margin-top:6px}
/* a1v42: details get the full width; own-game actions sit on their own wrapping row below */
.opengame{flex-wrap:wrap}.ogbody{flex:1 1 240px;min-width:0}
.opengame .ogacts{flex:1 1 100%;width:100%;display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-start;align-items:center}
.ogacts .invite{display:contents}.ogacts .btn,.ogacts button{margin:0;white-space:nowrap}
.list li .invite{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 2px}
.invrow .invite{display:inline-flex;flex-wrap:wrap;gap:6px;vertical-align:middle}
.bigjoin{font-size:1.25em;padding:10px 26px;margin:6px 0;background:#3fae3a;color:#fff}.invitepanel .joinalt{margin-top:6px}
.guestnudge{position:fixed;left:50%;transform:translateX(-50%);top:56px;z-index:50;max-width:min(560px,94vw);padding:10px 14px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
button.sharebtn{background:linear-gradient(#5aa8e8,#2a6aa8);color:#fff;text-shadow:1px 1px 0 #000}
.sharemenu{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:8px;padding-top:8px;border-top:1px dashed #b08a50}
@media (max-width:600px){.rcbtns>*{flex:1 1 40%}.sharemenu>*{flex:1 1 44%}}
/* Beta status: compact pixel-style badge on entry branding, never battle HUD. */
.beta-badge{display:inline-block;vertical-align:middle;margin-left:.65em;padding:3px 6px;border:2px solid #37230e;background:#f7d779;color:#37230e;box-shadow:2px 2px 0 #37230e;font:bold 12px/1.15 "Courier New",monospace;letter-spacing:1px;text-shadow:none;white-space:nowrap}
.lhtxt h1 .beta-badge,.herotxt h1 .beta-badge{font-size:14px;letter-spacing:1px}
@media(max-width:600px){.beta-badge{font-size:11px;margin-left:.45em;padding:2px 4px}.lhtxt h1 .beta-badge{font-size:12px}}

/* in-battle settings (mute, replay speed, less motion) */
.prefs{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:6px 0}
.prefs .pref{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:bold;white-space:nowrap;cursor:pointer}
.prefs .pref input{width:auto;margin:0}
.prefs.full{flex-direction:column;align-items:flex-start;gap:6px;margin:4px 0 10px}
.prefs select{font:inherit;font-size:13px}
@media (max-width:600px){.prefs{gap:8px}.prefs .pref{font-size:14px;min-height:32px}}

/* a1v51 + a1v68: Computer thinking panel. Desktop stays a single row with prefs visible.
   On compact/phone widths it collapses to a thin one-line strip: name + "is thinking…" + SKIP + gear. */
.thinking-label{display:flex;align-items:center;gap:6px;min-width:0;flex:1 1 auto}
.thinking-label .chip{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.thinking-status{min-width:0;overflow-wrap:anywhere}
.thinking-controls{display:flex;align-items:center;gap:8px;min-width:0;flex:0 1 auto}
.thinking-status.full{display:none}
.think-gear{display:none}
.endcluster{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.ready-badge{font:900 12px var(--px-font), "Courier New",monospace;background:#f1dca6;color:#3a1e08;border:3px solid #1c1a12;box-shadow:2px 3px 0 #0006;padding:3px 8px;letter-spacing:.3px;white-space:nowrap}
.ready-badge[hidden]{display:none!important}
.endconfirm .parch{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:16px 18px;text-align:left;box-sizing:border-box;min-width:min(320px,92vw)}
.endconfirm .parch p{margin:0;font:900 16px var(--px-font), "Courier New",monospace;color:#3a1e08;text-align:left;line-height:1.35}
/* a1v103: Don't ask again is a small secondary row. Reset global input/label styles
   (width:100%, padding, min-height:44px on coarse pointers) that used to draw a
   text-field-sized box stacked above the words and crowd the buttons. */
.endconfirm-dont{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:8px;margin:0;padding:0;width:fit-content;max-width:100%;font:700 13px "Trebuchet MS",Verdana,sans-serif;color:#5a3214;cursor:pointer;white-space:nowrap;line-height:1.2}
.endconfirm-dont input[type=checkbox]{box-sizing:border-box;width:16px;height:16px;min-width:16px;min-height:16px;margin:0;padding:0;flex:0 0 auto;background:#fffaf0;border:2px solid var(--wood);border-radius:2px;accent-color:var(--wood);cursor:pointer}
.endconfirm-acts{display:flex;flex-wrap:nowrap;gap:8px;justify-content:stretch;margin:0}
.endconfirm-acts button{flex:1 1 0;min-width:0}
@media (pointer:coarse){
  .endconfirm-dont{min-height:44px;font-size:14px}
  .endconfirm-dont input[type=checkbox]{width:18px;height:18px;min-width:18px;min-height:18px}
}
@media (max-width:400px){
  .endconfirm .parch{padding:14px;gap:10px;min-width:0;width:min(360px,92vw)}
  .endconfirm-dont{font-size:13px;white-space:nowrap}
}
@media (max-width:800px){
  /* Thin thinking strip sits just under the gold plaque, one line, not covering the map, toolbar, or unit card. */
  .hud.banner{top:144px;left:8px;right:8px;width:auto;max-width:none;transform:none;z-index:4;pointer-events:none}
  .hud.banner .thinking{pointer-events:auto;flex-wrap:nowrap;align-items:center;gap:6px;padding:4px 8px;max-width:100%;box-sizing:border-box;min-height:36px}
  .thinking-label{flex:1 1 auto;flex-wrap:nowrap;min-width:0;align-items:center}
  .thinking-label .chip,.thinking-status.short{display:none}
  .thinking-status.full{display:block;flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .think-skip{padding:4px 8px;font-size:13px}.skip-chevs{display:none}
  .thinking-controls{flex:0 0 auto;flex-wrap:nowrap;gap:6px;position:relative}
  .thinking-controls .prefs{display:none;position:absolute;top:calc(100% + 6px);right:0;flex-direction:column;align-items:flex-start;gap:6px;margin:0;padding:8px 10px;background:#f1dca6;border:3px solid #1c1a12;box-shadow:3px 4px 0 #0006;z-index:5;min-width:200px;white-space:normal}
  .thinking.open .prefs{display:flex}
  .think-gear{display:inline-flex;min-width:40px;padding:4px 8px}
  .thinking-controls>button.think-skip{flex:0 0 auto}
}
@media (max-width:600px){
  .hud.banner{width:auto;max-width:none}
}

/* a1v55: compact waiting-room seat editor; usable on narrow phones. */
.computer-seats{margin:10px 0;max-height:52vh;overflow:auto;overscroll-behavior:contain}
.computer-seats h4{margin:8px 0}.computer-seats p{margin:6px 0}
.computer-seat{display:flex;flex-wrap:wrap;gap:6px;align-items:center;border-top:1px solid #866b48;padding:8px 0}
.computer-seat b,.computer-seat>span{flex:1 1 100%}.computer-seat label{min-width:0;flex:1 1 120px}
.computer-seat select{max-width:100%;width:100%}.computer-seat button{white-space:normal}

/* Mixed 4P recap: preserve every House without clipping the phone viewport. */
.recap{box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100vh - 32px);overflow-y:auto}
.recap-table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}

.recap>canvas{max-width:100%;height:auto}

/* a1v56: text-style landing link; fixed waiting-panel width so Computer seats do not widen it. */
button.textlink{background:none;border:none;box-shadow:none;padding:0;margin:0;color:inherit;font:inherit;text-decoration:underline;cursor:pointer;min-height:0;display:inline;vertical-align:baseline}
.hud.bc .parch:has(.computer-seats){width:min(440px,calc(100vw - 24px));min-width:min(440px,calc(100vw - 24px));box-sizing:border-box}
.computer-seat button{min-width:11.5em}
.parch.conceded{text-align:center;min-width:min(320px,calc(100vw - 24px))}
.parch.conceded .btn{margin-top:8px}
.guest-entry{text-align:center}
.guest-entry .bigplay{margin:12px 0}


/* a1v62: map preview (lobby chooser + Open games + editor) */
.thumbwrap{position:relative;display:inline-block;flex:none;max-width:100%}
.mapcard .thumbwrap,.mymap .thumbwrap{display:inline-block;width:auto;max-width:100%}
.thumbwrap .thumb{display:block;max-width:100%}
.mpbtn{position:absolute;top:2px;right:2px;z-index:2;width:36px;height:36px;min-width:36px;min-height:36px;padding:0;display:flex;align-items:center;justify-content:center;background:#1c1a12;color:#ffd23f;border:2px solid #c08a48;box-shadow:1px 1px 0 #000;line-height:1}
.mpbtn::before{content:'';position:absolute;inset:-4px}
.mpbtn:hover,.mpbtn:focus-visible{filter:brightness(1.15);outline:2px solid #ffd23f;outline-offset:1px}
.mpicon{width:16px;height:16px;position:relative;display:block;pointer-events:none}
.mpicon::before{content:'';position:absolute;left:1px;top:1px;width:9px;height:9px;border:2px solid #ffd23f;border-radius:50%;box-sizing:border-box}
.mpicon::after{content:'';position:absolute;left:9px;top:9px;width:6px;height:2px;background:#ffd23f;transform:rotate(45deg);transform-origin:left center}
.mapcard{cursor:pointer}
.mapcard:focus-visible{outline:3px solid #ffd23f;outline-offset:1px}
.mymap{position:relative}
.mpov{position:fixed;inset:0;background:#000a;z-index:55;display:flex;align-items:center;justify-content:center;padding:12px}
.mpbox{width:min(1100px,100%);height:min(92vh,100%);display:flex;flex-direction:column;padding:10px;min-height:0;box-sizing:border-box}
.mphead{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;flex:0 0 auto;min-width:0}
.mpheadtxt{min-width:0;flex:1}
.mpbox h2{margin:0 0 2px;font:900 22px var(--px-font);line-height:1.2;overflow-wrap:anywhere}
.mpmeta,.mpkey{margin:0;font:13px/1.35 sans-serif;color:#5a3214}
.mpkey{font-weight:bold;margin-top:2px}
.mpzoom{display:flex;gap:6px;flex:none}
.mpzoom button{min-width:44px;min-height:44px;padding:0 10px}.mpzoom button.mpfit{min-width:52px;text-transform:none}
.mpview{flex:1 1 auto;min-height:0;position:relative;overflow:hidden;touch-action:none;background:#f1dca6 url(sprites/ui_parchment.png);background-size:128px;border:3px solid #1c1a12;cursor:grab;margin:8px 0}
.mpcv{width:100%;height:100%;display:block;image-rendering:pixelated}
.mpstatus{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#ffeec0;font:bold 16px var(--px-font);text-shadow:2px 2px 0 #1c1a12;padding:12px;text-align:center}
.mpfoot{flex:0 0 auto;display:flex;justify-content:flex-end}
.mpacts{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;width:100%}
.mpacts button{min-height:44px;padding:8px 16px}
button.mpchoose,button.mpjoin{background:linear-gradient(#5ad04a,#2a8a2a);color:#fff;text-shadow:1px 1px 0 #000}
@media (max-width:700px){
  .mpov{padding:0;align-items:stretch}
  .mpbox{width:100%;height:100%;max-height:100dvh;height:100dvh;border-width:2px;padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px))}
  .mphead{flex-wrap:wrap}
  .mpbox h2{font-size:18px}
  .mpzoom{margin-left:auto}
  .mpview{margin:6px 0}
  .mpacts{justify-content:stretch}
  .mpacts button{flex:1 1 40%}
}

/* a1v65: Your battles Live / Past tabs */
.lobby .panel{min-width:0}
/* a1v69: Open Battles is its own section above Your battles, outside the Live/Past tabs */
.lobby-side{display:flex;flex-direction:column;gap:18px;min-width:0}
.lobby-side .panel{min-width:0}
@media (max-width:400px){
  .panel.openbattles .ogline{overflow-wrap:anywhere}
}
.btabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.btab{padding:6px 14px;min-height:36px;background:#3a2c1a;color:#f1dca6;border:3px solid #1c1a12;font-weight:bold;font-family:var(--px-font);cursor:pointer}
.btab[aria-selected=true],.btab.on{background:#ffd23f;color:#1c1a12}
.btabpanel{min-width:0}
.btabpanel .list{overflow-wrap:anywhere;word-break:break-word}
h3.lastbattle{font-size:1rem;margin:14px 0 6px;color:#3a1e08}
@media (max-width:400px){
  .btab{flex:1 1 auto;padding:6px 10px;text-align:center}
  .lobby .list li{overflow-wrap:anywhere}
}

/* a1v66: Join Discord in the top nav (same look as the landing button, scaled; stays visible in Kong, discord.gg only) */
a.soc.navdisc{padding:4px 10px;font:bold 12px var(--px-font);gap:4px;margin:0;box-shadow:2px 2px 0 #000;flex:0 0 auto;white-space:nowrap;align-self:center;line-height:1.2}
a.soc.navdisc .navdisc-ico{font-size:14px;line-height:1}
@media (max-width:900px){
  a.soc.navdisc{padding:5px 8px;min-width:36px;min-height:36px;justify-content:center}
  a.soc.navdisc .navdisc-label{display:none}
}

/* a1v67: admin All battles table */
.admin-games .admin-filters{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;margin:0 0 10px}
.admin-games .admin-filters label{display:flex;gap:6px;align-items:center;margin:0}
.admin-games .admin-filters input[type=search]{min-width:12em;max-width:100%}
.admin-games .admin-pager{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 8px}
.admin-table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.admin-games table{min-width:860px;background:#fff8e6}
.admin-games th.sortable{cursor:pointer;white-space:nowrap;user-select:none}
.admin-games th.sortable:hover,.admin-games th.sortable:focus-visible{background:#ffe27a;outline:2px solid #c8352a;outline-offset:-2px}
.admin-games th[aria-sort=ascending]::after{content:' ▲'}
.admin-games th[aria-sort=descending]::after{content:' ▼'}
.admin-games td{vertical-align:top;overflow-wrap:anywhere}
.admin-games .col-turn{white-space:nowrap;min-width:5.5em}
.admin-games tbody td:nth-child(4){overflow-wrap:normal} /* Mode: keep "Vs Computer" on word bounds */
.admin-swipe{display:none}
@media (max-width:700px){
  .admin-games .admin-filters input[type=search]{min-width:0;flex:1 1 12em}
  .admin-swipe{display:block;margin:0 0 8px}
}

/* a1v80 review fixes: A1 parchment, compact scrollable recruit sheet, honest undo state. */
.recruit-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font:700 11px var(--px-font),monospace;flex:0 0 auto}
.recruit-sheet-head button{display:block;flex:0 0 auto;margin-left:auto;padding:2px 8px;font-size:18px;line-height:1;min-height:28px}
.recruit-scroll-cue{display:none;position:sticky;bottom:-12px;text-align:center;font:700 11px var(--px-font),monospace;padding:8px 4px 4px;background:linear-gradient(#e8d29a00,#e8d29a 35%);color:#5a3214;pointer-events:none;flex:0 0 auto}
.recruit.more-below .recruit-scroll-cue{display:block}.recruit{scrollbar-width:thin;scrollbar-color:#8a5a30 #e8d29a;overscroll-behavior:contain}
.undo.locked{opacity:.55}.tbdanger{color:#a91515;font-weight:900;max-width:400px;margin:8px auto 2px;line-height:1.35}
.pvfoot{position:relative}.pvmath{display:inline-block;vertical-align:middle;text-align:left}.pvmath summary{display:inline-block;list-style:none;cursor:pointer;border:1px solid #5a3214;border-radius:50%;width:18px;height:18px;line-height:16px;text-align:center;font-weight:900}.pvmath summary::-webkit-details-marker{display:none}.pvmath>div{position:absolute;right:0;bottom:24px;padding:8px;background:#f1dca6;border:2px solid #5a3214;max-width:min(440px,85vw);z-index:3;white-space:normal;box-shadow:2px 3px #0006}
@media(max-width:800px){
 .board:has(.hud.right:not(:empty)) .hud.bl:has(.base-card.on-turn){display:none}
 .hud.right:not(:empty),.hud.bl:not(:empty)~.hud.right:not(:empty){left:8px;right:8px;top:auto;bottom:76px;max-height:calc(100dvh - 230px);overflow:visible;z-index:6}
 .hud.right .recruit{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;width:auto;max-height:calc(100dvh - 230px);overflow-y:auto;padding:8px;box-sizing:border-box}
 .recruit-sheet-head,.recruit>canvas,.recruit-meta,.recruit-note,.recruit-scroll-cue,.recruit .roster-note{grid-column:1/-1}.recruit>canvas{justify-self:center;margin:0}.recruit-meta{margin:0;font-size:10px;line-height:1.2}
 .recruit .rtile{display:grid;grid-template-columns:36px minmax(0,1fr);grid-template-rows:auto auto;gap:0 4px;min-width:0;min-height:56px;padding:4px;font-size:10px;touch-action:pan-y}
 .recruit .rtile>canvas{width:36px!important;height:36px!important;grid-column:1;grid-row:1/3;object-fit:contain}.recruit .rtile .rn{font-size:10px;line-height:1.15;white-space:normal;min-width:0}.recruit .rtile .rc{grid-column:2;gap:2px;zoom:.8}
 .recruit-scroll-cue{bottom:-8px;padding-top:10px;margin-top:-10px}.hud.tut.low{max-width:min(460px,92vw)}
}
@media(max-width:360px){.woodbar{gap:4px}.umenu{min-width:0;max-width:100%}.ubtn{min-width:0;max-width:100%;box-sizing:border-box}.ubtn .uname{max-width:66px}.recruit .rtile{min-height:54px}.recruit-sheet-head{font-size:10px}
 .topbar.woodbar{padding:6px 6px;column-gap:4px;row-gap:2px}.topbar .bar-left,.topbar .bar-right{gap:4px}.topbar .nav-online{font-size:10px}.woodbar .logo{font-size:16px;letter-spacing:1px}.topbar .navlinks{gap:4px 8px}.topbar .navlinks a{font-size:13px;padding:6px 1px}}
@media(max-width:420px){.tutbox{font-size:12px;padding:7px 9px;line-height:1.3}.hud.tut{max-width:min(250px,80vw)}.tutbox button{margin-top:4px}}
.pvmath>div{position:static;display:block;margin-top:4px;max-width:none;box-shadow:none;font-size:11px}

/* a1v82: Undo, Next unit and the ready count sit in the gold/turn plaque (top left), on your turn only */
.hud.tl .gold-row{align-items:center;min-width:0}
.hud.tl .gold-block{display:flex;flex-direction:column;justify-content:center;min-width:0;flex:1 1 auto}
.hud.tl .gold-whose{font:900 10px var(--px-font), "Courier New", monospace;color:#5a3214;line-height:1.1;letter-spacing:.02em;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:400px){
  .hud.tl .gold-whose{font-size:9px}
  .hud.tl .row.gold-row{flex-wrap:wrap;gap:2px 6px}
  .hud.tl .row.gold-row .inc{overflow:visible;text-overflow:clip;flex:0 0 auto}
}
.hud.tl .pacts{gap:6px;margin-top:3px;flex-wrap:nowrap;align-items:center}
.hud.tl .pact{display:inline-flex;align-items:center;gap:5px;min-height:30px;padding:3px 9px;font-size:13px;line-height:1;text-transform:none;white-space:nowrap}
.hud.tl .pact .pact-ico{font-size:16px;line-height:1}
.hud.tl .pact.locked{opacity:.5;cursor:default}
.hud.tl .pacts .ready-badge{box-shadow:none;border-width:2px;padding:3px 7px;font-size:12px;background:#ffeec0}
.hud.tl .pacts .ready-badge b{color:#2a7a1e}
@media (pointer:coarse){.hud.tl .pact{min-height:40px;min-width:40px}}
/* a1v82: signed-in name + account menu at the battle's top right (same component as the top bar) */
.hud.tr .trrow{display:flex;align-items:flex-start;gap:10px}
.hud.acct{position:static;pointer-events:auto}
.hud.acct .ubtn{min-height:38px;font-size:13px;padding:5px 9px;box-shadow:2px 3px 0 #0006}
.hud.acct .udrop{z-index:40}
@media (max-width:800px){
  .hud.tr .trrow{display:block;width:100%}
  .hud.acct{position:absolute;top:56px;right:0;max-width:28vw}
  .hud.acct .umenu{justify-content:flex-end}
  .hud.acct .ubtn{min-height:36px;max-width:28vw;padding:4px 6px;font-size:12px;gap:2px}
  .hud.acct .ubtn .uname{max-width:calc(28vw - 30px)}
  .hud.acct .gtag,.hud.acct .urate{display:none}
  .hud.tl{max-width:calc(100% - 28vw - 14px);box-sizing:border-box}
  .hud.tl .row{flex-wrap:nowrap;min-width:0}
  .hud.tl .row .inc{white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}
  .turn-who{min-width:0}.turn-who .chip{max-width:26vw}
  .hud.tl .pacts{gap:4px}
  .hud.tl .pact{flex:0 0 auto;padding:3px 7px;font-size:12px;min-width:40px;justify-content:center}
  .hud.tl .pact .pl-long,.hud.tl .pacts .ready-badge .rb-long{display:none}
  .hud.tl .pacts .ready-badge{flex:0 1 auto;min-width:0;padding:2px 5px;font-size:11px;overflow:hidden;text-overflow:ellipsis}
  .hud.bl:not(:empty)~.hud.right:not(:empty){top:calc(var(--tl-bottom, 118px) + 6px)}
  .hud.banner{top:calc(var(--tl-bottom, 138px) + 6px)}
}
@media (max-width:400px){
  .hud.tl canvas{zoom:.55}
  .hud.tl .inc-u{display:none}
  .hud.tl .row .inc{font-size:11px}
  .hud.tl .pact .pact-lbl{display:none}
  .hud.tl .pact{padding:3px 0;min-width:40px}
}
.base-card .blist .bline.off{opacity:.5}.base-card .blist .bline.off .bn{text-decoration:line-through}.base-card .roster-note{margin-top:2px;font-size:12px;line-height:1.3}

/* a1v83: Battle Log window (desktop: centred modal; phones: bottom sheet) and the Settings panel */
.bl-wrap{position:fixed;inset:0;z-index:40;background:rgba(10,6,2,.45);display:flex;align-items:center;justify-content:center}
.bl-box{width:min(620px,92vw);max-height:min(80vh,760px);display:flex;flex-direction:column;padding:12px 14px;box-sizing:border-box}
.bl-head{display:flex;align-items:center;gap:10px}
.bl-head h3{margin:0;flex:1 1 auto;font-size:18px}
.bl-filter{font-size:13px;display:flex;align-items:center;gap:4px}
.bl-filter select{font-size:13px;max-width:44vw}
.bl-x{min-width:36px;min-height:36px;padding:2px 8px}
.bl-houses{display:flex;flex-direction:column;gap:4px;font-size:12px;margin:6px 0 8px}
.bl-house{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 6px;line-height:1.4;min-width:0;max-width:100%;box-sizing:border-box}
.bl-house .chip{flex:0 1 auto;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bl-house-stats{flex:1 1 12em;min-width:0;overflow-wrap:break-word}
.bl-list{flex:1 1 auto;overflow:auto;min-height:120px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#8a5a30 #e8d29a;font-size:13px;line-height:1.35}
.bl-round{margin-bottom:8px}
.bl-turn{position:sticky;top:0;background:#e9c88a;font-weight:700;padding:2px 4px;border-bottom:1px solid #8a5a30;z-index:1}
.bl-seat{margin:4px 0 6px 4px}
.bl-who{font-size:12px;margin-bottom:2px}
.bl-seat ul,.bl-legacy ul{margin:0;padding-left:18px}
.bl-e{margin:1px 0}
.bl-note{font-style:italic;color:#5a3a1a}
.bl-cap{color:#3b4f1a}
.bl-end{color:#6b5130}
.parch.settings .set-map{margin-bottom:6px;padding-bottom:4px;border-bottom:1px solid #b88c55}
@media (max-width:600px){
  .bl-wrap{align-items:flex-end}
  .bl-box{width:100vw;max-width:100vw;max-height:72vh;border-radius:12px 12px 0 0;padding:10px 10px calc(10px + env(safe-area-inset-bottom))}
  .bl-head h3{font-size:16px}
  .bl-x{min-width:44px;min-height:44px}
  .bl-houses{font-size:11px;gap:6px}
  .bl-house{width:100%}
}

/* a1v107: per-battle Chat sheet (same parchment + bottom-sheet pattern as the Battle Log) */
.hud.tr .btns .chat-btn{position:relative}
.chat-ic{display:block;width:14px;height:11px;margin:0 auto;border:2px solid currentColor;border-radius:3px;box-sizing:border-box;position:relative}
.chat-ic::after{content:'';position:absolute;left:2px;bottom:-5px;border:4px solid transparent;border-top-color:currentColor;border-left-color:currentColor}
.chat-dot{position:absolute;top:3px;right:3px;width:8px;height:8px;background:#c43c28;border:1px solid #f8ecc4;border-radius:50%;box-shadow:0 0 0 1px #1c1a12;pointer-events:none}
.ch-wrap{position:fixed;inset:0;z-index:41;background:rgba(10,6,2,.45);display:flex;align-items:center;justify-content:center}
.ch-box{width:min(480px,92vw);max-height:min(80vh,760px);display:flex;flex-direction:column;padding:12px 14px;box-sizing:border-box}
.ch-head{display:flex;align-items:center;gap:10px}
.ch-head h3{margin:0;flex:1 1 auto;font-size:18px}
.ch-list{flex:1 1 auto;overflow:auto;min-height:120px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#8a5a30 #e8d29a;font-size:13px;line-height:1.35}
.ch-msg{margin:0 0 8px;padding:0 0 8px;border-bottom:1px solid #d4b47a}
.ch-msg:last-child{border-bottom:0;margin-bottom:0}
.ch-msg-meta{display:flex;align-items:baseline;gap:6px;font-size:12px;min-width:0}
.ch-msg-meta .chip{flex:0 1 auto;max-width:46%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch-msg-time{margin-left:auto;color:#6b5130;font-size:11px;flex:none;white-space:nowrap}
.ch-msg-body{margin:3px 0 0;overflow-wrap:anywhere}
.ch-msg-acts{display:flex;flex-wrap:wrap;gap:8px;font-size:11px;margin-top:4px}
.ch-msg-acts button{background:none;border:0;padding:0;color:#6b3a12;text-decoration:underline;cursor:pointer;font:inherit}
.ch-muted{margin:6px 0 0;font-size:12px}
.ch-muted-row{display:flex;align-items:center;gap:8px;margin:2px 0}
.ch-phrases{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 6px}
.ch-phrases button{font-size:12px;padding:4px 8px;line-height:1.2}
.ch-compose{display:flex;gap:6px;align-items:flex-end}
.ch-compose textarea{flex:1;min-width:0;min-height:44px;max-height:120px;resize:vertical;font:inherit;box-sizing:border-box}
.ch-compose .ch-send{flex:none}
.ch-note{font-size:12px;font-style:italic;margin:6px 0 0;color:#5a3a1a}
.ch-empty{margin:8px 0;font-style:italic}
@media (max-width:600px){
  .ch-wrap{align-items:flex-end}
  .ch-box{width:100vw;max-width:100vw;max-height:78vh;border-radius:12px 12px 0 0;padding:10px 10px calc(10px + env(safe-area-inset-bottom))}
  .ch-head h3{font-size:16px}
  .ch-phrases button{min-height:44px}
}
@media (pointer:coarse){
  .ch-msg-acts button{min-height:32px;padding:4px 2px}
}

/* a1v84: spectators (no seat, or the battle is over) never see battle controls */
.gamescreen.spectating .endcluster,.gamescreen.spectating button.endturn,.gamescreen.spectating .pacts,.gamescreen.spectating .ready-badge,.gamescreen.spectating .surr{display:none!important}
.hud.tl .spect-note{font-style:italic}

/* a1v84: guest account call-to-action (once, after a guest's first finished battle) */
.guestcta{position:fixed;inset:0;z-index:1200;background:rgba(10,8,20,.62);display:flex;align-items:center;justify-content:center;padding:12px;box-sizing:border-box}
.guestcta-card{position:relative;max-width:520px;width:100%;max-height:calc(100vh - 24px);overflow:auto;box-sizing:border-box;padding:18px 18px 16px;border:3px solid #2a1c10;box-shadow:0 0 0 3px #c9a24a,6px 6px 0 rgba(0,0,0,.55);image-rendering:pixelated}
.guestcta-card h2{margin:0 34px 8px 0;font-size:20px;line-height:1.2}
.guestcta-card .gcta-lead{margin:0 0 10px}
.gcta-list{list-style:none;margin:0 0 14px;padding:0;display:grid;gap:8px}
.gcta-list li{display:flex;gap:8px;align-items:flex-start;line-height:1.35;font-size:14px}
.gcta-ic{flex:0 0 22px;text-align:center}
.gcta-btns{display:flex;gap:10px;flex-wrap:wrap}
.gcta-btns .gcta-go{flex:1 1 auto;text-align:center;font-weight:bold}
.gcta-btns .gcta-later{flex:0 1 auto}
.gcta-x{position:absolute;top:8px;right:8px;width:32px;height:32px;padding:0;font-size:20px;line-height:1}
@media (max-width:420px){.guestcta-card{padding:14px 12px 12px}.guestcta-card h2{font-size:17px}.gcta-list li{font-size:13px}.gcta-btns{flex-direction:column}.gcta-btns>*{width:100%;box-sizing:border-box}}

/* a1v85: touch tap selects, press-and-hold opens the card — no iOS callout/selection on the board; compact unit actions in the plaque */
.board canvas{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.hud.tl .uacts{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.hud.tl .uacts button{min-height:32px;padding:4px 10px;font-size:13px;line-height:1}
.hud.tl .uacts .uact-info{min-width:32px;padding:4px 8px;font-size:16px}

/* a1v85: short frames (Kong iframe in landscape, or a scaled 1.6:1 frame such as 800x500 / 640x400 / 390x244):
   keep the hero compact so Play now and How to play stay above the fold. Width rules are unchanged. */
@media (max-height:560px){
  .landing section.lhero{margin-top:6px!important;gap:12px}
  .lhero h1{font-size:34px}
  .lvp{font-size:16px;margin:2px 0}
  .lsub{display:none}
  .landing .bigplay{font-size:17px;padding:9px 18px;margin:4px 0 2px}
  .lsec{margin-top:4px}
  .landing .heroboard{max-height:calc(100vh - 120px)}
}
@media (max-height:560px) and (max-width:700px){.landing .heroboard{display:none}}
@media (max-height:300px){
  .woodbar{padding-top:3px;padding-bottom:3px}
  .lhero h1{font-size:26px}
  .lhtxt h1 .beta-badge{font-size:10px}
  .lvp{font-size:14px}
  .landing .bigplay{font-size:15px;padding:7px 14px}
}

/* a1v85: Kong-size frames. Between the compact phone HUD (≤800px) and ~1100px the gold/turn plaque (with Undo / Next unit /
   ready count) and the toolbar + account menu no longer fit on one line, so the plaque sat under the toolbar buttons.
   Here the account menu stacks under the toolbar and the plaque starts below the toolbar row. Every toolbar button stays on screen. */
.hud.acct .umenu:not(:has(.ubtn)){flex-direction:column;align-items:flex-end;gap:4px}
.hud.acct .umenu:not(:has(.ubtn))>*{font-size:12px;padding:4px 8px;min-height:32px;white-space:nowrap}
@media (min-width:801px) and (max-width:1100px){
  .hud.tl{top:66px}
  .hud.tr .trrow{flex-direction:column;align-items:flex-end;gap:6px}
}
@media (max-width:800px){
  .hud.acct .umenu:not(:has(.ubtn))>button{display:none} /* Kong 'Sign in on Kongregate' stays on the lobby and Account page; the name link still opens Account */
}
/* short frames: panels never run off the top; the plaque gets slimmer */
@media (max-height:560px){
  .hud.br .parch.log,.parch.log.settings{max-height:calc(100vh - 136px);max-height:calc(100dvh - 136px)}
}
@media (max-width:800px) and (max-height:300px){
  .hud.tl{top:56px;padding:3px 8px;gap:0}
  .hud.tl .turn-elapsed{display:none}
  .hud.tl .pacts{margin-top:1px}
  .hud.tl .pact{min-height:30px}
  .hud.tr button.endturn{padding:4px 10px}
}
/* a1v88 lobby / Battles page, ordered by next action. One primary colour: only Quick Battle and Continue are green; every other lobby button is the plain parchment style. */
.lobby2{max-width:980px;margin:0 auto;display:flex;flex-direction:column;gap:12px}
.lobby2 [hidden]{display:none!important}
.lobby2 .panel{margin:0}
.lobby2 button:not(.lprimary):not(.textlink):not(.htile):not(.mpbtn):not(.danger),.lobby2 a.btn:not(.lprimary){background:linear-gradient(#e8d8b0,#c4a870);box-shadow:inset -2px -3px 0 #9a7a40,inset 2px 2px 0 #fff,2px 3px 0 #0007;color:#3a2200}
.lobby2 .lprimary,.lobby2 button.lprimary{background:linear-gradient(#5ad04a,#2a8a2a);color:#fff;text-shadow:2px 2px 0 #000;border:3px solid #1c1a12}
.lobby2 h2{margin:0 0 8px}.lobby2 .cnt{font-size:14px;opacity:.8;font-weight:normal}
.yourturnsec .turncards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:10px}
.turncard{display:flex;align-items:center;gap:10px;padding:10px;background:#fff6dc;border:3px solid #3a2200;box-shadow:3px 4px 0 #0006;color:#3a2200;text-decoration:none;min-height:96px}
.turncard:hover{filter:brightness(1.04)}.turncard:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.turncard .tcthumb{flex:none;width:96px;display:flex;justify-content:center}.turncard .tcthumb canvas{max-width:96px;height:auto}
.turncard .tcbody{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.turncard .tcname{font-size:15px;overflow-wrap:anywhere}.turncard .tcvs{font-size:14px;overflow-wrap:anywhere}.turncard .tcmeta{font-size:12px;opacity:.8}
.turncard .tcgo{flex:none;font-size:15px;padding:10px 14px;white-space:nowrap}
/* a1v93 (t264u): green Quick Battle + caption centered as one stack; How to play is absolutely in the block's top-right. */
.quicksec{text-align:center;position:relative}
.quicksec .rulesbtn{position:absolute;top:0;right:0;z-index:1}
.quicksec .qstack{display:inline-flex;flex-direction:column;align-items:center;max-width:100%}
.quicksec .qbtn{font-size:22px;padding:14px 30px;margin:4px 0}
.quicksec .qsub{margin:6px 0 0;white-space:nowrap;font-size:12px}
.quicksec .qhello{margin:8px 0 0;font-weight:bold;text-align:center}
.lobby2 details>summary{cursor:pointer;list-style:none;display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.lobby2 details>summary::-webkit-details-marker{display:none}
.lobby2 details>summary h2{margin:0;display:inline}
.lobby2 details>summary::before{content:'▸';font-weight:bold;width:14px;display:inline-block}.lobby2 details[open]>summary::before{content:'▾'}
.lobby2 details[open]>summary{margin-bottom:10px}
.lobby2 .oempty p{margin:0}.lobby2 .ohost{margin:8px 0 0}
.lobby2 .otherbattles h3{margin:8px 0 4px;font-size:14px}
.lobby2 .hlabel{margin-top:10px}
.lobby2 .seatbox{grid-template-columns:1fr}
.seat0 .hsel0{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;opacity:0;pointer-events:none}
.htiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:6px;margin:4px 0 8px}
.htile{display:flex;align-items:flex-start;gap:8px;text-align:left;text-transform:none;font:inherit;font-size:13px;padding:7px 8px;background:#fff6dc;color:#3a2200;border:2px solid #7a5a30;box-shadow:2px 2px 0 #0005;letter-spacing:0;min-height:44px}
.htile .hsw{margin-top:2px}.htile .htxt{display:flex;flex-direction:column;gap:2px;min-width:0}.htile b{font-size:13px}.htile .hbonus{font-size:12px;line-height:1.3;opacity:.9}
.htile[aria-checked=true]{background:#ffe9a8;border-color:#3a2200;outline:3px solid #2a8a2a;outline-offset:-1px}
@media (max-width:600px){.yourturnsec .turncards{grid-template-columns:1fr}.turncard{flex-wrap:wrap}.turncard .tcthumb{width:72px}.turncard .tcthumb canvas{max-width:72px}.turncard .tcgo{width:100%;text-align:center}
  .quicksec{padding-top:48px}.quicksec .qbtn{font-size:20px}.quicksec .rulesbtn{font-size:11px;padding:4px 8px;letter-spacing:0;min-height:0}.htiles{grid-template-columns:1fr}}
.turncard{flex-wrap:wrap;align-content:flex-start}.turncard .tcgo{width:100%;text-align:center;box-sizing:border-box}
.lobby2 .textlink{text-transform:none;letter-spacing:0}
.lobby2 .guestnote{background:var(--parch);border:3px solid var(--wood-d);padding:8px 12px;margin:0;color:var(--ink);opacity:1}
/* a1v88: the signed-in name button keeps room for the name on phones (the 58% cap is for the two-button guest/sign-in menu; the dropdown counted as a second child and cut "Tim" to "T…") */
@media (max-width:700px){.umenu:has(>:nth-child(2))>button.ubtn{max-width:150px;white-space:nowrap}}
@media (max-width:360px){.umenu:has(>:nth-child(2))>button.ubtn{max-width:100%}}
/* a1v89: one accordion header style for Create Battle, Open Battles and Your Battles — big arrow that turns when open, pointer + hover, ' · ' summary that wraps cleanly */
.lobby2 details>summary.acchead{display:flex;align-items:center;gap:4px 8px;flex-wrap:wrap;margin:-6px;padding:6px;border-radius:4px;user-select:none}
.lobby2 details>summary.acchead::before{content:none}
.lobby2 details>summary.acchead:hover{background:#0000000f}.lobby2 details>summary.acchead:hover .accarrow{background:#ffe9a8}
.lobby2 details>summary.acchead:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.lobby2 .accarrow{flex:none;width:26px;height:26px;box-sizing:border-box;border:2px solid #3a2200;background:#fff6dc;box-shadow:2px 2px 0 #0005;display:inline-flex;align-items:center;justify-content:center;transition:transform .15s}
.lobby2 .accarrow::before{content:'';border-style:solid;border-width:7px 0 7px 11px;border-color:transparent transparent transparent #3a2200;margin-left:3px}
.lobby2 details[open]>summary.acchead .accarrow{transform:rotate(90deg)}
.lobby2 .acchead h2{margin:0;font-size:1.5em;line-height:1.2}
.lobby2 .accsum{font-size:14px;color:#5a4020;flex:1 1 auto;min-width:0}
.lobby2 .accsum .textlink{font-size:14px;padding:0;min-height:0}
.lobby2 details.oempty:not([open])>summary.acchead{margin-bottom:-6px}
.lobby2 details[open]>summary.acchead{margin-bottom:8px}
@media (prefers-reduced-motion:reduce){.lobby2 .accarrow{transition:none}}
@media (max-width:600px){.lobby2 .accsum{flex-basis:100%;padding-left:34px}.lobby2 .accsep{display:none}.lobby2 .acchead h2{font-size:1.3em}}
/* a1v89 (t243u): House picker when joining an open seat */
.overlay.housepick{z-index:20;padding:8px;overflow:auto;align-items:flex-start}
.overlay.housepick .parch{max-width:min(720px,96vw);width:100%;text-align:left;margin:auto 0;box-sizing:border-box}
.overlay.housepick .htiles{max-height:58vh;overflow:auto;padding:2px}
.htile:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(.7)}
.overlay.housepick .hpacts{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}.overlay.housepick .hpgo{background:linear-gradient(#5ad04a,#2a8a2a);color:#fff;text-shadow:2px 2px 0 #000;border:3px solid #1c1a12;font-size:18px;padding:10px 18px}
@media (max-width:600px){.overlay.housepick .htiles{grid-template-columns:1fr}.overlay.housepick .hpacts>*{width:100%}}
.seatbox .joinnote{margin:4px 0 0}
.lobby2 .seatbox select,.lobby2 .hpick{max-width:100%;min-width:0}.lobby2 .hpick select{flex:1 1 auto;width:0}
/* a1v91: chips on light House colours (gold, ivory, sky) use dark text */
.chip.chiplight{text-shadow:1px 1px 0 #fff8}
/* a1v91: small Remove beside a joined player (host, waiting screen) */
.computer-seat button.kickbtn{font-size:11px!important;padding:3px 10px!important;min-width:0!important;min-height:0;width:auto;flex:0 0 auto;margin-left:auto}
/* a1v92: live Battles page — section slots and a short highlight on what just changed */
.lobby2 .lslot{display:contents}
.lobby2 .lflash{animation:lflash 1.6s ease-out 2}
@keyframes lflash{0%{box-shadow:0 0 0 4px #ffd23f,3px 4px 0 #0006}100%{box-shadow:0 0 0 0 #ffd23f00,3px 4px 0 #0006}}
@media (prefers-reduced-motion:reduce){.lobby2 .lflash{animation:none;outline:3px solid #ffd23f}}

/* a1v96 (t274u): sortable, paged League Ladder; compact enough for a 390-wide phone */
.ladder-hint{margin:0 0 8px}
.ladder-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
table.ladder{width:100%;table-layout:fixed;border-collapse:collapse}
table.ladder th,table.ladder td{padding:4px 6px;text-align:left;font-size:13px;vertical-align:middle}
table.ladder th{padding:0;font-weight:bold}
table.ladder th .thsort{all:unset;box-sizing:border-box;display:block;width:100%;padding:8px 6px;cursor:pointer;font:inherit;font-weight:bold;text-align:left;white-space:nowrap;color:inherit}
table.ladder th .thsort:hover,table.ladder th .thsort:focus-visible{background:#ffe27a;outline:2px solid var(--wood-d);outline-offset:-2px}
table.ladder th.sorted{background:#e8c878}
table.ladder th .sortind{font-size:.85em}
table.ladder col.lnum,table.ladder th:nth-child(1),table.ladder td.lnum{width:2.6em}
table.ladder th:nth-child(3),table.ladder td.lrat{width:4.4em}
table.ladder th:nth-child(4),table.ladder td.lwl{width:4.2em}
table.ladder td.lnum,table.ladder td.lrat,table.ladder td.lwl{white-space:nowrap;font-variant-numeric:tabular-nums}
table.ladder td.lname{overflow-wrap:anywhere;word-break:break-word}
@media (max-width:430px){
  table.ladder th,table.ladder td{font-size:12px}
  table.ladder th .thsort{padding:8px 4px}
  table.ladder td{padding:4px 4px}
  table.ladder th:nth-child(3),table.ladder td.lrat{width:3.8em}
  table.ladder th:nth-child(4),table.ladder td.lwl{width:3.6em}
}

.ladder-pager{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:center;margin:0 0 8px}
.ladder-pager .sec{padding:6px 12px;min-width:0}
.ladder-pageind{font-weight:bold;white-space:nowrap}
.ladder-range{white-space:nowrap}
@media (max-width:430px){
  .ladder-pager{gap:6px 8px;margin:0 0 6px}
  .ladder-pager .sec{padding:8px 10px;font-size:12px}
}

/* a1v96 (t275u): Rated checkbox by the mode; compact Rated/Unrated tags on Open Battles and Your Battles */
.ratedrow{margin:8px 0 4px}
.ratedlab{display:flex;align-items:flex-start;gap:6px;font-weight:bold;cursor:pointer}
.ratedlab input{margin-top:2px;flex:none}
.rated-hint{display:block;margin:2px 0 0 22px;font-size:12px;line-height:1.3}
.ratedrow.rated-off .ratedlab{font-weight:normal;opacity:.85}
.ogtag.ograted,.ratetag.rated{background:var(--gold)}
.ogtag.ogunrated,.ratetag.unrated{background:#d4bc84;color:#3a1e08}
.ratetag{display:inline-block;font-size:.75em;font-weight:bold;padding:0 4px;white-space:nowrap;vertical-align:middle;border:1px solid #8a6a30}
@media (max-width:430px){
  .rated-hint{margin-left:0}
  .ogtag,.ratetag{font-size:.7em}
}

/* a1v97: turn pings (tab badge lives on the favicon; these style the prompt, Settings, Nudge, and lobby highlight) */
.pushask{position:fixed;z-index:80;left:50%;bottom:16px;transform:translateX(-50%);max-width:min(420px,calc(100vw - 24px));padding:12px 14px;box-shadow:3px 3px 0 #1a0c04}
.pushask .pushask-acts{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}
.pushask .pushask-acts .btn,.pushask .pushask-acts button{margin:0}
.prefs .pref-push,.prefs .pref-turn,.turn-notify-prefs .pref{white-space:normal;max-width:36em}
.turn-notify-prefs{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin:8px 0}
.turn-notify-prefs label.pref{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:8px;font-weight:bold;cursor:pointer;white-space:normal;max-width:36em}
.turn-notify-prefs label.pref input[type=checkbox]{width:auto;margin:0;flex:0 0 auto}
.turn-notify-prefs label.pref span{flex:1 1 auto;min-width:0}
.nudge-btn{margin-left:6px;vertical-align:middle}
li.row-nudged,a.turncard.row-nudged{outline:2px solid var(--gold);background:#fff3c4}
.nudge-tag{display:inline-block;font-size:.75em;font-weight:bold;padding:0 5px;margin-left:4px;background:var(--gold);border:1px solid #8a6a30;white-space:nowrap;vertical-align:middle}
.inc .nudge-btn{margin-left:8px}
@media (max-width:430px){
  .pushask{left:8px;right:8px;transform:none;max-width:none;bottom:8px}
  .nudge-tag{font-size:.7em}
}


/* a1v101: obvious overflow on scrollable parchment panels — fade + pill, thicker house-style scrollbar. */
.parch.log,.parch-scroll,.bl-list,.recruit,.base-card .blist{
  scrollbar-width:auto;
  scrollbar-color:#6b4423 #e8d29a;
}
.parch.log::-webkit-scrollbar,
.parch-scroll::-webkit-scrollbar,
.bl-list::-webkit-scrollbar,
.recruit::-webkit-scrollbar,
.base-card .blist::-webkit-scrollbar{width:14px;height:14px}
.parch.log::-webkit-scrollbar-track,
.parch-scroll::-webkit-scrollbar-track,
.bl-list::-webkit-scrollbar-track,
.recruit::-webkit-scrollbar-track,
.base-card .blist::-webkit-scrollbar-track{background:#e8d29a;border-left:1px solid #c9a85a}
.parch.log::-webkit-scrollbar-thumb,
.parch-scroll::-webkit-scrollbar-thumb,
.bl-list::-webkit-scrollbar-thumb,
.recruit::-webkit-scrollbar-thumb,
.base-card .blist::-webkit-scrollbar-thumb{background:#6b4423;border:2px solid #e8d29a;border-radius:8px}
.parch.log::-webkit-scrollbar-thumb:hover,
.parch-scroll::-webkit-scrollbar-thumb:hover,
.bl-list::-webkit-scrollbar-thumb:hover,
.recruit::-webkit-scrollbar-thumb:hover,
.base-card .blist::-webkit-scrollbar-thumb:hover{background:#4a2e16}
.parch-scroll-top{display:none;position:sticky;top:0;left:0;right:0;height:22px;margin-bottom:-22px;z-index:2;pointer-events:none;background:linear-gradient(to bottom,#e8d29a 0%,#e8d29acc 45%,rgba(232,210,154,0) 100%);flex:0 0 auto}
.parch-scroll.more-above>.parch-scroll-top{display:block}
.parch-scroll-cue{display:none;position:sticky;bottom:0;left:0;width:100%;box-sizing:border-box;margin:0;padding:18px 8px 8px;border:0;background:linear-gradient(to bottom,rgba(232,210,154,0) 0%,#e8d29a 42%,#e0c888 100%);text-align:center;cursor:pointer;z-index:3;pointer-events:none;flex:0 0 auto;font:inherit;color:inherit}
.parch-scroll.more-below>.parch-scroll-cue{display:block;pointer-events:auto}
.parch-scroll:not(.more-below)>.parch-scroll-cue{display:none;pointer-events:none}
.parch-scroll-pill{display:inline-block;font:700 12px var(--px-font),monospace;color:#3a1e08;background:linear-gradient(#f8ecc4,#e8d29a);border:3px solid #1c1a12;box-shadow:inset 2px 2px 0 #fff2c8,inset -2px -2px 0 #8a6a30,2px 3px 0 #0005;padding:4px 12px;border-radius:999px;pointer-events:none}
.recruit-scroll-cue .parch-scroll-pill,.recruit .parch-scroll-top,.recruit .parch-scroll-cue{grid-column:1/-1}
