/* Beer Game by Pineapple Brew
   SPDX-License-Identifier: CC0-1.0 */
:root{
  --bg:#E4E9EA; --surface:#FBFBF8; --surface-2:#EEF2F1; --ink:#2A1E16; --muted:#62584F; --line:#C5CDCE;
  --amber:#C98107; --amber-ink:#2A1E16; --amber-soft:#F5E2B5; --bad:#A8323E; --good:#2E6B4F; --focus:#33658A;
  --c0:#C98107; --c1:#2E7D5B; --c2:#33658A; --c3:#8C4A2B; --c4:#7A4E9A; --c5:#66781F; --cd:#2A1E16;
  --slab: Rockwell, "Rockwell Nova", "Roboto Slab", "Zilla Slab", "Sitka Heading", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#1D1915; --surface:#28221C; --surface-2:#221D18; --ink:#F2EBE1; --muted:#B3A89B; --line:#463B31;
    --amber:#EBA42A; --amber-ink:#1D1915; --amber-soft:#4A3A1E; --bad:#E57884; --good:#6DC39A; --focus:#8EC1E6;
    --c0:#EBA42A; --c1:#5DBB8E; --c2:#7AAFD8; --c3:#D5916A; --c4:#BC97DB; --c5:#B3C65E; --cd:#F2EBE1;
  }
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 var(--sans);min-height:100vh;display:flex;flex-direction:column}
body>main{flex:1 0 auto;width:100%}
h1,h2,h3{font-family:var(--slab);font-weight:700;line-height:1.15;margin:0 0 .5rem}
h1{font-size:clamp(1.8rem,4.5vw,2.6rem)}
h2{font-size:1.3rem}
h3{font-size:1.1rem}
p{max-width:70ch;margin:.4rem 0 .8rem}
a{color:inherit}
.top{display:flex;flex-wrap:wrap;align-items:baseline;gap:.4rem 1rem;padding:.8rem clamp(1rem,4vw,2rem);border-bottom:3px solid var(--ink)}
.brand{font-family:var(--slab);font-weight:700;font-size:1.3rem;text-decoration:none}
#top-game{color:var(--muted)}
main{max-width:1180px;margin:0 auto;padding:1.5rem clamp(1rem,4vw,2rem) 4rem}
section{margin-bottom:1.75rem}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:1.1rem 1.2rem}
.lede{font-size:1.15rem;max-width:62ch}
.hint,.muted{color:var(--muted);font-size:.92rem}
.bad-t{color:var(--bad)}
button{font:inherit;cursor:pointer;border-radius:8px;border:1.5px solid var(--ink);background:transparent;color:var(--ink);padding:.45rem .9rem;min-height:42px}
button:hover{background:var(--surface-2)}
button.primary{background:var(--amber);border-color:var(--amber);color:var(--amber-ink);font-weight:700}
button.primary:hover{filter:brightness(1.07)}
button.ghost{border-color:var(--line)}
button.small{min-height:34px;padding:.2rem .65rem;font-size:.9rem}
button:disabled{opacity:.5;cursor:not-allowed}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
label{display:block;font-weight:600;font-size:.92rem;margin:.7rem 0 0}
label>input,label>select{margin-top:.25rem;font-weight:400}
input,select{font:inherit;color:var(--ink);background:var(--surface);border:1.5px solid var(--line);border-radius:8px;padding:.4rem .6rem;width:100%;min-height:42px}
input[type=checkbox],input[type=radio]{width:auto;min-height:0;accent-color:var(--amber)}
label.check{display:flex;gap:.55rem;align-items:center;font-weight:400}
label.check input{margin:0}
fieldset{border:0;padding:0;margin:.9rem 0 0;min-width:0}
legend{font-weight:600;font-size:.92rem;padding:0;margin-bottom:.35rem}
.seg{display:flex;flex-wrap:wrap;gap:.4rem}
.seg label{margin:0;font-weight:500;position:relative}
.seg input{position:absolute;opacity:0;width:1px;height:1px}
.seg span{display:inline-block;border:1.5px solid var(--line);border-radius:999px;padding:.3rem .85rem;cursor:pointer;background:var(--surface)}
.seg input:checked+span{background:var(--ink);color:var(--surface);border-color:var(--ink)}
.seg input:focus-visible+span{outline:3px solid var(--focus);outline-offset:2px}
.seg.big span{padding:.45rem 1rem;font-weight:600}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:0 .8rem}
.row3{display:grid;grid-template-columns:repeat(3,1fr);gap:0 .8rem}
@media (max-width:560px){.row2,.row3{grid-template-columns:1fr}}
.preview{font-size:.9rem;color:var(--muted);margin:.4rem 0 0}
.sub{border-left:3px solid var(--amber);padding-left:.9rem;margin-top:.4rem}
[hidden]{display:none!important}

