:root{--bg:#031113;--panel:#07251e;--gold:#f6bd2f;--lime:#a6ef52;--text:#f6fff9;--safe-bottom:max(16px,env(safe-area-inset-bottom));font-family:Arial,Helvetica,sans-serif;color-scheme:dark}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#020d10;color:var(--text)}body{overflow-x:hidden;padding-bottom:var(--safe-bottom)}button,a{font:inherit}button{touch-action:manipulation}.topbar{height:74px;padding:0 max(18px,env(safe-area-inset-left)) 0 max(18px,env(safe-area-inset-right));display:flex;align-items:center;justify-content:space-between;background:#021119;border-bottom:1px solid #163d49;gap:12px}.brand{font-weight:1000;font-size:27px;letter-spacing:.03em;white-space:nowrap}.brand b{color:#32bcff}.topnav{display:flex;gap:8px}.topnav a{color:#fff;text-decoration:none;border:1px solid #31566a;border-radius:13px;padding:13px 16px;font-weight:900;font-size:12px;background:#09202e}.game-shell{max-width:1180px;margin:auto;padding:10px}.game-head{display:flex;align-items:center;justify-content:space-between;gap:10px;background:linear-gradient(90deg,#123f23,#0a2e21);border:1px solid #6b7133;border-radius:18px;padding:11px 13px;margin-bottom:9px}.game-title h1{margin:0;color:#ffd96a;font-size:24px;line-height:1}.game-title p{margin:5px 0 0;color:#9cff5d;font-weight:950;letter-spacing:.06em}.mode-row{display:flex;gap:8px}.mode-btn{min-height:54px;border:2px solid #466a71;border-radius:14px;color:white;background:#173b65;padding:7px 14px;font-weight:950}.mode-btn[data-mode="local"]{background:#593180}.mode-btn.active{border-color:#ffe34f;box-shadow:0 0 0 2px rgba(255,227,79,.2)}.board-frame{position:relative;background:#031812;border:3px solid #477667;border-radius:25px;padding:10px;overflow:hidden}.board-inner{position:relative;margin:auto;width:min(100%,860px);aspect-ratio:1010/1034}.board-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;border-radius:15px;display:block}.token-layer{position:absolute;inset:0;pointer-events:none}.token{position:absolute;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;transform:translate(-50%,-50%);border:3px solid #fff;background:linear-gradient(145deg,#1f9ef1,#08376f);font-size:20px;font-weight:1000;box-shadow:0 4px 13px #000,0 0 0 4px #ffe148;transition:left .2s linear,top .2s linear,transform .16s}.token.cpu,.token.p2{background:linear-gradient(145deg,#ef5d57,#771326);box-shadow:0 4px 13px #000,0 0 0 4px #ff7369}.token.bump{transform:translate(-50%,-50%) scale(1.22)}.hud{display:grid;grid-template-columns:1.18fr 1fr 1fr;gap:8px;margin-top:8px}.card{background:linear-gradient(180deg,#0c3425,#07241c);border:1px solid #74652e;border-radius:15px;padding:11px;min-width:0}.label{color:#ffe272;font-size:11px;font-weight:1000;letter-spacing:.08em}.turn-line{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:7px}.turn-name{font-weight:1000;font-size:16px}.turn-space{color:#b6d6c5;font-size:11px;margin-top:3px}.dice{width:62px;height:62px;border-radius:14px;border:2px solid #fff0b9;background:#f1dfb1;color:#1d170c;display:grid;place-items:center;font-size:34px;font-weight:1000;box-shadow:inset 0 -6px 9px rgba(0,0,0,.15)}.roll-btn{width:100%;min-height:64px;border:0;border-radius:14px;background:linear-gradient(#ffc43b,#efa615);color:#231901;font-weight:1000;font-size:18px;margin-top:10px}.roll-btn:disabled{opacity:.6}.status{min-height:34px;margin-top:7px;color:#fff4b9;font-size:12px;font-weight:850}.treasures{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px}.treasure{border:1px solid #2d5945;border-radius:10px;text-align:center;padding:8px 4px;min-height:76px}.treasure .ico{font-size:28px;filter:grayscale(1);opacity:.36}.treasure.found .ico{filter:none;opacity:1}.treasure b{display:block;font-size:8px;margin-top:3px;color:#dfeee6}.progress{margin-top:8px;text-align:center;border:1px solid #6d6029;border-radius:999px;padding:4px;color:#ffd95a;font-weight:1000;font-size:10px}.rival{display:flex;align-items:center;gap:9px;margin-top:10px}.rival-icon{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#811c2a;border:2px solid #ff8879;font-size:22px}.actions{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:8px}.action{min-height:48px;border:1px solid #5d6534;border-radius:12px;background:#0d3326;color:#fff;font-weight:900}.modal{position:fixed;inset:0;z-index:100;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.78)}.modal.open{display:flex}.modal-card{width:min(720px,100%);max-height:88vh;overflow:auto;background:#09281f;border:2px solid #8f7d31;border-radius:20px;padding:17px;box-shadow:0 18px 60px #000}.modal-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.modal h2{margin:0;color:#ffe16b}.close{width:44px;height:44px;border-radius:50%;border:1px solid #8e7940;background:#173f31;color:#fff;font-size:22px}.world-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:9px;margin-top:15px}.world-btn{min-height:72px;text-align:left;border:2px solid #315d4a;border-radius:13px;background:#12392d;color:#fff;padding:10px;font-weight:950}.world-btn.active{border-color:#ffe155;background:#1b4938}.world-btn span{display:block;color:#9dd7bd;font-size:10px;margin-top:4px}.rules{line-height:1.55;color:#e8f5ee}.celebrate{text-align:center}.celebrate .big{font-size:68px}.celebrate h2{font-size:30px}.celebrate p{color:#d7eee2}.copyright{text-align:center;color:#739789;font-size:10px;padding:12px}
@media(max-width:760px){.topbar{height:60px}.brand{font-size:22px}.topnav a{padding:10px 11px;font-size:10px}.game-head{padding:9px}.game-title h1{font-size:20px}.mode-btn{min-height:50px;padding:6px 10px;font-size:10px}.board-frame{padding:5px;border-radius:18px}.board-inner{width:100%;max-width:700px}.token{width:34px;height:34px;font-size:16px;border-width:2px}.hud{grid-template-columns:1.1fr 1fr 1fr}.card{padding:8px}.roll-btn{min-height:58px}.dice{width:52px;height:52px;font-size:28px}.treasure{min-height:60px;padding:5px 2px}.treasure .ico{font-size:22px}.actions{grid-template-columns:repeat(4,1fr)}.action{font-size:10px;min-height:44px}}
@media(max-width:520px){.topnav a:nth-child(2){display:none}.game-head{display:block}.mode-row{margin-top:8px}.mode-btn{flex:1}.hud{display:block}.card{margin-top:7px}.actions{grid-template-columns:repeat(2,1fr)}.world-grid{grid-template-columns:1fr}.token{width:31px;height:31px}.board-inner{max-width:520px}}
@media(orientation:landscape) and (max-height:650px){.topbar{height:46px}.game-shell{padding:5px}.game-head{padding:5px 9px;margin-bottom:4px}.game-title h1{font-size:16px}.game-title p{font-size:10px}.mode-btn{min-height:38px}.board-frame{display:flex;justify-content:center}.board-inner{height:min(68vh,560px);width:auto}.hud{grid-template-columns:1.2fr 1fr 1fr;margin-top:4px}.card{padding:6px}.roll-btn{min-height:43px;margin-top:5px}.actions{margin-top:4px}.action{min-height:36px}.copyright{padding:6px}}


/* v10.12.40 — scaling-only pass. Gameplay/board art intentionally unchanged. */
:root{--tr-vh:100svh;--tr-vw:100vw}
.board-inner{width:min(100%,1010px);max-width:1010px}
@media (min-width:600px){
  html.tr-fit-screen,html.tr-fit-screen body{height:var(--tr-vh);min-height:var(--tr-vh);overflow:hidden}
  html.tr-fit-screen body{display:grid;grid-template-rows:auto minmax(0,1fr) auto;padding-bottom:0}
  html.tr-fit-screen .topbar{min-height:0}
  html.tr-fit-screen .game-shell{width:100%;height:100%;min-height:0;max-width:1280px;padding:clamp(5px,.7vw,10px);display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:0}
  html.tr-fit-screen .game-head{margin-bottom:clamp(4px,.6vh,9px);padding-block:clamp(6px,.8vh,11px)}
  html.tr-fit-screen .board-frame{min-height:0;height:100%;padding:clamp(3px,.45vw,8px);display:grid;place-items:center}
  html.tr-fit-screen .board-inner{width:auto;height:100%;max-width:100%;max-height:100%;aspect-ratio:1010/1034}
  html.tr-fit-screen .hud{margin-top:clamp(4px,.55vh,8px);gap:clamp(5px,.55vw,8px)}
  html.tr-fit-screen .card{padding:clamp(6px,.65vw,10px)}
  html.tr-fit-screen .turn-line{margin-top:4px}
  html.tr-fit-screen .dice{width:clamp(46px,5.4vh,60px);height:clamp(46px,5.4vh,60px);font-size:clamp(25px,3.2vh,33px)}
  html.tr-fit-screen .roll-btn{min-height:clamp(48px,5.5vh,60px);margin-top:6px}
  html.tr-fit-screen .status{min-height:18px;margin-top:4px;line-height:1.15}
  html.tr-fit-screen .treasures{margin-top:5px}
  html.tr-fit-screen .treasure{min-height:clamp(50px,6vh,70px);padding:4px 2px}
  html.tr-fit-screen .treasure .ico{font-size:clamp(20px,2.8vh,27px)}
  html.tr-fit-screen .progress{margin-top:5px;padding:3px}
  html.tr-fit-screen .rival{margin-top:6px}
  html.tr-fit-screen .actions{margin-top:clamp(4px,.5vh,7px);gap:5px}
  html.tr-fit-screen .action{min-height:clamp(38px,4.3vh,46px)}
  html.tr-fit-screen .copyright{padding:3px max(10px,env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));font-size:9px;line-height:1.15}
}
@media (min-width:600px) and (max-height:1100px){
  html.tr-fit-screen .topbar{height:52px}
  html.tr-fit-screen .brand{font-size:21px}
  html.tr-fit-screen .topnav a{padding:9px 10px;font-size:9px}
  html.tr-fit-screen .game-title h1{font-size:18px}
  html.tr-fit-screen .game-title p{font-size:10px;margin-top:3px}
  html.tr-fit-screen .mode-btn{min-height:42px;padding:4px 9px;font-size:9px}
  html.tr-fit-screen .card{padding:5px 7px}
  html.tr-fit-screen .label{font-size:9px}
  html.tr-fit-screen .turn-name{font-size:13px}
  html.tr-fit-screen .turn-space{font-size:9px}
  html.tr-fit-screen .status{font-size:10px}
  html.tr-fit-screen .roll-btn{min-height:44px;font-size:14px}
  html.tr-fit-screen .treasure{min-height:45px}
  html.tr-fit-screen .treasure b{font-size:7px}
  html.tr-fit-screen .rival-icon{width:34px;height:34px;font-size:18px}
  html.tr-fit-screen .action{min-height:34px;font-size:9px}
}
@media (orientation:landscape) and (min-width:600px){
  html.tr-fit-screen .game-shell{grid-template-columns:minmax(0,1fr) minmax(280px,34%);grid-template-rows:auto minmax(0,1fr) auto;column-gap:8px}
  html.tr-fit-screen .game-head{grid-column:1/-1;grid-row:1}
  html.tr-fit-screen .board-frame{grid-column:1;grid-row:2/4}
  html.tr-fit-screen .hud{grid-column:2;grid-row:2;display:grid;grid-template-columns:1fr;align-content:start;margin-top:0}
  html.tr-fit-screen .actions{grid-column:2;grid-row:3;grid-template-columns:repeat(2,1fr);align-self:end}
  html.tr-fit-screen .board-inner{width:auto;height:100%;max-width:100%;max-height:100%}
}
@media(max-width:599px){
  .board-inner{width:100%;max-width:none}
}


