/* Ludo Master — local artwork, responsive portrait screens. */
:root{color-scheme:dark;--navy:#071e3b;--gold:#f5cd75;--ink:#fff5d9;--blue:#0874df}
*{box-sizing:border-box;margin:0;padding:0}
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
body{display:grid;place-items:center;background:radial-gradient(ellipse at top,#163960,#040d1b 75%);font-family:ui-rounded,"Trebuchet MS",system-ui,sans-serif;color:var(--ink)}
button,input,select{font:inherit}button{cursor:pointer;color:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default;opacity:.5}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #ffdd77;outline-offset:2px}button:active:not(:disabled){filter:brightness(1.12)}
[hidden]{display:none!important}.phone{position:relative;width:min(440px,96vw);height:min(920px,96dvh);overflow:hidden;background:var(--navy);border:1px solid #497492;border-radius:26px;box-shadow:0 0 0 5px #020b18,0 28px 80px #0009;container-type:size}
#app{position:absolute;inset:0;display:flex;flex-direction:column;gap:10px;padding:14px 12px;overflow:hidden;background:radial-gradient(ellipse at 40% 0,#0a589488,transparent 70%),repeating-conic-gradient(from 45deg,#0a294a 0 25%,#09213e 0 50%) 0 0/46px 46px;isolation:isolate}
#app>*{flex-shrink:0;min-width:0}.app-top{display:flex;align-items:center;justify-content:space-between;gap:10px;height:44px;min-height:44px}.app-top h1{font-size:19px;line-height:1.2;color:#ffe4a3;text-shadow:0 2px 2px #000;letter-spacing:.4px}
.round{display:grid;place-items:center;width:40px;height:40px;min-width:40px;border:1.5px solid #e7c785;border-radius:50%;background:linear-gradient(140deg,#1a4c74,#051729);box-shadow:inset 0 1px 2px #fff7,0 3px 4px #0008;color:#f9dda1;font-size:26px}
/* All atlas cells are equally sized, with no external image dependencies. */
.art{display:inline-block;width:40px;height:40px;flex-shrink:0;background-image:url('../assets/game-sprites.png');background-size:400% 400%;background-repeat:no-repeat;vertical-align:middle}
.art-pawn-red{background-position:0 0}.art-pawn-green{background-position:33.333333% 0}.art-pawn-blue{background-position:66.666667% 0}.art-pawn-yellow{background-position:100% 0}
.art-man{background-position:0 33.333333%}.art-woman{background-position:33.333333% 33.333333%}.art-bot{background-position:66.666667% 33.333333%}.art-crown{background-position:100% 33.333333%}
.art-classic{background-position:0 66.666667%}.art-snake{background-position:33.333333% 66.666667%}.art-trophy{background-position:66.666667% 66.666667%}.art-gear{background-position:100% 66.666667%}
.art-home{background-position:0 100%}.art-cards{background-position:33.333333% 100%}.art-coin{background-position:66.666667% 100%}.art-gift{background-position:100% 100%}
.art-classic,.art-snake,.art-trophy,.art-gear{clip-path:inset(0 0 6% 0)}
.avatar-emoji{display:grid;place-items:center;width:38px;height:38px;font-size:28px;flex-shrink:0}
.splash{position:absolute;inset:0;display:grid;grid-template-rows:minmax(0,1fr) auto;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);background:radial-gradient(ellipse at center,#168bdc,#062455);cursor:pointer}.splash-art{display:block;width:100%;height:100%;min-height:0;object-fit:contain;object-position:center}.splash-bottom{position:static;padding:12px 24px 20px;background:#062455;text-align:center}.splash-bottom p{font-weight:900;letter-spacing:2px;text-shadow:0 2px #00254a;margin-bottom:10px;font-size:14px}.loading-track{height:12px;border:1px solid #9ad9ff;border-radius:20px;background:#031c46;padding:2px;box-shadow:0 2px 5px #0007}.loading-track #bar{height:100%;width:0;border-radius:10px;background:linear-gradient(#ffef8d,#f7af00);transition:width 1s ease}.splash-bottom small{display:block;margin-top:10px;color:#e0f3ff;font-size:11px}
.board-surface{position:absolute;inset:0;transform-origin:center;pointer-events:none}
/* Home: artwork and touch controls are independent layers. */
#app[data-page="home"]{padding:12px 10px 8px;gap:8px;background:linear-gradient(#087ddb,#134985 70%,#07274d)}
.home-top{display:flex;align-items:center;gap:6px;min-height:57px;padding:4px 5px;background:linear-gradient(#0768c6,#053a86);border:1px solid #70caff;border-radius:32px;box-shadow:inset 0 1px #b6e5ff77,0 4px 9px #00234a77;z-index:1}
.profile-badge{display:flex;align-items:center;gap:6px;min-width:0;flex:1;background:none;border:0;text-align:left;color:#fff}.profile-badge>.art{width:48px;height:48px}.profile-badge>span{min-width:0}.profile-badge b{display:block;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:130px;text-shadow:0 2px #002556}.profile-badge small{font-size:11px;color:#ffdc64;font-weight:800}.coin-balance{display:flex;align-items:center;gap:5px;background:#032b69;border:1px solid #518ed1;border-radius:20px;padding:1px 9px 1px 1px;font-size:15px}.coin-balance .art{width:31px;height:31px}.settings-button{background:none;border:0;box-shadow:none}.settings-button .art{width:36px;height:36px}
.hero{flex:1!important;min-height:0;position:relative;overflow:hidden;border-radius:16px;background:#2699e7;box-shadow:0 3px 10px #03235055}
.hero::before{content:'';position:absolute;inset:-10px;background:url('../assets/kingdom-hero.png') center/cover;filter:blur(15px);opacity:.8}.hero picture{display:block;width:100%;height:100%;position:relative}.hero img{position:relative;width:100%;height:100%;object-fit:contain;display:block}
.modes{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;height:200px}
.mode-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;border:3px solid #dc4b36;border-radius:23px;background:linear-gradient(135deg,#fffef2,#fae8c8);box-shadow:inset 0 0 0 2px #fff9,0 3px 0 #782a1a,0 5px 10px #0006;padding:9px 6px;gap:4px}
.mode-card .art{width:92px;height:92px;max-height:55%;max-width:90%;aspect-ratio:1}.mode-card strong{font-size:23px;font-weight:1000;line-height:1.02;color:#eeb631;text-shadow:0 2px #603508,-1px 0 #613302,1px 0 #613302;letter-spacing:-.6px}.mode-card em{display:block;font-style:normal;color:#1266b2;font-size:19px;text-shadow:0 1px #02355e;letter-spacing:1px}.mode-card small{font-size:11px;font-weight:800;color:#623d1a;background:#e8c79755;border-radius:12px;padding:4px 8px;margin-top:3px}
.snake-mode{border-color:#37a945;box-shadow:inset 0 0 0 2px #fff9,0 3px 0 #165429,0 5px 10px #0006;background:linear-gradient(135deg,#fffef0,#e7f4d6)}.snake-mode strong{color:#85c626;text-shadow:0 2px #234a14,-1px 0 #234a14,1px 0 #234a14}.snake-mode small{color:#285222;background:#9dd07955}
.offline-ribbon{display:flex;align-items:center;justify-content:center;gap:9px;min-height:30px;background:linear-gradient(#1388d8,#0c50a4);border:1px solid #70d3ff;border-radius:18px;box-shadow:inset 0 1px #ffffff55;color:white;font-size:12px;font-weight:800}.offline-ribbon span{font-size:15px}
.footnav{display:flex;min-height:66px;gap:2px;border:1px solid #58b0e6;border-radius:19px 19px 10px 10px;background:linear-gradient(#0874c8,#053777);box-shadow:inset 0 2px #bbe9ff77;overflow:hidden}.footnav button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;position:relative;background:none;border:0;color:#e3f4ff;font-size:10px;font-weight:800;padding:3px 1px 7px}.footnav .art{width:37px;height:37px}.footnav .selected:after{content:'';position:absolute;bottom:3px;height:3px;background:#ffe58c;border-radius:8px;width:50%;box-shadow:0 0 6px #fff2aa}
.continue-match{min-height:34px!important;font-size:12px!important;padding:6px!important}
/* Shared screen controls. */
.action{display:block;width:100%;min-height:44px;border:1px solid #b3e994;border-radius:15px;background:linear-gradient(#66e95f 0,#24b132 48%,#078823 51%,#119632);box-shadow:inset 0 2px #ffffff66,0 3px #045517,0 6px 12px #0003;color:#fff;font-size:15px;font-weight:800;text-shadow:0 1px 2px #0005;padding:10px 12px;line-height:1.25}
.action.secondary{border-color:#86d4ff;background:linear-gradient(#1faff7,#0272dc 50%,#034eb1 51%,#0765cb);box-shadow:inset 0 2px #ffffff66,0 3px #002a68,0 6px 12px #0003}.action.gold{color:#573207;text-shadow:0 1px #fff6;border-color:#ffeabd;background:linear-gradient(#fff395,#ffd149 50%,#e8a923 51%,#f1b339);box-shadow:inset 0 2px #fff9,0 3px #825006}.action.danger{border-color:#ffb499;background:linear-gradient(#ff7856,#e74735 50%,#c62723 51%,#dc3730);box-shadow:inset 0 2px #fff5,0 3px #701519}
.segment{display:flex;gap:6px;min-height:42px}.segment button{flex:1;min-width:0;min-height:42px;padding:8px 4px;border:1px solid #5289b7;border-radius:12px;color:#d6eaff;background:linear-gradient(#123f6d,#08294e);font-size:12px;text-transform:capitalize}.segment .on{color:#533809;background:linear-gradient(#ffedac,#edbf60);border-color:#fff1c0;font-weight:900;box-shadow:inset 0 1px #fff,0 2px #815b1c}
.sub,.note,.micro{color:#c6d7e7;line-height:1.5;font-size:12px}.note{margin:5px 0}.micro{font-size:11px;text-align:center}.card{border:1px solid #8dacbf88;border-radius:16px;padding:12px;background:linear-gradient(130deg,#173e63,#0b2b4a);box-shadow:inset 0 1px #ffffff12,0 3px 10px #0002}.card h2{font-size:19px;color:#ffe4a6}.error{font-size:11px;color:#ffd79d;line-height:1.3}.error:empty{display:none}
.setup-slots{flex:1!important;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:12px}
.setup-slot{position:relative;width:100%;height:100%;max-height:250px;align-self:center;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:9px;min-width:0;text-align:center;padding:24px 9px 14px;border:2px solid color-mix(in srgb,var(--color),white 60%);border-radius:23px;background:radial-gradient(ellipse at 30% 0,#ffffff55,transparent 65%),linear-gradient(145deg,var(--color),color-mix(in srgb,var(--color),#000 38%));box-shadow:inset 0 2px 2px #fff8,inset 0 -3px 5px #0003,0 4px 0 color-mix(in srgb,var(--color),#000 65%),0 7px 14px #0004;color:#fff;text-shadow:0 1px 2px #0005}
.setup-slot>span:nth-child(2){width:100%;min-width:0}.setup-slot b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px}.setup-slot small{display:block;font-size:10px;line-height:1.5;margin-top:6px;color:#fff;background:#04162d66;padding:4px 5px;border-radius:10px;text-transform:capitalize}.slot-avatar{display:grid;place-items:center;flex-shrink:0;border-radius:50%;background:radial-gradient(circle,#ffffff55,#ffffff08 70%)}.slot-avatar .art{width:88px;height:88px;filter:drop-shadow(0 3px 2px #0003)}.setup-slot>span:last-child{position:absolute;top:9px;right:10px;display:grid;place-items:center;width:24px;height:24px;border:1px solid #ffffff66;border-radius:50%;background:#04162d33;color:#fff;font-size:16px}.setup-slot:before{content:'PLAYER ' attr(data-slot-number);position:absolute;top:12px;left:12px;font-size:8px;font-weight:800;letter-spacing:1px;color:#fffbe5}
.setup-slots[data-players="3"] .setup-slot:last-child{grid-column:1/-1;width:calc(50% - 6px);justify-self:center}
@media(max-height:740px){.setup-slot{gap:6px;padding-top:24px;padding-bottom:10px}.slot-avatar .art{width:66px;height:66px}.setup-slot b{font-size:15px}}
@media(max-height:540px){.setup-slot{gap:3px;padding-top:21px;padding-bottom:7px;border-radius:17px}.slot-avatar .art{width:43px;height:43px}.setup-slot small{font-size:9px;margin-top:3px;padding:2px}.setup-slot:before{font-size:7px;top:9px;left:9px}.setup-slot>span:last-child{top:6px;right:7px;width:20px;height:20px}.setup-slots{gap:9px}}
.editor-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.editor-fields label,.new-profile-field{display:flex;flex-direction:column;gap:5px;min-width:0;color:#daebf6;font-size:12px}.editor-fields input,.editor-fields select,.new-profile-field input,.collection-bar select{width:100%;min-width:0;height:42px;padding:8px;border:1px solid #719bbe;border-radius:9px;background:#071d37;color:white;font:inherit}.editor-fields input[readonly]{opacity:.7}
.pager{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;min-height:42px}.pager button{min-height:42px;border:1px solid #749bbd;border-radius:11px;padding:8px 12px;background:linear-gradient(#154577,#0b2a50);color:#e5f3ff;font-size:11px}.pager span{font-size:11px;color:#bbd6e7}.page-list{flex:1!important;min-height:0;display:flex;flex-direction:column;gap:10px}
.collection-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px}.collection-bar label{display:flex;align-items:center;gap:5px;font-size:11px}.collection-bar select{width:114px;text-transform:capitalize}.shop-grid{flex:1!important;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:center}.shop-item{min-width:0;display:flex;flex-direction:column;gap:10px;height:min(310px,100%);max-height:100%;text-align:center;padding:10px}.shop-item h3{font-size:13px}.shop-item .action{font-size:12px;padding:8px}.shop-item .note{font-size:11px;margin:0}.shop-icon{flex:1;min-height:40px;display:grid;place-items:center;border-radius:12px;background:radial-gradient(ellipse,#275a84,#0c2442);font-size:42px}.shop-icon .art{width:92px;height:92px;max-width:100%}.shop-die{width:58px;height:58px;border:2px solid #e4dcc9;border-radius:12px;background:linear-gradient(130deg,#fffcf0,#dfdac8);box-shadow:0 4px #8497a1;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);padding:9px;gap:4px}.shop-die i{border-radius:50%;background:#162637}.shop-die i:nth-child(2){grid-area:1/3}.shop-die i:nth-child(3){grid-area:2/2}.shop-die i:nth-child(4){grid-area:3/1}.shop-die i:nth-child(5){grid-area:3/3}.dice-gold .shop-die{background:linear-gradient(135deg,#fff4b0,#d99820)}.dice-galaxy .shop-die{background:linear-gradient(135deg,#8d51da,#201850)}.dice-galaxy .shop-die i{background:#fff}.theme-swatch{width:82px;height:82px;border:3px solid #ffe29b;border-radius:16px;background:repeating-conic-gradient(from 45deg,#073360 0 25%,#0a2142 0 50%) 0/24px 24px}.theme-forest .theme-swatch{background:linear-gradient(#25864c,#072d28)}.theme-plum .theme-swatch{background:linear-gradient(#7c3f94,#2c1044)}.pawn-pearl .shop-icon .art{filter:saturate(.55) brightness(1.4)}.pawn-metal .shop-icon .art{filter:saturate(.6) contrast(1.4)}
.profile-summary{display:flex;align-items:center;gap:12px;padding:12px;background:linear-gradient(#10518b,#093966);border:1px solid #5997c2;border-radius:17px}.profile-summary>.art,.profile-summary>span>.art{width:58px;height:58px}.profile-summary h2{font-size:20px;overflow-wrap:anywhere}.profile-summary p{font-size:11px;color:#ffdc8f;margin-top:5px}.profile-fields{flex:1!important;align-content:center}.profile-fields label:first-child{grid-column:1/-1}.achievement{display:flex;flex-direction:column;justify-content:center;gap:6px;min-height:70px}.achievement b{font-size:13px}
.rankrow{display:flex;align-items:center;gap:9px;min-height:58px}.rankrow strong{font-size:22px;color:#ffde80}.rankrow>span{flex:1;min-width:0;font-size:13px;overflow-wrap:anywhere}.rankrow .art{width:29px;height:29px}.rankrow .sub{display:block;font-size:10px}.rankrow>b{font-size:11px;white-space:nowrap}.winner-summary{display:flex;align-items:center;justify-content:center;gap:12px}.winner-summary>.art{width:70px;height:70px}.winner-summary h2{color:#ffe291;font-size:22px;overflow-wrap:anywhere}.results-list{gap:7px}.results-list .rankrow{min-height:48px;padding:8px 12px}.result-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.reward-card{flex:1!important;display:flex;flex-direction:column;justify-content:center;gap:12px;overflow-wrap:anywhere}.reward-total{color:#ffdd75;font-size:20px;font-weight:900}
/* Gameplay: square board and compact corner-aligned player dice. */
#app[data-page="game"]{padding:10px 9px;gap:8px}.game-top{height:55px;min-height:55px}.game-top h1{display:flex;flex-direction:column;align-items:center;font-family:Georgia,serif;text-transform:uppercase;font-size:18px;letter-spacing:1px;text-align:center}.game-top h1 .art{width:30px;height:25px}.game-top .round{width:34px;height:34px;min-width:34px;font-size:24px}
.panels{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;height:74px;min-height:74px}.panel{position:relative;display:flex;align-items:center;gap:4px;height:74px;min-width:0;padding:5px;border:1.5px solid color-mix(in srgb,var(--color),#ffd 35%);border-radius:19px;background:linear-gradient(120deg,color-mix(in srgb,var(--color),#000 25%),color-mix(in srgb,var(--color),#061725 78%));box-shadow:inset 0 0 0 2px #ffffff18,inset 0 2px 4px #fff4,0 3px 6px #0008}.panel.active{border-color:#ffdf88;box-shadow:inset 0 0 0 2px #fff2b95c,0 0 0 1px #f9b83c,0 0 12px color-mix(in srgb,var(--color),transparent 15%)}.panel>.art{width:35px;height:35px}.panel-empty{height:74px;pointer-events:none}.player-info{flex:1;min-width:0}.player-info b{display:block;font-size:12px;color:#fff7da;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px #0008}.player-info small{display:block;color:#daebf4;font-size:8px;line-height:1.4;margin:2px 0 4px}.pips{display:flex;gap:3px}.pips i{width:8px;height:8px;border-radius:50%;border:1px solid #fff6;background:linear-gradient(#fff4,color-mix(in srgb,var(--color),#000 30%));box-shadow:0 1px 1px #0008}.pips i.finished{background:linear-gradient(#fff4b0,#f0b523);border-color:#ffe8ab}
.arena{flex:1!important;min-height:0;display:flex;flex-direction:column;justify-content:center;gap:8px}.arena>.panels{flex-shrink:0}.arena>.play-area{max-height:calc(100cqw - 20px)}
.player-dice{border:0;background:none;width:51px;min-width:51px;height:62px;min-height:62px;padding:5px 2px 0;color:#d1dde6;opacity:.8!important}.player-dice.current{opacity:1!important}.dice-stage{display:block;position:relative;width:38px;height:38px;margin:0 auto 5px;perspective:220px;border-radius:9px;box-shadow:0 0 0 2px #fff4,0 0 0 4px color-mix(in srgb,var(--color),#000 25%),0 3px 6px #0008}.player-dice:enabled .dice-stage{box-shadow:0 0 0 2px #ffe9a5,0 0 0 4px #dc9f37,0 0 12px #ffc950}
.dice-cube{position:relative;display:block;width:38px;height:38px;transform-style:preserve-3d}.cube-face{position:absolute;inset:0;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);gap:3px;padding:6px;border:1px solid #f0e8d7;border-radius:8px;background:linear-gradient(135deg,#fffef4,#f0ead9 65%,#c9c4b7);backface-visibility:hidden;box-shadow:inset 1px 2px 2px white,inset -1px -2px 3px #918b7788}.cube-face i{border-radius:50%;background:radial-gradient(circle at 65% 80%,#3a3e3e,#090d12);box-shadow:inset 0 1px 1px #000}
.face-1{transform:translateZ(19px)}.face-2{transform:rotateX(90deg) translateZ(19px)}.face-3{transform:rotateY(90deg) translateZ(19px)}.face-4{transform:rotateY(-90deg) translateZ(19px)}.face-5{transform:rotateX(-90deg) translateZ(19px)}.face-6{transform:rotateY(180deg) translateZ(19px)}.die-caption{display:block;font-size:8px;font-weight:700;line-height:1.15;white-space:nowrap}.player-dice:enabled .die-caption{color:#ffe29a}
.play-area{flex:1!important;min-height:0;container-type:size;display:grid;place-items:center;position:relative}.board{position:relative;isolation:isolate;width:min(100cqw,100cqh);height:min(100cqw,100cqh);aspect-ratio:1;border:5px solid #f4d394;border-radius:17px;overflow:hidden;background:#f4ecda;box-shadow:0 0 0 1px #855e28,0 4px 0 #916129,0 8px 15px #0009,inset 0 0 0 2px #fff2b5}.board-grid{position:absolute;inset:0;display:grid;grid-template-columns:repeat(15,1fr);grid-template-rows:repeat(15,1fr)}.square{display:grid;place-items:center;border:.5px solid #85795b;border-radius:2px;background:linear-gradient(135deg,#fffdf2,#e6ddca);box-shadow:inset 1px 1px #fff9,inset -1px -1px #938a6f44;font-size:clamp(7px,3cqw,15px);font-weight:900;color:#927d42;line-height:1}.square.empty{border:0;box-shadow:none}.square.lane,.square.start{background:linear-gradient(135deg,color-mix(in srgb,var(--color),#fff 15%),var(--color) 55%,color-mix(in srgb,var(--color),#000 18%));color:#fff6d7;border-color:color-mix(in srgb,var(--color),#000 50%);text-shadow:0 1px 2px #0004}.home-zone{position:absolute;width:40%;height:40%;z-index:1;border:3px solid color-mix(in srgb,var(--color),#000 32%);border-radius:10px;background:linear-gradient(130deg,color-mix(in srgb,var(--color),#fff 15%),var(--color) 35%,color-mix(in srgb,var(--color),#000 32%));box-shadow:inset 1px 2px 2px #fff8,inset -2px -3px 3px #0006}.home-zone:after{content:'';position:absolute;inset:14%;border:2px solid color-mix(in srgb,var(--color),#000 55%);border-radius:12%;background:linear-gradient(135deg,#fffcef,#e9ddc5);box-shadow:inset 1px 2px 3px #fff,0 1px 2px #fff7}.home-zone.red{top:0;left:0}.home-zone.green{top:0;right:0}.home-zone.yellow{bottom:0;right:0}.home-zone.blue{bottom:0;left:0}.finish-center{position:absolute;left:40%;top:40%;width:20%;height:20%;z-index:1;background:conic-gradient(from -45deg,#21b658 0deg 90deg,#f4bf35 90deg 180deg,#3484f5 180deg 270deg,#ed4549 270deg);box-shadow:inset 0 0 0 1px #0006;filter:saturate(1.25)}
.piece{position:absolute;width:7.6%;height:7.6%;transform:translate(-50%,-65%);padding:0;border:0;background:none;z-index:4;transition:left .2s ease,top .2s ease;filter:drop-shadow(0 1px 1px #0005)}.piece:before{content:'';position:absolute;inset:0;background-image:url('../assets/game-sprites.png');background-size:400% 400%;background-repeat:no-repeat;pointer-events:none}.pawn-red:before{background-position:0 0}.pawn-green:before{background-position:33.333333% 0}.pawn-blue:before{background-position:66.666667% 0}.pawn-yellow:before{background-position:100% 0}.piece:disabled{opacity:1;pointer-events:none}.piece span{position:absolute;z-index:2;bottom:7%;left:0;right:0;font-size:7px;font-weight:900;color:white;text-shadow:0 1px 2px #000;pointer-events:none}.piece.movable{z-index:12;animation:pawn-glow .9s infinite alternate;cursor:pointer;filter:drop-shadow(0 0 3px #fff69f)}@keyframes pawn-glow{to{filter:drop-shadow(0 0 5px #fff69f) brightness(1.2)}}.landing{background:#ffe687!important;box-shadow:inset 0 0 0 2px #fff7ac}
.game-status{min-height:47px;display:flex;flex-direction:column;justify-content:center;gap:3px;text-align:center}.turn-line{font-size:12px;font-weight:800;color:#ffdda3;line-height:1.35;text-shadow:0 2px #0008}.turn-line:before,.turn-line:after{content:'—';color:#b59a5b;margin:0 8px}.dice-copy{font-size:10px;color:#adc4d9;line-height:1.3}.meta{display:flex;align-items:center;justify-content:space-around;min-height:34px;border:1px solid #c5a567;border-radius:12px;background:#031529aa;color:#f3ddb0;font-size:9px;letter-spacing:.5px}
.snake-grid{position:absolute;inset:0;display:grid;grid-template-columns:repeat(10,1fr);grid-template-rows:repeat(10,1fr)}.snake-cell{position:relative;border:.5px solid #18372888;box-shadow:inset 1px 1px #fff5;padding:2px;font-size:10px;color:#173224}.snake-cell span{position:relative;z-index:3;display:inline-block;border-radius:3px;padding:0 2px;background:#fffce9dd;font-size:clamp(7px,2.4cqw,11px);font-weight:800}.snake-paths{position:absolute;inset:0;width:100%;height:100%;z-index:2;pointer-events:none;filter:drop-shadow(0 1px .6px #0005)}#app[data-page="game"][data-mode="snake"]{background:radial-gradient(at top,#225c49aa,transparent 65%),repeating-conic-gradient(from 45deg,#073729 0 25%,#062c26 0 50%) 0/50px 50px}.snake-board{border-color:#d2d994}
/* Dialogs and local customization. */
.overlay{position:absolute;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;padding:12px;background:#01091cbb;backdrop-filter:blur(5px);overflow:hidden}.dialog{display:flex;flex-direction:column;gap:10px;width:100%;max-height:100%;padding:20px;border:2px solid #91b1cb;border-radius:24px;background:linear-gradient(#103f76,#071e44);box-shadow:inset 0 2px #ffffff33,0 18px 50px #0009;overflow:hidden}.dialog h2{text-align:center;color:#ffe3a0;font-size:23px;line-height:1.2;margin-bottom:4px}.dialog .action{min-height:42px;font-size:14px}.dialog .note{margin:0}.setting{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:35px;font-size:13px;margin:4px 0}.setting input{width:22px;height:22px;accent-color:#ffcd60}.rules{font-size:13px;line-height:1.6;padding-left:20px;min-height:150px}.rules li{margin:8px 0}.dialog .pager{margin-top:0}.toast{position:absolute;z-index:60;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));padding:10px 12px;border:1px solid #ecc982;border-radius:12px;background:#102748;color:#fff3d3;text-align:center;font-size:12px;box-shadow:0 4px 15px #0008;pointer-events:none}
#phone[data-dice="dice-gold"] .cube-face{background:linear-gradient(135deg,#fff6b9,#ffdc70 55%,#c89122);border-color:#edc767}#phone[data-dice="dice-galaxy"] .cube-face{background:linear-gradient(135deg,#824cc4,#252051);border-color:#9872d1}#phone[data-dice="dice-galaxy"] .cube-face i{background:#fff0fa}#phone[data-pawn="pawn-pearl"] .piece:before{filter:saturate(.55) brightness(1.4)}#phone[data-pawn="pawn-metal"] .piece:before{filter:saturate(.6) contrast(1.4)}#phone[data-theme="theme-forest"] #app:not([data-page="home"]){background:radial-gradient(at top,#276944aa,transparent),#092f28}#phone[data-theme="theme-plum"] #app:not([data-page="home"]){background:radial-gradient(at top,#673c8daa,transparent),#251239}#phone[data-frame="frame-champion"] .profile-badge,#phone[data-frame^="level-frame"] .profile-badge{filter:drop-shadow(0 0 3px #ffd56b)}
.winner-summary{position:relative}.winner-summary:after{content:'✦  ·  ✧  ·  ✦';position:absolute;inset:0;color:#ffe395;font-size:24px;letter-spacing:12px;text-align:center;pointer-events:none;opacity:0;animation:celebration 1.3s ease-out 3}#phone[data-celebration="celebration-confetti"] .winner-summary:after{content:'✦  ▪  ◆  ▪  ✦';color:#f1b4ff;text-shadow:12px 9px #67f7bd,-12px 18px #ffd572}@keyframes celebration{0%{opacity:0;transform:translateY(10px) scale(.7)}30%{opacity:1}100%{opacity:0;transform:translateY(-25px) scale(1.2)}}
.reduced *{animation:none!important;transition:none!important}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media(max-width:480px){.phone{width:100vw;height:100dvh;border:0;border-radius:0;box-shadow:none}#app{padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}#app[data-page="home"]{padding:max(10px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}#app[data-page="game"]{padding:max(8px,env(safe-area-inset-top)) max(7px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left))}}
@media(max-height:740px){#app{gap:8px}.modes{height:167px}.mode-card .art{width:73px;height:73px}.mode-card strong{font-size:20px}.mode-card em{font-size:16px}.mode-card small{font-size:10px;padding:3px 6px}.home-top{min-height:50px}.profile-badge>.art{width:42px;height:42px}.footnav{min-height:59px}.footnav .art{width:31px;height:31px}.game-top{height:43px;min-height:43px}.game-top h1{font-size:16px}.game-top h1 .art{width:24px;height:20px}.panels,.panel,.panel-empty{height:67px;min-height:67px}.panel>.art{width:30px;height:30px}.panel{gap:3px;padding:4px}.player-info b{font-size:11px}.player-dice{width:48px;min-width:48px}.meta{min-height:28px}.game-status{min-height:40px}.shop-item{height:min(270px,100%)}.dialog{padding:15px;gap:8px}}
@media(max-width:350px){.panel>.art{width:25px;height:25px}.panels{gap:8px}.panel{border-radius:14px;gap:2px}.player-dice{width:45px;min-width:45px}.player-info b{font-size:10px}.player-info small{font-size:7px}.pips{gap:2px}.pips i{width:6px;height:6px}.coin-balance{font-size:12px;padding-right:6px}.coin-balance .art{width:27px;height:27px}.profile-badge b{font-size:15px;max-width:90px}.profile-badge small{font-size:10px}.setup-slot b{font-size:14px}.slot-avatar .art{width:43px;height:43px}}
@media(max-height:600px){#app{gap:7px}.modes{height:142px}.mode-card{gap:2px;padding:6px 4px;border-radius:18px}.mode-card .art{width:60px;height:60px}.mode-card strong{font-size:18px}.mode-card em{font-size:15px}.mode-card small{font-size:9px;margin-top:2px}.offline-ribbon{min-height:26px;font-size:11px}.footnav{min-height:54px}.footnav .art{width:28px;height:28px}.home-top{min-height:46px}.profile-badge>.art{width:38px;height:38px}.hero{border-radius:12px}.app-top{height:38px;min-height:38px}.app-top h1{font-size:17px}.game-top h1{font-size:14px}.game-top h1 .art{height:18px;width:22px}.panels,.panel,.panel-empty{height:63px;min-height:63px}.game-status{min-height:36px}.turn-line{font-size:11px}.dice-copy{font-size:9px}.meta{min-height:25px}.shop-item{height:min(235px,100%)}.shop-icon .art{width:72px;height:72px}.profile-summary{padding:8px}.profile-summary>.art,.profile-summary>span>.art{width:46px;height:46px}.winner-summary>.art{width:50px;height:50px}.page-list{gap:8px}.rankrow{min-height:50px}.dialog .action{min-height:40px}}
@media(max-height:480px){#app{gap:5px}.home-top{min-height:42px}.modes{height:113px}.mode-card .art{width:42px;height:42px}.mode-card strong{font-size:16px}.mode-card em{font-size:13px}.mode-card small{font-size:8px}.footnav{min-height:46px}.footnav .art{width:25px;height:25px}.offline-ribbon{min-height:24px}.panels,.panel,.panel-empty{height:59px;min-height:59px}.game-top{height:34px;min-height:34px}.game-status{min-height:30px}.dice-copy{display:none}.meta{min-height:23px}.dialog{padding:12px;gap:6px}.dialog h2{font-size:19px}.dialog .action{min-height:34px;padding:7px}.dialog .rules{font-size:12px;min-height:110px}.dialog .setting{min-height:26px;margin:0}.editor-fields{gap:6px}.editor-fields input,.editor-fields select{height:34px}.winner-summary>.art{width:35px;height:35px}.results-list .rankrow{min-height:40px}}
