:root {
  color-scheme: light;
  --forest:#173d30; --deep:#102d25; --gold:#bd995c; --cream:#fff2d6; --paper:#fffaee; --ink:#283c30;
  --rust:#a8493a; --green:#245344; --muted:#665c49; --line:#ddc8a4;
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink); background:var(--deep);
}
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; display:flex; flex-direction:column; background:radial-gradient(ellipse at 42% 2%,#235242 0%,var(--forest) 38%,var(--deep) 100%); }
button,a { -webkit-tap-highlight-color:transparent; }
button { font:inherit; cursor:pointer; }
button:focus-visible,a:focus-visible { outline:3px solid #e7af45; outline-offset:3px; }
button[hidden] { display:none; }
a { color:inherit; }
h1,h2 { font-family:Georgia,"Times New Roman",serif; letter-spacing:-.028em; margin:0; }
p { line-height:1.55; }
.topbar { background:#102f26; color:#f8e9c2; border-bottom:1px solid #537258; box-shadow:0 6px 24px #081c1730; }
.top-inner { max-width:1370px; margin:auto; min-height:70px; padding:0 clamp(14px,4vw,36px); display:flex; align-items:center; justify-content:space-between; gap:7px; }
.brand { display:flex; align-items:center; gap:9px; color:#f9e6b6; text-decoration:none; font-family:Georgia,serif; font-size:clamp(1.05rem,3vw,1.52rem); font-weight:bold; white-space:nowrap; }
.awning { width:32px; height:32px; background:url('./assets/icon-192.png') center/contain no-repeat; border-radius:7px; flex:none; }
.top-actions { display:flex; align-items:center; gap:7px; }
.top-button { color:#f8e9c2; background:#1b4335; border:1px solid #667857; min-height:42px; border-radius:7px; padding:5px 12px; font-size:.875rem; font-weight:650; white-space:nowrap; }
.top-button:hover { background:#2a5542; }
#game { width:100%; max-width:1330px; margin:0 auto; padding:clamp(12px,3vw,28px); flex:1; }
.bottom { width:min(100%,1330px); margin:auto; color:#c2cbaa; padding:10px clamp(14px,4vw,30px) 18px; display:flex; justify-content:space-between; gap:10px; font-size:.84rem; }
.welcome { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr); min-height:480px; width:min(1080px,100%); margin: clamp(8px,4vh,48px) auto; border:3px solid var(--gold); border-radius:18px; overflow:hidden; background:var(--cream); box-shadow:0 18px 48px #071b16a0; }
.welcome-art { position:relative; overflow:hidden; min-height:440px; background:url('./assets/cover.webp') center/cover no-repeat; border-right:3px solid var(--gold); }
.welcome-side { display:flex; flex-direction:column; justify-content:center; align-items:flex-start; padding:clamp(25px,6vw,65px); background:radial-gradient(ellipse at top,#fffbee,var(--cream)); }
.welcome h1 { font-size:clamp(2.7rem,6.1vw,5.25rem); color:#194b38; line-height:.97; margin:11px 0 0; }
.welcome h1 span { display:block; }
.kicker { text-transform:uppercase; font-weight:750; letter-spacing:.13em; font-size:.82rem; color:#8c402f; }
.welcome-side p { font-size:1.02rem; margin:18px 0 22px; max-width:28ch; }
.welcome-side .button { margin-bottom:9px; width:100%; }
.home-meta { margin-top:12px; font-size:.9rem; color:var(--muted); line-height:1.5; }
.home-meta b { padding:0 4px; color:#945c2d; }
.status-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:1px 0 16px; }
.round-info { display:flex; align-items:center; gap:8px; color:#fff1cf; flex:none; }
.round-clock { display:grid; place-items:center; border:1px solid #9a9d69; border-radius:50%; font-size:1.65rem; width:39px; height:39px; background:#275143; line-height:1; }
.round-info strong { display:block; font-size:.98rem; }
.round-dots { display:flex; gap:4px; margin-top:4px; }
.round-dots i { width:6px; height:6px; background:#64816c; border-radius:50%; }
.round-dots .done { background:#f2bf62; }
.scores { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.score { min-height:47px; display:flex; align-items:center; gap:6px; border-radius:8px; border:1px solid #64816a; padding:5px 8px; color:#f5e8c8; background:#17372e; }
.score.active { border:1px solid #e0b766; background:#2a5342; }
.score strong,.score span:not(.marker) { display:block; font-size:.84rem; line-height:1.3; }
.score span:not(.marker) { color:#dfcfaa; }
.marker { width:22px; height:22px; display:inline-grid; place-items:center; background:var(--player); border:1px solid #fff2c5; outline:1px solid #44362aa0; border-radius:5px; box-shadow:0 2px 2px #30231845; flex:none; }
.marker img { width:80%; height:80%; }
.game-grid { display:grid; grid-template-columns:minmax(0,1.52fr) minmax(320px,1fr); gap:clamp(14px,2.4vw,28px); align-items:start; }
.market-board { display:grid; grid-template-columns:repeat(11,minmax(0,1fr)); grid-template-rows:repeat(11,minmax(0,1fr)); width:100%; aspect-ratio:1; border:5px solid #d0ad72; background:#e1c390; border-radius:12px; overflow:hidden; box-shadow:0 12px 30px #081d1690,inset 0 0 0 1px #8f693e; gap:1px; }
.board-center { grid-area:2/2/11/11; position:relative; overflow:hidden; background:#9db37d; }
.board-center > img,.market-video { display:block; width:100%; height:100%; object-fit:cover; }
.market-video { position:absolute; inset:0; pointer-events:none; opacity:0; }
.market-video.is-playing { opacity:1; }
@media (prefers-reduced-motion:reduce) {
  .market-video { display:none; }
}
.board-sign { position:absolute; top:5%; left:50%; transform:translateX(-50%); white-space:nowrap; border:2px solid #9d6a39; border-radius:18px 18px 15px 15px; background:var(--cream); color:#1e4b38; font-family:Georgia,serif; font-weight:bold; font-size:clamp(.85rem,2.8vw,2.4rem); padding:.15em .55em .28em; box-shadow:0 3px 0 #673a245b; }
.tile { padding:1px; position:relative; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:0; min-width:0; overflow:hidden; border:0; background:#f8edcf; color:#2f3d2c; border-radius:1px; text-align:center; }
.tile-label { font-weight:720; font-size:clamp(.48rem,.8vw,.74rem); line-height:1.1; max-width:99%; }
.goods-icon { display:inline-block; object-fit:contain; flex:none; vertical-align:middle; }
.tile > .goods-icon { width:57%; height:52%; max-width:34px; }
.event-icon { height:26px; width:26px; display:inline-grid; place-items:center; border-radius:50%; color:#544324; background:#f4d791; font-size:1.1rem; font-weight:800; line-height:1; }
.tile > .event-icon { height:49%; max-height:27px; width:auto; aspect-ratio:1; font-size:clamp(.55rem,1.6vw,1.15rem); }
.tile-fruit { background:#f4e3bf; } .tile-veg { background:#e0eab8; } .tile-meat { background:#f2d8d0; }
.tile-fish { background:#d9e8e4; } .tile-bread { background:#f6e5ad; } .tile-dairy { background:#e3e7d3; } .tile-pantry { background:#f3dec0; }
.tile-fee,.tile-spill { background:#f0d7b4; } .tile-tip,.tile-bonus { background:#efd49c; }
.tile-gate { background:#d7e4bf; } .tile-sell { background:#eee2bc; }
.tile-markers { position:absolute; right:1px; top:1px; display:flex; flex-wrap:wrap; justify-content:flex-end; max-width:100%; }
.tile-markers .marker { width:clamp(10px,1.35vw,19px); height:clamp(10px,1.35vw,19px); border-radius:3px; margin:-.5px; }
.board-foot { display:flex; justify-content:space-between; align-items:center; color:#e4d8b8; font-size:.87rem; gap:8px; margin-top:6px; }
.text-button { border:0; background:transparent; color:inherit; border-bottom:1px solid currentColor; padding:5px 1px; font-weight:700; font-size:.875rem; min-height:36px; }
.turn-panel,.orders-section,.basket-section { border:1px solid var(--gold); border-radius:12px; background:var(--paper); overflow:hidden; box-shadow:0 6px 17px #091a153b; }
.play-column { display:flex; flex-direction:column; gap:12px; min-width:0; }
.turn-top { min-height:39px; padding:5px 13px; display:flex; align-items:center; gap:7px; background:#e8d8ae; color:#244638; font-size:.87rem; font-weight:750; }
.turn-body { padding:13px 15px; }
.turn-body h2 { font-size:clamp(1.35rem,2.2vw,1.9rem); }
.turn-body p { margin:4px 0 11px; }
.turn-body .last-action { border-top:1px solid #e7d8ba; padding:8px 0 0; margin:11px 0 0; font-size:.83rem; color:#625642; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px; border-radius:8px; padding:8px 13px; border:1px solid transparent; font-weight:750; font-size:.96rem; line-height:1.2; text-align:center; }
.button.primary { color:#fff5da; background:#205744; border-color:#174532; box-shadow:0 2px 0 #15392b; }
.button.primary:hover { background:#2d6b53; }
.button.secondary { color:#294e3e; background:#fff1cf; border-color:#b9a375; }
.button.secondary:hover { background:#f3e0af; }
.button.small { padding:7px 9px; }
.button.small img { width:23px; height:23px; }
.roll-row,.action-buttons { display:flex; flex-wrap:wrap; align-items:center; gap:9px; }
.roll-row .button { min-width:min(146px,100%); }
.dice-pair { display:flex; gap:6px; }
.die { width:37px; height:37px; background:linear-gradient(143deg,#fff9e6,#f3d9a8); border:1px solid #ad8b59; border-radius:8px; box-shadow:inset 0 1px 0 #fffaed,0 2px 0 #b5925e; display:grid; place-items:center; grid-template:repeat(3,1fr)/repeat(3,1fr); padding:4px; flex:none; }
.die i { background:#3a3324; width:5px; height:5px; border-radius:50%; }
.move-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.choice { display:flex; gap:8px; align-items:center; border:1px solid #b09561; min-height:59px; background:#fff2d3; border-radius:8px; padding:6px; color:var(--ink); text-align:left; box-shadow:0 2px 0 #c4a873; }
.choice:hover { background:#f8e4ac; }
.choice .die { width:31px; height:31px; border-radius:6px; }
.move-text { flex:1; min-width:0; }
.move-text strong,.move-text span,.move-text small { display:block; line-height:1.2; }
.move-text strong { font-size:.91rem; }
.move-text span,.move-text small { margin-top:3px; font-size:.83rem; color:#55483a; }
.section-title { display:flex; justify-content:space-between; align-items:baseline; gap:6px; margin:0 0 7px; }
.section-title h2 { font-size:1.25rem; }
.section-title span { font-size:.84rem; font-weight:650; color:#65523c; white-space:nowrap; }
.orders-section,.basket-section { padding:10px; }
@font-face {
  font-family:Kalam; src:url('./assets/kalam-bold.woff') format('woff');
  font-weight:700; font-style:normal; font-display:swap;
}
.order-check {
  width:.89em; height:.89em; margin-top:.08em; display:grid; place-items:center;
  border:.09em solid currentColor; border-radius:.08em;
  background:#fff4d7; color:#274a33; font:700 1em/1 system-ui,sans-serif;
}
.order-check.is-collected { background:#275a3b; color:#fff5da; border-color:#275a3b; }
.ready-label { color:#24583d; margin-top:5px; font-size:.82rem; font-weight:800; }
.basket { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
.basket-chip { display:flex; flex-direction:column; align-items:center; border-radius:6px; background:#f0e5ce; color:#665642; padding:3px 1px; font-size:.83rem; line-height:1.1; }
.basket-chip img { width:min(26px,100%); height:26px; }
.basket-chip.stocked { background:#e2ead6; color:#284c3b; font-weight:800; }
.mobile-route,.mobile-log { display:none; }
.finish { max-width:790px; margin:clamp(20px,7vh,75px) auto; background:var(--cream); border:3px solid var(--gold); border-radius:16px; text-align:center; padding:clamp(22px,6vw,55px); box-shadow:0 20px 34px #081b1770; }
.finish h1 { font-size:clamp(2.2rem,7vw,4.6rem); margin:6px 0; }
.finish .scores { justify-content:center; margin:28px 0 20px; }
dialog { width:min(650px,calc(100% - 24px)); max-height:calc(100% - 30px); background:var(--paper); border:2px solid var(--gold); border-radius:13px; padding:22px; color:var(--ink); overflow:auto; box-shadow:0 20px 60px #05151080; }
dialog::backdrop { background:#071e17b5; }
.dialog-close { position:absolute; right:10px; top:9px; width:38px; height:38px; border-radius:7px; background:#fff1d0; border:1px solid #bfa879; color:var(--ink); font-size:1.3rem; }
dialog h2 { padding-right:38px; font-size:clamp(1.4rem,4vw,2rem); }
.rules,.history { padding-inline-start:24px; }
.rules li,.history li { line-height:1.55; margin:8px 0; }
.rules-note { background:#f2e7ca; padding:8px 10px; border-radius:6px; }
.board-dialog { width:min(790px,calc(100% - 20px)); }
.board-scroll { overflow:auto; padding:8px 0 4px; }
.board-scroll .market-board { min-width:450px; }
.board-scroll .tile-label { font-size:.66rem; }
@media (max-width: 760px) {
  .top-inner { min-height:60px; padding-inline:10px; }
  .top-button { padding-inline:8px; }
  #game { padding:11px; }
  .welcome { grid-template-columns:minmax(0,1fr); min-height:0; margin:5px auto; }
  .welcome-art { min-height:0; height:min(71vw,360px); background-position:center 24%; border:0; border-bottom:2px solid var(--gold); }
  .welcome-side { padding:18px 23px 21px; }
  .welcome h1 { margin-top:7px; font-size:2.73rem; }
  .welcome-side p { margin:10px 0 13px; max-width:none; }
  .home-meta { margin-top:4px; }
  .game-grid { grid-template-columns:minmax(0,1fr); }
  .game-grid .board-column { display:none; }
  .mobile-route { display:block; margin-bottom:9px; }
  .route-header { display:flex; align-items:center; justify-content:space-between; color:#f9ecc9; font-size:.88rem; font-weight:750; }
  .route-tiles { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; }
  .route-tile { position:relative; min-height:55px; border-radius:6px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2px; font-size:.74rem; font-weight:740; text-align:center; color:#2d392b; min-width:0; padding:2px; }
  .route-tile .goods-icon,.route-tile .event-icon { width:23px; height:23px; }
  .route-current { outline:2px solid #efb95f; outline-offset:-2px; }
  .route-tile .marker { position:absolute; top:2px; right:2px; width:14px; height:14px; border-radius:3px; }
  .mobile-log { display:block; color:#f9ecc9; text-align:right; }
  .status-bar { margin-bottom:4px; align-items:center; }
  .scores { gap:3px; }
  .score { padding:3px 5px; min-height:33px; gap:4px; }
  .score .marker { width:13px; height:13px; }
  .score strong,.score span:not(.marker) { font-size:.73rem; }
  .round-info { gap:5px; }
  .round-info strong { font-size:.84rem; }
  .round-clock { width:25px; height:25px; font-size:1rem; }
  .round-dots { gap:2px; }
  .round-dots i { width:4px; height:4px; }
}
@media (min-width:761px) and (max-width:1000px) {
  .game-grid { grid-template-columns:minmax(0,1.22fr) minmax(300px,1fr); gap:13px; }
  .tile-label { font-size:.52rem; }
}
@media (max-width:380px) {
  .brand { gap:3px; }
  .brand .awning { width:26px; height:26px; }
  .top-button { font-size:.78rem; padding-inline:5px; }
  .round-clock { display:none; }
  .move-text span { font-size:.76rem; }
}
.language-select { color:#f8e9c2; background:#1b4335; border:1px solid #667857; min-height:42px; border-radius:7px; padding:4px 7px; font:inherit; font-size:.875rem; font-weight:650; }
.language-select:focus-visible { outline:3px solid #e7af45; outline-offset:3px; }
.top-inner .brand { min-width:0; }
.tile-label { overflow-wrap:anywhere; }
@media (max-width:760px) {
  .language-select { max-width:87px; }
  .top-actions { gap:4px; }
  .route-tile > span { overflow-wrap:anywhere; }
}
@media (max-width:390px) {
  .language-select { max-width:80px; font-size:.76rem; padding-inline:4px; }
}
.top-inner { padding-left:max(clamp(10px,4vw,36px),env(safe-area-inset-left)); padding-right:max(clamp(10px,4vw,36px),env(safe-area-inset-right)); }
.topbar { padding-top:env(safe-area-inset-top); }
#game { padding-bottom:max(clamp(11px,3vw,28px),env(safe-area-inset-bottom)); }
.settings-button { display:inline-flex; align-items:center; gap:5px; }
.settings-button span:first-child { font-size:1.15rem; line-height:1; }
.settings-dialog .setting-row { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:57px; border-bottom:1px solid #e6d7b5; font-weight:700; }
.settings-dialog .language-select { max-width:none; min-width:105px; }
.settings-dialog .setting-toggle { min-width:94px; }
.settings-dialog .action-buttons { margin-top:17px; }
.game-inventory { display:flex; flex-direction:column; gap:12px; }
.phone-panels { display:none; }
@media (max-width:760px) {
  .settings-button { min-width:42px; justify-content:center; }
  #settings-label { display:none; }
  .in-match .bottom { display:none; }
  .in-match .top-inner { min-height:50px; }
  .phone-panels { display:flex; gap:6px; }
  .phone-panel { flex:1; color:#f8eaca; background:#1b4335; border:1px solid #698063; border-radius:7px; padding:6px; font-size:.86rem; font-weight:730; min-height:42px; }
  .phone-panel[aria-pressed=true] { background:#eed9a5; color:#234736; border-color:#cca66a; }
  .game-grid[data-phone-panel=turn] .basket-section,
  .game-grid[data-phone-panel=orders] .basket-section { display:none; }
  .game-grid[data-phone-panel=basket] .basket-section { order:-1; }
  .play-column { gap:8px; }
  .turn-body { padding:9px 11px; }
  .turn-body p { margin:2px 0 7px; }
  .turn-body .last-action { margin-top:8px; padding-top:6px; }
  .route-tile { min-height:48px; }
}
@media (max-width:360px) {
  .top-inner .brand { gap:1px; }
  .brand { font-size:1rem; }
  .top-button { min-height:39px; padding-inline:5px; }
}
@media (min-width:761px) and (max-height:510px) and (pointer:coarse) {
  .in-match .top-inner { min-height:45px; }
  .in-match #game { padding:10px; }
  .in-match .market-board { max-width:calc(100dvh - 105px); }
  .in-match .game-grid { grid-template-columns:minmax(0,1.1fr) minmax(290px,1fr); gap:12px; }
}
.tv-mode .top-inner { max-width:1500px; }
.tv-mode #game { max-width:1500px; padding:20px max(3.2vw,24px) 25px; }
.tv-mode .top-inner,.tv-mode .bottom { padding-inline:max(3.2vw,24px); }
.tv-mode .game-grid { grid-template-columns:minmax(0,1.26fr) minmax(295px,1fr); gap:20px; }
.tv-mode .game-grid .board-column { display:block; }
.tv-mode .game-grid .market-board { width:min(100%,calc(100vh - 150px)); margin-inline:auto; }
.tv-mode .mobile-route,.tv-mode .phone-panels,.tv-mode .mobile-log { display:none; }
.tv-mode .game-inventory .orders-section,.tv-mode .game-inventory .basket-section { display:block; }
.tv-mode .tile-label { font-size:clamp(.53rem,1vw,.88rem); }
.tv-mode .button,.tv-mode .choice { min-height:49px; }
.tv-mode button:focus,.tv-mode select:focus,.tv-mode a:focus { outline:4px solid #ffd46b; outline-offset:3px; position:relative; z-index:2; }
.tv-mode .tile:focus { outline-offset:-4px; background:#ffe08b; }
.tv-mode .welcome { margin-top:0; }
@media (max-width:700px) {
  .tv-mode .game-grid { grid-template-columns:minmax(0,1fr); }
  .tv-mode .game-grid .board-column { display:none; }
  .tv-mode .mobile-route,.tv-mode .phone-panels,.tv-mode .mobile-log { display:flex; }
  .tv-mode .mobile-route { flex-direction:column; }
  .tv-mode .game-grid[data-phone-panel=turn] .basket-section,
  .tv-mode .game-grid[data-phone-panel=orders] .basket-section { display:none; }
}
@media (max-width:760px) and (max-height:690px) {
  .welcome-art { height:min(67vw,36vh); height:min(67vw,36dvh); }
  .welcome-side { padding-block:14px; }
  .welcome h1 { font-size:clamp(2rem,8vw,2.7rem); }
  .in-match #game { padding-top:7px; }
  .in-match .top-inner { min-height:46px; }
  .route-header .text-button { min-height:31px; }
  .route-tile { min-height:43px; }
  .turn-body .last-action { margin-top:5px; padding-top:4px; }
  .phone-panel { min-height:37px; }
  .orders-section,.basket-section { padding:7px; }
  .mobile-log .text-button { min-height:30px; }
}

@media (max-width:760px) {
  .game-grid[data-phone-panel=orders] .turn-panel,
  .game-grid[data-phone-panel=basket] .turn-panel { display:none; }
  .phone-history { flex:0 0 42px; }
  .turn-body .last-action { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
  .status-bar { display:grid; grid-template-columns:minmax(0,1fr); gap:4px; }
  .status-bar .scores { justify-content:stretch; }
  .status-bar .score { flex:1; min-width:0; }
}
@media (min-width:701px) {
  .tv-mode .game-grid .turn-panel,.tv-mode .game-grid .orders-section,.tv-mode .game-grid .basket-section { display:block; }
  .tv-mode .game-grid .game-inventory { display:flex; }
}

.brand-initials,.compact-score { display:none; }
.brand .brand-wordmark { overflow:hidden; text-overflow:ellipsis; }
@media (max-width:760px) and (orientation:portrait) {
  .at-home:not(.tv-mode) body { min-height:100vh; min-height:100dvh; }
  .at-home:not(.tv-mode) .top-inner { min-height:52px; gap:8px; }
  .at-home:not(.tv-mode) .brand { gap:6px; }
  .at-home:not(.tv-mode) .brand-wordmark { font-size:1rem; line-height:.98; overflow:visible; }
  .at-home:not(.tv-mode) .brand-wordmark span { display:block; }
  .at-home:not(.tv-mode) .top-actions { flex-shrink:0; }
  .at-home:not(.tv-mode) .top-button { min-height:44px; }
  .at-home:not(.tv-mode) .bottom { display:none; }
  .at-home:not(.tv-mode) #game { display:flex; padding:0; }
  .at-home:not(.tv-mode) .welcome {
    display:flex; flex:1; flex-direction:column; min-width:0;
    margin:0; border:0; border-radius:0; box-shadow:none; background:#173d30;
  }
  .at-home:not(.tv-mode) .welcome-art {
    flex:1; min-height:105px; height:auto; border:0;
    background:#416950 var(--home-art) center 53% / cover no-repeat;
  }
  .at-home:not(.tv-mode) .welcome-side {
    align-items:center; gap:8px; margin-top:-1px; text-align:center;
    border-top:2px solid var(--gold); border-radius:20px 20px 0 0;
    padding:clamp(10px,2.1dvh,22px) max(16px,env(safe-area-inset-right))
      max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
  }
  .at-home:not(.tv-mode) .welcome .kicker { display:none; }
  .at-home:not(.tv-mode) .welcome h1 {
    font-size:clamp(2.35rem,9.3vw,4.6rem); margin:0; line-height:.9;
  }
  .at-home:not(.tv-mode) .welcome-side p {
    max-width:42ch; margin:2px 0; line-height:1.35;
  }
  .at-home:not(.tv-mode) .welcome-side .button {
    width:min(100%,420px); margin:0; overflow-wrap:anywhere;
  }
  .at-home:not(.tv-mode) .home-meta { margin:0; font-size:.8rem; }
}
@media (max-width:760px) and (orientation:portrait) and (max-height:640px) {
  .at-home:not(.tv-mode) .welcome-side { gap:6px; }
  .at-home:not(.tv-mode) .welcome h1 { font-size:clamp(2.05rem,8.5vw,3rem); }
  .at-home:not(.tv-mode) .welcome-side p { font-size:.9rem; }
}
@media (max-width:760px) and (orientation:portrait) {
  html.in-match:not(.tv-mode) { background:#173d30; }
  html.in-match:not(.tv-mode) body { min-height:100vh; min-height:100dvh; }
  .in-match:not(.tv-mode) #game {
    display:flex; flex-direction:column; padding:0;
  }
  .in-match:not(.tv-mode) .game-shell {
    flex:1; display:flex; flex-direction:column; width:100%;
  }
  .in-match:not(.tv-mode) .topbar { background:#12382d; }
  .in-match:not(.tv-mode) .top-inner { gap:8px; min-height:52px; }
  .in-match:not(.tv-mode) .top-actions { flex-shrink:0; }
  .in-match:not(.tv-mode) .top-button { min-height:44px; }
  .in-match:not(.tv-mode) .status-bar {
    display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap;
    gap:6px; margin:0; padding:8px 11px; background:#184436; box-shadow:0 2px 6px #081c1730;
  }
  .in-match:not(.tv-mode) .status-bar .scores { gap:4px; flex:1; min-width:0; }
  .in-match:not(.tv-mode) .status-bar .score { border-color:#547760; background:#17382e; }
  .in-match:not(.tv-mode) .status-bar .score.active { border-color:#edc477; background:#315845; }
  .in-match:not(.tv-mode) .round-info strong { white-space:nowrap; }
  .in-match:not(.tv-mode) .mobile-route {
    flex:1 0 clamp(126px,27vh,360px); flex-basis:clamp(126px,27dvh,360px);
    min-height:126px; display:flex; flex-direction:column; justify-content:space-between;
    position:relative; isolation:isolate; margin:0; padding:9px 10px 12px;
    background:#416950 var(--market-art) center 53% / cover no-repeat;
  }
  .in-match:not(.tv-mode) .mobile-route::before {
    content:""; position:absolute; inset:0; z-index:-1;
    background:linear-gradient(180deg,#0b291ccb 0%,transparent 34%,transparent 56%,#102d23de 100%);
  }
  .in-match:not(.tv-mode) .route-header { color:#fff9e7; gap:7px; }
  .in-match:not(.tv-mode) .route-header > span,
  .in-match:not(.tv-mode) .route-header .text-button {
    background:#12392ddd; border:1px solid #d5bb7f; border-radius:20px; padding:4px 10px;
  }
  .in-match:not(.tv-mode) .route-header .text-button { min-height:36px; }
  .in-match:not(.tv-mode) .route-tiles { align-items:stretch; gap:5px; }
  .in-match:not(.tv-mode) .route-tile {
    border:1px solid #d7bc85; border-radius:9px; min-height:51px; padding:4px 2px;
    box-shadow:0 3px 4px #17291b60;
  }
  .in-match:not(.tv-mode) .route-current { outline:3px solid #ffd678; outline-offset:-2px; }
  .in-match:not(.tv-mode) .route-tile .marker { width:17px; height:17px; }
  .in-match:not(.tv-mode) .game-grid {
    display:block; padding:11px 11px max(9px, env(safe-area-inset-bottom));
    background:radial-gradient(ellipse at 50% 0,#fdf5db,#f7e9c9);
    border-top:2px solid #d5aa64; border-radius:17px 17px 0 0; margin-top:-1px; position:relative;
  }
  .in-match:not(.tv-mode) .play-column { gap:8px; }
  .in-match:not(.tv-mode) .phone-panels { order:3; gap:3px; padding:4px; border-radius:12px; background:#153d2f; }
  .in-match:not(.tv-mode) .phone-panel { border:0; min-height:44px; background:transparent; color:#f9edce; }
  .in-match:not(.tv-mode) .phone-panel[aria-pressed=true] { background:#f4dfaa; color:#163f30; }
  .in-match:not(.tv-mode) .phone-history { flex:0 0 39px; }
  .in-match:not(.tv-mode) .turn-panel { border-radius:12px; box-shadow:0 3px 9px #8f683f36; }
  .in-match:not(.tv-mode) .turn-top { background:#eee2bc; }
  .in-match:not(.tv-mode) .turn-body .primary { flex:1; }
  .in-match:not(.tv-mode) .roll-row .primary { flex:1; }
  .in-match:not(.tv-mode) .turn-body .action-buttons { gap:7px; }
  .in-match:not(.tv-mode) .orders-section,.in-match:not(.tv-mode) .basket-section { box-shadow:0 3px 9px #8f683f36; }
  .in-match:not(.tv-mode) .basket-chip { padding:5px 1px; font-size:.95rem; }
}
@media (max-width:460px) and (orientation:portrait) {
  .in-match:not(.tv-mode) .brand-wordmark { display:none; }
  .in-match:not(.tv-mode) .brand-initials { display:inline; font-size:1.04rem; letter-spacing:.03em; }
  .in-match:not(.tv-mode) .status-bar .score { justify-content:center; padding:3px; }
  .in-match:not(.tv-mode) .status-bar .score-details,
  .in-match:not(.tv-mode) .status-bar .score .marker { display:none; }
  .in-match:not(.tv-mode) .compact-score { display:flex; align-items:center; gap:3px; min-width:0; }
  .in-match:not(.tv-mode) .score .score-initial {
    background:var(--player); color:#fff7dc; display:grid; place-items:center;
    border-radius:4px; font-weight:800; min-width:21px; height:21px; padding:0 2px;
  }
  .in-match:not(.tv-mode) .score .score-stars { color:#ffe7ab; white-space:nowrap; font-size:.72rem; }
}
@media (max-width:760px) and (orientation:portrait) and (max-height:690px) {
  .in-match:not(.tv-mode) .top-inner { min-height:47px; }
  .in-match:not(.tv-mode) .status-bar { padding-block:5px; }
  .in-match:not(.tv-mode) .mobile-route { flex-basis:104px; min-height:104px; padding-top:6px; padding-bottom:8px; }
  .in-match:not(.tv-mode) .route-header .text-button { min-height:30px; }
  .in-match:not(.tv-mode) .route-tile { min-height:43px; }
  .in-match:not(.tv-mode) .game-grid { padding-top:8px; }
  .in-match:not(.tv-mode) .phone-panel { min-height:40px; }
  .in-match:not(.tv-mode) .turn-top { min-height:33px; }
  .in-match:not(.tv-mode) .turn-body h2 { font-size:1.26rem; }
  .in-match:not(.tv-mode) .turn-body p { font-size:.88rem; }
}

/* The TV board takes its size from the viewport height so the entire route stays visible. */
.tv-fullscreen,.tv-board-context { display:none; }
@media (min-width:761px) and (orientation:landscape) {
  html.tv-mode {
    font-size:clamp(12px,1.67vh,36px);
    --tv-gutter:max(2.4vw,env(safe-area-inset-left),env(safe-area-inset-right));
    --tv-board-side:min(79vh,54vw,calc(100vw - 33rem));
    --tv-board-footer:2.55rem;
    --tv-spacing:clamp(10px,1.35vh,28px);
  }
  .tv-mode body { min-height:100vh; min-height:100dvh; }
  .tv-mode .topbar { background:#102f26; }
  .tv-mode .top-inner {
    max-width:none; min-height:6.4vh; padding-inline:var(--tv-gutter);
  }
  .tv-mode .brand { font-size:1.55rem; gap:.65rem; }
  .tv-mode .awning { width:2.15rem; height:2.15rem; }
  .tv-mode .top-actions { gap:.45rem; }
  .tv-mode .top-button { min-height:2.35rem; padding:.3rem .8rem; font-size:.95rem; }
  .tv-mode .tv-fullscreen:not([hidden]) { display:inline-block; }
  .tv-mode .bottom { display:none; }
  .tv-mode #game {
    display:flex; flex-direction:column; max-width:none;
    padding:var(--tv-spacing) var(--tv-gutter) max(.45rem,env(safe-area-inset-bottom));
  }
  .tv-mode .game-shell { flex:1; min-width:0; }
  .tv-mode .status-bar {
    min-height:5.4vh; margin:0 0 var(--tv-spacing); padding:.25rem .7rem;
    gap:1rem; border:1px solid #5b7d60; border-radius:.6rem; background:#1b483a;
  }
  .tv-mode .round-info { gap:.6rem; }
  .tv-mode .round-info strong { font-size:1.06rem; }
  .tv-mode .round-clock { width:2.15rem; height:2.15rem; font-size:1.65rem; }
  .tv-mode .round-dots { gap:.24rem; margin-top:.22rem; }
  .tv-mode .round-dots i { width:.34rem; height:.34rem; }
  .tv-mode .scores { gap:.4rem; }
  .tv-mode .score { min-height:2.25rem; padding:.15rem .65rem; gap:.45rem; }
  .tv-mode .score.active { border-color:#f4cd75; background:#30634e; }
  .tv-mode .score strong,.tv-mode .score span:not(.marker) { font-size:.85rem; line-height:1.12; }
  .tv-mode .score .marker,.tv-mode .turn-top .marker { width:1.35rem; height:1.35rem; }
  .tv-mode .game-grid {
    grid-template-columns:minmax(0,1fr) var(--tv-board-side) minmax(0,1fr);
    grid-template-areas:"inventory board turn" "inventory board context";
    grid-template-rows:auto minmax(0,1fr);
    gap:var(--tv-spacing); align-items:stretch;
  }
  .tv-mode .game-grid .board-column { grid-area:board; min-width:0; }
  .tv-mode .game-grid .play-column { display:contents; }
  .tv-mode .game-grid .game-inventory { grid-area:inventory; }
  .tv-mode .game-grid .turn-panel { grid-area:turn; }
  .tv-mode .game-grid .market-board { width:100%; max-width:none; border-width:.27rem; }
  .tv-mode .board-sign { font-size:clamp(1.25rem,3.8vh,2.4rem); }
  .tv-mode .tile-label { font-size:.74rem; hyphens:auto; }
  .tv-mode .tile { gap:.12rem; }
  .tv-mode .tile > .goods-icon,.tv-mode .tile > .event-icon { max-width:2.25rem; max-height:2.25rem; }
  .tv-mode .tile-markers .marker { width:1rem; height:1rem; }
  .tv-mode .board-foot {
    min-height:var(--tv-board-footer); margin-top:0; gap:.5rem;
    font-size:.83rem;
  }
  .tv-mode .board-foot .text-button { min-height:2.15rem; font-size:.88rem; }
  .tv-mode .play-column,.tv-mode .game-inventory { gap:var(--tv-spacing); }
  .tv-mode .game-inventory,.tv-mode .orders-section { flex:1; min-width:0; }
  .tv-mode .game-grid .orders-section { display:flex; flex-direction:column; }
  .tv-mode .turn-panel,.tv-mode .orders-section,.tv-mode .basket-section {
    border-width:.1rem; border-radius:.75rem;
  }
  .tv-mode .turn-top {
    background:#285443; min-height:2.4rem; padding:.25rem .85rem;
    gap:.4rem; font-size:1rem;
  }
  .tv-mode .turn-panel { background:#173d30; color:#f9edcf; border-color:#6d856a; }
  .tv-mode .turn-top { color:inherit; }
  .tv-mode .turn-body { padding:.65rem .85rem; }
  .tv-mode .turn-body h2 { font-size:1.8rem; line-height:1.05; }
  .tv-mode .turn-body p { margin:.3rem 0 .55rem; line-height:1.25; }
  .tv-mode .turn-body .last-action {
    margin:.6rem 0 0; padding:.45rem 0 0; font-size:.85rem; line-height:1.2;
    color:#e4d4b0; border-color:#537560;
  }
  .tv-mode .button { min-height:2.7rem; font-size:1rem; padding:.4rem .8rem; }
  .tv-mode .button.small img { width:1.25rem; height:1.25rem; }
  .tv-mode .roll-row .primary { flex:1; }
  .tv-mode .move-options { grid-template-columns:minmax(0,1fr); gap:.65rem; }
  .tv-mode .choice {
    min-height:3.55rem; padding:.45rem; gap:.5rem;
    background:#225246; border-color:#65856c; box-shadow:none; color:#fff1d2;
  }
  .tv-mode .choice:hover { background:#2e6351; }
  .tv-mode .choice:focus { background:#f7d984; color:#193d31; }
  .tv-mode .choice .die,.tv-mode .die { width:2.15rem; height:2.15rem; }
  .tv-mode .move-text strong { font-size:1rem; }
  .tv-mode .move-text span,.tv-mode .move-text small { font-size:.83rem; color:inherit; }
  .tv-mode .section-title { margin-bottom:.4rem; }
  .tv-mode .section-title h2 { font-size:1.28rem; }
  .tv-mode .section-title span { font-size:.83rem; }
  .tv-mode .orders-section,.tv-mode .basket-section { padding:.65rem .7rem; }
  .tv-mode .basket { gap:.26rem; }
  .tv-mode .basket-chip { gap:.2rem; padding:.3rem .05rem; font-size:.98rem; }
  .tv-mode .basket-chip img { width:min(1.75rem,100%); height:1.75rem; }
  .tv-mode .tv-board-context {
    grid-area:context; display:block; min-width:0; align-self:start;
    background:var(--paper); border:.1rem solid var(--gold); border-radius:.75rem;
    padding:.65rem .7rem;
  }
  .tv-mode .tv-board-context h2 { font-size:1.28rem; }
  .tv-mode .tv-board-spaces {
    list-style:none; margin:.6rem 0 0; padding:0; display:grid; gap:.4rem;
  }
  .tv-mode .tv-board-spaces li {
    display:flex; align-items:center; gap:.6rem; padding:.55rem; border-radius:.5rem;
  }
  .tv-mode .tv-board-spaces li > .goods-icon,.tv-mode .tv-board-spaces li > .event-icon {
    width:1.8rem; height:1.8rem; flex:none;
  }
  .tv-mode .tv-board-spaces strong,.tv-mode .tv-board-spaces li div span {
    display:block; line-height:1.2; overflow-wrap:anywhere;
  }
  .tv-mode .tv-board-spaces li div span { color:var(--muted); font-size:.83rem; margin-top:.15rem; }
  .tv-mode button:focus,.tv-mode select:focus,.tv-mode a:focus {
    outline:.22rem solid #ffdb75; outline-offset:.12rem;
    box-shadow:0 0 0 .5rem #14392e;
  }
  .tv-mode .tile:focus { outline-offset:-.25rem; box-shadow:inset 0 0 0 .4rem #6d4a20; }
  .tv-mode.at-home .topbar {
    position:absolute; inset:0 0 auto; z-index:2;
    background:transparent; border:0; box-shadow:none;
  }
  .tv-mode.at-home .top-inner { justify-content:flex-end; padding-top:.35rem; }
  .tv-mode.at-home .brand { display:none; }
  .tv-mode.at-home #game { padding:0; }
  .tv-mode .welcome {
    flex:1; position:relative; isolation:isolate; display:flex; align-items:center;
    width:100%; min-height:100vh; min-height:100dvh;
    margin:0; border:0; border-radius:0; box-shadow:none; background:#102d25;
  }
  .tv-mode .welcome-art {
    position:absolute; inset:0; z-index:-1; min-height:0; border:0;
    background:url('./assets/tv-market-panorama-2k.webp') center / cover no-repeat;
  }
  .tv-mode .welcome-art::after {
    content:""; position:absolute; inset:0; pointer-events:none;
    background:linear-gradient(90deg,rgba(8,28,21,.98) 0%,rgba(8,28,21,.9) 22%,rgba(8,28,21,.62) 43%,rgba(8,28,21,.1) 76%,transparent 100%);
  }
  .tv-mode .welcome-side {
    width:min(33vw,34rem); min-width:min(100%,21rem); align-items:stretch;
    margin-inline-start:4.7vw; padding:4.9rem 0 2.8rem; background:transparent;
  }
  .tv-mode .welcome h1 {
    font-size:clamp(3.55rem,10.2vh,6.35rem);
    color:#fff1d2; margin:0; line-height:.92;
    text-shadow:0 .06em .28em #0a241d;
  }
  .tv-mode .welcome-side .kicker,.tv-mode .welcome-side p { display:none; }
  .tv-mode .welcome-side .home-meta {
    order:-1; color:#f4dfb6; font-size:1.05rem; margin:.9rem 0 2.2rem;
  }
  .tv-mode .welcome-side h1 { order:-2; }
  .tv-mode .welcome-side .home-meta b { color:#e7bc6c; }
  .tv-mode .welcome-side .button {
    justify-content:flex-start; min-height:4rem; margin:0 0 .7rem;
    padding:.55rem 1.15rem; background:#143b2f; color:#fff1d2;
    border-color:#69836b; box-shadow:none; font-size:1.26rem;
  }
  .tv-mode .welcome-side .button:hover { background:#235544; }
  .tv-mode .welcome-side .button:focus { background:#f5d686; color:#13382d; border-color:#f5d686; }
  .tv-mode .finish { width:min(100%,55rem); margin:auto; }
  .tv-mode dialog { width:min(90vw,41rem); max-height:90vh; padding:1.15rem; }
  .tv-mode .dialog-close { width:2.3rem; height:2.3rem; }
}


@media (prefers-reduced-motion:no-preference) {
  .button:active,.choice:active { transform:scale(.97); }
  [data-feedback=roll] .choice .die { animation:dice-settle .42s ease-out both; }
  [data-feedback=roll] .choice:nth-child(2) .die { animation-delay:.04s; }
  .changed-grocery,.earned-stars { animation:market-reward .65s ease-out both; }
  [data-feedback=win] .finish { animation:market-reward .7s ease-out both; }
}
@keyframes dice-settle {
  0% { transform:translateY(-13px) rotate(-17deg) scale(.8); opacity:.5; }
  42% { transform:translateY(3px) rotate(12deg) scale(1.09); opacity:1; }
  71% { transform:translateY(-3px) rotate(-6deg); }
  100% { transform:none; }
}
@keyframes market-reward {
  0% { box-shadow:0 0 0 0 #f6c75c; }
  32% { transform:scale(1.06); box-shadow:0 0 0 5px #f6c75cdf; }
  100% { transform:none; }
}

.basket-chip.stocked {
  position:relative;
  background:radial-gradient(ellipse at 50% 34%,#fff5c3 0%,#ece9ba 52%,#dce9c7 100%);
  box-shadow:inset 0 0 0 1px #b3974e;
}
.basket-chip.stocked .basket-count {
  min-width:1.35em; padding:.12em .26em; border-radius:1em;
  background:#26523c; color:#fff2c9;
}
.basket-chip.stocked::after {
  content:""; position:absolute; top:.27em; right:.32em; width:.34em; height:.34em;
  background:#b47720; transform:rotate(45deg); pointer-events:none;
}

.board-dice-roll {
  position:fixed; z-index:4; pointer-events:none; overflow:hidden;
  display:grid; grid-template-columns:repeat(2,auto); align-content:center; justify-content:center;
  gap:calc(var(--die-size) * .49); padding-top:var(--roll-landing-offset);
  --dice-motion:2.7s;
}
.board-dice-roll[hidden] { display:none; }
.rolling-die {
  position:relative; width:var(--die-size); height:var(--die-size);
  perspective:calc(var(--die-size) * 5.2);
  animation:board-die-hop var(--dice-motion) linear both;
  --roll-side:-1; --roll-yaw:-4deg; --roll-twist:-7deg;
}
.roll-die-2 { --roll-side:1; --roll-yaw:4deg; --roll-twist:8deg; }
.rolling-die::before {
  content:""; position:absolute; z-index:-1; top:55%; left:-5%; width:124%; height:62%;
  border-radius:39%;
  background:radial-gradient(ellipse,#1c130cec 6%,#241708b5 49%,#23160808 78%);
  animation:board-die-shadow var(--dice-motion) linear both;
}
.rolling-die::after {
  content:""; position:absolute; z-index:-1; inset:6% -3% -5% 3%; border-radius:16%;
  background:#281b10b5;
  box-shadow:0 .06em .22em .06em #24180cbd;
  transform:rotateZ(var(--roll-twist));
  font-size:var(--die-size);
  animation:board-die-contact var(--dice-motion) linear both;
}
.die-camera,.die-cube,.cube-face { position:absolute; inset:0; }
.die-camera,.die-cube { transform-style:preserve-3d; }
.die-camera { transform:rotateZ(var(--roll-twist)) rotateX(-5deg) rotateY(var(--roll-yaw)); }
.die-cube { animation:board-cube-spin var(--dice-motion) linear both; }
.cube-face {
  --face-depth:calc(var(--die-size) * .5);
  box-sizing:border-box; display:grid; place-items:center;
  grid-template:repeat(3,1fr)/repeat(3,1fr); padding:12%;
  border:1px solid #9a6d3c; border-radius:9%;
  backface-visibility:hidden;
  background:linear-gradient(142deg,#fff7df 12%,#f8e5bb 62%,#ddba81 100%);
  box-shadow:inset .04em .04em .13em #fff9e8,inset -.07em -.08em .12em #a277474d;
  font-size:calc(var(--die-size) * .48);
}
.cube-face-1 { transform:translateZ(var(--face-depth)); }
.cube-face-2 { transform:rotateY(90deg) translateZ(var(--face-depth)); }
.cube-face-3 { transform:rotateX(90deg) translateZ(var(--face-depth)); }
.cube-face-4 { transform:rotateX(-90deg) translateZ(var(--face-depth)); }
.cube-face-5 { transform:rotateY(-90deg) translateZ(var(--face-depth)); }
.cube-face-6 { transform:rotateY(180deg) translateZ(var(--face-depth)); }
.cube-face i {
  width:69%; aspect-ratio:1; border-radius:50%;
  background:radial-gradient(circle at 54% 66%,#33241f 10%,#221610 60%,#160d08 93%);
  box-shadow:inset 0 .025em .04em #110c08,0 .025em 0 #fff1cd;
}
.rolled-number {
  position:absolute; z-index:1; left:50%; bottom:calc(var(--die-size) * -.36);
  min-width:1.55em; padding:.13em .26em; transform:translateX(-50%);
  color:#fff9e6; background:#16392f; border:1px solid #e6be68; border-radius:1em;
  font:800 clamp(.75rem,calc(var(--die-size) * .22),1.45rem)/1.1 system-ui,sans-serif;
  text-align:center; box-shadow:0 .09em .2em #1d170f9c;
  animation:show-rolled-number var(--dice-motion) step-end both;
}
.route-roll .rolling-die { --roll-twist:0deg; }
.route-roll .rolled-number { bottom:calc(var(--die-size) * -.47); }
@keyframes show-rolled-number {
  0% { visibility:hidden; }
  42.5%,100% { visibility:visible; }
}
@media (prefers-reduced-motion:no-preference) {
  .basket-chip.stocked.changed-grocery::before {
    content:""; position:absolute; inset:0; pointer-events:none; border-radius:inherit;
    background:
      radial-gradient(circle at 16% 28%,#fff6a7 0 2px,transparent 3px),
      radial-gradient(circle at 81% 17%,#fffad3 0 3px,transparent 4px),
      radial-gradient(circle at 86% 60%,#ffda7c 0 2px,transparent 3px),
      radial-gradient(circle at 19% 73%,#ffe39b 0 1px,transparent 3px);
    animation:basket-sparkle .66s ease-out both;
  }
}
@media (prefers-reduced-motion:reduce) {
  .board-dice-roll .rolling-die,.board-dice-roll .rolling-die::before,
  .board-dice-roll .rolling-die::after,
  .board-dice-roll .die-cube,.board-dice-roll .rolled-number { animation:none; }
  .die-cube { transform:rotateX(var(--land-x)) rotateY(var(--land-y)); }
}
.dice-resting .rolling-die,.dice-resting .rolling-die::before,
.dice-resting .rolling-die::after,.dice-resting .die-cube,.dice-resting .rolled-number { animation:none; }
.dice-resting .die-cube { transform:rotateX(var(--land-x)) rotateY(var(--land-y)); }
@keyframes basket-sparkle {
  from { opacity:0; transform:scale(.62); }
  27% { opacity:1; }
  to { opacity:0; transform:scale(1.13); }
}
@keyframes board-die-hop {
  0% { transform:translate(calc(var(--roll-side) * 170%),-120%) scale(.66); }
  9% { transform:translate(calc(var(--roll-side) * 111%),-101%) scale(.90); }
  19% { transform:translate(calc(var(--roll-side) * 57%),12%) scale(1.03); }
  28% { transform:translate(calc(var(--roll-side) * 26%),-43%) scale(.98); }
  36% { transform:translate(calc(var(--roll-side) * 7%),6%) scale(1); }
  40% { transform:translate(0,-5%) scale(1); }
  42.5%,100% { transform:translate(0,0) scale(1); }
}
@keyframes board-cube-spin {
  0% { transform:rotateX(calc(var(--land-x) + 540deg)) rotateY(calc(var(--land-y) + var(--roll-side) * 680deg)) rotateZ(-34deg); }
  19% { transform:rotateX(calc(var(--land-x) + 270deg)) rotateY(calc(var(--land-y) + var(--roll-side) * 305deg)) rotateZ(16deg); }
  34% { transform:rotateX(calc(var(--land-x) + 45deg)) rotateY(calc(var(--land-y) + var(--roll-side) * 63deg)) rotateZ(-8deg); }
  40% { transform:rotateX(calc(var(--land-x) - 6deg)) rotateY(calc(var(--land-y) - var(--roll-side) * 8deg)) rotateZ(2deg); }
  42.5%,100% { transform:rotateX(var(--land-x)) rotateY(var(--land-y)) rotateZ(0deg); }
}
@keyframes board-die-shadow {
  0%,9% { opacity:.28; transform:translateY(145%) scale(.85); }
  19% { opacity:.88; transform:translateY(-13%) scale(1); }
  28% { opacity:.40; transform:translateY(60%) scale(.85); }
  36%,100% { opacity:.88; transform:translateY(-5%) scale(1); }
}
@keyframes board-die-contact {
  0%,9% { opacity:0; }
  19% { opacity:.64; }
  28% { opacity:.08; }
  36% { opacity:.75; }
  42.5%,100% { opacity:1; }
}
@keyframes route-die-hop {
  0% { transform:translate(calc(var(--roll-side) * 128%),-55%) scale(.72); }
  19% { transform:translate(calc(var(--roll-side) * 44%),5%) scale(1); }
  28% { transform:translate(calc(var(--roll-side) * 20%),-23%) scale(.98); }
  42.5%,100% { transform:translate(0,0) scale(1); }
}
.route-roll .rolling-die { animation-name:route-die-hop; }

.tv-side-context { display:contents; }
.tv-side-context .tv-board-context,.tv-side-context .active-player { display:none; }

.profile-tabs,.profile-options { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.45rem; }
.profile-tabs { margin:.8rem 0 1rem; }
.profile-tabs .button { padding:.35rem .15rem; line-height:1.15; }
.profile-tabs [aria-pressed="true"] { background:#235544; border-color:#235544; color:#fff5da; }
.player-form > label { display:block; font-weight:700; margin-bottom:.3rem; }
.player-form > input {
  width:100%; min-height:2.65rem; border:1px solid #9d865b; border-radius:.45rem;
  padding:.4rem .65rem; background:#fff9e9; color:#183d31; font:inherit;
}
.player-form input:focus-visible { outline:.2rem solid #946825; outline-offset:.12rem; }
.profile-gallery { margin:.75rem 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem; }
.profile-group h3 { margin:0 0 .28rem; font-size:1rem; }
.avatar-option {
  min-width:0; display:block; padding:.13rem; border:.14rem solid #c8b68d;
  border-radius:.4rem; background:#fff9e9; cursor:pointer;
}
.avatar-option img { display:block; width:100%; height:auto; border-radius:.21rem; }
.avatar-option[aria-pressed="true"] { border-color:#275e47; box-shadow:0 0 0 .12rem #275e47; }
.avatar-option:focus-visible { outline:.2rem solid #946825; outline-offset:.12rem; }
@media (max-width:36rem) {
  .profile-gallery { grid-template-columns:1fr; }
  .profile-options img { max-width:6rem; margin-inline:auto; }
}
@media (min-width:761px) and (orientation:landscape) {
  .tv-mode .tv-side-context {
    grid-area:context; min-width:0; min-height:0; display:flex; flex-direction:column; gap:var(--tv-spacing);
  }
  .tv-mode .tv-side-context .tv-board-context { display:block; align-self:stretch; }
  .tv-mode .tv-side-context .active-player {
    flex:1; min-height:0; min-width:0; margin:0; display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:.5rem; padding:.18rem 0; contain:size;
  }
  .active-player-frame {
    flex:none; width:min(80%,30vh,16rem); aspect-ratio:1;
    border:.2rem solid #dcb875; border-radius:50%; overflow:hidden;
    background:#e9d8a6; box-shadow:0 0 0 .2rem #284d3c, 0 .35rem 1.1rem #0a281e;
  }
  .active-player-frame img { display:block; width:100%; height:100%; object-fit:cover; }
  .active-player figcaption {
    min-width:0; max-width:100%; display:flex; align-items:center; justify-content:center;
    gap:.4rem; padding:.25rem .75rem; border:1px solid #8e8258; border-radius:.4rem;
    color:#fff3ce; background:#1b483a; font:700 clamp(1rem,2.4vh,1.55rem)/1.12 Georgia,serif;
  }
  .active-player figcaption span[dir] { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .active-player .marker { flex:none; width:1.25rem; height:1.25rem; }
  .tv-mode .score { max-width:14vw; }
  .tv-mode .score-details { min-width:0; }
  .tv-mode .score-name { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
}

@media (min-width:761px) and (orientation:landscape) {
  @supports (width:1cqh) {
    .active-player { container-type:size; }
    .active-player-frame { width:min(80cqw,30vh,16rem,max(2.5rem,calc(100cqh - 2.85rem))); }
  }
}


.room-lobby {
  width:min(100%,52rem); margin:clamp(.65rem,5vh,3rem) auto; padding:clamp(.85rem,3vw,2rem);
  border:1px solid #d5ab59; border-radius:.9rem; background:var(--paper); color:var(--ink);
  text-align:center;
}
.room-lobby-label { margin:0; text-transform:uppercase; font-weight:750; letter-spacing:.12em; }
.room-lobby h1 { margin:.12em 0; font-size:clamp(2.2rem,7.8vw,5rem); letter-spacing:.12em; font-variant-numeric:tabular-nums; }
.room-teams { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; margin:.9rem 0; text-align:start; }
.room-team { background:#f7ecd0; border:1px solid #ccac6b; border-radius:.55rem; padding:.75rem; min-width:0; }
.room-team h2 { font-size:1.35rem; margin:0 0 .4rem; }
.room-team ul { padding:0; margin:0; list-style:none; }
.room-team li,.room-seat-preview > div { display:flex; align-items:center; gap:.45rem; font-weight:750; min-width:0; overflow-wrap:anywhere; }
.room-team li + li { margin-top:.4rem; }
.room-team img,.room-seat-preview img { width:2.5rem; height:2.5rem; object-fit:cover; border-radius:50%; border:1px solid #bc9a56; flex:none; }
.room-lobby .action-buttons { justify-content:center; }
.room-form p { margin:.55rem 0; }
.room-code-field { display:grid; gap:.25rem; font-weight:700; margin:.75rem 0; }
.room-code-field input {
  width:min(100%,15rem); padding:.3em .6em; background:#fff7e2; color:#234736; border:1px solid #9a814d;
  border-radius:.45rem; font:700 1.6rem/1.2 system-ui,sans-serif; letter-spacing:.22em;
}
.room-count,.room-seat-preview { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.35rem; margin:.6rem 0; }
.room-seat-preview { grid-template-columns:repeat(2,minmax(0,1fr)); }
.room-count [aria-pressed=true] { background:#245540; color:#fff3d4; border-color:#245540; }
.room-error { color:#8c372b; font-weight:700; }
.room-game-label { color:#f8deb4; font-weight:750; white-space:nowrap; }
.online-match .scores { flex-wrap:wrap; }
.online-match .tile-markers { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
.online-match .tile-markers .marker { width:clamp(.39rem,1vw,.92rem); height:clamp(.39rem,1vw,.92rem); }
@media (min-width:761px) and (orientation:landscape) {
  .tv-mode .welcome-side:has([data-action="rooms"]) { padding-bottom:1.45rem; }
  .tv-mode .online-match .score { max-width:9.5vw; padding-inline:.35rem; }
}
@media (max-width:760px) {
  .online-match .status-bar { flex-wrap:wrap; gap:.32rem; }
  .online-match .scores { width:100%; justify-content:flex-start; }
}
.room-keypad { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:.3rem; max-width:22rem; }
.room-keypad .button { padding-inline:.25rem; }

.coin-art { display:block; object-fit:contain; flex:none; }
.coin-wallet {
  --wallet-coin:clamp(1.28rem,4.2vw,1.75rem);
  min-width:0; border:.12rem solid #b78a40; border-radius:.72rem;
  padding:.46rem .58rem .55rem;
  background:linear-gradient(180deg,#fff1ce,#f3e0af);
  color:#203e2d; box-shadow:inset 0 0 0 1px #fff3d4,0 3px 9px #10281e46;
}
.wallet-heading { display:flex; align-items:baseline; justify-content:space-between; gap:.3rem .6rem; margin-bottom:.36rem; }
.wallet-heading h2 { font-size:clamp(1.05rem,2.4vw,1.28rem); }
.wallet-total { flex:none; color:#644622; font-size:.88rem; font-variant-numeric:tabular-nums; }
.wallet-groups {
  display:flex; flex-wrap:wrap; gap:.28rem .4rem; min-height:calc(var(--wallet-coin) + .55rem);
  padding:.29rem; border:1px solid #264637; border-radius:.42rem;
  background:radial-gradient(ellipse at 42% 0%,#2d5a44,#1a3c30);
  box-shadow:inset 0 .11rem .32rem #0a281e;
}
.wallet-group {
  display:flex; align-items:center; gap:.12rem;
  padding:.14rem .22rem; border:1px solid #7d805984; border-radius:.33rem;
}
.wallet-group .coin-art {
  width:var(--wallet-coin); height:var(--wallet-coin);
  filter:drop-shadow(0 .1rem .1rem #0a241e);
}
.wallet-empty {
  position:relative; isolation:isolate; display:flex; flex-wrap:wrap; align-items:center;
  justify-content:space-between; gap:.3rem .55rem;
  padding:.42rem .52rem;
  border:1px solid #a36939; border-radius:.42rem;
  background:repeating-linear-gradient(130deg,#6a3c2a 0 .45rem,#754230 .45rem .9rem);
  color:#fff1cf;
}
.wallet-empty p {
  margin:0; display:flex; align-items:center; gap:.4rem;
  font-size:.96rem; font-weight:800;
}
.empty-coin { display:inline-grid; place-items:center; flex:none; width:1.3em; height:1.3em; border:2px solid #ffda84; border-radius:50%; }
.empty-coin::after { content:""; width:1em; height:2px; background:#ffda84; transform:rotate(-44deg); }
.empty-coin-wells { display:flex; gap:.2rem; }
.empty-coin-wells i {
  width:clamp(.65rem,1.05vw,1.03rem); aspect-ratio:1;
  border:1px dashed #e6b778; border-radius:50%; background:#4d2e23;
}
@media (prefers-reduced-motion:no-preference) {
  .wallet-empty-pulse::after {
    content:""; position:absolute; z-index:-1; inset:0; border:.14rem solid #f9bc67; border-radius:inherit;
    pointer-events:none; animation:empty-tray-ring .95s ease-out both;
  }
}
@keyframes empty-tray-ring {
  0% { opacity:0; transform:scale(.97); }
  20% { opacity:1; }
  100% { opacity:0; transform:scale(1.055,1.24); }
}
.coin-wallet.wallet-dense { --wallet-coin:1rem; }
.money-event {
  position:relative; background:none; color:#fff6d8; overflow:visible;
}
.money-event .coin-art { width:100%; height:100%; }
.money-event b {
  position:absolute; bottom:-.04rem; right:-.24rem; min-width:1.4em; padding:.12em .17em;
  border:1px solid #fff2cc; border-radius:.3em; background:#27523d; color:inherit;
  text-align:center; font:800 clamp(.48rem,1.05vh,.7rem)/1 system-ui,sans-serif;
}
.money-fee b { background:#7b352a; }
.order-money,.history-money { display:inline-flex; align-items:center; gap:.2rem; }
.order-money .coin-art { width:1.1em; height:1.1em; }
.history-money .coin-art { width:1.35rem; height:1.35rem; }
.coin-change {
  position:fixed; z-index:6; pointer-events:none; display:inline-flex; align-items:center; gap:.18em;
  transform:translateX(-50%); padding:.19em .45em .19em .25em;
  border:1px solid #e4be64; border-radius:2rem;
  background:#1e503a; color:#fff6d4; box-shadow:0 .22rem .7rem #10251c80; font:800 1.15rem/1 system-ui,sans-serif;
}
.coin-change .coin-art { width:1.3em; height:1.3em; }
.coin-spend { background:#67352d; }
@media (min-width:761px) and (orientation:landscape) {
  .tv-mode .coin-wallet { --wallet-coin:clamp(1.25rem,2.15vw,2.35rem); }
  .tv-mode .wallet-heading h2 { font-size:1.28rem; }
  .tv-mode .wallet-total { font-size:1rem; }
  .tv-mode .coin-wallet.wallet-dense { --wallet-coin:clamp(.9rem,1.18vw,1.5rem); }
  .tv-mode .coin-change { font-size:1.55rem; }
}
@media (prefers-reduced-motion:no-preference) {
  .coin-change { animation:coin-change-float 1.5s ease both; }
  .purse-gain { animation:purse-highlight .65s ease-out; }
  .purse-spend { animation:purse-highlight .65s ease-out; --purse-glow:#e89269; }
}
@keyframes coin-change-float {
  0% { opacity:0; transform:translate(-50%,.45rem) scale(.8); }
  20%,69% { opacity:1; transform:translate(-50%,0) scale(1); }
  100% { opacity:0; transform:translate(-50%,-.45rem) scale(.95); }
}
@keyframes purse-highlight {
  25% { box-shadow:0 0 0 .24rem var(--purse-glow,#f5c95a); }
}

@container (max-height:5rem) {
  .active-player .active-player-frame { display:none; }
}
@container (max-height:2.45rem) {
  .active-player figcaption { display:none; }
}

.phone-panel.has-order-progress { border-color:#efc76b; }
.phone-panel.has-order-progress[aria-pressed=false] { color:#fff1b7; }
.coin-gain { color:#fff3bf; border-color:#ffd571; }
.coin-burst { position:absolute; inset:50% auto auto 50%; pointer-events:none; display:none; }
.coin-burst i { position:absolute; width:.34em; height:.34em; background:#ffe9a1; transform:rotate(45deg); box-shadow:0 0 .45em #ffc44d; }
.coin-burst i.coin-ray-token { background:none; box-shadow:none; width:.84em; height:.84em; }
.coin-burst i .coin-art { width:100%; height:100%; filter:drop-shadow(0 .08em .12em #3d2519); }
@media (prefers-reduced-motion:no-preference) {
  .coin-burst { display:block; }
  .coin-burst i { animation:coin-reward-ray .79s ease-out var(--ray-delay) both; }
  .purse-gain { animation:purse-highlight .83s ease-out; }
  .order-step-flash { animation:order-progress-light .82s ease-out; }
  .order-check.new-order-check { animation:grocery-check-pop .52s ease-out; }
}
@keyframes coin-reward-ray {
  0% { opacity:0; transform:translate(0,0) rotate(25deg) scale(.5); }
  24% { opacity:1; }
  73% { opacity:.9; }
  100% { opacity:0; transform:translate(var(--ray-x),var(--ray-y)) rotate(112deg) scale(.83); }
}
@keyframes order-progress-light {
  25% { box-shadow:inset 0 0 0 .16rem #ffe6a2,0 0 .75rem #e8b44a90; }
}
@keyframes grocery-check-pop {
  0% { transform:scale(.7); }
  52% { transform:scale(1.2); box-shadow:0 0 0 .16rem #efd27b; }
  100% { transform:scale(1); }
}

.move-tone-0 { --move-ink:#174b70; --move-edge:#4ea0c6; --move-fill:#cfedfa; }
.move-tone-1 { --move-ink:#67360c; --move-edge:#d39231; --move-fill:#ffe5a0; }
.tile.occupied-tile { box-shadow:inset 0 0 0 2px #947248; }
.tile.current-tile,.in-match .mobile-route .route-current {
  background:#daefb8; color:#204633;
  outline:0; box-shadow:inset 0 0 0 3px #35643e,inset 0 0 0 5px #effbd6;
}
.tile.current-tile .active-cart { outline:2px solid #fff4bb; }
.tile.possible,.mobile-route .route-tile.possible {
  z-index:1; background:var(--move-fill); color:var(--move-ink);
  box-shadow:inset 0 0 0 3px var(--move-edge),inset 0 0 0 5px #fff3dc;
}
.tile.possible:focus,.tile.possible:hover { filter:saturate(1.19); }
.tile.shared-destination { background:linear-gradient(135deg,#cfedfa 0 48%,#ffe5a0 52%); }
.move-count,.journey-count {
  position:absolute; top:.12rem; left:.14rem; display:grid; place-items:center;
  width:1.55em; height:1.55em; border:1px solid #fff7dd; border-radius:50%;
  color:#fff9e6; background:var(--move-ink,#244c35);
  font:800 clamp(.62rem,1.3vw,1.04rem)/1 system-ui,sans-serif;
  font-variant-numeric:tabular-nums;
}
.move-options .choice.move-tone-0,.move-options .choice.move-tone-1 {
  background:var(--move-fill); color:var(--move-ink); border-color:var(--move-edge);
  box-shadow:inset .26rem 0 0 var(--move-edge);
}
.move-options .choice:focus { outline:.2rem solid var(--move-edge); outline-offset:.12rem; }
.move-options .choice .die { border-color:var(--move-edge); }
.move-options .move-text span,.move-options .move-text small { color:inherit; }
.tv-board-spaces .context-current { box-shadow:inset .24rem 0 0 #39724c; }
.tv-board-spaces .context-move { background:var(--move-fill); box-shadow:inset .24rem 0 0 var(--move-edge); }
[data-preview-move="0"] [data-trail~="0"]:not(.possible):not(.current-tile) { background:#d8eef4; box-shadow:inset 0 -.19rem 0 #74b5cb; }
[data-preview-move="1"] [data-trail~="1"]:not(.possible):not(.current-tile) { background:#fae8b6; box-shadow:inset 0 -.19rem 0 #daaa56; }
[data-journey] .turn-panel .action-buttons { pointer-events:none; }
[data-journey] .tile.cart-in-motion:not(.journey-land) { background:#f6edce; box-shadow:none; }
.cart-in-motion .active-cart { visibility:hidden; }
.route-travelling > .route-tiles:not(.journey-strip) { display:none; }
.route-travelling .journey-strip { grid-template-columns:repeat(var(--journey-slots),minmax(0,1fr)); }
.journey-strip .route-tile { min-height:2.9rem; }
.cart-rider {
  position:fixed; z-index:5; pointer-events:none; display:block;
  transform:translate(-50%,-50%); filter:drop-shadow(0 .15rem .16rem #2c201a90);
}
.cart-rider .marker { width:var(--rider-size); height:var(--rider-size); border-radius:25%; }
.tile.journey-origin,.route-tile.journey-origin { box-shadow:inset 0 0 0 3px #49724c; }
.tile.journey-step,.route-tile.journey-step { background:var(--hop-color); box-shadow:inset 0 -3px 0 var(--hop-rim); }
[data-hop-tone="0"] { --hop-color:#cbeed9; --hop-rim:#4c946f; }
[data-hop-tone="1"] { --hop-color:#ffe8a6; --hop-rim:#d19a3e; }
[data-hop-tone="2"] { --hop-color:#efd9ef; --hop-rim:#a770a7; }
.tile.journey-active,.route-tile.journey-active { box-shadow:inset 0 0 0 3px var(--hop-rim); }
.tile.journey-land,.route-tile.journey-land { background:#ffe29a; box-shadow:inset 0 0 0 4px #b77524; }
@media (prefers-reduced-motion:no-preference) {
  .journey-active .journey-count { animation:journey-number .28s ease-out both; }
  .tile.journey-land,.route-tile.journey-land { animation:journey-landing .34s ease both; }
}
@keyframes journey-number {
  0% { opacity:0; transform:translateY(.3em) scale(.5); }
  60% { transform:scale(1.17); }
  100% { opacity:1; transform:none; }
}
@keyframes journey-landing {
  30% { filter:brightness(1.16); }
}

.move-distance {
  display:flex; align-items:center; gap:.3rem; padding-right:.18rem;
  color:inherit; font:800 clamp(1.05rem,2.1vh,1.35rem)/1 system-ui,sans-serif;
}
.move-text strong > span[aria-hidden] { font:inherit; }
.move-count-voice {
  position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap;
}
.turn-panel .turn-body { position:relative; }
.journey-tally {
  position:absolute; inset:0; z-index:2; display:grid; place-content:center; gap:.18rem;
  pointer-events:none; text-align:center; color:#204332; background:#fff4d8;
}
.tv-mode .journey-tally { color:#fff1c8; background:#173d30; }
.journey-tally span { font-weight:750; font-size:clamp(.95rem,2.1vh,1.2rem); }
.journey-tally strong { font:800 clamp(1.75rem,4.1vh,2.8rem)/1.08 system-ui,sans-serif; }
.journey-tally small { font-size:.65em; opacity:.72; }
.journey-count { font-size:clamp(.72rem,1.45vw,1.22rem); }

[data-purchase] .turn-panel .action-buttons { pointer-events:none; }
.purchase-receipt-host { position:relative; }
.grocery-flight {
  position:fixed; z-index:6; display:grid; place-items:center; pointer-events:none;
  width:clamp(2rem,4.2vw,3.8rem); aspect-ratio:1; border-radius:50%;
  border:2px solid #e8ad50; background:#fff4d8; box-shadow:0 .24rem .75rem #17352880;
  transform:translate(-50%,-50%);
}
.grocery-flight .goods-icon { width:82%; height:82%; }
.order-check.purchase-pending {
  color:transparent; background:#fff4d7; border-color:#967242;
}
.purchase-receipt {
  position:absolute; inset:0; z-index:2; display:grid; align-content:center; gap:.3rem;
  padding:.55rem .65rem; background:#fff3d4; color:#204332; pointer-events:none;
}
.purchase-receipt-row {
  display:flex; align-items:center; gap:.4rem; min-width:0;
  border:1px solid #d5bc83; border-radius:.4rem; padding:.25rem .4rem; background:#fffaea;
}
.purchase-receipt-row .goods-icon { width:1.55rem; height:1.55rem; }
.purchase-receipt-row strong { margin-right:.35rem; }
@media (prefers-reduced-motion:no-preference) {
  .purchase-stall-hit { animation:purchase-stall-clink .57s ease-out; }
  .purchase-basket-hit { animation:purchase-basket-nudge .58s cubic-bezier(.2,.7,.25,1); }
  .purchase-check-ink .check-ink { animation:purchase-ink .34s cubic-bezier(.28,.65,.42,1) both; }
}
@keyframes purchase-stall-clink {
  28% { background:#fff0aa; box-shadow:inset 0 0 0 2px #c28932,0 0 .45rem #e8ad5066; }
}
@keyframes purchase-basket-nudge {
  28% { transform:translateY(.14rem) scale(1.05,.94); }
  62% { transform:translateY(-.1rem); }
}
@keyframes purchase-ink {
  0% { clip-path:inset(0 100% 0 0); }
  100% { clip-path:inset(0 0 0 0); }
}

.orders-section { container:order-roster / inline-size; }
.orders {
  display:grid; grid-template-columns:minmax(0,1fr); align-content:start;
  grid-auto-rows:min-content; gap:.42rem;
}
.player-paper {
  --list-font:clamp(.88rem,4.7cqw,1.3rem);
  --list-icon:clamp(1.35rem,7.3cqw,2rem);
  --list-check:clamp(.84rem,5cqw,1.17rem);
  display:flex; flex-direction:column; min-width:0; border:1px solid var(--player); border-radius:.52rem;
  color:#193a28; overflow:hidden;
  background:linear-gradient(90deg,#fff1ce 42%,#fff1cde0 66%,#fff1cda8 100%),
    #fff1ce url('./assets/order-market.webp') no-repeat right center / auto 100%;
  box-shadow:0 1px 2px #442e1c3b;
}
.player-paper.active-paper { outline:2px solid #dca437; outline-offset:0; }
.paper-player {
  background:linear-gradient(#0002,#0002),var(--player); color:#fff9e6; display:flex; align-items:center;
  gap:.32rem; padding:.19rem .43rem; min-width:0;
}
.paper-player .marker { width:1.13rem; height:1.13rem; border-color:#fff1cead; outline:0; }
.paper-player h3 {
  flex:1; min-width:0; font:700 clamp(1.02rem,2.1vh,1.25rem)/1.07 Kalam,"Segoe Print",Georgia,serif;
  color:inherit; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:0;
}
.paper-turn {
  flex:none; border-radius:.7rem; color:#274332; background:#fff0bd;
  padding:.07rem .34rem; font-size:.65rem; font-weight:800;
}
.player-order-groups {
  display:grid; grid-template-columns:minmax(0,1fr); flex:1;
  padding:.22rem .42rem .28rem; gap:.22rem;
}
.order-card { display:grid; min-width:0; border-radius:.21rem; }
.order-card + .order-card { border-top:1px solid #ba8f534d; padding-top:.14rem; }
.order-content {
  display:grid; grid-template-rows:auto minmax(min-content,1fr) auto; gap:.14rem; color:#183c27;
}
.order-heading { display:flex; align-items:center; justify-content:space-between; line-height:1; font-weight:750; }
.order-short-label { display:none; }
.checklist-count { font-size:.88rem; font-variant-numeric:tabular-nums; }
.order-stars { white-space:nowrap; font:700 .69rem/1 Georgia,serif; color:#79521a; }
.order-goods { display:grid; gap:.1rem; list-style:none; margin:0; padding:0; }
.order-item {
  display:grid; grid-template-columns:var(--list-icon) minmax(0,1fr) auto; align-items:center;
  gap:.24rem; min-width:0; font:700 var(--list-font)/1.04 Kalam,"Segoe Print",Georgia,serif;
}
.order-good-name { overflow-wrap:anywhere; }
.order-item > .goods-icon { display:block; width:var(--list-icon); height:var(--list-icon); }
.order-item-checks { display:flex; gap:.15rem; }
.order-item .order-check {
  flex:none; width:var(--list-check); height:var(--list-check);
  font-size:calc(var(--list-check) * .85); box-shadow:0 0 0 1px #fff3d4;
}
.order-progress { display:flex; gap:.12rem; margin:.05rem 0 0; }
.order-progress i { flex:1; height:.14rem; border-radius:.18rem; background:#ccae7c; }
.order-progress .filled { background:#46754a; }
.order-ready .order-progress .filled { background:#26724c; }
.order-close .order-progress .filled { background:#96631f; }
.ready-label { color:#24583d; margin:.04rem 0 0; font-size:.68rem; line-height:1.05; }
.order-close .ready-label { color:#704613; }
.paper-empty { font-size:.83rem; margin:.23rem 0; }
.many-roster .paper-player { padding:.13rem .38rem; }
.many-roster .paper-player h3 { font-size:1.02rem; }
.many-roster .paper-player .marker { width:.95rem; height:.95rem; }
.many-roster .player-paper:not(.active-paper) .ready-label {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
@container order-roster (min-width:20rem) {
  .many-roster .orders { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .many-roster .player-paper {
    --list-font:clamp(.82rem,3.8cqw,1.13rem);
    --list-icon:clamp(1.16rem,5.55cqw,1.53rem);
    --list-check:clamp(.77rem,3.8cqw,1rem);
  }
  .many-roster .paper-turn { display:none; }
}
@container order-roster (min-width:27rem) {
  .medium-roster .orders { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .medium-roster .player-paper { --list-font:clamp(.9rem,3.65cqw,1.24rem); }
  .small-roster .player-paper { --list-font:clamp(1.1rem,4.7cqw,1.5rem); }
}
@media (min-width:761px) and (orientation:landscape) {
  .tv-mode .game-grid .orders-section { min-height:0; }
  .tv-mode .single-checklists .orders {
    flex:1; min-height:0; grid-auto-rows:minmax(min-content,1fr);
    overflow:auto; margin:-2px; padding:2px;
  }
  .tv-mode .many-roster .order-money { font-size:.76rem; }
}
@media (min-width:761px) and (max-height:800px) and (orientation:landscape) {
  .tv-mode .many-roster .player-paper { --list-icon:clamp(1.1rem,5.1cqw,1.38rem); }
  .tv-mode .many-roster .player-order-groups { padding-block:.16rem; }
}

.grocery-flight > .coin-art { width:82%; height:82%; }
.purchase-spent { visibility:hidden; }
.purchase-receipt-row > .coin-art { width:1.55rem; height:1.55rem; }
.purchase-receipt-row > .basket-count { margin-inline-start:auto; }
@media (max-width:760px) {
  .purchase-receipt { grid-template-columns:repeat(auto-fit,minmax(min(100%,8.6rem),1fr)); gap:.22rem; }
  .purchase-receipt-row { font-size:.86rem; }
}

.match-formats {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; flex-basis:100%; margin:.65rem 0;
}
.match-formats .button { flex-direction:column; align-items:flex-start; text-align:start; gap:.3rem; padding:.7rem; }
.match-formats small { font-size:.8rem; font-weight:550; }
.match-formats .button[aria-pressed=true] { color:#fff3d2; background:#1b503d; border-color:#cba957; }

.turn-announcement,.delivery-moment {
  position:fixed; z-index:12; left:50%; pointer-events:none;
  box-shadow:0 .65rem 1.7rem #071e16a6; border:2px solid #d5b45e;
}
.turn-announcement {
  display:flex; gap:.58rem; align-items:center; max-width:90vw; top:clamp(4rem,9vh,7rem); transform:translateX(-50%);
  padding:.36rem .9rem .36rem .4rem; border-radius:3rem; background:#193d30; color:#fff1ce;
  box-shadow:inset 0 0 0 2px var(--player),0 .65rem 1.7rem #071e1690;
}
.turn-announcement img,.award-portrait { object-fit:cover; border-radius:50%; flex:none; }
.turn-announcement img { width:3.05rem; height:3.05rem; border:2px solid var(--player); }
.turn-announcement small,.turn-announcement strong { display:block; line-height:1.13; }
.turn-announcement strong { font-family:Georgia,serif; font-size:clamp(1.05rem,3vw,1.55rem); overflow-wrap:anywhere; }
.delivery-moment {
  width:min(80vw,17rem); top:50%; transform:translate(-50%,-50%); text-align:center;
  padding:.7rem .75rem .84rem; border-radius:.9rem; color:#223e2f; background:#fff1d2;
}
.delivery-player { display:flex; justify-content:center; align-items:center; gap:.34rem; overflow-wrap:anywhere; }
.delivery-stage { position:relative; height:6.25rem; isolation:isolate; }
.delivery-bag {
  position:absolute; z-index:1; width:4.2rem; height:3.6rem; bottom:.2rem; left:50%;
  transform:translateX(-50%); display:grid; place-items:center;
  background:linear-gradient(100deg,#c79555 0 14%,#eac48b 15% 95%,#a87539 96%);
  color:#76502c; border-radius:.25rem .25rem .55rem .55rem; box-shadow:0 .24rem .35rem #83613e5c;
}
.delivery-bag i { position:absolute; top:-.23rem; inset-inline:.18rem; height:.5rem; border-radius:50%; background:#986636; }
.delivery-bag b { font-size:1.35rem; margin-top:.26rem; }
.delivery-grocery { display:none; }
.delivery-stamp {
  display:inline-block; padding:.14rem .5rem; border:2px solid currentColor; border-radius:.24rem;
  color:#2b6543; transform:rotate(-5deg); font-family:Kalam,"Segoe Print",Georgia,serif; font-size:1.25rem;
}
.delivery-star { position:fixed; z-index:13; font-size:2rem; color:#ffdf72; text-shadow:0 2px 3px #55320c; pointer-events:none; }
@media (prefers-reduced-motion:no-preference) {
  .turn-announcement { animation:turn-badge 1.55s ease both; }
  .delivery-grocery {
    display:block; position:absolute; left:50%; top:.23rem; font-size:1.5rem;
    animation:bag-grocery .58s var(--bag-delay) ease-in-out both;
  }
  .delivery-grocery > .goods-icon { width:1.55rem; height:1.55rem; display:block; }
  .delivery-stamp { animation:delivery-stamped .38s 1.04s cubic-bezier(.21,.72,.28,1.36) both; }
  .earned-stars { animation:score-landing .46s ease-out; }
}
@keyframes turn-badge {
  0% { opacity:0; transform:translate(-50%,-.5rem); }
  16%,82% { opacity:1; transform:translate(-50%,0); }
  100% { opacity:0; transform:translate(-50%,-.3rem); }
}
@keyframes bag-grocery {
  0% { opacity:0; transform:translate(calc(-50% + var(--bag-x)),.45rem) scale(.8); }
  22% { opacity:1; }
  68% { opacity:1; transform:translate(-50%,2.15rem); }
  100% { opacity:0; transform:translate(-50%,3.4rem) scale(.56); }
}
@keyframes delivery-stamped {
  from { opacity:0; transform:rotate(-11deg) scale(1.36); }
  to { opacity:1; transform:rotate(-5deg) scale(1); }
}
@keyframes score-landing { 44% { box-shadow:0 0 .55rem .18rem #ebc255; } }

.market-awards { margin:1.05rem 0; }
.market-awards h2 { margin:0 0 .45rem; }
.market-awards ul {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));
  gap:.35rem; list-style:none; margin:0; padding:0;
}
.market-awards li {
  display:flex; align-items:center; gap:.55rem; padding:.33rem .56rem; text-align:start;
  background:#faeac6; border:1px solid #d4b37c; border-inline-start:.26rem solid var(--player); border-radius:.4rem;
}
.award-portrait { width:2.3rem; height:2.3rem; border:1px solid var(--player); }
.market-awards li div { flex:1; min-width:0; overflow-wrap:anywhere; }
.market-awards li strong,.market-awards li div span { display:block; line-height:1.13; }
.market-awards li div span { color:#624626; font-size:.83rem; }
.award-icon { color:#825e27; font-size:1.25rem; line-height:1; }
.award-icon > .goods-icon,.award-icon > .coin-art { width:1.38rem; height:1.38rem; }
@media (min-width:761px) and (orientation:landscape) {
  .tv-mode .finish { padding:clamp(1rem,3.8vh,2.4rem); }
  .tv-mode .finish h1 { font-size:clamp(2rem,6.8vh,4.35rem); }
  .tv-mode .finish .scores { margin:.75rem 0; }
}

.room-capacity { font-weight:750; color:#42634c; }
.room-team[aria-current=true] { border-color:#426f51; box-shadow:inset 0 0 0 1px #426f51; }
@media (min-width:761px) and (orientation:landscape) {
  .tv-mode .room-teams { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .tv-mode .room-lobby { margin-block:clamp(.65rem,3vh,2rem); }
  .tv-mode .room-lobby h1 { font-size:clamp(2rem,7.8vh,4.7rem); }
}

.online-match .tile-markers.crowded-tile {
  display:flex; align-items:center; gap:2px; padding:1px;
}
.cart-count {
  padding:0 .23em; border-radius:.3em; background:#174939; color:#fff2cf;
  font:750 .72rem/1.12 system-ui,sans-serif;
}
.large-scores { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:.18rem; }
.large-scores .score { min-width:0; justify-content:center; min-height:1.55rem; padding:.12rem .25rem; gap:.2rem; }
.large-scores .score > .marker { width:.86rem; height:.86rem; flex:none; }
.large-scores .score-details { display:none; }
.large-scores .compact-score { display:flex; align-items:center; gap:.24rem; white-space:nowrap; }
.large-scores .score span:not(.marker) { font-size:.73rem; }
.large-roster .paper-player h3 { font-size:.91rem; }
.large-roster .paper-player .marker { width:.8rem; height:.8rem; }
.large-roster .order-content { grid-template: minmax(0,1fr) auto / minmax(0,1fr) auto; align-items:center; gap:.05rem .21rem; }
.large-roster .order-heading { grid-column:2; grid-row:1; text-align:end; }
.large-roster .order-stars,.large-roster .ready-label { display:none; }
.large-roster .order-progress { grid-column:1/-1; }
.large-roster .order-goods { display:flex; justify-content:space-evenly; gap:.18rem; }
.large-roster .order-item { display:flex; flex-direction:column; gap:.06rem; }
.large-roster .order-item > .goods-icon { width:1.03rem; height:1.03rem; }
.large-roster .order-good-name {
  position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
.large-roster .order-item-checks { gap:.09rem; }
.large-roster .order-item .order-check { width:.48rem; height:.48rem; margin:0; font-size:.46rem; }
.large-roster .player-order-groups { padding:.11rem .25rem .17rem; }
.large-roster .checklist-count { font-size:.68rem; }
@container order-roster (min-width:16rem) {
  .large-roster .orders { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.23rem; }
}
@media (min-width:761px) and (orientation:landscape) {
  .tv-mode .status-bar .large-scores { flex:1; }
  .tv-mode .large-scores .score { max-width:none; min-height:1.25rem; }
}

.match-formats { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width:520px) {
  .match-formats { grid-template-columns:minmax(0,1fr); }
}
[data-match-clock] { font-variant-numeric:tabular-nums; }
.timed-shopping ul {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.28rem;
  padding:0; margin:.35rem 0 0; list-style:none; overflow:auto;
}
.timed-shopping li {
  display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center;
  gap:.07rem .24rem; border:1px solid #d5b879; border-inline-start:.2rem solid var(--player);
  background:#faeac6; padding:.22rem .32rem; border-radius:.36rem; min-width:0;
}
.timed-shopping li[aria-current=true] { border-color:#a66a1e; background:#ffdf91; }
.timed-shopping li strong,.timed-shopping li > span:last-child { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.timed-shopping li .marker { width:.86rem; height:.86rem; }
.timed-shopping li > span:last-child { grid-column:2; font-size:.72rem; color:#563e23; }

.tile.tile-spill,.mobile-route .route-tile.tile-spill,.tv-board-spaces .tile-spill {
  --hazard-edge:#923c39;
  background:#f6c3b4; color:#592421;
}
.tile.tile-spill,.mobile-route .route-tile.tile-spill { box-shadow:inset 0 0 0 2px var(--hazard-edge); }
.tile.tile-spill.possible,.mobile-route .route-tile.tile-spill.possible {
  box-shadow:inset 0 0 0 2px var(--move-edge),inset 0 0 0 4px var(--hazard-edge);
}
.tile.tile-spill.current-tile,.mobile-route .route-tile.tile-spill.route-current {
  box-shadow:inset 0 0 0 2px #35643e,inset 0 0 0 4px var(--hazard-edge);
}
.tile-spill .hazard-icon,.hazard-choice .hazard-icon,.hazard-heading .hazard-icon {
  width:clamp(1.35rem,3.8vw,3rem); height:auto; aspect-ratio:1; flex:none;
  background:#ffe5cb; color:#652a25; border:1px solid #aa5a4a; box-shadow:0 1px 2px #6b292b35;
}
.tile > .hazard-icon { max-height:57%; max-width:76%; }
.route-tile .hazard-icon { width:1.75rem; height:1.75rem; }
.hazard-icon img { display:block; width:94%; height:94%; object-fit:contain; }
.hazard-heading { display:flex; align-items:center; gap:.45rem; }
.move-options .choice.hazard-choice { background:#ffdacc; color:#592421; border-color:#a34b42; }
.move-options .choice.hazard-choice .hazard-icon { width:1.8rem; height:1.8rem; }
.tv-board-spaces .tile-spill strong,.tv-mode .tv-board-spaces li.tile-spill div span { color:#592421; }
.tile.tile-spill::after,.mobile-route .route-tile.tile-spill::after {
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  opacity:.35; box-shadow:inset 0 0 .36rem .18rem #bf4a3866;
}
@media (prefers-reduced-motion:no-preference) {
  .tile.tile-spill::after,.mobile-route .route-tile.tile-spill::after {
    animation:hazard-pulse 2.65s ease-in-out infinite;
  }
  .tile.tile-spill.possible::after,.mobile-route .route-tile.tile-spill.possible::after {
    animation-duration:1.65s;
  }
  .tile.tile-spill .hazard-icon,.mobile-route .route-tile.tile-spill .hazard-icon {
    animation:hazard-icon-beat 2.65s ease-in-out infinite;
  }
}
@keyframes hazard-pulse {
  0%,35%,100% { opacity:.29; }
  21% { opacity:.95; }
  48% { opacity:.67; }
}
@keyframes hazard-icon-beat {
  0%,35%,100% { transform:scale(1); }
  21% { transform:scale(1.08); }
  48% { transform:scale(1.04); }
}

/* Illustrated market theme for the landscape TV board. */
@media (min-width:761px) and (orientation:landscape) {
  .tv-mode.in-match {
    background:linear-gradient(90deg,#103123e8,#142d226e 45%,#102d23eb),
      #153828 url('./assets/tv-market-panorama-2k.webp') center / cover fixed;
  }
  .tv-mode.in-match .status-bar,
  .tv-mode.in-match .turn-panel {
    border:2px solid #d5a24f;
    background:
      repeating-linear-gradient(125deg,#f3d98206 0 1px,transparent 1px 5px),
      linear-gradient(155deg,#275139,#112b21);
    box-shadow:inset 0 0 0 2px #50351d,inset 0 0 0 4px #b67c39,0 .25rem .7rem #0d2019b3;
  }
  .tv-mode.in-match .game-grid {
    grid-template-areas:"inventory board turn" "inventory board basket" "inventory board context";
    grid-template-rows:auto auto minmax(0,1fr);
  }
  .tv-mode.in-match .game-inventory { display:contents; }
  .tv-mode.in-match .game-grid .orders-section { grid-area:inventory; }
  .tv-mode.in-match .game-grid .basket-section { grid-area:basket; }
  .tv-mode.in-match .game-grid .market-board {
    border:.28rem solid #d79b42;
    border-radius:.9rem;
    gap:2px;
    background:#513723;
    box-shadow:0 0 0 2px #6d3b20,0 0 0 4px #e6b056,0 .45rem 1.15rem #102219c9;
  }
  .tv-mode.in-match .board-center { box-shadow:inset 0 0 0 2px #543419; }
  .tv-mode.in-match .board-sign {
    top:auto; bottom:5%; transform:translateX(-50%);
    font-size:clamp(.85rem,2.4vh,1.5rem);
    color:#fff1bc;
    background:#183224ed;
    border:1px solid #f3cb7c;
  }
  .tv-mode.in-match .tile:not(.possible,.current-tile,.occupied-tile,.tile-spill,[data-trail]:not([data-trail=""])) {
    color:#342616;
    border-radius:.32rem;
    background:linear-gradient(145deg,#fff1ce,#f3d390);
    box-shadow:inset 0 0 0 1px #885022,inset 0 0 0 3px #fff3cc;
  }
  .tv-mode.in-match .tile:is(.tile-gate,.tile-tip,.tile-bonus,.tile-sell):not(.possible,.current-tile,.occupied-tile,[data-trail]:not([data-trail=""])) {
    color:#fff4ce;
    background:linear-gradient(145deg,#38684a,#173b29);
    box-shadow:inset 0 0 0 1px #e6bd65,inset 0 0 0 3px #b48238;
  }
  .tv-mode.in-match .tile.tile-fee:not(.possible,.current-tile,.occupied-tile,[data-trail]:not([data-trail=""])) {
    background:linear-gradient(145deg,#e9f6fc,#acd0e6);
    box-shadow:inset 0 0 0 1px #376784,inset 0 0 0 3px #eaf3f8;
  }
  .tv-mode.in-match .turn-top {
    margin:.4rem .42rem 0;
    border:1px solid #c78d36;
    border-radius:.45rem;
    background:linear-gradient(#fff3ca,#efd49b);
    color:#1e3525;
    font:700 clamp(1rem,2.5vh,1.45rem)/1.12 Georgia,serif;
  }
  .tv-mode.in-match .turn-top .marker { width:1.75rem; height:1.75rem; }
  .tv-mode.in-match .turn-panel .primary {
    border-color:#ac702a;
    background:linear-gradient(#fff4c9,#edb84c);
    color:#223621;
    box-shadow:inset 0 0 0 2px #fff0b8,0 2px 0 #77431e;
  }
  .tv-mode.in-match .game-grid .orders-section,
  .tv-mode.in-match .game-grid .basket-section,
  .tv-mode.in-match .tv-side-context .coin-wallet {
    background:linear-gradient(145deg,#fff4d8,#eed49d);
    color:#233c28;
    border:2px solid #b77c33;
    box-shadow:inset 0 0 0 2px #ffedb9,0 .15rem .45rem #0d201970;
  }
  .tv-mode.in-match .player-paper {
    border-color:#ad7637;
    border-radius:.5rem;
    box-shadow:inset 0 0 0 2px #fff0c1,0 1px 3px #50351d50;
  }
  .tv-mode.in-match .player-paper .paper-player {
    border-radius:.32rem;
    margin:.2rem .25rem;
  }
  .tv-mode.in-match .player-paper .paper-player .marker { width:1.45rem; height:1.45rem; }
  .tv-mode.in-match .medium-roster .player-paper {
    display:grid;
    grid-template-columns:minmax(0, .8fr) minmax(0, 1.2fr);
    --list-font:clamp(.76rem,1.8vh,1.1rem);
    --list-icon:clamp(.84rem,2.1vh,1.25rem);
    --list-check:clamp(.7rem,1.65vh,.95rem);
  }
  .tv-mode.in-match .medium-roster .paper-player {
    align-self:start;
    flex-wrap:wrap;
    padding:.3rem;
  }
  .tv-mode.in-match .medium-roster .paper-player h3 { font-size:clamp(.84rem,2vh,1.2rem); }
  .tv-mode.in-match .basket-chip.stocked {
    background:linear-gradient(#f7dfaa,#d6a461);
    border-color:#9c652c;
  }
  .tv-mode.in-match .tv-side-context .active-player { display:none; }
}