/* v10.12.42 — local 2-player opposite-side dice only. Core gameplay unchanged. */
.local-p2-roll{display:none;justify-content:center;align-items:center;margin:0 0 7px;min-width:0}
body.local-mode .local-p2-roll{display:flex}
.local-p2-panel{width:min(520px,100%);display:grid;grid-template-columns:minmax(86px,auto) 58px minmax(180px,1fr);align-items:center;gap:8px;padding:6px 8px;border:2px solid #8858c7;border-radius:15px;background:linear-gradient(180deg,#2d1747,#1a0d2e);box-shadow:0 5px 16px rgba(0,0,0,.35);transform:rotate(180deg);transform-origin:center}
.local-p2-panel.active-turn{border-color:#ffe34f;box-shadow:0 0 0 3px rgba(255,227,79,.22),0 5px 18px rgba(0,0,0,.4)}
.local-p2-copy{min-width:0;text-align:center}
.local-p2-state{margin-top:3px;color:#d9c1ff;font-size:11px;font-weight:1000;letter-spacing:.08em}
.local-p2-panel.active-turn .local-p2-state{color:#ffe567}
.local-dice{width:54px;height:54px;font-size:30px}
.local-roll-btn{min-height:50px;margin-top:0;font-size:14px}
.local-roll-btn:disabled{opacity:.55;filter:saturate(.55)}
body.local-mode #rollBtn:not(:disabled),body.local-mode #rollBtnP2:not(:disabled){box-shadow:0 0 0 3px rgba(255,227,79,.24),0 0 18px rgba(255,198,45,.25)}

@media(max-width:599px){
  .local-p2-roll{margin:0 0 6px}
  .local-p2-panel{grid-template-columns:74px 46px minmax(130px,1fr);gap:6px;padding:5px 6px;border-radius:12px}
  .local-dice{width:44px;height:44px;font-size:25px;border-radius:10px}
  .local-roll-btn{min-height:44px;font-size:11px}
  .local-p2-state{font-size:9px}
}
@media(min-width:600px){
  html.tr-fit-screen body.local-mode .game-shell{grid-template-rows:auto auto minmax(0,1fr) auto auto}
  html.tr-fit-screen body.local-mode .game-head{grid-row:1}
  html.tr-fit-screen body.local-mode .local-p2-roll{grid-row:2;margin-bottom:clamp(3px,.45vh,6px)}
  html.tr-fit-screen body.local-mode .board-frame{grid-row:3}
  html.tr-fit-screen body.local-mode .hud{grid-row:4}
  html.tr-fit-screen body.local-mode .actions{grid-row:5}
  html.tr-fit-screen body.local-mode .local-p2-panel{padding:4px 7px;grid-template-columns:minmax(76px,auto) 46px minmax(165px,1fr)}
  html.tr-fit-screen body.local-mode .local-dice{width:44px;height:44px;font-size:25px}
  html.tr-fit-screen body.local-mode .local-roll-btn{min-height:42px;font-size:12px}
}
@media(orientation:landscape) and (min-width:600px){
  html.tr-fit-screen body.local-mode .game-shell{grid-template-columns:minmax(0,1fr) minmax(280px,34%);grid-template-rows:auto auto minmax(0,1fr) auto;column-gap:8px}
  html.tr-fit-screen body.local-mode .game-head{grid-column:1/-1;grid-row:1}
  html.tr-fit-screen body.local-mode .local-p2-roll{grid-column:1;grid-row:2;margin:0 0 4px}
  html.tr-fit-screen body.local-mode .board-frame{grid-column:1;grid-row:3/5}
  html.tr-fit-screen body.local-mode .hud{grid-column:2;grid-row:2/4}
  html.tr-fit-screen body.local-mode .actions{grid-column:2;grid-row:4}
}
