:root{--gold:#e4ad6b;--cream:#fff0d5}
body{background:#0d0907;color:var(--cream)}
#selection{background:linear-gradient(145deg,#201209e8,#090909f5 60%),url('coffee-roastery.png') center/cover fixed}
header .brand b,.eyebrow{color:var(--gold)}
#opening{background:linear-gradient(90deg,#070605ee,#160e089e,#070605cc),url('coffee-roastery.png') center/cover}
#opening .opening-title{text-shadow:0 8px 42px #000}
.opening-story{max-width:38rem;font-size:clamp(16px,2.3vw,22px);line-height:1.55;letter-spacing:normal!important;color:#f4d7b5}
.league-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 0;border-bottom:1px solid #89623855}
.league-bar button{background:#291b12;border:1px solid #a97443;padding:12px 16px;font-size:14px;color:var(--cream);text-align:left}
.league-bar b{color:#ffc985}.league-bar a{color:#ffd0a0;font-size:14px;white-space:nowrap}
#leagueStatus{font-size:14px;line-height:1.4;color:#d9c3ab;min-height:1.4em;margin:10px 0}
#leagueBusy{color:#ffcf8c;font-size:14px}
#walletPanel,#roomPanel{padding:22px;margin:14px 0;background:#20160f;border:1px solid #8f673e}
#walletPanel p,#roomPanel p,#onlineOptions p{font-size:16px;line-height:1.5;color:#e4ccb0}
.wallet-totals{display:flex;flex-wrap:wrap;gap:28px}.wallet-totals b{font-size:32px;color:#ffd99b}.wallet-totals span{font-size:14px}
.wallet-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center}.wallet-actions button,#roomPanel button{border:1px solid #ad7f4c;background:#3d2718;color:var(--cream);padding:14px;font-size:14px}
.wallet-actions label{font-size:14px}.wallet-actions input{width:88px}
#tapCoffee{font-weight:800;background:#c08042;color:#100906;touch-action:manipulation;min-height:54px;transition:transform 90ms,filter 90ms}
#tapCoffee:active{transform:scale(.96);filter:brightness(1.3)}#tapPending{font-size:14px;min-width:90px}
#ledger{padding-left:20px;font-size:14px;line-height:1.9;color:#c8b398;max-height:140px;overflow:auto}
#wagerOptions{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;border-top:1px solid #704b30;padding:16px 0;margin-top:12px}
#wagerOptions small{grid-column:1/-1;font-size:14px;line-height:1.45;color:#baa58e}#potPreview{color:#ffd99b;font-size:16px}
#wagerOptions label,#arenaOption,#onlineOptions label{font-size:14px;display:grid;gap:8px}#arenaOption{margin:12px 0}
input[type=number],#roomCode,#roomPanel input,select{background:#0f0b08;color:#ffe8ca;border:1px solid #795637;padding:12px;font:inherit;min-width:0;max-width:100%;box-sizing:border-box}
#roomPanel input{display:block;width:100%;font-size:14px;margin:12px 0}#roomPanel button{margin:5px 8px 5px 0}
#onlineOptions>button{margin-top:10px}.game-options .segmented{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.segmented button{font-size:14px;padding-inline:5px}
#networkStatus{position:absolute;z-index:12;top:17%;left:50%;transform:translateX(-50%);padding:5px 10px;background:#130c09bd;color:#ffe2b8;font-size:12px;pointer-events:none;white-space:nowrap}
#networkStatus.error{color:#ffb5a5;background:#361810dc}
#ladderScreen{background:linear-gradient(90deg,#100a08f5,#0d0907d9),url('coffee-plantation.png') center/cover}
.rung.current{border-color:#f2bd77;background:#6b3c1f66}.rung.cleared{background:#31512722}
.card{background:#fff!important}.card img{background:#fff!important}.card .index{color:#75583d}
.primary{background:linear-gradient(115deg,#b4783d,#f0c78b 55%,#be8448);color:#160c05;border-color:#e5b77e}
.bank-result{font-size:24px;color:#ffd28a}.bank-result small{display:block;font-size:14px;color:#d6bfa4;margin-top:8px}
@media(max-width:600px){.league-bar{align-items:stretch}.league-bar button{font-size:12px;padding:10px;line-height:1.6}.league-bar a{align-self:center}#walletPanel,#roomPanel{padding:15px}#wagerOptions{grid-template-columns:1fr}#wagerOptions small{grid-column:auto}.game-options .segmented{grid-template-columns:repeat(2,1fr)}.wallet-actions{align-items:stretch}.wallet-actions button{flex:1 1 140px}#networkStatus{top:16%;max-width:80%;white-space:normal;text-align:center}}
@media(prefers-reduced-motion:reduce){#tapCoffee{transition:none}}
.coffee-chapters{position:absolute;inset:0;z-index:-1;overflow:hidden;pointer-events:none}.chapter{position:absolute;inset:0;background-position:center;background-size:cover;opacity:0;animation:coffee-chapter 21s infinite}.chapter.plantation{background-image:linear-gradient(90deg,#080605d9,#08060580),url('coffee-plantation.png')}.chapter.roastery{background-image:linear-gradient(90deg,#080605e9,#08060590),url('coffee-roastery.png');animation-delay:7s}.chapter.bazaar{background-image:linear-gradient(90deg,#080605e9,#08060580),url('coffee-bazaar.png');animation-delay:14s}
#opening{isolation:isolate}.coffee-chapters~*{position:relative}#arenaOption{background:linear-gradient(90deg,#120d0afa,#120d0a75),url('coffee-roastery.png') center 55%/cover;padding:18px;border:1px solid #715030}#arenaOption[data-stage="1"]{background-image:linear-gradient(90deg,#120d0afa,#120d0a75),url('coffee-bazaar.png')}#arenaOption[data-stage="2"]{background-image:linear-gradient(90deg,#120d0afa,#120d0a75),url('coffee-plantation.png')}
@keyframes coffee-chapter{0%{opacity:0;transform:scale(1)}5%,28%{opacity:1}34%,100%{opacity:0;transform:scale(1.06)}}
@media(prefers-reduced-motion:reduce){.chapter{animation:none}.chapter.roastery{opacity:1}}

#leagueToast{position:fixed;z-index:100;bottom:20px;left:50%;transform:translateX(-50%);background:#3b2115;color:#fff0dc;border:1px solid #e8ae73;padding:16px;max-width:min(88vw,520px);font-size:16px;box-shadow:0 6px 24px #000b}
.tools{flex-wrap:wrap;justify-content:flex-end}.tools button{font-size:14px!important;min-height:40px}.brand{flex-shrink:0}
@media(max-width:600px){#selection>header{flex-wrap:wrap;gap:14px}.tools{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.tools button{padding:9px 5px!important}}

.bean-harvest{display:grid;grid-template-columns:200px 1fr;gap:24px;align-items:center;margin:24px 0}
#tapCoffee{position:relative;width:200px;height:220px;padding:0;border:1px solid #c48a43;border-radius:24px;overflow:hidden;background:#fff;box-shadow:0 8px 35px #c887281c;touch-action:manipulation;user-select:none;-webkit-user-select:none}
#tapCoffee img{width:100%;height:100%;object-fit:cover;pointer-events:none}#tapCoffee span{position:absolute;bottom:0;left:0;right:0;padding:13px 4px;background:#271609ed;color:#ffe0a4;font-size:14px}
.harvest-info h3{font-size:20px;margin:0;color:#f6cc83}.harvest-info p{max-width:460px}.harvest-info progress{display:block;width:100%;height:12px;margin:12px 0;accent-color:#e7b65b}.harvest-info small,.harvest-info output{display:block;line-height:1.6;font-size:13px}.harvest-info output{color:#ffd28a;min-height:24px}
#exchangeGold:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:600px){.bean-harvest{grid-template-columns:130px 1fr;gap:14px}#tapCoffee{width:130px;height:160px}.harvest-info h3{font-size:16px}.harvest-info p{font-size:13px!important;margin:7px 0}.harvest-info strong{font-size:13px}#tapCoffee span{font-size:11px;padding:10px 2px}}

/* The golden bean is a transparent cutout, with no white card behind it. */
.bean-harvest{grid-template-columns:1fr;justify-items:center;text-align:center;gap:8px}
#tapCoffee{width:min(68vw,280px);height:290px;overflow:visible;background:transparent;border:0;border-radius:0;box-shadow:none;perspective:700px}
#tapCoffee img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 14px 20px #c482192d)}
#tapCoffee span{bottom:-2px;background:none;color:#ffd892;font-size:14px;padding:0}
.harvest-info{width:min(100%,460px)}.harvest-info p{margin:8px auto}
#tapCoffee:disabled{opacity:.72;cursor:default}
@media(max-width:600px){#tapCoffee{width:210px;height:225px}.harvest-info h3{font-size:18px}}
#game{contain:layout paint}#arena{contain:strict}.controls button{will-change:transform}
body:has(#game:not([hidden])) .chapter{animation-play-state:paused}