/* Start page */
.resume{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;justify-content:space-between;background:var(--amber-soft);border:1.5px solid var(--amber);border-radius:10px;padding:.7rem 1rem}
.home-grid{display:grid;grid-template-columns:1fr 1.45fr;gap:1rem;align-items:start}
@media (max-width:900px){.home-grid{grid-template-columns:1fr}}
.list-head{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-top:.3rem}
.games{list-style:none;margin:.4rem 0 .6rem;padding:0;max-height:250px;overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--surface-2)}
.game-row{width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;display:flex;flex-wrap:wrap;justify-content:space-between;gap:.2rem 1rem;padding:.55rem .8rem;background:transparent}
.games li:last-child .game-row{border-bottom:0}
.g-name{font-weight:700}
.g-meta{color:var(--muted);font-size:.88rem}
.empty{padding:.8rem;color:var(--muted)}
.error{color:var(--bad)}
details.more{border-top:1px solid var(--line);margin-top:1.1rem;padding-top:.7rem}
details summary{cursor:pointer;font-family:var(--slab);font-weight:700}
.form-actions{margin-top:1.2rem}
.delays{width:100%;border-collapse:collapse;margin-top:.5rem;font-size:.9rem}
.delays th,.delays td{padding:.3rem .35rem;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
.delays select{min-height:34px;padding:.15rem .3rem;margin:0;width:4.2rem}
.steps{padding-left:1.3rem;max-width:66ch}
.steps li{margin:.25rem 0}

/* Supply chain */
.chain{list-style:none;margin:1rem 0;padding:0;display:grid;grid-template-columns:repeat(var(--cols,5),minmax(0,1fr))}
.station{position:relative;display:flex;flex-direction:column;gap:.15rem;padding:1rem .9rem .85rem;background:var(--surface);border:1.5px solid var(--ink);border-left-width:0;min-height:120px;min-width:0}
.station:first-child{border-left-width:1.5px;border-radius:10px 0 0 10px}
.station:last-child{border-radius:0 10px 10px 0}
.station::after{content:"";position:absolute;right:-9px;top:50%;width:16px;height:16px;background:inherit;border-top:1.5px solid var(--ink);border-right:1.5px solid var(--ink);transform:translateY(-50%) rotate(45deg);z-index:2}
.station:last-child::after{display:none}
.station .bar{position:absolute;left:0;right:0;top:0;height:6px;background:var(--role)}
.station.mine{background:var(--amber-soft)}
.station.customer{background:var(--surface-2)}
.st-role{font-family:var(--slab);font-weight:700;font-size:1.02rem;overflow-wrap:anywhere}
.st-who{font-size:.9rem;color:var(--muted);overflow-wrap:anywhere}
.st-inv{font-family:var(--slab);font-size:1.55rem;line-height:1.1;font-variant-numeric:tabular-nums}
.st-inv small{font-size:.95rem}
.st-state{font-size:.85rem;margin-top:auto;padding-top:.2rem}
.station button{margin-top:.45rem;align-self:flex-start}
@media (max-width:760px){
  .chain{grid-template-columns:1fr}
  .station{border-left-width:1.5px;border-top-width:0;min-height:0;border-radius:0;display:grid;grid-template-columns:1fr auto;grid-template-areas:"role inv" "who state" "btn btn";column-gap:.75rem;row-gap:.1rem;align-items:baseline;padding:.8rem .85rem .7rem}
  .station:first-child{border-top-width:1.5px;border-radius:10px 10px 0 0}
  .station:last-child{border-radius:0 0 10px 10px}
  .station::after{right:auto;top:auto;left:50%;bottom:-9px;transform:translateX(-50%) rotate(135deg)}
  .st-role{grid-area:role}
  .st-inv{grid-area:inv;text-align:right;font-size:1.35rem}
  .st-who{grid-area:who}
  .st-state{grid-area:state;text-align:right;margin:0;padding:0}
  .station button{grid-area:btn;margin-top:.35rem}
}
@media (min-width:761px) and (max-width:1060px){
  .chain.wide{grid-template-columns:repeat(4,minmax(0,1fr));row-gap:.75rem}
  .chain.wide .station{border-left-width:1.5px;border-radius:10px;margin-right:12px}
  .chain.wide .station::after{right:-20px}
}
.dot{display:inline-block;width:.55rem;height:.55rem;border-radius:50%;background:var(--line);margin-right:.35rem;vertical-align:.05em}
.dot.on{background:var(--good)}
.state-done{color:var(--good);font-weight:600}
.state-wait{color:var(--muted)}
.state-bot{color:var(--c2)}

/* Round */
.round-head{display:flex;justify-content:space-between;align-items:center;gap:1rem}
.round-head h1{margin:0}
.timer{position:relative;width:68px;height:68px;flex:none}
.timer svg{width:100%;height:100%;transform:rotate(-90deg)}
.timer circle{fill:none;stroke-width:4}
.timer .track{stroke:var(--line)}
.timer .prog{stroke:var(--amber);stroke-dasharray:100;stroke-dashoffset:0;stroke-linecap:round;transition:stroke-dashoffset .25s linear}
.timer span{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--slab);font-size:1.4rem;font-variant-numeric:tabular-nums}
.timer.urgent .prog{stroke:var(--bad)}
.timer.urgent span{color:var(--bad)}
.timer.none{width:auto;height:auto;color:var(--muted);font-size:.9rem}
.banner{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;justify-content:space-between;background:var(--amber-soft);border:1.5px solid var(--amber);border-radius:10px;padding:.7rem 1rem;margin-bottom:1rem}
.desk{display:grid;grid-template-columns:1.35fr 1fr;gap:1rem;align-items:start}
@media (max-width:860px){.desk{grid-template-columns:1fr}}
.mine-panel,.rc{border-top:6px solid var(--role)}
.panel h2 small,.rc h3 small{display:block;font-family:var(--sans);font-weight:400;font-size:.9rem;color:var(--muted);margin-top:.15rem}
.bigs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:.6rem 0 1rem}
.big span{display:block;font-size:.85rem;color:var(--muted)}
.big strong{display:block;font-family:var(--slab);font-size:clamp(1.5rem,4vw,2.4rem);line-height:1.1;font-variant-numeric:tabular-nums;white-space:nowrap}
.big.cost strong{font-size:clamp(1.15rem,3vw,1.9rem)}
.big.bad strong{color:var(--bad)}
.bigs.sm{grid-template-columns:1fr 1fr;gap:.5rem .75rem}
.bigs.sm .cost{grid-column:1 / -1}
.bigs.sm strong{font-size:1.35rem}
.bigs.sm .big.cost strong{font-size:1.1rem}
.flows{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:.2rem 0 .8rem}
@media (max-width:480px){.flows{grid-template-columns:1fr}}
.flows h3{font-size:.95rem;margin:0 0 .3rem}
.flows dt::first-letter{text-transform:uppercase}
.facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:0 1.2rem;margin:0}
.flows .facts{grid-template-columns:1fr}
.facts div{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem;border-bottom:1px dotted var(--line);padding:.28rem 0}
.facts dt{color:var(--muted);font-size:.9rem}
.facts dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap}
.facts dd.wrap{white-space:normal;min-width:4.5rem}
.facts .by{display:block;font-weight:400;font-size:.8rem;color:var(--muted)}
.order-panel{border:2px solid var(--ink)}
.sent{display:flex;align-items:center;justify-content:space-between;gap:1rem;background:var(--surface-2);border-left:6px solid var(--good);border-radius:6px;padding:.5rem .9rem;margin:.4rem 0}
.sent span{color:var(--muted)}
.sent strong{font-family:var(--slab);font-size:clamp(2.2rem,6vw,3rem);line-height:1;font-variant-numeric:tabular-nums}
.stepper{display:grid;grid-template-columns:64px 1fr 64px;gap:.5rem;margin:.8rem 0}
.stepper input{text-align:center;font-family:var(--slab);font-size:clamp(2.4rem,7vw,3.4rem);min-height:84px;margin:0;border-width:2px;border-color:var(--ink);font-variant-numeric:tabular-nums}
.stepper button{font-size:1.8rem;min-height:84px;padding:0}
.quick{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.9rem}
.order-panel .primary{width:100%;min-height:58px;font-size:1.2rem}
.host-tools{margin-top:1rem;padding-top:.8rem;border-top:1px solid var(--line)}
.tabs{display:flex;flex-wrap:wrap;gap:.4rem;margin:.2rem 0 1rem}
.tabs button[aria-pressed="true"]{background:var(--ink);color:var(--surface)}
.grid4{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:1rem}

