:root{font-family:system-ui,-apple-system,'Segoe UI',sans-serif;color:#192849;background:#edf2ff}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at top,#dae7ff,#f5f7ff 65%);min-height:100vh}button,select{font:inherit}button{cursor:pointer}header{max-width:680px;margin:0 auto;padding:22px 18px 10px;display:flex;align-items:center;justify-content:space-between}.brand{font-size:24px;font-weight:900;letter-spacing:-.8px}.brand span{color:#7258f7}.tag{font-size:11px;color:#6a769a;background:white;border:1px solid #e5eaff;border-radius:20px;padding:6px 10px}.wrap{max-width:680px;margin:auto;padding:5px 14px 40px}.toolbar,.game-panel,.rules{background:#fff;border-radius:20px;box-shadow:0 10px 35px #273b7e12;padding:14px;margin:0 0 13px}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:space-between}.toolbar label{font-size:13px;color:#67738f;font-weight:650}.toolbar select{border:1px solid #e0e5f1;background:#f9faff;padding:9px;border-radius:9px;color:#26385d}.reset{border:0;background:#eae6ff;color:#6047c9;border-radius:9px;font-weight:800;padding:10px 13px}.board-wrap{border-radius:17px;background:#fff;padding:7px;box-shadow:0 14px 35px #273b7e20;max-width:640px;margin:0 auto 14px}.board{position:relative;display:grid;grid-template-columns:repeat(15,1fr);aspect-ratio:1;border:2px solid #263452;border-radius:7px;overflow:hidden;background:white}.cell{position:relative;border:.65px solid #a7b0c5;min-width:0;min-height:0;background:#fff}.base-red{background:#f35e66}.base-green{background:#36bb85}.base-yellow{background:#ffc84b}.base-blue{background:#548df5}.home-center{background:#fff}.path-red{background:#ffb9bc}.path-green{background:#b0efd2}.path-yellow{background:#ffe7a1}.path-blue{background:#b4ccff}.star:after{content:'★';position:absolute;inset:0;display:grid;place-items:center;font-size:clamp(9px,2.3vw,19px);color:#58647f66}.base-pad{position:absolute;border-radius:18%;background:#fff;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;place-items:center;padding:5%;box-shadow:inset 0 0 0 2px #ffffff70}.red-pad{top:6.67%;left:6.67%;width:26.67%;height:26.67%}.green-pad{top:6.67%;right:6.67%;width:26.67%;height:26.67%}.yellow-pad{bottom:6.67%;right:6.67%;width:26.67%;height:26.67%}.blue-pad{bottom:6.67%;left:6.67%;width:26.67%;height:26.67%}.base-spot{border-radius:50%;width:57%;aspect-ratio:1;display:grid;place-items:center;background:#e2e5ec;border:2px solid #ffffff}.base-spot.r{background:#ffb5b8}.base-spot.g{background:#a6e7cf}.base-spot.y{background:#ffe6a1}.base-spot.b{background:#b3caff}.center-piece{position:absolute;left:40%;top:40%;width:20%;height:20%;background:conic-gradient(#36bb85 0 25%,#ffc84b 25% 50%,#548df5 50% 75%,#f35e66 75%);clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0);border:2px solid #25345a;display:grid;place-items:center}.center-piece:after{content:'★';color:white;font-size:clamp(17px,4vw,36px);text-shadow:0 1px 3px #0004}.token{position:absolute;width:6.4%;height:6.4%;border-radius:50%;border:2px solid white;box-shadow:0 2px 3px #0006;transform:translate(-50%,-50%);z-index:4;display:grid;place-items:center;font-size:clamp(8px,1.5vw,13px);font-weight:900;color:white;text-shadow:0 1px 1px #0005;padding:0}.token.red{background:#e53c49}.token.green{background:#16a86e}.token.yellow{background:#e4a900}.token.blue{background:#3777e3}.token:disabled{pointer-events:none}.token{touch-action:manipulation}.token.available{outline:3px solid #292a4c;z-index:8}.token.current{box-shadow:0 0 0 2px #fff,0 0 0 4px #2d365c}.token:disabled{cursor:default}@keyframes pulse{to{filter:brightness(1.25);transform:translate(-50%,-50%) scale(1.17)}}.move-choices{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 12px}.move-choices:empty{display:none}.choice-label{font-size:12px;color:#65708c;font-weight:700}.piece-choice{border:1px solid #7661da;background:#f0ecff;color:#4c34ad;border-radius:9px;padding:9px 12px;font-weight:800;touch-action:manipulation}.game-panel{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center}.turn{display:flex;align-items:center;gap:9px;font-size:15px;font-weight:900}.dot{width:15px;height:15px;border-radius:50%;display:inline-block}.dot.red{background:#f35e66}.dot.green{background:#36bb85}.dot.yellow{background:#ffc84b}.dot.blue{background:#548df5}.status{font-size:13px;color:#69748b;margin-top:7px;line-height:1.35}.dice-area{display:flex;align-items:center;gap:10px}.dice{width:51px;height:51px;border:2px solid #dce3f0;background:#fff;border-radius:13px;display:grid;place-items:center;font-size:32px;color:#263659;box-shadow:0 4px 9px #162c4514}.roll{background:#7258f7;color:white;border:0;padding:14px 18px;border-radius:12px;font-weight:900;min-width:98px}.roll:disabled{background:#b7bcce}.players{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:12px}.player{display:flex;align-items:center;gap:7px;border:1px solid #e1e7f4;border-radius:12px;padding:10px;background:#fff;font-size:12px;font-weight:750}.player.active{border:2px solid #7158f7;background:#f8f6ff}.player small{margin-left:auto;font-size:10px;color:#7b859e}.rules{color:#65708c;font-size:12px;line-height:1.65}.rules b{color:#293654}.footer{text-align:center;color:#95a0b8;font-size:11px;padding:8px}.winner{color:#1c9868;font-weight:900}@media(min-width:650px){header{padding-top:30px}.brand{font-size:28px}.wrap{padding-left:24px;padding-right:24px}.toolbar{padding:14px 18px}}@media(max-width:420px){.dice-area{gap:5px}.roll{padding:13px 10px;min-width:84px}.dice{width:44px;height:44px;font-size:28px}.base-pad{border-radius:13%}}
.piece-choice{min-height:48px;font-size:14px;background:#5944e4;color:#fff;border:0;box-shadow:0 3px 9px #4f3fc02b}.piece-choice:active{transform:scale(.98)}.feedback{margin:4px 4px 15px;font-size:12px;color:#4e5e83;padding:9px 11px;background:#e4eaff;border-radius:10px}.token.available{outline:4px solid #292a4c;box-shadow:0 0 0 5px #ffffffaa,0 2px 5px #0007;z-index:12}.game-panel{margin-bottom:9px}
.history{font-size:12px;color:#64728e;background:white;border-radius:10px;padding:10px 12px;margin:-5px 2px 12px;line-height:1.6}.toolbar label{display:flex;flex-direction:column;gap:4px}.toolbar select{max-width:100%;font-size:13px}@media(max-width:420px){.toolbar{display:grid;grid-template-columns:1fr 1fr}.toolbar label{min-width:0}.toolbar .reset{grid-column:1/-1}}

/* LudoAdda UI V1.6. Core movement logic retained. */
[hidden]{display:none!important}
:root{color:#1b2451;background:#f4f5ff}body{background:radial-gradient(circle at 50% -8%,#d8d1ff,#f5f6ff 52%,#eef3ff);color:#25274b}header{max-width:1180px;padding:20px 26px 14px}.brand{font-size:24px;color:#27205f;line-height:1}.brand span:not(.brand-icon){color:#7455ec}.brand small{display:block;font-size:9px;letter-spacing:2px;font-weight:800;color:#8a86ac;margin:7px 0 0 37px}.brand-icon{display:inline-grid;place-items:center;background:linear-gradient(145deg,#7957ff,#a558eb);width:30px;height:30px;border-radius:9px;color:#fff;font-size:22px;vertical-align:middle;box-shadow:0 5px 13px #6955ef4b}.header-actions{display:flex;align-items:center;gap:9px}.tag{color:#726ac6;background:#edeaff;border-color:#ded7ff;font-weight:800;letter-spacing:.4px}.home-btn,.settings-toggle{border:1px solid #d9d6f6;background:white;border-radius:12px;padding:10px 14px;color:#5e4ec6;font-weight:850}.wrap{max-width:1180px;padding:0 22px 40px}.game-intro{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 2px 16px}.eyebrow{color:#8e79ec;font-size:10px;font-weight:900;letter-spacing:1.4px}.game-intro h1{margin:4px 0 0;font-size:26px;color:#232450;line-height:1.15}.game-intro h1 span{color:#785cf3}.game-intro p{font-size:12px;color:#898ba5;margin:7px 0 0}.toolbar{justify-content:flex-start;background:#fff;border:1px solid #e9e7fa;padding:15px;margin-bottom:15px;box-shadow:0 8px 30px #42427110}.toolbar label{flex:1;min-width:145px}.toolbar select{width:100%}.toolbar .reset{align-self:end}.game-layout{display:grid;grid-template-columns:minmax(0,620px) minmax(250px,1fr);gap:22px;align-items:start}.board-column{min-width:0}.board-wrap{max-width:580px;margin:0 auto 12px;padding:6px;border:1px solid #dfdffa;box-shadow:0 12px 34px #3e3c8730}.board{border-color:#41406e}.control-column{min-width:0;position:sticky;top:14px}.game-panel{display:flex;flex-direction:column;align-items:stretch;gap:18px;padding:22px;border:1px solid #e8e7fc;box-shadow:0 10px 30px #23236312}.turn{font-size:18px}.status{font-size:13px;min-height:30px}.dice-area{justify-content:space-between;gap:12px}.dice{height:72px;width:72px;font-size:46px;border:2px solid #e4defe;box-shadow:0 8px 19px #3926a522;background:linear-gradient(155deg,#fff,#f6f4ff);flex-shrink:0}.dice.rolling{animation:dice-wobble .32s ease}.roll{flex:1;min-width:0;padding:21px 10px;font-size:14px;background:linear-gradient(120deg,#7558ff,#9658ee);box-shadow:0 8px 17px #775ce744;letter-spacing:.3px}.roll:disabled{background:#bbc1d4;box-shadow:none}@keyframes dice-wobble{0%{transform:rotate(0) scale(1)}35%{transform:rotate(-16deg) scale(1.12)}70%{transform:rotate(12deg) scale(.93)}100%{transform:rotate(0) scale(1)}}.players{gap:8px}.player{box-shadow:0 4px 15px #2421600d;min-height:47px}.player.active{background:#f1edff;border-color:#8164fa}.token{border-width:2px;box-shadow:inset 0 2px 4px #ffffff75,0 4px 6px #0005;font-size:clamp(10px,1.5vw,14px)}.token.available{outline-color:#20134d}.piece-choice{background:#7055ee;min-height:50px}.move-choices{background:white;border-radius:16px;padding:12px;border:1px solid #e9e5fa;box-shadow:0 7px 20px #34307712}.move-choices:empty{display:none}.feedback{margin:0 0 12px;background:#eceafe;color:#6552b8}.history{margin:0 0 12px;border:1px solid #eae9fb;max-height:130px;overflow:auto}.rules{margin-top:12px;padding:17px;border:1px solid #e7e6fa}.footer{margin-top:12px}.token-group{position:absolute;z-index:5;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:1px;width:6.3%;height:6.3%;border:1.5px solid #ffffff;border-radius:7px;box-shadow:0 2px 5px #0006;background:#fff;pointer-events:none}.token-mini{width:43%;height:43%;border-radius:50%;border:1px solid #fff;box-shadow:inset 0 1px 1px #ffffff88}.token-group .stack-count{position:absolute;right:-6px;top:-7px;background:#2d285a;color:white;border-radius:12px;padding:0 3px;font-size:8px;font-weight:900}.token-group.is-available{outline:3px solid #4b32dc;pointer-events:auto;cursor:pointer}.lobby{max-width:1100px;margin:30px auto 65px;padding:0 20px}.lobby-shell{display:grid;grid-template-columns:1.1fr 1fr;background:linear-gradient(125deg,#251e63,#433091 64%,#6244c5);border-radius:30px;box-shadow:0 25px 60px #2d24634d;overflow:hidden;min-height:470px}.lobby-head{color:white;padding:70px 44px;position:relative}.lobby-head:after{content:'';position:absolute;width:270px;height:270px;border:1px solid #ffffff2b;border-radius:50%;left:7%;bottom:-180px;pointer-events:none}.lobby-chip{display:inline-block;color:#f8e59b;font-size:11px;font-weight:900;letter-spacing:1px;background:#ffffff1d;padding:9px 12px;border-radius:12px}.lobby-head h1{font-size:clamp(37px,5.2vw,68px);line-height:1.05;margin:29px 0 15px;letter-spacing:-2px}.lobby-head p{font-size:16px;line-height:1.65;color:#e2dcff;max-width:390px}.lobby-dice{display:flex;gap:16px;margin-top:25px}.lobby-dice span{font-size:54px;color:#fff;filter:drop-shadow(0 8px 7px #100d4570)}.lobby-dice span:last-child{transform:rotate(19deg);color:#ffe08a}.lobby-panel{background:#fff;padding:55px 30px;display:flex;flex-direction:column;justify-content:center;gap:14px}.mode-card{border:1px solid #e3dcff;background:#f8f6ff;border-radius:17px;padding:17px;display:flex;align-items:center;gap:13px}.mode-card.future{background:#f9fafc;border-color:#e7e9f4;opacity:.76}.mode-emoji{font-size:26px}.mode-card div{display:flex;flex-direction:column;gap:5px;flex:1}.mode-card strong{font-size:16px;color:#222251}.mode-card small{font-size:11px;line-height:1.4;color:#8485a8}.available-pill,.future-pill{font-size:9px;font-weight:900;border-radius:12px;padding:6px 8px;background:#e4f8eb;color:#248857}.future-pill{background:#eeeef5;color:#888ba3}.start-button{background:linear-gradient(120deg,#7057fa,#a05cec);padding:20px 22px;border:0;border-radius:15px;color:#fff;font-size:16px;font-weight:950;box-shadow:0 8px 20px #745aff50;display:flex;justify-content:space-between}.lobby-caption{text-align:center;color:#9795ac;font-size:11px}.token-group button{position:absolute;inset:0;opacity:0;width:100%;height:100%;pointer-events:auto}.token-group.is-available button{cursor:pointer}
@media(max-width:850px){.game-layout{grid-template-columns:1fr;gap:0}.control-column{position:static;display:contents}.game-panel{margin-top:0;padding:13px 16px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px}.dice{width:49px;height:49px;font-size:32px}.roll{padding:16px 12px;min-width:96px}.dice-area{gap:7px}.move-choices{order:0}.board-wrap{max-width:610px}.game-intro h1{font-size:24px}.lobby-shell{grid-template-columns:1fr}.lobby-head{padding:40px 30px 28px}.lobby-panel{padding:24px 25px 32px}.lobby-dice{margin-top:10px}.lobby-head h1{font-size:48px;margin:18px 0}.lobby{margin-top:15px}}@media(max-width:460px){header{padding:13px 12px 10px}.brand{font-size:20px}.brand small{font-size:7px;letter-spacing:1.3px;margin-left:33px}.brand-icon{width:27px;height:27px}.header-actions .tag{display:none}.home-btn{font-size:12px;padding:9px}.wrap{padding:0 9px 28px}.game-intro{padding:8px 3px 11px}.game-intro h1{font-size:21px}.game-intro p{font-size:11px}.settings-toggle{font-size:11px;padding:9px}.player{font-size:11px;padding:8px 6px}.player small{font-size:9px}.board-wrap{padding:4px;margin-bottom:9px}.game-panel{border-radius:15px}.dice-area{gap:7px}.dice{width:44px;height:44px;font-size:28px}.roll{min-width:82px;padding:14px 7px;font-size:11px}.turn{font-size:14px}.status{font-size:11px;min-height:25px}.lobby{padding:0 10px}.lobby-shell{border-radius:22px}.lobby-head{padding:27px 25px 10px}.lobby-head h1{font-size:41px}.lobby-head p{font-size:13px}.lobby-dice span{font-size:40px}.lobby-panel{padding:20px}.toolbar label{min-width:0}}@media(prefers-reduced-motion:reduce){.dice.rolling,.token.available{animation:none}}

/* V1.7 refined visual/interaction controls */
.game-tools{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.tool-button{border:1px solid #ded9f7;background:#f7f6ff;color:#5445aa;border-radius:11px;padding:10px 12px;font-weight:800;font-size:12px}.tool-button:focus-visible,.roll:focus-visible,.piece-choice:focus-visible,.start-button:focus-visible{outline:3px solid #f5ba45;outline-offset:3px}.save-badge{color:#327f69;font-size:10px;font-weight:750;white-space:nowrap}.dice{background:linear-gradient(140deg,#fff,#eae6ff);border-color:#d2c6ff;box-shadow:inset -5px -7px 11px #beb4e138, 0 7px 14px #34327a25}.dice.rolling{animation:dice-wobble .5s ease-in-out}.board-wrap{background:linear-gradient(145deg,#fff,#f4f0ff);box-shadow:0 9px 29px #36317d35}.token{box-shadow:inset 0 3px 5px #ffffff9c,inset 0 -5px 6px #0002,0 4px 6px #0006}.token.available{filter:drop-shadow(0 0 5px #fff)}.pause-overlay{position:fixed;inset:0;z-index:100;background:#12133bbc;display:grid;place-items:center;padding:20px}.pause-dialog{width:min(100%,390px);background:#fff;border-radius:25px;padding:30px 24px;box-shadow:0 20px 60px #06051c8f;text-align:center;display:flex;flex-direction:column;gap:14px}.pause-dialog h2{margin:0;color:#282164;font-size:26px}.pause-dialog p{color:#757490;margin:0}.pause-dialog .start-button{justify-content:center}.pause-illustration{font-size:53px}.game-panel{z-index:15}.player.active{box-shadow:0 0 0 2px #8c74ff27,0 8px 19px #6b54e42b}
@media(max-width:850px){.game-panel{position:sticky;bottom:5px;z-index:17;box-shadow:0 4px 24px #1a15565c}.game-panel .game-tools{grid-column:1/-1}.save-badge{display:none}}
@media(max-width:460px){.tool-button{padding:8px 10px}.game-panel{padding:10px 11px;gap:7px}.game-tools{justify-content:flex-end}.game-tools .tool-button{font-size:11px}}

/* V1.8 - stronger small-screen legibility and animated movement */
.token-move-ghost{position:absolute;z-index:30;border-radius:50%;border:2px solid white;box-shadow:0 5px 14px #12174585,inset 0 2px 4px #fff7;display:grid;place-items:center;color:white;font-weight:900;pointer-events:none;transform:translate(-50%,-50%);font-size:clamp(10px,1.5vw,14px);will-change:left,top;}
.board-wrap{overflow:hidden}.board{isolation:isolate}
.token-group.is-available{box-shadow:0 0 0 3px #5e4bff55,0 2px 7px #0006}
.piece-choice:focus-visible,.token:focus-visible,.token-group button:focus-visible{outline:3px solid #ffae36;outline-offset:2px}
.token{transition:box-shadow .18s,filter .18s}
.game-panel .status{line-height:1.45}
#ruleDetails[hidden]{display:none!important}
@media(max-width:850px){.game-panel{bottom:env(safe-area-inset-bottom, 0px)}.board-wrap{width:100%}}
@media(max-width:460px){.game-panel{position:static!important}.game-tools{justify-content:flex-start!important}.tool-button{min-height:36px}.piece-choice{min-height:46px}}
@media(prefers-reduced-motion:reduce){.token-move-ghost{display:none}}


.token.available { cursor: pointer; touch-action: manipulation; }
.token-group { overflow: hidden; }
.token-group.stack-action {
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  z-index: 13;
  color: white;
  padding: 0;
  font-weight: 900;
  font-size: clamp(10px, 2.5vw, 18px);
  outline: 3px solid #3a219d;
  outline-offset: 1px;
}
.stack-action:focus-visible { outline-color: #ffae36; }
#stackDialog {
  width: min(90vw, 340px);
  border: 0;
  border-radius: 20px;
  padding: 20px;
  color: #282164;
}
#stackDialog::backdrop { background: #12133bbc; }
#stackDialog h2 { margin: 0 0 12px; font-size: 21px; }
#stackChoices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
#stackChoices button {
  min-height: 48px;
  border: 2px solid var(--piece-color);
  border-radius: 10px;
  background: #f7f6ff;
  color: #282164;
  font-weight: 800;
  touch-action: manipulation;
}
@media(prefers-reduced-motion:reduce) { .dice.rolling { animation: none; } }


/* V2.1 visual theme */
:root {
  --ink: #181b36;
  --muted: #515875;
  --plum: #332468;
  --accent: #5941c9;
  --paper: #fffdf9;
  --border: #e5dff1;
  color: var(--ink);
  background: #f6f3fa;
}
body { background: linear-gradient(155deg, #f3eefb, #fff9ef 72%); }
header { max-width: 1160px; padding: 24px 24px 16px; gap: 10px; }
.brand { color: var(--ink); white-space: nowrap; }
.brand > span { color: var(--accent); }
.brand .brand-icon { background: var(--plum); color: #fff; }
.header-actions { gap: 8px; }
.tag, .home-btn {
  color: var(--plum);
  background: var(--paper);
  border: 1px solid var(--border);
}
.home-btn { min-height: 44px; }
body:has(#lobby:not([hidden])) #homeBtn { display: none; }
.lobby { max-width: 1160px; padding: 18px 24px 44px; margin: auto; }
.landing {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  background: #261c50;
  color: #fff;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 24px 56px #2a19592b;
}
.landing-copy { padding: clamp(28px, 5.5vw, 74px); }
.landing h1 {
  font: 700 clamp(38px, 6.2vw, 80px)/.98 Georgia, serif;
  letter-spacing: -.055em;
  margin: 0 0 22px;
}
.landing h1 em { color: #e0ceff; }
.landing p { color: #e4def4; max-width: 38ch; line-height: 1.6; margin: 0 0 24px; }
.landing .start-button {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  min-height: 52px;
  background: #f8d57a;
  color: #2d2346;
  border-radius: 12px;
  box-shadow: none;
}
.landing .landing-note { margin: 13px 0 0; font-size: 13px; }
.landing-art {
  min-height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  padding: 64px 45px;
  background: radial-gradient(circle at 62% 48%, #7860bb, #4d367f 68%, #3c2a6a);
}
.art-board {
  width: min(100%, 320px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11%;
  padding: 8%;
  border-radius: 14%;
  transform: rotate(-12deg);
  background: #fff4d9;
  box-shadow: 0 10px 0 #cfb68e, 0 26px 42px #170c42a8;
}
.art-board i { border: 6px solid #fff9e9; border-radius: 24%; position: relative; box-shadow: 0 3px 10px #331d5240; }
.art-board i:nth-child(1) { background: #f07883; }
.art-board i:nth-child(2) { background: #76c6a2; }
.art-board i:nth-child(3) { background: #91b6ee; }
.art-board i:nth-child(4) { background: #f8cc66; }
.art-board i::after { content: ''; position: absolute; inset: 29%; border-radius: 50%; background: #fff3; border: 2px solid #fff9; }
.art-die {
  position: absolute;
  right: 14%;
  bottom: 16%;
  display: grid;
  place-items: center;
  width: clamp(54px, 9vw, 102px);
  aspect-ratio: 1;
  border-radius: 18%;
  background: #f9d97f;
  color: #3a265a;
  font-size: clamp(35px, 6.5vw, 76px);
  line-height: 1;
  transform: rotate(13deg);
  box-shadow: 0 6px 0 #c2874e, 0 13px 24px #170c4280;
}
.wrap { max-width: 1160px; }
.game-intro { color: var(--ink); margin: 0 0 12px; }
.game-intro h1 { color: inherit; font: 700 clamp(25px, 4vw, 42px)/1 Georgia, serif; margin: 0; }
.settings-toggle, .tool-button {
  min-height: 44px;
  background: #f7f3fc;
  color: var(--plum);
  border: 1px solid var(--border);
}
.settings-toggle { white-space: nowrap; }
.game-panel, .board-wrap, .toolbar, .rules, .activity {
  color: var(--ink);
  border: 1px solid var(--border);
  background: var(--paper);
  box-shadow: 0 9px 24px #26144b12;
}
.board-wrap { padding: 8px; border-radius: 16px; margin-bottom: 0; }
.board { border-color: var(--plum); }
.game-panel { position: static; padding: 16px; }
.game-panel .turn { font-size: 17px; color: var(--ink); }
.game-panel .status { color: var(--muted); }
.roll, .pause-dialog .start-button {
  min-height: 48px;
  background: var(--accent);
  color: #fff;
  border: 0;
  box-shadow: none;
}
.roll:disabled { background: #eee9f7; color: #554a72; opacity: 1; }
.players { gap: 6px; }
.player { color: var(--ink); background: var(--paper); border: 1px solid var(--border); }
.player.active { outline: 2px solid var(--accent); outline-offset: -2px; }
.activity { border-radius: 13px; margin-top: 10px; padding: 0 12px; }
.activity summary { cursor: pointer; color: var(--plum); padding: 12px 0; font-size: 13px; font-weight: 750; }
.activity .history { background: transparent; margin: 0; padding: 0 0 12px; }
.pause-dialog, #stackDialog { background: var(--paper); }
.result-card { border-top: 6px solid #f8d57a; }
.footer { color: var(--muted); }
button:focus-visible, summary:focus-visible { outline: 3px solid #9672f2; outline-offset: 2px; }
@media (max-width: 850px) {
  .game-panel { margin-top: 10px; }
  .tool-button { min-height: 44px !important; }
}
@media (max-width: 620px) {
  header { padding: 16px 14px 10px; }
  .lobby { padding: 8px 14px 32px; }
  .landing { grid-template-columns: 1fr; border-radius: 22px; }
  .landing-copy { padding: 28px 22px 22px; }
  .landing-art { padding: 29px; }
  .art-board { width: min(53%, 176px); }
  .art-die { right: 23%; bottom: 13%; }
  .game-panel { padding: 10px; }
  .game-panel .turn { font-size: 14px; }
}

.music-panel { padding-bottom: 0; }
.music-panel[open] { padding-bottom: 12px; }
.music-panel label, .music-panel p { display: block; color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.music-panel input { display: block; max-width: 100%; margin-bottom: 8px; font-size: 13px; }
.music-panel input::file-selector-button { min-height: 44px; border: 1px solid var(--border); border-radius: 10px; background: #f7f3fc; color: var(--plum); }
.music-panel audio { display: block; width: 100%; margin-bottom: 8px; }
.music-panel p { overflow-wrap: anywhere; }

/* Airplane pieces and capture feedback */
[data-piece-skin="airplane"] .token {
  overflow: visible;
  background: linear-gradient(160deg, var(--plane-light), var(--plane-dark));
  border: 1px solid #fff;
  text-shadow: none;
}
[data-piece-skin="airplane"] .token.red { --plane-light: #fa6f83; --plane-dark: #b52b53; }
[data-piece-skin="airplane"] .token.green { --plane-light: #52cd95; --plane-dark: #087454; }
[data-piece-skin="airplane"] .token.yellow { --plane-light: #f8cb54; --plane-dark: #a76205; }
[data-piece-skin="airplane"] .token.blue { --plane-light: #73b2ff; --plane-dark: #2853bb; }
[data-piece-skin="airplane"] .token::before {
  content: '';
  width: 82%;
  height: 80%;
  background: #fff8e9;
  clip-path: polygon(50% 0, 62% 15%, 62% 34%, 100% 60%, 100% 72%, 62% 60%, 62% 78%, 77% 90%, 77% 100%, 50% 90%, 23% 100%, 23% 90%, 38% 78%, 38% 60%, 0 72%, 0 60%, 38% 34%, 38% 15%);
  transform: rotate(30deg);
}
[data-piece-skin="airplane"] .piece-number {
  position: absolute;
  display: grid;
  place-items: center;
  right: -2px;
  bottom: -2px;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 2px;
  border: 1px solid white;
  border-radius: 50%;
  background: var(--plane-dark);
  color: white;
  font-size: clamp(8px, 1.3vw, 12px);
  line-height: 1;
}
.token-move-ghost { font-size: clamp(10px, 2.5vw, 24px); }
.capture-effect { position: absolute; z-index: 29; width: 0; height: 0; pointer-events: none; }
.capture-effect strong {
  position: absolute;
  left: 0;
  top: -21px;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #ffde73;
  color: #361c4f;
  border: 2px solid #fff5d1;
  border-radius: 20px;
  padding: 3px 7px;
  font-size: clamp(9px, 2.3vw, 14px);
  box-shadow: 0 2px 7px #26144b70;
}
.capture-effect span {
  position: absolute;
  inset: 0 auto auto 0;
  color: #ffdc57;
  text-shadow: 0 1px 3px #492174;
  animation: capture-star .7s ease-out both;
}
@keyframes capture-star {
  from { transform: translate(-50%, -50%) scale(.45); opacity: 1; }
  40% { opacity: 1; }
  to { transform: translate(calc(var(--dx) - 50%), calc(var(--dy) - 50%)) rotate(75deg) scale(1.2); opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .capture-effect strong { animation: capture-label .5s var(--impact-delay, 0ms) both; }
  .capture-effect span { animation-duration: .5s; animation-delay: var(--impact-delay, 0ms); }
}
@keyframes capture-label {
  from { transform: translateX(-50%) scale(.55); opacity: 0; }
  25% { transform: translateX(-50%) scale(1.15); opacity: 1; }
  80% { transform: translateX(-50%) scale(1); opacity: 1; }
  to { transform: translate(-50%, -6px) scale(1); opacity: 0; }
}


/* Glossy classic pawns and warm board tiles */
.board-wrap {
  background: linear-gradient(150deg, #fff4ce, #cda76d);
  border-color: #aa8052;
  box-shadow: 0 4px 0 #9b714d, 0 12px 23px #50352538, inset 0 1px 2px #fff;
}
.board { border-color: #76523b; }
.cell {
  background: linear-gradient(145deg, #fffbea, #f2deac);
  border-color: #7c5d3d52;
  box-shadow: inset 0 1px #fff5;
}
.cell.base-red { background: linear-gradient(145deg, #ff8058, #db362d); }
.cell.base-green { background: linear-gradient(145deg, #57ca67, #10834e); }
.cell.base-yellow { background: linear-gradient(145deg, #ffe770, #ed9f0c); }
.cell.base-blue { background: linear-gradient(145deg, #56abf6, #255aac); }
.cell.path-red { background: #ffc3a7; }
.cell.path-green { background: #aee0a2; }
.cell.path-yellow { background: #ffe285; }
.cell.path-blue { background: #aacff6; }
.base-pad {
  background: linear-gradient(155deg, #fff9e5, #ebd1a1);
  box-shadow: inset 0 2px 4px #67400945, 0 1px 0 #fff8;
}
.dice {
  background: linear-gradient(145deg, #fffdfa, #f3dfae);
  border-color: #d6b67c;
  color: #23243b;
  box-shadow: 0 3px 0 #b5935f, 0 5px 10px #59472d30, inset 0 2px #fff;
}
.music-services { border-bottom: 1px solid var(--border); margin-bottom: 12px; padding-bottom: 10px; }
.music-services a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 4px 4px 0;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--plum);
  background: #f7f3fc;
  font-size: 13px;
  font-weight: 750;
}


[data-piece-skin="classic"] :is(.token, .token-move-ghost, .token-mini) {
  background: none !important;
  border: 0;
  box-shadow: none;
}
[data-piece-skin="classic"] .red { --pawn-light: #ff9582; --pawn-mid: #e84e47; --pawn-dark: #8a242e; }
[data-piece-skin="classic"] .green { --pawn-light: #97e0ac; --pawn-mid: #399966; --pawn-dark: #165239; }
[data-piece-skin="classic"] .yellow { --pawn-light: #ffe69c; --pawn-mid: #dca329; --pawn-dark: #784a0b; }
[data-piece-skin="classic"] .blue { --pawn-light: #9ad5ff; --pawn-mid: #428cce; --pawn-dark: #204980; }
[data-piece-skin="classic"] :is(.token, .token-move-ghost, .token-mini)::before {
  content: '';
  position: absolute;
  inset: 36% 9% 5%;
  border-radius: 48% 48% 40% 40% / 84% 84% 20% 20%;
  background: radial-gradient(ellipse at 38% 22%, var(--pawn-light), var(--pawn-mid) 48%, var(--pawn-dark) 95%);
  box-shadow: inset 0 -0.18em 0 var(--pawn-dark), 0 0.12em 0.18em #442a235e;
}
[data-piece-skin="classic"] :is(.token, .token-move-ghost, .token-mini)::after {
  content: '';
  position: absolute;
  inset: 4% 24% 44%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 24%, #ffffffcf, transparent 26%), radial-gradient(circle at 37% 27%, var(--pawn-light), var(--pawn-mid) 57%, var(--pawn-dark) 100%);
  box-shadow: 0 .08em .11em #48262155;
}
[data-piece-skin="classic"] .piece-number {
  position: absolute;
  z-index: 1;
  inset: auto 0 12%;
  color: #fff;
  font-size: clamp(8px, 1.15vw, 12px);
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px #201225;
}
[data-piece-skin="classic"] .token.available:not(:focus-visible) {
  outline: none;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px #422169) drop-shadow(0 0 3px #a56cf8);
}
[data-piece-skin="classic"] .base-spot {
  border: 0;
  opacity: .48;
  box-shadow: inset 0 1px 2px #55391545;
}

.dice-area { perspective: 420px; }
.dice {
  position: relative;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  justify-items: center;
  align-items: center;
  padding: min(9px, 2vw);
  aspect-ratio: 1;
  background: linear-gradient(135deg, #fffefa 12%, #fff3ce 77%, #f2d69b);
  border: 1px solid #d4af72;
  box-shadow: 0 3px 0 #c6a26b, 0 6px 0 #957446, 0 8px 12px #49351c44, inset 0 1px 2px #fff;
}
.dice span {
  width: 68%;
  aspect-ratio: 1;
  visibility: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 65%, #3b4160, #14192d 75%);
  box-shadow: inset 0 1px 1px #080b17, 0 1px #fff9;
}
.dice span:nth-child(1) { grid-area: 1 / 1; }
.dice span:nth-child(2) { grid-area: 1 / 3; }
.dice span:nth-child(3) { grid-area: 2 / 1; }
.dice span:nth-child(4) { grid-area: 2 / 2; }
.dice span:nth-child(5) { grid-area: 2 / 3; }
.dice span:nth-child(6) { grid-area: 3 / 1; }
.dice span:nth-child(7) { grid-area: 3 / 3; }
.dice:is([data-face="2"],[data-face="3"],[data-face="4"],[data-face="5"],[data-face="6"]) span:is(:nth-child(1),:nth-child(7)),
.dice:is([data-face="4"],[data-face="5"],[data-face="6"]) span:is(:nth-child(2),:nth-child(6)),
.dice:is([data-face="1"],[data-face="3"],[data-face="5"]) span:nth-child(4),
.dice[data-face="6"] span:is(:nth-child(3),:nth-child(5)) { visibility: visible; }
[data-piece-skin="classic"] :is(.token, .token-move-ghost, .token-mini)::before {
  background: radial-gradient(ellipse at 35% 26%, var(--pawn-light), var(--pawn-mid) 48%, var(--pawn-dark) 94%);
  box-shadow: inset 0 -.28em 0 var(--pawn-dark), 0 .12em .14em #442a2360;
}
@media (prefers-reduced-motion: no-preference) {
  .dice.rolling { animation: tabletop-roll .51s ease-out both; }
}
@keyframes tabletop-roll {
  0% { transform: rotateX(0) rotateZ(0); }
  30% { transform: translateY(-15px) rotateX(165deg) rotateZ(-38deg); }
  67% { transform: translateY(-7px) rotateX(340deg) rotateZ(12deg); }
  84% { transform: translateY(2px) rotateX(367deg) rotateZ(-7deg); }
  100% { transform: translateY(0) rotateX(360deg) rotateZ(0); }
}



/* A cube viewed from above and right. The front face carries the roll. */
.dice {
  --pip: #292638;
  --two: radial-gradient(circle at 29% 27%, var(--pip) 0 7%, transparent 8%),
         radial-gradient(circle at 71% 73%, var(--pip) 0 7%, transparent 8%);
  --three: radial-gradient(circle at 50% 50%, var(--pip) 0 7%, transparent 8%), var(--two);
  --four: radial-gradient(circle at 71% 27%, var(--pip) 0 7%, transparent 8%),
          radial-gradient(circle at 29% 73%, var(--pip) 0 7%, transparent 8%), var(--two);
  --right-pips: var(--two);
  --top-pips: var(--three);
  overflow: visible;
  transform-style: preserve-3d;
  transform: scale(.76) rotateX(-24deg) rotateY(-30deg);
  border-radius: 9%;
  box-shadow: inset 0 1px 1px #fff;
  background: linear-gradient(140deg, #fffdf2, #f4dbaa);
}
.dice:is([data-face="2"], [data-face="5"]) { --right-pips: var(--four); }
.dice:is([data-face="3"], [data-face="4"]) { --top-pips: var(--four); --right-pips: var(--two); }
.dice[data-face="4"] { --top-pips: var(--three); }
.dice::before, .dice::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid #b28e5f;
  border-radius: inherit;

}
.dice::before {
  transform-origin: right center;
  transform: rotateY(-90deg);
  background: var(--right-pips), linear-gradient(115deg, #e4c88d, #bd965b);
}
.dice::after {
  transform-origin: center top;
  transform: rotateX(-90deg);
  background: var(--top-pips), linear-gradient(150deg, #fff8e4, #ebd19e);
}
[data-piece-skin="classic"] :is(.token, .token-move-ghost, .token-mini)::before {
  inset: 32% 19% 5%;
  border-radius: 60% 60% 18% 18% / 90% 90% 13% 13%;
  box-shadow: inset 0 -.16em 0 var(--pawn-dark), 0 .11em .12em #442a2360;
}
[data-piece-skin="classic"] :is(.token, .token-move-ghost, .token-mini)::after {
  inset: 5% 31% 56%;
}
@media (prefers-reduced-motion: no-preference) {
  .dice.rolling { animation: cube-roll .51s ease-out both; }
}
@keyframes cube-roll {
  0%, 100% { transform: scale(.76) rotateX(-24deg) rotateY(-30deg); }
  29% { transform: translate(-3px, -16px) scale(.76) rotateX(-48deg) rotateY(-58deg) rotateZ(-18deg); }
  62% { transform: translate(3px, -5px) scale(.76) rotateX(-10deg) rotateY(-13deg) rotateZ(13deg); }
  80% { transform: translateY(1px) scale(.76) rotateX(-30deg) rotateY(-37deg) rotateZ(-4deg); }
}



.dice { translate: -4px 0; }
[data-piece-skin="classic"] .token-group {
  background: #fff7e2;
  overflow: visible;
  gap: 0;
  align-content: center;
}
[data-piece-skin="classic"] .token-mini { position: relative; width: 46%; height: 46%; }
[data-piece-skin="classic"] .stack-pair .token-mini { height: 76%; }
[data-piece-skin="classic"] .token-mini::before { box-shadow: inset 0 -1px 0 #0004, 0 1px 1px #442a2355; }
[data-piece-skin="classic"] .token-mini::after { box-shadow: none; }

.dice-readout { display: grid; justify-items: center; gap: 2px; }
.dice-readout .dice { margin: 0; }
#rollResult {
  display: grid;
  place-items: center;
  min-width: 32px;
  padding: 1px 6px;
  border: 1px solid #d8caed;
  border-radius: 7px;
  background: #f2eafb;
  color: #2c1b4e;
  font-size: 18px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.awaiting-arrival { visibility: hidden; }
.dice-readout .dice { width: clamp(32px, 5vw, 54px); height: auto; padding: 6px; }

.game-panel .dice-area {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(106px, 1.35fr) minmax(50px, .57fr) minmax(80px, 1fr);
  gap: clamp(6px, 1.5vw, 12px);
  align-items: stretch;
}
.dice-tray {
  display: grid;
  place-items: center;
  min-height: clamp(75px, 9vw, 104px);
  overflow: hidden;
  perspective: 320px;
  background: radial-gradient(ellipse at 50% 44%, #f8eac9 15%, #e5cca0 94%);
  border: 4px solid #b18a58;
  border-radius: 16px;
  box-shadow: inset 0 3px 8px #603b2542, 0 2px 0 #8b663f;
}
.dice-carriage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.dice-carriage::before {
  content: '';
  position: absolute;
  top: 72%;
  width: 39px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #63451d65, transparent 73%);
}
.dice-tray .dice {
  width: clamp(33px, 5vw, 48px);
  height: auto;
  margin: 0;
  padding: 6px;
  translate: -3px 0;
}
.dice-result {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8f3fd;
  font-size: 11px;
  font-weight: 700;
}
.dice-result #rollResult {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: clamp(24px, 4vw, 34px);
}
.dice-area .roll { min-width: 0; padding-inline: 6px; align-self: stretch; }
@media (prefers-reduced-motion: no-preference) {
  .dice-carriage:has(.rolling) { animation: across-tray .51s ease-out both; }
}
@keyframes across-tray {
  0% { transform: translateX(-24%); }
  55% { transform: translateX(21%); }
  80% { transform: translateX(-7%); }
  100% { transform: translateX(0); }
}

.dice {
  --one: radial-gradient(circle at 50% 50%, var(--pip) 0 7%, transparent 8%);
  --five: var(--one), var(--four);
  --six: radial-gradient(circle at 29% 50%, var(--pip) 0 7%, transparent 8%),
         radial-gradient(circle at 71% 50%, var(--pip) 0 7%, transparent 8%), var(--four);
  --back-pips: var(--six);
  --left-pips: var(--five);
  --bottom-pips: var(--four);
}
.dice[data-face="2"] { --back-pips: var(--five); --left-pips: var(--three); --bottom-pips: var(--six); --top-pips: var(--one); }
.dice[data-face="3"] { --back-pips: var(--four); --left-pips: var(--five); --bottom-pips: var(--six); --top-pips: var(--one); }
.dice[data-face="4"] { --back-pips: var(--three); --left-pips: var(--five); --bottom-pips: var(--six); --top-pips: var(--one); }
.dice[data-face="5"] { --back-pips: var(--two); --left-pips: var(--three); --bottom-pips: var(--six); --top-pips: var(--one); }
.dice[data-face="6"] { --back-pips: var(--one); --left-pips: var(--five); --bottom-pips: var(--four); }
.die-facet {
  position: absolute;
  inset: -1px;
  border: 1px solid #b28e5f;
  border-radius: inherit;
}
.die-back { transform: translateZ(calc(-1 * clamp(33px, 5vw, 48px))); background: var(--back-pips), #e6c78c; }
.die-left { transform-origin: left center; transform: rotateY(90deg); background: var(--left-pips), #f7dfae; }
.die-bottom { transform-origin: center bottom; transform: rotateX(90deg); background: var(--bottom-pips), #caa46d; }
@media (prefers-reduced-motion: no-preference) {
  .dice.rolling { animation: tray-tumble .51s linear both; }
  .dice-carriage:has(.rolling) { animation: tray-travel .51s linear both; }
  .dice-carriage:has(.rolling)::before { animation: tray-shadow .51s linear both; }
}
@keyframes tray-tumble {
  0% { transform: translateY(-9px) scale(.76) rotateX(-24deg) rotateY(-30deg) rotateZ(0); }
  28% { transform: translateY(1px) scale(.76) rotateX(98deg) rotateY(90deg) rotateZ(30deg); }
  49% { transform: translateY(-7px) scale(.76) rotateX(207deg) rotateY(174deg) rotateZ(13deg); }
  66% { transform: translateY(1px) scale(.76) rotateX(296deg) rotateY(285deg) rotateZ(-9deg); }
  81% { transform: translateY(-3px) scale(.76) rotateX(344deg) rotateY(338deg) rotateZ(5deg); }
  91% { transform: translateY(0) scale(.76) rotateX(330deg) rotateY(326deg) rotateZ(-2deg); }
  100% { transform: scale(.76) rotateX(336deg) rotateY(330deg) rotateZ(0); }
}
@keyframes tray-travel {
  0% { transform: translate(-25%, -3px); }
  28% { transform: translate(-9%, 2px); }
  66% { transform: translate(24%, 2px); }
  83% { transform: translate(10%, -1px); }
  100% { transform: translate(0); }
}
@keyframes tray-shadow {
  0%, 49% { transform: scale(.76); opacity: .46; }
  28%, 66% { transform: scale(1.08); opacity: 1; }
  81% { transform: scale(.9); opacity: .72; }
  100% { transform: scale(1); opacity: 1; }
}

/* A single tabletop palette across the lobby, game and dialogs. */
:root {
  --ink: #231c31;
  --muted: #62556a;
  --plum: #382657;
  --accent: #4d3386;
  --paper: #fffdf7;
  --border: #e8decd;
  background: #f9f3e9;
}
body { background: radial-gradient(ellipse at 12% 0, #efe5f3, transparent 54%), #f9f3e9; }
.landing { background: linear-gradient(128deg, #2d2045, #3e295b); }
.landing-art { background: radial-gradient(circle at 55% 44%, #9477ad, #55406f 70%); }
.landing h1 em { color: #ffdda0; }
.landing .start-button { background: #ffde92; }
.game-intro { margin-bottom: 14px; }
.game-panel, .toolbar, .rules, .activity {
  border-radius: 16px;
  box-shadow: 0 4px 14px #472e3f0d;
}
.game-panel { padding: 12px; gap: 10px; }
.turn-status { grid-column: 1 / -1; padding: 9px 11px; border-radius: 11px; background: #f5edf8; }
.game-panel .turn { font-weight: 850; letter-spacing: -.015em; }
.game-panel .status { margin: 4px 0 0; }
.players { margin-bottom: 8px; }
.player { box-shadow: none; }
.player.active { background: #f4ebfb; outline-color: #7651aa; box-shadow: none; }
.player small { color: var(--muted); }
.dice-result { background: #f6eee1; color: #55463e; }
.dice-result #rollResult { color: #3f295e; }
.dice-area .roll {
  background: linear-gradient(155deg, #624699, #452b75);
  border-bottom: 3px solid #2f1c53;
  line-height: 1.2;
}
.dice-area .roll:disabled {
  background: #ece6f3;
  border-color: #d9d0e5;
  color: #564768;
}
.dice-area .roll:not(:disabled):active { transform: translateY(1px); }
.game-tools { gap: 6px; }
.tool-button, .settings-toggle { background: #fbf6ed; }
.activity summary { padding-block: 12px; min-height: 44px; }
.pause-dialog { border: 1px solid var(--border); }
.result-card { border-top: 6px solid #f0c266; gap: 12px; }
.result-card .pause-illustration {
  width: 76px;
  height: 76px;
  place-self: center;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff0c9;
  font-size: 40px;
}
@media (min-width: 851px) {
  .game-panel { padding: 16px; gap: 13px; }
}
@media (max-width: 620px) {
  .game-intro { margin-bottom: 8px; }
  .game-panel { gap: 8px; }
  .turn-status { padding: 7px 9px; }
  .game-panel .status { font-size: 12px; }
}

/* Small, rounded resin die. Each face has its own lighting. */
.dice-tray .dice {
  --pip: #fff1d4;
  width: clamp(33px, 5vw, 48px);
  border-radius: 23%;
  border-color: #a4344b;
  background: radial-gradient(ellipse at 27% 12%, #fff6de75, transparent 42%),
              linear-gradient(145deg, #ef7180, #bd3657 69%, #8e2143);
  box-shadow: inset 0 1px 2px #ffd4bb9c, inset 0 -2px 3px #67163163;
}
.dice-tray .dice span {
  background: radial-gradient(circle at 38% 65%, #fff9e8, #f4dbb5 83%);
  box-shadow: inset 0 1px 1px #8f4055, 0 1px #ffb1b552;
}
.dice-tray .dice::before, .dice-tray .dice::after, .dice-tray .die-facet { border-color: #a4344b; }
.dice-tray .dice::before { background: var(--right-pips), linear-gradient(115deg,#aa3051,#7d1e40); }
.dice-tray .dice::after { background: var(--top-pips), linear-gradient(145deg,#fa9a97,#d34d65); }
.dice-tray .die-back { background: var(--back-pips), linear-gradient(145deg,#d6526b,#9a294c); }
.dice-tray .die-left { background: var(--left-pips), linear-gradient(145deg,#e97985,#b13a58); }
.dice-tray .die-bottom { background: var(--bottom-pips), linear-gradient(145deg,#b44160,#85233f); }
@media (prefers-reduced-motion: no-preference) {
  .dice-tray .dice.rolling { animation: resin-roll .51s linear both; }
  .dice-carriage:has(.rolling) { animation: resin-travel .51s ease-out both; }
}
@keyframes resin-roll {
  0% { transform: translateY(-5px) scale(.76) rotateX(-24deg) rotateY(-30deg) rotateZ(0); }
  29% { transform: translateY(1px) scale(.76) rotateX(98deg) rotateY(78deg) rotateZ(22deg); }
  48% { transform: translateY(-3px) scale(.76) rotateX(194deg) rotateY(174deg) rotateZ(13deg); }
  65% { transform: translateY(1px) scale(.76) rotateX(281deg) rotateY(270deg) rotateZ(-7deg); }
  83% { transform: scale(.76) rotateX(344deg) rotateY(337deg) rotateZ(3deg); }
  100% { transform: scale(.76) rotateX(336deg) rotateY(330deg) rotateZ(0); }
}
@keyframes resin-travel {
  0% { transform: translateX(-25%); }
  36% { transform: translateX(6%); }
  68% { transform: translateX(18%); }
  100% { transform: translateX(0); }
}

.dice-tray.in-flight .dice { visibility: hidden; }
.dice-tray.board-die-flight {
  position: fixed;
  inset: 0 auto auto 0;
  width: max-content;
  min-height: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  pointer-events: none;
  z-index: 60;
}

.scoreboard {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
}
.scoreboard h2 { margin: 0 0 6px; font-size: 16px; }
.scoreboard table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.scoreboard :is(th, td) { padding: 7px 4px; border-bottom: 1px solid var(--border); text-align: center; }
.scoreboard th:first-child { text-align: left; }
.scoreboard thead th { color: var(--muted); font-size: 12px; }
.scoreboard tbody tr:last-child > * { border-bottom: 0; }
.scoreboard .score-winner { background: #fff0c9; }

#matchClock {
  margin-inline-start: auto;
  white-space: nowrap;
  border-radius: 10px;
  background: #fffdf7;
  color: var(--plum);
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
#matchClock.clock-low { background: #ffe7e6; color: #8f2341; }
