
:root{color-scheme:dark;--red:#f6274c;--green:#15c16c;--yellow:#ffcf30;--blue:#289bf1;font-family:Tahoma,Arial,sans-serif}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-height:100vh;background:radial-gradient(circle at 50% -10%,#2778c8,#10366b 55%,#061d3f);color:white}
button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:disabled{cursor:default;opacity:.52}
#play{max-width:720px;margin:auto;padding:9px 9px 30px}
.game-header{border:1px solid #417bac;background:#092951db;border-radius:15px;display:flex;align-items:center;gap:10px;padding:9px;box-shadow:0 5px 16px #00172ba8}
.game-header h1{margin:0;font-size:20px}.game-header h1 span{background:#ffce53;color:#122d4e;padding:2px 5px;border-radius:7px;font-size:11px}.game-header small{font-size:10px;color:#c5def9}
.back-link{width:41px;height:42px;display:grid;place-items:center;font-size:25px;text-decoration:none;background:#184974;border:1px solid #5a89bb;color:#fff;border-radius:11px}
.sound{margin-inline-start:auto;width:42px;height:42px;border:1px solid #6792c0;background:#174774;border-radius:11px;font-size:23px}
.score-cards{display:grid;grid-template-columns:repeat(2,1fr);gap:7px;margin:10px 0}
.player{display:flex;gap:8px;align-items:center;background:#102c55;border:1px solid #406f9f;border-radius:11px;padding:7px;min-width:0;opacity:.87}
.player.active{border:2px solid #ffce59;background:#174a81;box-shadow:0 0 14px #fdce3729;opacity:1}
.player-dot{width:24px;height:24px;border-radius:50%;border:2px solid #fff8;flex-shrink:0;box-shadow:inset 0 1px 3px #fff9,0 2px 4px #0008}
.player-label{display:grid;gap:2px;min-width:0}.player-label strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.player-label small{font-size:10px;color:#b9d9f9}
.board-shell{border:2px solid #457caa;background:#0b2b52;padding:7px;border-radius:17px;box-shadow:0 8px 26px #00172bb5}
.board{position:relative;aspect-ratio:1/1;width:100%;display:grid;grid-template-columns:repeat(15,1fr);grid-template-rows:repeat(15,1fr);direction:ltr;isolation:isolate;border:2px solid #f9faff;background:white;border-radius:6px;overflow:hidden;touch-action:manipulation}
.cell{background:#fff;border:0.5px solid #8695b3;position:relative}.cell.red{background:#f62d50;border-color:#b92441}.cell.green{background:#10b964;border-color:#108a4b}.cell.yellow{background:#fbd126;border-color:#bfa00e}.cell.blue{background:#229cf4;border-color:#0879c4}
.cell.lane-red{background:#f62d50}.cell.lane-green{background:#10b964}.cell.lane-yellow{background:#fbd126}.cell.lane-blue{background:#229cf4}
.cell.star:after{content:'☆';position:absolute;inset:0;display:grid;place-items:center;color:#39445c;font-weight:900;font-size:clamp(13px,3.6vw,23px)}.cell.star.colored:after{color:white}
.center{position:absolute;inset:40%;background:conic-gradient(from -45deg,#12bd68 0 25%,#fbcf26 25% 50%,#2c9df7 50% 75%,#f53156 75%);z-index:3;pointer-events:none}
.base-box{position:absolute;z-index:4;width:25.7%;height:25.7%;background:white;border:2px solid #d5dfef;box-shadow:0 3px 7px #0003;pointer-events:none}
.base-box.red{top:7.1%;left:7.1%}.base-box.green{top:7.1%;left:67.1%}.base-box.yellow{top:67.1%;left:67.1%}.base-box.blue{top:67.1%;left:7.1%}
.piece{position:absolute;transform:translate(-50%,-50%);z-index:10;display:grid;place-items:center;color:white;border:2px solid white;border-radius:52% 52% 40% 40%;width:6.3%;height:6.3%;font-size:clamp(10px,3vw,15px);font-weight:900;box-shadow:inset 0 2px 3px #fff8,inset 0 -3px 2px #0004,0 3px 5px #001c40a3;transition:none;padding:0;background:#999}
.piece::before{content:"";position:absolute;inset:7% 12% 62% 18%;border-radius:50%;background:#ffffff80;pointer-events:none}
.piece.red{background:#ec164d}.piece.green{background:#00ac60}.piece.yellow{background:#f7ba0a;color:#2c2c2c}.piece.blue{background:#168cef}
.piece.movable{z-index:23;box-shadow:0 0 0 2px white,0 0 0 5px #ffd244,0 4px 8px #0009;animation:pulse 600ms ease-in-out infinite alternate}
@keyframes pulse{to{filter:brightness(1.2);transform:translate(-50%,-50%) scale(1.08)}}
.board-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:#d8e9fd;margin:8px 3px 2px}
.action-panel{margin:10px 0;border:2px solid #5187bc;border-radius:16px;background:linear-gradient(150deg,#0d2b50,#123b70);padding:13px;box-shadow:0 8px 16px #00152aa8}
.action-head{display:flex;align-items:center;justify-content:space-between;gap:15px}.turn-label{font-weight:900;font-size:16px}.action-hint{color:#cde2f6;font-size:11px;margin-top:3px}
.clock-holder{display:flex;align-items:center;gap:3px;color:#ffdf77}.clock-holder span{font-size:28px;font-weight:900;font-variant-numeric:tabular-nums}.clock-holder small{font-size:11px}
.timer-track{margin:9px 0 10px;background:#061e38;border-radius:99px;height:8px;overflow:hidden;border:1px solid #3b71a1}#timeBar{background:linear-gradient(90deg,#31d79d,#ffe06f);height:100%;width:100%;transition:width .2s linear}
.action-bottom{display:flex;align-items:center;gap:13px}.roll-action{flex:1;min-height:72px;border:2px solid #fff0a5;border-radius:15px;color:#113252;font-size:21px;font-weight:900;background:linear-gradient(165deg,#ffe77d,#ffb833);box-shadow:0 4px 0 #a96d19}
.roll-action:disabled{background:#465b75;border-color:#738ca6;color:#cdd6e0;box-shadow:none}
.die{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);width:77px;height:77px;border-radius:17px;padding:12px;background:linear-gradient(145deg,#f4fdff,#afdaff);border:3px solid white;box-shadow:inset -4px -5px 4px #76add9,0 3px 9px #0007;flex-shrink:0}
.pip{width:11px;height:11px;background:#073969;border-radius:50%;opacity:0;margin:auto}.pip.show{opacity:1}.die.rolling{animation:shake .54s ease-in-out infinite}
@keyframes shake{0%,100%{transform:rotate(-11deg)}50%{transform:rotate(18deg) scale(1.1)}}
.move-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.move-buttons button{border:1px solid #ffdd62;border-radius:10px;padding:9px 12px;color:#fff;background:#235d9b}
.log-panel{background:#0b2850;border:1px solid #3b6eac;border-radius:14px;margin:12px 0;padding:10px 13px;color:#e6f1ff}.log-panel summary{font-size:13px;cursor:pointer;font-weight:900}
#gameLog{font-size:12px;line-height:2.1;padding:7px}.credit{text-align:center;color:#b7d7f4;font-size:11px;padding:13px}.credit a{color:#ffdf8a;text-decoration:none;font-weight:900}
.end-screen{position:fixed;inset:0;background:#04162ddd;backdrop-filter:blur(6px);z-index:80;display:grid;place-items:center;padding:20px}.end-screen[hidden]{display:none!important}
.win-card{background:radial-gradient(circle at top,#265e9d,#0b2c58 75%);border:2px solid #ffd161;border-radius:23px;width:min(95%,450px);padding:26px 18px;text-align:center;box-shadow:0 13px 35px #0009}.win-emoji{font-size:66px;animation:winb 800ms infinite alternate}@keyframes winb{to{transform:scale(1.17)}}
.win-card h2{color:#ffe58a;font-size:24px}.win-card p{line-height:1.8;font-size:13px}.buttons{display:flex;gap:8px;justify-content:center}.buttons button,.buttons a{background:#ffd563;border:2px solid #fff0a3;border-radius:13px;color:#14325e;text-decoration:none;padding:12px;font-weight:900}
@media(max-width:600px){#play{padding:7px 6px 20px}.game-header h1{font-size:17px}.game-header small{font-size:10px}.board-shell{padding:5px}.action-panel{padding:9px}.roll-action{min-height:63px;font-size:19px}.die{width:67px;height:67px;padding:10px}.action-panel{position:sticky;bottom:6px;z-index:32;background:#0c305de8;backdrop-filter:blur(5px)}}