/* Learner mode */
.advice{border-left:6px solid var(--amber)}
.advice-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem 1rem}
.advice-head h2{margin:0}
.adv-num{font-family:var(--slab);font-size:2.4rem;line-height:1;font-variant-numeric:tabular-nums}
.formula{font-family:var(--slab);font-size:1.1rem;margin:.6rem 0 .4rem}
.calc{margin:0;display:grid;gap:0}
.calc div{display:grid;grid-template-columns:minmax(150px,24%) 1fr;gap:.2rem 1rem;padding:.4rem 0;border-bottom:1px dotted var(--line)}
@media (max-width:560px){.calc div{grid-template-columns:1fr}}
.calc dt{font-weight:600}
.calc dd{margin:0;font-variant-numeric:tabular-nums}
.calc b{font-weight:700}
.compare-note{margin-top:.8rem}

/* Charts */
.charts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,440px),1fr));gap:1rem}
.chart{margin:0;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.9rem 1rem .6rem;min-width:0}
.chart figcaption{font-family:var(--slab);font-weight:700}
.legend{display:flex;flex-wrap:wrap;gap:.2rem .9rem;font-size:.85rem;color:var(--muted);margin:.3rem 0 .4rem}
.legend i,.tip i{display:inline-block;width:.95rem;height:.25rem;border-radius:2px;vertical-align:middle;margin-right:.35rem}
.plot{position:relative;width:100%;touch-action:pan-y}
.plot svg{display:block;overflow:visible}
.plot .grid{stroke:var(--line);stroke-width:1}
.plot .zero{stroke:var(--muted);stroke-width:1.2}
.plot .lab{fill:var(--muted);font-size:11px;font-family:var(--sans)}
.plot .ln{fill:none;stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round}
.plot .ln.dash{stroke-dasharray:5 4;stroke-width:1.8}
.plot .ln.dot{stroke-dasharray:1.5 4;stroke-width:2.4}
.plot .guide{stroke:var(--ink);stroke-width:1;stroke-dasharray:2 3}
.tip{position:absolute;top:6px;background:var(--surface);border:1.5px solid var(--ink);border-radius:6px;padding:.35rem .55rem;font-size:.82rem;pointer-events:none;white-space:nowrap;z-index:3}
.tip span{display:block}

