.vd-game-regenwormen { --game-color:#5f7540; }
.worm-game { --worm-ink:#354d39; --worm-green:#d8e5b5; color:var(--worm-ink); width:100%; min-width:0; }
.worm-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:1.2rem; margin:1rem 0 1.3rem; color:var(--vd-ink); }
.worm-heading h1 { font-size:clamp(1.65rem,2.8vw,2.6rem); line-height:1.12; font-weight:750; letter-spacing:-.035em; margin:.35rem 0 .6rem; overflow-wrap:anywhere; }
.worm-heading p { margin:0; max-width:38rem; font-size:.95rem; line-height:1.45; }
.worm-heading .vd-eyebrow { font-size:.67rem; letter-spacing:.13em; font-weight:800; }
.worm-total { display:flex; flex-direction:column; align-items:center; flex-shrink:0; padding:.7rem 1rem; background:#e6bd64; color:#4a3c24; border:1px solid #d5aa52; border-radius:1rem; transform:rotate(2deg); box-shadow:0 4px 12px #76634314; }
.worm-total small { font-size:.55rem; font-weight:900; letter-spacing:.12em; }
.worm-total strong { font-size:2.7rem; font-weight:800; line-height:1.1; }
.worm-total span { font-size:.6rem; font-weight:700; white-space:nowrap; }
.worm-layout { display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1.4fr); gap:1.1rem; align-items:start; }
.worm-turn-panel,.worm-market-panel { border:1px solid #dfdfd4; border-radius:1.3rem; padding:1.2rem; background:#fffefa; box-shadow:0 4px 14px #354d3906; min-width:0; }
.worm-turn-panel h2,.worm-market-panel h2 { font-size:.8rem; font-weight:850; margin:0 0 .65rem; }
.worm-kept h2 { display:flex; justify-content:space-between; }
.worm-kept h2 span { font-weight:600; opacity:.65; }
.worm-roll:not(:first-child) { margin-top:1.15rem; }
.worm-dice { display:flex; flex-wrap:wrap; gap:.4rem; }
.worm-die { position:relative; display:inline-flex; align-items:center; justify-content:center; width:2.6rem; height:2.8rem; background:#fffdf7; border:1px solid #d9d8c9; border-radius:.7rem; font-size:1.35rem; font-weight:800; box-shadow:0 2px 0 #d4d6c8, 0 4px 7px #354d3910; }
.worm-die.is-worm { font-size:2rem; }
.worm-die small { position:absolute; right:.18rem; top:.1rem; font-size:.45rem; line-height:1; }
.worm-die.is-kept { background:var(--worm-green); border-color:#afc08d; }
.worm-die.is-used { opacity:.55; border-style:dashed; box-shadow:none; }
.worm-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; margin-top:1rem; }
.worm-controls:empty { display:none; }
.worm-move { min-width:0; margin:0; }
.worm-move .vd-button { width:100%; min-height:48px; white-space:normal; line-height:1.25; font-size:.84rem; justify-content:center; padding:.7rem .5rem; }
.worm-move:first-child:last-child { grid-column:1/-1; }
.worm-rule-note,.worm-wait,.worm-result { font-size:.74rem; line-height:1.5; margin:1rem 0 0; }
.worm-wait { padding:.8rem; background:#f2f2e7; border-radius:.65rem; font-weight:700; }
.worm-market-title { display:flex; justify-content:space-between; gap:.4rem; align-items:baseline; }
.worm-market-title>span { font-size:.65rem; }
.worm-market { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:.4rem; }
.worm-tile { display:flex; min-width:0; min-height:6rem; flex-direction:column; justify-content:center; align-items:center; padding:.45rem .1rem; border:1px solid #dccb9e; border-radius:.65rem; background:linear-gradient(#fff4d8,#f4e2ae); box-shadow:0 2px 0 #d5c18c, 0 4px 8px #7663430b; transition:border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
.worm-tile strong { font-size:clamp(1.2rem,2.1vw,1.9rem); font-weight:800; line-height:1.25; }
.worm-tile>span:not(.worm-tile-back) { font-size:.63rem; letter-spacing:-.08em; line-height:1.5; }
.worm-tile small { font-size:.48rem; font-weight:800; line-height:1.4; }
.worm-tile.is-owned { background:transparent; border:1px dashed #bdc5b4; box-shadow:none; color:#687160; }
.worm-tile.is-owned strong { font-size:1.05rem; }
.worm-tile.is-facedown { background:repeating-linear-gradient(45deg,#e3e8d8,#e3e8d8 4px,#d6ddc8 4px,#d6ddc8 8px); border-color:#b4c0a1; box-shadow:none; }
.worm-tile-back { font-size:2rem; font-weight:800; }
.worm-tile.is-claimable { outline:2px solid #728c49; outline-offset:2px; border-color:#a4b677; background:var(--worm-green); box-shadow:0 3px 10px #6479431c; }
.worm-players { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:.65rem; margin-top:1rem; }
.worm-player { padding:.8rem; border:1px solid #dfdfd4; border-radius:1rem; background:#fffefa; min-width:0; }
.worm-player.is-active { border-color:#98ad75; background:#edf2df; box-shadow:inset 3px 0 #839d59; }
.worm-player header { display:flex; align-items:center; gap:.4rem; }
.worm-player-number { background:var(--worm-ink); color:#fff; font-size:.65rem; font-weight:900; border-radius:50%; width:1.3rem; height:1.3rem; display:grid; place-items:center; flex-shrink:0; }
.worm-player h2 { font-size:.8rem; font-weight:800; overflow-wrap:anywhere; flex:1; min-width:0; margin:0; }
.worm-player header>strong { font-size:1.1rem; line-height:1; white-space:nowrap; }
.worm-player header small { display:block; font-size:.5rem; font-weight:600; margin-top:.15rem; }
.worm-stack { display:flex; gap:.6rem; align-items:center; min-height:3.5rem; margin-top:.6rem; }
.worm-stack-top { display:flex; flex-direction:column; align-items:center; padding:.25rem .45rem; border:1px solid #dccb9e; border-radius:.5rem; background:#f9e8ba; box-shadow:0 2px 0 #d5c18c; flex-shrink:0; }
.worm-stack-top strong { font-size:1.4rem; font-weight:800; line-height:1.1; }
.worm-stack-top small { font-size:.4rem; }
.worm-stack p { font-size:.7rem; line-height:1.5; margin:0; overflow-wrap:anywhere; }
.worm-stack p span { opacity:.65; font-size:.6rem; }

.worm-box-art { width:100%; height:100%; }
.worm-display .worm-controls { display:none; }
.worm-display .worm-heading { margin:0 0 1rem; }
.worm-display .worm-layout { grid-template-columns:minmax(0,.65fr) minmax(0,1.5fr); }
.worm-display .worm-tile { min-height:7rem; }
.worm-display .worm-players { grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); }
@media(min-width:761px) {
  .worm-display .worm-player header { display:grid; grid-template-columns:1.3rem minmax(0,1fr); gap:.35rem .4rem; }
  .worm-display .worm-player h2 { grid-column:1/-1; grid-row:1; line-height:1.4; }
  .worm-display .worm-player-number { grid-column:1; grid-row:2; }
  .worm-display .worm-player header>strong { grid-column:2; grid-row:2; display:flex; justify-content:flex-end; align-items:baseline; gap:.3rem; }
  .worm-display .worm-player header small { display:inline; margin:0; }
  .worm-display .worm-stack { min-height:2.75rem; margin-top:.4rem; }
}
@media(min-width:761px) and (max-height:760px) {
  .worm-display .worm-tile { min-height:6.5rem; }
  .worm-display .worm-turn-panel,.worm-display .worm-market-panel { padding:1rem; }
  .worm-display .worm-roll:not(:first-child) { margin-top:.7rem; }
  .worm-display .worm-rule-note { margin-top:.7rem; }
  .worm-display .worm-players { margin-top:.7rem; }
}
@media(max-width:760px) {
  .worm-layout { grid-template-columns:1fr; gap:.8rem; }
  .worm-market { grid-template-columns:repeat(8,minmax(0,1fr)); }
  .worm-market-panel,.worm-turn-panel { padding:.9rem; }
  .worm-heading { gap:.65rem; }
  .worm-heading h1 { font-size:1.8rem; }
  .worm-heading p { font-size:.8rem; }
  .worm-total { padding:.65rem .6rem; }
  .worm-total strong { font-size:2.1rem; }
  .worm-tile { min-height:4.4rem; border-width:1px; }
  .worm-tile small { font-size:.4rem; }
  .worm-tile>span:not(.worm-tile-back) { font-size:.45rem; }
  .worm-players { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .worm-display .worm-layout { grid-template-columns:1fr; }
}
@media(max-width:430px) {
  .worm-market { grid-template-columns:repeat(4,minmax(0,1fr)); gap:.45rem; }
  .worm-tile { min-height:4.5rem; }
  .worm-tile strong { font-size:1.55rem; }
  .worm-tile small { font-size:.5rem; }
  .worm-tile>span:not(.worm-tile-back) { font-size:.6rem; }
  .worm-heading h1 { font-size:1.45rem; }
  .worm-heading .vd-eyebrow { font-size:.54rem; }
  .worm-total { padding:.5rem; }
  .worm-total small { font-size:.45rem; }
  .worm-total span { font-size:.5rem; }
  .worm-player { padding:.65rem; }
  .worm-player.is-active { padding:.65rem; }
  .worm-player header { flex-wrap:wrap; }
  .worm-player header>strong { margin-left:auto; }
}
@media(prefers-reduced-motion:reduce) { .worm-game * { animation:none!important; transition:none!important; } }
.worm-pick { margin:0; }
.worm-die.is-pickable { cursor:pointer; font-family:inherit; color:inherit; transition:transform .12s ease, background .12s ease, border-color .12s ease; -webkit-tap-highlight-color:transparent; }
.worm-die.is-pickable:active { transform:scale(.94); }
.worm-die.is-selected { background:var(--worm-green); border-color:#728c49; box-shadow:0 0 0 2px #728c49, 0 4px 7px #354d3910; transform:translateY(-2px); }
.worm-confirm { width:100%; min-height:48px; margin-top:1rem; justify-content:center; }

/* Dice: ivory cube faces with real pips and a drawn worm. */
.worm-die { width:3rem; height:3rem; padding:.28rem; border-radius:.8rem; background:linear-gradient(160deg,#fffefa,#f1efe2); border:1px solid #d6d3c0; box-shadow:0 3px 0 #cfccb8, 0 6px 10px #354d3918, inset 0 1px 0 #fff; }
.worm-pips { display:grid; grid-template:repeat(3,1fr)/repeat(3,1fr); width:100%; height:100%; place-items:center; }
.worm-pip { width:.5rem; height:.5rem; border-radius:50%; background:#2f4a36; box-shadow:inset 0 1px 1px #0006; }
.worm-icon { width:1.7rem; height:1rem; color:#c8553a; }
.worm-die-icon { width:2.1rem; height:1.3rem; }
.worm-die.is-kept { background:linear-gradient(160deg,#e6efc9,#d1e0a8); border-color:#a9bd82; box-shadow:0 3px 0 #a9bd82, 0 6px 10px #354d3918; }
.worm-die.is-used { box-shadow:none; }
.worm-tile-icon { width:.6rem; height:.4rem; flex:none; color:#b5472f; }
.worm-tile>span:not(.worm-tile-back) { display:flex; flex-wrap:nowrap; justify-content:center; gap:.05rem; }
.worm-confirms { display:grid; gap:.5rem; margin-top:1rem; }
.worm-confirms .worm-confirm { margin-top:0; }
.worm-confirm[hidden] { display:none; }