/* Results */
.compare{display:grid;gap:.55rem;margin:1rem 0}
.cmp{display:grid;grid-template-columns:minmax(130px,230px) 1fr 10rem;gap:.75rem;align-items:center}
.cmp .track{height:20px;background:var(--surface-2);border:1px solid var(--line);border-radius:4px;overflow:hidden}
.cmp .fill{height:100%;background:var(--muted)}
.cmp.team .fill{background:var(--amber)}
.cmp.role .fill{background:var(--role)}
.cmp b{text-align:right;font-variant-numeric:tabular-nums}
@media (max-width:560px){.cmp{grid-template-columns:1fr auto}.cmp .track{grid-column:1 / -1;grid-row:2}}
.tablewrap{overflow-x:auto}
table.res{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
table.res th,table.res td{text-align:left;padding:.45rem .5rem;border-bottom:1px solid var(--line);white-space:nowrap}
table.res th{font-size:.85rem;color:var(--muted);font-weight:600;vertical-align:bottom}
table.res.dense td,table.res.dense th{padding:.3rem .45rem;font-size:.86rem}
table.res tr.hl td{background:var(--amber-soft)}
.n{text-align:right!important}
.swatch{display:inline-block;width:.75rem;height:.75rem;border-radius:2px;background:var(--role);margin-right:.45rem;vertical-align:-.05em}
.writeup{margin:.3rem 0 0;padding-left:1.2rem;max-width:78ch}
.writeup li{margin:.3rem 0}
details.station-detail{border-top:6px solid var(--role);margin-bottom:1rem}
details.station-detail>summary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:.3rem 1rem;font-size:1.15rem;padding:.1rem 0}
details.station-detail>summary span{font-family:var(--sans);font-weight:400;font-size:.95rem;color:var(--muted)}
details.station-detail[open]>summary{margin-bottom:.8rem}
.detail-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem}
.inner-charts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:1rem}
.inner-charts .chart{background:var(--surface-2)}

/* Waiting room */
.two{display:grid;grid-template-columns:1fr 1fr;gap:1rem;align-items:start}
@media (max-width:860px){.two{grid-template-columns:1fr}}
.people{list-style:none;padding:0;margin:0}
.people li{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.45rem 0;border-bottom:1px solid var(--line)}
.tag{display:inline-block;font-size:.78rem;border:1px solid var(--line);border-radius:999px;padding:0 .5rem;margin-left:.35rem;color:var(--muted)}
.share{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.share code{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:.3rem .5rem;overflow-wrap:anywhere;font-size:.9rem}
.code{font-family:var(--slab);font-size:2rem;letter-spacing:.2em;margin:.2rem 0}
.rules{margin:0}
.rules div{display:grid;grid-template-columns:minmax(110px,36%) 1fr;gap:.75rem;padding:.3rem 0;border-bottom:1px dotted var(--line)}
.rules dt{color:var(--muted)}
.rules dd{margin:0}
.actions{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:1.5rem}

#toast{position:fixed;left:50%;bottom:1.2rem;transform:translate(-50%,200%);background:var(--ink);color:var(--surface);padding:.6rem 1rem;border-radius:8px;max-width:min(92vw,540px);z-index:20;visibility:hidden;transition:transform .2s,visibility .2s}
#toast.show{transform:translate(-50%,0);visibility:visible}
#toast.error{background:var(--bad);color:#fff}
#net{position:fixed;top:.6rem;right:.8rem;background:var(--bad);color:#fff;font-size:.85rem;padding:.25rem .6rem;border-radius:6px;z-index:20}
@media (prefers-reduced-motion:reduce){#toast,.timer .prog{transition:none}}

/* Header and brand */
.top{align-items:center;position:relative;z-index:5}
.brand{display:inline-flex;align-items:center;gap:.6rem;color:inherit}
.brand img{height:46px;width:auto;display:block}
main.full{max-width:none;padding:0}
body.on-hero .top{position:absolute;top:0;left:0;right:0;border-bottom:0;color:#fff;background:linear-gradient(rgba(24,16,8,.75),rgba(24,16,8,0))}
.btn-row{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}

/* Landing */
.landing{position:relative;min-height:100vh;min-height:100svh;margin:0;display:flex;align-items:flex-end;color:#fff;background:#2a1e16;overflow:hidden}
.landing-bg{position:absolute;inset:0;background:#2a1e16 url(hero-1400.jpg) center 42%/cover no-repeat}
@media (min-width:1100px){.landing-bg{background-image:url(hero-2400.jpg)}}
.landing::after{content:"";position:absolute;inset:0;background:linear-gradient(to right,rgba(22,15,8,.78) 0%,rgba(22,15,8,.45) 34%,rgba(22,15,8,0) 58%),linear-gradient(to top,rgba(22,15,8,.94) 0%,rgba(22,15,8,.7) 26%,rgba(22,15,8,.1) 55%,rgba(22,15,8,0) 70%)}
@media (max-width:760px){
  .landing-bg{background-position:center 25%}
  .landing::after{background:linear-gradient(to top,rgba(22,15,8,.96) 0%,rgba(22,15,8,.88) 48%,rgba(22,15,8,.35) 68%,rgba(22,15,8,0) 82%)}
  .cta button{flex:1 1 100%}
}
.landing-inner{position:relative;z-index:1;width:100%;max-width:1180px;margin:0 auto;padding:7rem clamp(1rem,4vw,2rem) clamp(2rem,7vh,4.5rem)}
.landing h1{font-size:clamp(2.2rem,4.8vw,3.9rem);max-width:12ch;color:#fff;text-shadow:0 2px 14px rgba(0,0,0,.45);margin-bottom:.6rem}
.landing .lede{color:#f7eddc;font-size:clamp(1.1rem,2.4vw,1.45rem);max-width:none}
.cta{display:flex;flex-wrap:wrap;gap:.8rem;margin:1.5rem 0 1.1rem}
.cta button{min-height:58px;font-size:1.15rem;padding:.6rem 1.6rem}
button.light{background:rgba(255,255,255,.1);border-color:#fff;color:#fff}
button.light:hover{background:rgba(255,255,255,.22)}
.how-link{color:#f7eddc}
.landing .resume{background:rgba(245,226,181,.96);color:#2a1e16;margin-bottom:1.4rem;max-width:760px}
.page{max-width:820px;margin:0 auto}
.back{margin:0 0 1rem}
.resume{margin-bottom:1rem}

/* Wizard */
.wizard-steps{list-style:none;padding:0;margin:.4rem 0 1.1rem;display:flex;flex-wrap:wrap;gap:.4rem}
.wizard-steps button[aria-current="step"]{background:var(--ink);color:var(--surface)}
.wizard-nav{display:flex;flex-wrap:wrap;gap:.6rem;justify-content:space-between;align-items:center;margin-top:1.4rem;padding-top:1rem;border-top:1px solid var(--line)}
.wizard-nav .btn-row{margin-left:auto}

/* Guided mode */
.guided{margin:.9rem 0 0}
.phases{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.4rem}
.phases li{border:1.5px solid var(--line);border-radius:8px;padding:.45rem .65rem;background:var(--surface)}
.phases li b{font-family:var(--slab);font-weight:700}
.phases li.done{color:var(--muted)}
.phases li.done b{font-weight:400}
.phases li.now{border-color:var(--amber);background:var(--amber-soft);box-shadow:0 0 0 2px var(--amber)}
.phase-row{display:flex;flex-wrap:wrap;gap:.6rem 1rem;align-items:center;justify-content:space-between;margin-top:.6rem}
.phase-note{margin:0;font-size:1.05rem;max-width:72ch}
@media (max-width:560px){.phases{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Cockpit */
.mine-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:.5rem 1rem}
.cost-so-far{margin:0;text-align:right}
.cost-so-far span{display:block;font-size:.85rem;color:var(--muted)}
.cost-so-far strong{font-family:var(--slab);font-size:1.5rem;font-variant-numeric:tabular-nums}
.cockpit{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;margin:.7rem 0 .8rem}
.tile{background:var(--surface-2);border:1.5px solid var(--line);border-radius:10px;padding:.7rem .85rem .75rem;min-width:0;transition:background .2s,border-color .2s,box-shadow .2s}
.t-label{font-size:.88rem;color:var(--muted);font-weight:600}
.t-value{display:flex;align-items:baseline;flex-wrap:wrap;gap:.2rem .55rem;font-family:var(--slab);font-weight:700;font-size:clamp(2.3rem,5.5vw,3.4rem);line-height:1.05;font-variant-numeric:tabular-nums;margin:.1rem 0}
.t-value small{font-family:var(--sans);font-size:.95rem;font-weight:600}
.t-value .unknown{color:var(--muted)}
#order-qty{-moz-appearance:textfield;appearance:textfield}
#order-qty::-webkit-outer-spin-button,#order-qty::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.delta.n{color:var(--muted)}
.delta.up{color:var(--good)}
.delta.down{color:var(--bad)}
.t-sub{font-size:.9rem;color:var(--muted);font-variant-numeric:tabular-nums}
.t-sub b,.t-gap b{color:var(--ink)}
.t-gap{margin-top:.4rem;padding-top:.4rem;border-top:1px dashed var(--line);font-size:.9rem;font-variant-numeric:tabular-nums}
.tile.neg .t-value{color:var(--bad)}
.tile.focus{background:var(--amber-soft);border-color:var(--amber);box-shadow:0 0 0 2px var(--amber)}
@media (max-width:400px){.cockpit{gap:.45rem}.tile{padding:.55rem .6rem}.t-value{font-size:2rem}}
@media (prefers-reduced-motion:reduce){.tile{transition:none}}

/* Order panel */
.order-panel.locked .stepper,.order-panel.locked .quick,.order-panel.locked>.primary{opacity:.45}
.locked-note{background:var(--surface-2);border-left:6px solid var(--amber);border-radius:6px;padding:.5rem .8rem}
.warn{border-left:6px solid var(--bad);background:var(--surface-2);border-radius:6px;padding:.6rem .8rem;margin:0 0 .8rem}
.warn p{margin:0 0 .5rem}
.waiting{font-size:.92rem;color:var(--muted);margin:.7rem 0 0}
.timer.paused{color:var(--bad);font-weight:600}

/* QR */
.join-card{display:flex;flex-wrap:wrap;gap:1rem 1.5rem;align-items:center}
.join-card .qr{width:176px;height:176px;flex:none;border-radius:6px;border:1px solid var(--line)}
.join-card>div{flex:1 1 260px;min-width:0}

/* Second countdown in the order panel */
.timer-inline{display:flex;align-items:center;gap:.6rem;margin:.1rem 0 .9rem}
.timer-inline span{font-size:.9rem;color:var(--muted);white-space:nowrap}
.timer-inline .bar{flex:1;height:12px;border:1.5px solid var(--line);border-radius:999px;background:var(--surface-2);overflow:hidden;min-width:60px}
.timer-inline .bar i{display:block;height:100%;width:100%;background:var(--amber);transition:width .25s linear}
.timer-inline b{font-family:var(--slab);font-size:1.5rem;font-variant-numeric:tabular-nums;min-width:3.2ch;text-align:right}
.timer-inline.urgent b,.timer-inline.paused b{color:var(--bad)}
.timer-inline.urgent .bar i{background:var(--bad)}

/* Sticky round bar */
#roundbar{position:fixed;top:0;left:0;right:0;z-index:15;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.4rem 1rem;
  background:var(--ink);color:var(--surface);padding:.4rem .9rem;font-variant-numeric:tabular-nums;transform:translateY(-110%);transition:transform .18s}
#roundbar.show{transform:none}
#roundbar b{font-family:var(--slab);font-size:1.2rem}
#roundbar .rb-state{font-size:.9rem;opacity:.85}
#roundbar.urgent{background:var(--bad);color:#fff}

/* New round announcement */
#newround{position:fixed;top:.8rem;left:50%;transform:translate(-50%,-160%);z-index:21;background:var(--amber);color:var(--amber-ink);
  border-radius:999px;padding:.5rem 1.2rem;font-family:var(--slab);font-weight:700;font-size:1.1rem;box-shadow:0 4px 14px rgba(0,0,0,.25);transition:transform .25s}
#newround.show{transform:translate(-50%,0)}
@keyframes roundpulse{0%{box-shadow:0 0 0 0 rgba(201,129,7,.85)}70%{box-shadow:0 0 0 16px rgba(201,129,7,0)}100%{box-shadow:0 0 0 0 rgba(201,129,7,0)}}
.pulse{animation:roundpulse 1.1s ease-out 2}
@media (prefers-reduced-motion:reduce){.pulse{animation:none}#newround,.timer-inline .bar i{transition:none}}

/* Footer */
.site-foot{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.5rem 0;padding:1.4rem 1rem;border-top:1px solid var(--line);background:var(--surface-2);font-size:.9rem}
.site-foot a{color:var(--muted);text-decoration:none;padding:.15rem 1rem}
.site-foot a:hover{color:var(--ink);text-decoration:underline}
.site-foot a+a{border-left:1px solid var(--line)}
body.on-hero .site-foot{display:none}

/* Footer inside the full-screen start page */
.hero-foot{display:flex;flex-wrap:wrap;gap:.4rem .2rem;margin-top:clamp(1.4rem,4vh,2.6rem);padding-top:.9rem;border-top:1px solid rgba(255,255,255,.28);font-size:.9rem}
.hero-foot a{color:#e8ddcb;text-decoration:none;padding:.15rem .9rem}
.hero-foot a:first-child{padding-left:0}
.hero-foot a+a{border-left:1px solid rgba(255,255,255,.28)}
.hero-foot a:hover{color:#fff;text-decoration:underline}
@media (max-width:480px){.hero-foot{gap:.3rem 1.2rem}.hero-foot a,.hero-foot a+a{border-left:0;padding:.15rem 0}}
