@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root{font-family:'DM Sans',system-ui,sans-serif;color:#f7f5ff;background:#0b0820;color-scheme:dark;--gold:#f5fd74;--muted:#b8b3d7;--pink:#ff54c4;--cyan:#55edff;--purple:#9667ff;--line:#ffffff20}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 5% 10%,#6228bc55,transparent 48%),radial-gradient(ellipse at 95% 45%,#bb197d25,transparent 40%),linear-gradient(150deg,#120d30,#08091c 75%);background-attachment:fixed}body::before{content:'';position:fixed;inset:0;pointer-events:none;background-image:radial-gradient(#b9a4ff33 1px,transparent 1px);background-size:28px 28px;mask-image:linear-gradient(#000,transparent 85%)}header,main,footer{position:relative;max-width:1400px;margin:auto}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{cursor:default;opacity:.5}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--cyan);outline-offset:4px}header{padding:21px 32px;display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid var(--line)}.brand-block{display:flex;align-items:center;gap:16px}.brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;font:700 29px 'Space Grotesk',sans-serif;letter-spacing:-1px;text-transform:uppercase}.brand span{display:grid;place-items:center;font-size:34px;line-height:1;width:46px;height:46px;background:linear-gradient(135deg,#cf58ff,#7253ff);border-radius:13px;box-shadow:0 4px 0 #422394,0 0 28px #a84dff45;transform:rotate(-9deg)}.release-label{color:var(--cyan);font-size:12px;font-weight:700;letter-spacing:1.4px;text-transform:uppercase;border-left:1px solid var(--line);padding-left:16px}.header-actions{display:flex;gap:10px}.quiet{background:#ffffff08;border:1px solid #ffffff30;border-radius:10px;color:inherit;padding:11px 15px;min-height:44px;font-size:14px}.quiet:hover:enabled{background:#ffffff18;border-color:var(--cyan)}main{padding:28px 32px 36px}.eyebrow{font-size:14px;letter-spacing:2px;font-weight:700;color:var(--cyan)}h1,h2{font-family:'Space Grotesk',sans-serif;letter-spacing:-1px}h1{font-size:clamp(30px,3.4vw,46px);line-height:1.12;margin:12px 0}h2{font-size:26px;margin:12px 0 24px}p{line-height:1.65}.secondary{color:var(--muted);font-size:14px;line-height:1.6}.intro{text-align:center;margin:6px 0 30px}.intro h1{font-size:clamp(42px,6vw,72px);letter-spacing:-3px;margin:14px 0;line-height:1}.intro h1 em{font-style:normal;color:var(--gold);text-shadow:0 0 30px #f5fd7420}.intro p{color:var(--muted)}.arcade-tags{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.arcade-tags span{padding:6px 12px;border:1px solid #aa83ff40;border-radius:999px;font-size:12px;font-weight:700;color:#d6caff;background:#a574ff0a;letter-spacing:1px}.setup-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;max-width:960px;margin:auto}.panel{padding:28px;border:1px solid #a784ff55;border-radius:22px;background:linear-gradient(145deg,#302057ee,#171431f2);box-shadow:0 18px 45px #0003,inset 0 1px #ffffff15}.setup-grid .panel{border-top:3px solid var(--purple)}.setup-grid .join-panel{border-top-color:var(--pink);background:linear-gradient(145deg,#3d1948ee,#18132ef2)}.join-panel .eyebrow{color:#ff96de}label{display:flex;flex-direction:column;gap:8px;font-size:14px;font-weight:600;margin-bottom:20px}input,select{width:100%;min-width:0;background:#0c0b24;border:1px solid #aa91ea55;border-radius:10px;padding:12px;color:#fff;min-height:48px}input::placeholder{color:#9590b2}.fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.primary{position:relative;isolation:isolate;background:linear-gradient(110deg,#eefb70,#bbf66b);border:1px solid #eaffb0;border-radius:12px;padding:15px 24px;color:#17230a;font-weight:800;box-shadow:0 5px 0 #617a24,0 9px 28px #c7fa4820;min-height:50px;transition:transform .16s,box-shadow .16s;overflow:hidden}.primary:hover:enabled{transform:translateY(-2px);box-shadow:0 7px 0 #617a24,0 12px 32px #c7fa4845}.primary:active:enabled{transform:translateY(3px);box-shadow:0 2px 0 #617a24}.primary::after{content:'';position:absolute;inset:0;transform:translateX(-120%) skewX(-20deg);background:linear-gradient(90deg,transparent,#fff7,transparent);animation:shine 6s ease-in-out infinite;pointer-events:none}.primary:disabled::after{animation:none}.setup-grid .primary{width:100%}.setup-grid form{display:flex;flex-direction:column}.setup-grid form>.secondary{margin-top:auto;min-height:66px}.join-panel .primary{background:linear-gradient(110deg,#ff82d2,#cb8cff);border-color:#ffd0ee;box-shadow:0 5px 0 #863771;color:#2c0e37}.lobby{max-width:800px;margin:24px auto;text-align:center}.invite{display:flex;justify-content:center;align-items:center;gap:28px;margin:24px 0;padding:20px;background:#0a0929;border:1px dashed #aa83ff77;border-radius:16px}.invite strong{display:block;font:700 38px 'Space Grotesk',sans-serif;color:var(--gold);letter-spacing:6px;text-shadow:0 0 22px #f5fd7433}.lobby-seats{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:24px 0}.lobby-seat{padding:18px;background:#ffffff06;border:1px solid #a987ff44;border-radius:12px;overflow-wrap:anywhere}.lobby-seat b{display:block;margin-bottom:6px}.lobby-seat small{color:var(--muted);font-size:14px}.game-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}.game-heading h1{margin:8px 0 0;overflow-wrap:anywhere}.game-heading>.secondary{border:1px solid #ac8df24a;background:#a774ff12;border-radius:999px;padding:8px 14px;flex-shrink:0}.seats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:24px}.seat{--player:#a683ff;background:linear-gradient(130deg,#32235499,#18132d);border:1px solid #aa86ff40;border-radius:15px;padding:15px 16px;text-align:left;color:#eeeaff;min-width:0;display:grid;grid-template-columns:1fr auto;gap:7px;position:relative;overflow:hidden}.seat:nth-child(2){--player:#ff7dd1}.seat:nth-child(3){--player:#55edff}.seat:nth-child(4){--player:#f5fd74}.seat::before{content:'';position:absolute;left:0;top:14px;bottom:14px;width:3px;background:var(--player);border-radius:4px}.seat.active{border-color:var(--player);background:linear-gradient(120deg,#66419f70,#241b4d);box-shadow:0 0 22px #a878ff22}.seat.viewed{outline:1px solid #ffffff60;outline-offset:2px}.seat .name{font-weight:700;overflow-wrap:anywhere;min-width:0;align-self:center}.seat .points{font:700 30px 'Space Grotesk',sans-serif;color:var(--player)}.seat small{font-size:12px;color:#c4bcdc;grid-column:1/-1}.seat.active small{color:var(--gold)}.play-grid{display:grid;grid-template-columns:minmax(0,1fr) 370px;gap:24px;align-items:start}.table{padding:24px;border:1px solid #ad7fff88;border-radius:24px;background:radial-gradient(ellipse at 50% 65%,#59308e70,transparent 65%),linear-gradient(145deg,#271a48,#100f2c);box-shadow:0 0 0 5px #8e55e50a,0 18px 60px #0004,inset 0 1px #f7dcff2a;text-align:center;position:relative;overflow:hidden}.table::after{content:'';height:3px;position:absolute;inset:0 20% auto;background:linear-gradient(90deg,transparent,var(--pink),var(--cyan),transparent);box-shadow:0 0 24px #ff54c470}.tabletop{display:flex;justify-content:space-between;align-items:center;color:#d8d0eb;font-size:14px;gap:12px}.tabletop>span{background:#0c092488;border:1px solid #a47bea3a;border-radius:999px;padding:8px 12px}.tabletop #roll-count{color:var(--gold)}.arena-label{font:700 13px 'Space Grotesk',sans-serif;letter-spacing:3px;color:#d1b6ff;margin:22px 0 0}.dice{position:relative;display:block;height:256px;margin:18px 0 0;isolation:isolate}.dice::before{content:'ROLL ZONE · TAP DICE TO KEEP THEM';position:absolute;inset:0 0 auto;height:122px;border:1px dashed #52eaff66;border-radius:14px;background:linear-gradient(110deg,#38cfeb0c,#9070ed12);color:#a4eaf5;font-size:11px;letter-spacing:1.5px;text-align:left;padding:8px 12px;z-index:-1}.dice::after{content:'';position:absolute;left:2%;right:2%;bottom:12px;height:50px;border-radius:50%;background:#9953ff22;filter:blur(16px);z-index:-1}.dice .die{--die:#ab75ff;--edge:#643abc;position:absolute;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);width:16%;max-width:82px;height:auto;aspect-ratio:1;translate:-50% 0;padding:clamp(7px,1.1vw,14px);gap:clamp(3px,.5vw,6px);background:linear-gradient(145deg,#ffffffc0,var(--die) 58%);border:2px solid #ffffff90;border-radius:18px;box-shadow:0 7px 0 var(--edge),0 13px 18px #0006,0 0 26px color-mix(in srgb,var(--die) 35%,transparent),inset 0 2px 2px #fffb;transition:left .34s ease,top .34s ease,transform .2s,box-shadow .2s;will-change:left,top}.dice .die:nth-child(2){--die:#5fe7ff;--edge:#21889b}.dice .die:nth-child(3){--die:#ff75c8;--edge:#a02d73}.dice .die:nth-child(4){--die:#f6e86e;--edge:#a08a2a}.dice .die:nth-child(5){--die:#83efa1;--edge:#2b955a}.die:disabled{opacity:1}.die:hover:enabled{transform:translateY(-6px) rotate(-5deg)}.dice .die.held{transform:rotate(-5deg);border-color:var(--cyan);box-shadow:0 5px 0 var(--edge),0 0 0 4px #55edff22,0 0 24px #55edff40}.pip{border-radius:50%;background:#231438;box-shadow:inset 0 1px 2px #0008}.die small{position:absolute;top:calc(100% + 9px);left:0;width:100%;font-size:11px;font-weight:800;color:var(--cyan);letter-spacing:2px}.dice.rolling .die:not(.held){animation:tumble .6s ease-out}.hint{font-size:16px;color:#e5dbfb;min-height:48px;margin:14px 0 16px;line-height:1.5}.roll{width:100%;max-width:350px;font-size:20px;padding:17px 24px}.roll:enabled{box-shadow:0 6px 0 #627d23,0 0 30px #d1fb6230}#turn-status{margin:18px 0 0;min-height:24px}.last-move{margin-top:18px;min-height:64px;padding:16px 20px;border:1px solid #d070ff3b;border-left:3px solid var(--pink);border-radius:0 12px 12px 0;background:#a13fd10c;color:#e0cfed;line-height:1.6;font-size:14px}.bottom{display:flex;justify-content:space-between;gap:16px;padding:20px 0;font-size:14px;color:var(--muted)}.bottom strong{color:var(--gold);font-size:20px;margin-left:6px}.scorecard{background:#19132f;color:#eee8ff;border:1px solid #ae7eff66;border-radius:20px;overflow:hidden;align-self:start;box-shadow:0 18px 50px #0004}.scorehead{padding:19px 20px 16px;background:linear-gradient(115deg,#482574,#241940)}.scorehead h2{font-size:23px;margin:0 0 6px;overflow-wrap:anywhere}.scorehead span{font-size:13px;color:#cab8ea}.card-progress{height:4px;background:#120b24}.card-progress span{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--purple),var(--pink),var(--gold));transition:width .4s}.group{padding:10px 18px;background:#a97bff16;color:#ceb2ff;font-size:12px;letter-spacing:2px;font-weight:800;border-bottom:1px solid #b487ff20}.group.combo{background:#ff54c412;color:#ff97dc}.row{width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 18px;border:0;border-bottom:1px solid #ffffff09;background:transparent;color:#e6e0f8;text-align:left;font-size:14px;min-height:54px;transition:background .16s}.row:disabled{opacity:1}.row:enabled:hover{background:#8a5dff35}.row.locked{color:#a39ab9;background:#ffffff02}.row b{min-width:34px;padding:4px 6px;border-radius:7px;text-align:center;font-family:'Space Grotesk',sans-serif;font-size:18px}.row.available b{color:var(--gold);background:#d1ef6114}.row.available{background:linear-gradient(90deg,#9056fa19,transparent)}.row-label{display:flex;align-items:center;gap:11px;min-width:0}.category-mark{flex:0 0 29px;width:29px;height:29px;display:grid;place-items:center;border:1px solid #b386ff55;border-radius:8px;color:#d1adff;background:#a069ff17;font-weight:800;font-size:15px}.row:nth-child(2n) .category-mark{color:#7cedff;border-color:#5ceaff40;background:#3ddfff12}#lower .category-mark{color:#ff9edc;border-color:#f966bd40;background:#ff54c412}.category-copy{min-width:0}.category-copy>span{display:block;font-weight:600}.category-copy small{display:block;font-size:12px;color:#bdb0d1;line-height:1.4;margin-top:2px}.row.locked b{color:#bcb0d0}.bonus{display:flex;justify-content:space-between;align-items:center;padding:13px 18px;font-size:12px;color:#c5b4e2;gap:12px;background:#8861bd0a}.bonus b{color:var(--gold);font-size:15px}.total{padding:15px 20px;background:linear-gradient(115deg,#532d87,#342453);display:flex;align-items:center;justify-content:space-between;font-weight:700;border-top:1px solid #b58bf744}.total strong{font-size:38px;color:var(--gold);font-family:'Space Grotesk',sans-serif;text-shadow:0 0 24px #f5fd7430}.card-return{background:#56317c;border:0;width:100%;padding:12px;color:#fff;font-size:14px}.results{margin-top:20px;border-color:#f5fd7480;background:linear-gradient(135deg,#4a3263,#23204c)}.results .eyebrow{color:var(--gold)}.results h2{margin-bottom:18px}.results ol{padding-left:24px}.results li{padding:10px 0}.results li strong{float:right;color:var(--gold)}.rules{max-width:1000px;margin:28px auto 0;padding:18px 24px;border:1px solid var(--line);border-radius:14px;background:#ffffff03;font-size:14px;line-height:1.8;color:var(--muted)}summary{cursor:pointer;color:#e0d2fb;font-weight:700}.rules p{max-width:900px}footer{padding:12px 32px 26px;color:#a08cb9;font-size:12px;display:flex;justify-content:space-between;gap:20px}#notice{position:relative;max-width:1336px;margin:12px auto 0;padding:0 16px;color:#f5fd74;line-height:1.6}#notice:empty{display:none}#join-code{text-transform:uppercase;letter-spacing:2px}.celebration{position:fixed;inset:0;z-index:20;display:grid;place-items:center;pointer-events:none;overflow:hidden;opacity:0}.celebration.show{opacity:1}.celebration-card{position:relative;z-index:1;text-align:center;padding:28px 42px;border-radius:22px;background:#24113af5;border:2px solid #ff79da;box-shadow:0 0 90px #de42fb66;transform:scale(.8);opacity:0;max-width:calc(100vw - 32px)}.show .celebration-card{animation:score-pop 1.8s ease both}.celebration-card strong{display:block;font:700 clamp(30px,5vw,62px) 'Space Grotesk',sans-serif;color:var(--gold);line-height:1.1}.celebration-card span{display:block;font-size:16px;color:#f1ccff;margin-top:10px;overflow-wrap:anywhere}.confetti{position:absolute;left:50%;top:50%;width:9px;height:16px;background:var(--particle);border-radius:2px;opacity:0}.show .confetti{animation:burst 1.8s ease-out both;animation-delay:var(--delay)}@keyframes shine{0%,75%{transform:translateX(-120%) skewX(-20deg)}100%{transform:translateX(120%) skewX(-20deg)}}@keyframes tumble{0%{transform:none}35%{transform:translateY(-32px) rotate(-22deg) scale(1.07)}65%{transform:translateY(5px) rotate(15deg)}85%{transform:translateY(-6px) rotate(-5deg)}100%{transform:none}}@keyframes score-pop{0%{opacity:0;transform:scale(.75) rotate(-4deg)}15%,70%{opacity:1;transform:scale(1) rotate(0)}100%{opacity:0;transform:scale(1.08) translateY(-18px)}}@keyframes burst{0%{opacity:1;transform:translate(0,0) rotate(0)}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(var(--spin))}}
@media(min-width:1000px){.play-grid>section{position:sticky;top:20px}.table{padding:28px 30px}.dice{margin-top:22px;height:272px}.arena-label{margin-top:26px}.hint{margin-top:18px}.table #turn-status{margin-bottom:6px}}
@media(max-width:1050px){.play-grid{grid-template-columns:minmax(0,1fr) 330px;gap:18px}.table{padding:22px 16px}.dice .die{border-radius:13px}.seat{padding:14px 12px}.brand-block{gap:12px}}
@media(max-width:760px){header{padding:18px 20px}.release-label{display:none}main{padding:22px 18px}.setup-grid,.play-grid{grid-template-columns:1fr}.intro h1{letter-spacing:-2px}.seats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:20px}.scorecard{width:100%}.game-heading{align-items:start;flex-wrap:wrap}.game-heading h1{font-size:32px}.game-heading>.secondary{font-size:12px}.panel{padding:24px}.bottom{flex-wrap:wrap}.rules{padding:16px 18px}.row{padding-top:12px;padding-bottom:12px}.dice{height:248px}.dice .die{padding:clamp(8px,2.2vw,14px);gap:clamp(3px,1vw,6px);max-width:76px}.table{padding:20px 14px}.arena-label{margin-top:20px}.hint{min-height:46px;margin-top:8px}.roll{max-width:none}.game-heading .eyebrow{font-size:12px}footer{padding:12px 20px 24px;flex-wrap:wrap}.celebration-card{padding:24px}.brand{font-size:24px}.brand span{width:38px;height:38px;font-size:29px}}
@media(max-width:400px){header{gap:10px;flex-wrap:wrap}.header-actions{gap:6px;margin-left:auto}.quiet{padding:9px;font-size:13px}.fields{grid-template-columns:1fr;gap:0}.lobby-seats{grid-template-columns:1fr}.invite{gap:12px;flex-wrap:wrap}.invite strong{font-size:28px}.seat .points{font-size:25px}.dice .die{border-radius:11px;padding:7px;gap:3px}.dice::before{font-size:9px;letter-spacing:1px}.tabletop{font-size:12px}.tabletop>span{padding:7px 10px}.setup-grid{gap:18px}}
.header-actions{flex-wrap:wrap;justify-content:flex-end}.new-game{border-color:#d2ff6980;color:var(--gold);background:#c4ed6110;font-weight:700}.new-game span{margin-right:6px}.new-game:hover:enabled{border-color:var(--gold);background:#c4ed6122}
.confirm-dialog{position:fixed;margin:auto;width:min(480px,calc(100% - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:32px;border:1px solid #c88aff;border-radius:24px;background:radial-gradient(ellipse at 15% 0%,#8842c955,transparent 65%),linear-gradient(145deg,#2e194d,#15112c);color:#f7f5ff;box-shadow:0 0 0 5px #ae61fb12,0 0 65px #a93cda44,0 25px 80px #0009}
.confirm-dialog::backdrop{background:#080519ba;backdrop-filter:blur(7px)}
.confirm-dialog[open]{animation:dialog-enter .2s ease-out}.dialog-emblem{display:grid;place-items:center;width:58px;height:58px;margin-bottom:24px;border:1px solid #e3beff90;border-radius:16px;font-size:42px;line-height:1;color:#fff;background:linear-gradient(140deg,#c963ff,#7c4cdb);box-shadow:0 5px 0 #4e2687,0 0 30px #ae64ff55;transform:rotate(-9deg)}
.confirm-dialog .eyebrow{font-size:12px;letter-spacing:2px;color:var(--cyan)}.confirm-dialog h2{font-size:30px;line-height:1.15;margin:12px 0 16px}.confirm-dialog p{font-size:16px;line-height:1.6;color:#d0c4e7;margin:0 0 28px}.dialog-actions{display:flex;gap:12px;align-items:stretch}.dialog-actions button{flex:1;min-width:0;padding:13px 16px;min-height:50px;font-size:14px}.dialog-actions .quiet{border-color:#bb9fd957;background:#ffffff06}.dialog-actions .primary::after{animation:none}
@keyframes dialog-enter{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:none}}
@media(max-width:580px){header{flex-wrap:wrap}.header-actions{width:100%;justify-content:flex-start}.header-actions .new-game{margin-right:auto}.confirm-dialog{padding:26px 22px}.confirm-dialog h2{font-size:27px}.dialog-actions{flex-direction:column}.dialog-actions .primary{order:-1}}
/* The outlined upper area is the roll zone; kept dice sit beneath it. */
.dice{height:372px}
.dice::before{height:222px}
.dice::after{top:164px;bottom:auto}
/* Free dice cross lanes, scatter, and bounce into their final slots. */
.dice{container-type:inline-size}
.dice .die{transition:left .14s ease-out,top .14s ease-out,transform .16s,box-shadow .16s}
.dice.rolling .die:not(.held){--turn:720deg;--near-turn:560deg;--half-turn:360deg;--quarter-turn:180deg;animation:power-tumble var(--roll-cycle,1.35s) ease-in-out infinite;z-index:2;transition:none;filter:drop-shadow(0 0 12px var(--die))}
.dice.rolling .die:nth-child(even):not(.held){--turn:-720deg;--near-turn:-560deg;--half-turn:-360deg;--quarter-turn:-180deg}
.dice.rolling .die:not(.held)::after{content:'';position:absolute;inset:-12px;border:2px solid var(--die);border-left-color:transparent;border-right-color:transparent;border-radius:50%;opacity:.65;animation:spin-ring .45s linear infinite;pointer-events:none}
.dice.rolling::after{height:80px;background:radial-gradient(ellipse,#55edff88,#b63cff55 45%,transparent 70%);animation:roll-energy 1.35s ease-in-out infinite}
.table:has(.dice.rolling) .arena-label{color:var(--gold);text-shadow:0 0 18px #f5fd7490}
@keyframes power-tumble{0%{transform:translate(0,0) rotate(0) scale(1)}18%{transform:translate(var(--mix-a-half),-24px) rotate(var(--quarter-turn)) scale(1.06)}38%{transform:translate(var(--mix-a),-42px) rotate(var(--half-turn)) scale(1.1)}58%{transform:translate(var(--mix-b),-18px) rotate(var(--near-turn)) scale(1.04)}78%{transform:translate(var(--mix-b-half),7px) rotate(var(--turn)) scale(1.08,.9)}90%{transform:translate(0,-8px) rotate(var(--turn)) scale(.97,1.03)}100%{transform:translate(0,0) rotate(var(--turn)) scale(1)}}
@keyframes spin-ring{to{rotate:360deg}}
@keyframes roll-energy{0%,100%{opacity:.15;transform:scaleX(.6)}40%{opacity:1;transform:scaleX(1.1)}80%{opacity:.75;transform:scaleX(.9)}}
@media(max-width:760px){.dice.rolling .die:not(.held)::after{inset:-7px}.dice.rolling .die:not(.held){filter:drop-shadow(0 0 7px var(--die))}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.show .celebration-card{opacity:1;transform:none}.confetti,.dice.rolling .die::after{display:none}.dice.rolling .die:not(.held){filter:none}}
/* Compact play layout: two score columns, no scrolling panels. */
body:has(#game:not([hidden])) header{padding:10px 24px}
body:has(#game:not([hidden])) main{padding:12px 24px}
body:has(#game:not([hidden])) footer{display:none}
body:has(#game:not([hidden])) .rules{margin:8px auto 0;padding:6px 14px;font-size:12px}
.game-heading{margin-bottom:10px}
.game-heading h1{font-size:28px;margin:3px 0 0}
.game-heading .eyebrow{font-size:11px}
.seats{margin-bottom:12px;gap:10px}
.seat{padding:7px 12px;gap:1px 8px}
.seat .points{font-size:25px}
.seat small{font-size:11px}
.play-grid{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:16px;align-items:start}
.play-grid>section{position:static;min-width:0}
.table{padding:14px 16px}
.tabletop{font-size:12px}
.tabletop>span{padding:5px 10px}
.arena-label{font-size:11px;letter-spacing:2px;margin:10px 0 0}
.dice{--roll-top:76px;--kept-top:164px;height:240px;margin:6px 0 0}
.dice::before{height:151px;font-size:10px;padding:7px 10px}
.dice::after{top:114px}
.dice .die{max-width:58px;border-radius:13px;padding:9px;gap:4px}
.die small{font-size:9px;top:calc(100% + 7px)}
.hint{min-height:32px;margin:6px 0 9px;font-size:13px;line-height:1.3}
.roll{font-size:17px;padding:10px 20px;min-height:44px}
.table #turn-status{font-size:11px;line-height:1.3;min-height:15px;margin:10px 0 0}
.last-move{margin-top:9px;min-height:0;padding:7px 12px;font-size:12px;line-height:1.3}
.bottom{padding:7px 0 0;font-size:11px;gap:8px}
.bottom strong{font-size:14px}
.scorehead{padding:10px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.scorehead h2{font-size:19px;margin:0}
.scorehead span{font-size:11px;flex-shrink:0}
.score-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.score-half{min-width:0;display:flex;flex-direction:column}
.score-half+ .score-half{border-left:1px solid var(--line)}
.score-half>.bonus{margin-top:auto;min-height:36px}
.group{padding:8px 10px;font-size:10px;letter-spacing:1.4px}
.row{padding:6px 9px;min-height:45px;font-size:12px;gap:3px}
.row-label{gap:6px}
.category-mark{width:23px;height:23px;flex-basis:23px;border-radius:6px;font-size:12px}
.category-copy small{font-size:10px;line-height:1.2;margin-top:1px}
.row b{font-size:16px;min-width:28px;padding:3px}
.bonus{padding:8px 10px;font-size:10px;gap:5px}
.bonus b{font-size:13px}
.total{padding:6px 14px;font-size:13px}
.total strong{font-size:28px}
.card-return{padding:6px;font-size:11px}
.play-grid>section:has(.results:not([hidden])) .table{display:none}
.results{margin-top:8px;padding:20px}
.results h2{font-size:25px}
.results li{padding:6px 0}
@media(min-width:900px) and (max-height:850px){
 body:has(#game:not([hidden])) .brand{font-size:23px}
 body:has(#game:not([hidden])) .brand span{width:34px;height:34px;font-size:28px}
 body:has(#game:not([hidden])) .quiet{min-height:38px;padding:8px 12px;font-size:12px}
 body:has(#game:not([hidden])) .release-label{font-size:10px}
 .game-heading h1{font-size:24px}.game-heading{margin-bottom:7px}
 .dice{height:224px;--kept-top:153px;--roll-top:69px}
 .dice::before{height:139px}
 .dice .die{max-width:52px;padding:8px}
 .row{min-height:41px;padding-top:4px;padding-bottom:4px}
 .table{padding:12px 14px}.arena-label{margin-top:6px}
}

@media(max-width:899px){
 .play-grid{grid-template-columns:1fr;gap:10px}
 body:has(#game:not([hidden])) header{padding:8px 12px}
 body:has(#game:not([hidden])) main{padding:8px 12px}
 body:has(#game:not([hidden])) .release-label{display:none}
 .game-heading h1{font-size:22px}.game-heading{flex-wrap:nowrap;gap:6px;margin-bottom:8px}
 .game-heading>.secondary{font-size:10px;padding:5px 8px}
 .seats{gap:6px;margin-bottom:8px}.seat{padding:6px 8px}.seat .name{font-size:11px}.seat .points{font-size:18px}.seat small{font-size:9px}
 .table{display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,.55fr);column-gap:12px;padding:10px}
 .tabletop{grid-column:1/-1}.arena-label{display:none}
 .dice{grid-column:1;grid-row:2/5;height:190px;margin:8px 0 0;--roll-top:64px;--kept-top:127px}
 .dice::before{height:116px;font-size:8px;letter-spacing:.4px;padding:5px}
 .dice .die{max-width:44px;padding:6px;gap:3px;border-radius:10px}
 .hint{grid-column:2;align-self:end;font-size:11px;min-height:0;margin:8px 0}
 .roll{grid-column:2;align-self:center;font-size:14px;padding:9px;min-height:42px}
 .table #turn-status{grid-column:2;font-size:10px;margin:6px 0 0}
 .last-move{font-size:10px;margin-top:5px;padding:5px 9px}
 .bottom{padding-top:4px;font-size:10px}
 .scorehead{padding:8px 10px}.scorehead h2{font-size:17px}
 .row{min-height:34px;padding:4px 8px}
 .category-copy small{display:none}
 .group{padding:6px 9px}.score-half>.bonus{min-height:29px;padding:6px 8px}
 .total{padding:4px 12px}.total strong{font-size:23px}
}
@media(max-width:580px){
 body:has(#game:not([hidden])) .brand{font-size:20px}
 body:has(#game:not([hidden])) .brand span{width:28px;height:28px;font-size:23px}
 body:has(#game:not([hidden])) header{gap:7px}
 body:has(#game:not([hidden])) .header-actions{gap:6px;flex-wrap:nowrap}
 body:has(#game:not([hidden])) .quiet{min-height:34px;font-size:11px;padding:6px 9px}
 .row{font-size:11px}.row-label{gap:4px}.category-mark{display:none}
 .table{column-gap:8px;grid-template-columns:minmax(0,1fr) 120px}
 .dice .die{padding:4px;gap:2px;border-radius:8px}
 .seat small{display:none}.seat{grid-template-columns:1fr}.seat .points{font-size:16px}
 .bottom{flex-wrap:nowrap}.bottom strong{font-size:12px}
}
/* Short screens keep the whole turn visible without hiding overflow. */
@media(min-width:900px) and (max-height:850px){
 .dice{height:202px;--kept-top:137px}
 .dice::before{height:131px}
 .hint{min-height:26px}
 .table{padding:10px 14px}
 body:has(#game:not([hidden])) .rules{margin-top:4px;padding:3px 14px}
}
@media(min-width:900px) and (max-height:690px){
 body:has(#game:not([hidden])) main{padding-top:8px;padding-bottom:8px}
 .dice{height:180px;--roll-top:61px;--kept-top:117px}
 .dice::before{height:112px}
 .dice .die{max-width:44px;padding:6px;gap:3px}
 .row{min-height:35px}.category-copy small{font-size:9px}
 .scorehead{padding-top:7px;padding-bottom:7px}
 .hint{font-size:12px;min-height:24px}
 .seat{padding-top:5px;padding-bottom:5px}
}
@media(max-width:899px){
 .dice{height:140px;--roll-top:40px;--kept-top:91px}
 .dice::before{height:83px}
 .dice::after{top:55px}
 .dice .die{max-width:34px;padding:4px;gap:2px}
 .dice.rolling .die:not(.held){animation-name:compact-tumble}
 .dice.rolling .die:not(.held)::after{inset:-4px}
 .table #turn-status{align-self:start}
 .row{min-height:30px;padding-top:3px;padding-bottom:3px}
 .row b{line-height:1;font-size:14px}
 .group{line-height:1.3}
 .total strong{line-height:1.1}
 .scorehead h2{line-height:1.2}
 .seats .seat{grid-template-columns:minmax(0,1fr) auto;padding:6px}
 .seat .name{font-size:10px;line-height:1.1}
 .seat .points{font-size:17px}
 body:has(#game:not([hidden])) .rules{margin-top:4px;padding:3px 12px}
}
@keyframes compact-tumble{0%{transform:translate(0,0) rotate(0)}18%{transform:translate(var(--mix-a-half),-10px) rotate(var(--quarter-turn))}38%{transform:translate(var(--mix-a),-18px) rotate(var(--half-turn)) scale(1.08)}58%{transform:translate(var(--mix-b),-8px) rotate(var(--near-turn))}78%{transform:translate(var(--mix-b-half),4px) rotate(var(--turn)) scale(1.06,.9)}90%{transform:translate(0,-4px) rotate(var(--turn))}100%{transform:translate(0,0) rotate(var(--turn))}}
@media(min-width:900px) and (max-height:690px){
 .category-copy small{display:none}
 .arena-label{display:none}
 .dice{height:168px;--kept-top:110px}
 .dice .die{max-width:36px;padding:5px;gap:2px}
 .row{min-height:32px;line-height:1.2}
 .score-half>.bonus{min-height:28px;padding-top:5px;padding-bottom:5px}
 .total strong{line-height:1}
 .total{padding-top:5px;padding-bottom:5px}
}
/* Use spare desktop height for the game, not blank space below it. */
@media(min-width:900px) and (min-height:700px){
 body:has(#game:not([hidden])):has(.rules:not([open])){height:100dvh;display:flex;flex-direction:column}
 body:has(#game:not([hidden])):has(.rules:not([open]))>header{width:100%;flex-shrink:0}
 body:has(#game:not([hidden])):has(.rules:not([open]))>main{width:100%;flex:1;min-height:0;display:flex;flex-direction:column;padding-bottom:12px}
 body:has(.rules:not([open])) #game:not([hidden]){display:flex;flex-direction:column;flex:1;min-height:0}
 .game-heading,.seats{flex-shrink:0}
 body:has(.rules:not([open])) .play-grid{flex:1;min-height:0;align-items:stretch}
 body:has(.rules:not([open])) .play-grid>section{display:flex;flex-direction:column;min-height:0}
 body:has(.rules:not([open])) .table{flex:1;display:flex;flex-direction:column;min-height:0}
 body:has(.rules:not([open])) .dice{--large-die:min(16.2cqw,calc((100cqh - var(--roll-top) - 60px) / 2),171px);--roll-top:clamp(52px,calc(10dvh - 20px),88px);--kept-top:calc(var(--roll-top) + var(--large-die) + 44px);container-type:size;flex:1;height:auto;min-height:0;margin-top:10px}
 body:has(.rules:not([open])) .dice::before{height:calc(var(--roll-top) + var(--large-die) + 16px)}
 body:has(.rules:not([open])) .dice::after{top:45%}
 body:has(.rules:not([open])) .dice .die{width:var(--large-die);max-width:none;padding:clamp(6px,calc(2dvh - 8px),17px);gap:clamp(3px,calc(1dvh - 4px),7px);border-radius:18px}
 body:has(.rules:not([open])) .scorecard{align-self:stretch;display:flex;flex-direction:column;min-height:0}
 body:has(.rules:not([open])) .score-columns{flex:1;min-height:0}
 body:has(.rules:not([open])) .score-half{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
 body:has(.rules:not([open])) #upper,body:has(.rules:not([open])) #lower{display:grid;grid-template-rows:repeat(7,minmax(0,1fr))}
 body:has(.rules:not([open])) .row{height:100%;min-height:0}
 body:has(.rules:not([open])) .rules{flex-shrink:0;width:min(100%,1000px)}
 .tabletop,.arena-label,.hint,.roll,#turn-status,.last-move,.bottom,.scorehead,.card-progress,.card-return,.total{flex-shrink:0}
 .roll{align-self:center}
 body:has(.rules:not([open])) .play-grid>section:has(.results:not([hidden])) .table{display:none}
}
@media(min-width:1100px) and (min-height:900px){
 .row{font-size:14px;padding-left:12px;padding-right:12px}
 .category-copy small{font-size:11px}
 .category-mark{width:28px;height:28px;flex-basis:28px;font-size:14px}
 .row b{font-size:20px}
 .scorehead h2{font-size:23px}
 .hint{font-size:15px}
 .roll{font-size:20px;min-height:52px}
}
/* A shared grid aligns name cards with the panels and uses wide displays. */
@media(min-width:900px){
 body:has(#game:not([hidden]))>header,body:has(#game:not([hidden]))>main{max-width:1900px;width:100%}
 .play-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
 .seats{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:16px}
 .seats:not(:has(.seat:nth-child(3))){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .seats:has(.seat:nth-child(3)):not(:has(.seat:nth-child(4))) .seat:first-child{grid-column:span 2}
 .seat.viewed{outline:none;box-shadow:inset 0 0 0 1px #ffffff60}
}
.seat .name{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.personal-best{display:inline-block;padding:3px 8px;border:1px solid #e4f36a44;border-radius:999px;background:#dced6810;color:var(--gold);font-size:11px;font-weight:600;letter-spacing:0;line-height:1.3}
.game-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.game-actions>.secondary{border:1px solid #ac8df24a;background:#a774ff12;border-radius:999px;padding:8px 14px;flex-shrink:0}.undo-score{border-color:#55edff88;color:var(--cyan);background:#55edff12;font-weight:700;white-space:nowrap}.undo-score:hover:enabled{background:#55edff25}
@media(max-width:760px){.game-actions{justify-content:flex-start}.game-actions>.secondary{font-size:12px;padding:6px 10px}.undo-score{font-size:12px;padding:7px 10px}}
@media(max-width:899px){.seat .name{gap:3px}.personal-best{font-size:9px;padding:2px 4px}}
/* Explicit pip geometry avoids Safari collapsing empty grid tracks in buttons. */
.dice .die{-webkit-appearance:none;appearance:none;display:block}
.dice .die>span{display:block;position:absolute;width:18%;height:18%;pointer-events:none}
.dice .die>span:nth-child(3n+1){left:14%}
.dice .die>span:nth-child(3n+2){left:41%}
.dice .die>span:nth-child(3n){left:68%}
.dice .die>span:nth-child(-n+3){top:14%}
.dice .die>span:nth-child(n+4):nth-child(-n+6){top:41%}
.dice .die>span:nth-child(n+7):nth-child(-n+9){top:68%}


/* First-roll state, readable die values, and scorecard wayfinding. */
.dice .die.unrolled{filter:saturate(.4) brightness(.7);border-style:dashed}
.dice .die .unrolled-mark{position:absolute;inset:0;display:grid;place-items:center;width:auto!important;height:auto!important;left:0!important;top:0!important;font:800 clamp(20px,4vw,36px)/1 'Space Grotesk',sans-serif;color:#211335;text-shadow:0 1px #fff8}
.seat.viewed{border:2px solid var(--player);box-shadow:0 0 0 2px color-mix(in srgb,var(--player) 32%,transparent),0 0 24px color-mix(in srgb,var(--player) 28%,transparent)}
.card-return{display:block;width:100%;min-height:40px;margin:8px 0;padding:8px 12px;border:1px solid var(--cyan);border-radius:10px;background:#55edff1c;color:var(--cyan);font-size:14px;font-weight:800;text-align:center}
.card-return:hover{background:#55edff30}
.score-coach{margin:6px 0 4px;padding:8px 10px;border-left:3px solid var(--gold);border-radius:6px;background:#f5fd7412;color:#f5fd74;font-size:13px;line-height:1.4}
.roll-controls{position:relative;display:flex;align-items:center;justify-content:center;width:100%;min-height:88px;flex-shrink:0}
.roll-actions{display:flex;flex-direction:column;align-items:center;gap:5px;flex:1;max-width:350px}
.roll-actions .roll{width:100%;max-width:none}
.roll-mode{border:0;background:transparent;color:var(--cyan);font-family:inherit;font-size:12px;font-weight:700;line-height:1.3;text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:4px 8px}
.roll-mode:hover,.roll-mode:focus-visible{color:#fff}
.power-meter{position:absolute;left:calc(50% - 262px);bottom:0;display:flex;align-items:center;gap:8px;min-width:54px;height:132px}
.power-meter[hidden]{display:none}
.power-track{position:relative;width:22px;height:112px;margin-bottom:10px;border:2px solid #b792f6;border-radius:13px 13px 5px 5px;background:#150e2d;box-shadow:inset 0 0 8px #0009,0 0 12px #c479ff33;overflow:visible}
.power-track::after{content:'';position:absolute;bottom:-10px;left:-6px;width:30px;height:30px;border:2px solid #b792f6;border-radius:50%;background:#211238;z-index:0}
.power-fill{position:absolute;left:2px;right:2px;bottom:2px;height:0%;max-height:calc(100% - 4px);border-radius:8px;background:linear-gradient(0deg,#5ee9ff 0%,#c17aff 55%,#ff5aad 100%);box-shadow:0 0 12px #ef78ff8a;z-index:1}
.power-bulb{position:absolute;bottom:-6px;left:-2px;width:22px;height:22px;border-radius:50%;background:var(--cyan);box-shadow:0 0 10px #5ee9ffaa;z-index:2}
.power-value{min-width:34px;color:var(--gold);font:800 13px 'Space Grotesk',sans-serif}
.aim-band{position:absolute;left:-7px;right:-7px;height:24%;border:2px solid #61efff;border-radius:7px;background:#55edff22;box-shadow:0 0 11px #55edff99;z-index:3;pointer-events:none}
.perfect-band{position:absolute;left:0;right:0;top:33.333%;height:33.333%;background:#f5fd74a6;box-shadow:0 0 12px #f5fd74;pointer-events:none}
.aim-controls{position:relative;display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;color:#e5f8ff}
.aim-controls[hidden]{display:none}
.aim-controls strong{font-size:10px;letter-spacing:.8px;white-space:nowrap;color:var(--cyan)}
.aim-picks{display:flex;gap:6px;align-items:center}
.aim-picks label{display:flex;flex-direction:row;align-items:center;gap:3px;margin:0;font-size:10px;white-space:nowrap}
.aim-picks select{min-height:28px;width:44px;padding:2px 4px;border-radius:6px;font-size:12px}
.aim-controls small{position:absolute;top:calc(100% + 4px);left:50%;transform:translateX(-50%);font-size:11px;white-space:nowrap;color:var(--gold);z-index:3}
.table:has(.aim-controls:not([hidden])) .arena-label{visibility:hidden}
@media(max-width:620px){.tabletop:has(.aim-controls:not([hidden])){flex-wrap:wrap}.tabletop .aim-controls{order:3;width:100%}.aim-controls strong{font-size:9px}.aim-controls small{top:calc(100% + 2px)}}
@media(max-width:580px){.roll-controls{min-height:88px;padding-left:56px}.roll-actions{max-width:none}.power-meter{left:2px;min-width:48px;gap:5px;height:105px}.power-track{height:90px}.power-value{font-size:11px}}
@media(prefers-reduced-motion:reduce){.power-fill{transition:none}}
@media(max-width:580px){.header-actions{display:flex;flex-wrap:nowrap;gap:6px}.header-actions .quiet{font-size:12px;padding:8px 9px;white-space:nowrap}.header-actions .new-game{margin-right:0}.new-game span{display:none}}
@media(max-width:380px){.header-actions .quiet{font-size:11px;padding:7px 7px}}
/* Keep the live table focused on the dice and give held dice a clear lower lane. */
body:has(#game:not([hidden])) .rules{display:none}
@media(min-width:900px){.table:has(.power-meter:not([hidden])) .hint{padding-left:100px;padding-right:12px}}
.lobby-actions{display:flex;justify-content:center;align-items:stretch;gap:14px;margin:20px 0}.lobby-actions .quiet,.lobby-actions .primary{min-width:150px}
@media(max-width:480px){.lobby-actions{flex-direction:column}.lobby-actions .primary{order:-1}}

/* Keep the desktop setup flow and both primary actions inside one viewport. */
@media(min-width:900px) and (min-height:650px){
 body:has(#setup:not([hidden])){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 body:has(#setup:not([hidden]))>header{width:100%;flex:0 0 auto;padding:12px 24px}
 body:has(#setup:not([hidden]))>main{width:100%;flex:1;min-height:0;padding:12px 24px;display:flex}
 body:has(#setup:not([hidden])) #setup{width:100%;flex:1;min-height:0;display:flex;flex-direction:column}
 body:has(#setup:not([hidden])) .intro{flex:0 0 auto;margin:0 0 10px}
 body:has(#setup:not([hidden])) .intro .eyebrow{font-size:12px}
 body:has(#setup:not([hidden])) .intro h1{font-size:clamp(36px,6dvh,60px);margin:4px 0;line-height:.95}
 body:has(#setup:not([hidden])) .intro p{margin:7px 0;font-size:15px;line-height:1.35}
 body:has(#setup:not([hidden])) .arcade-tags span{padding:4px 10px}
 body:has(#setup:not([hidden])) .setup-grid{width:100%;flex:0 0 auto;min-height:0;gap:18px}
 body:has(#setup:not([hidden])) .setup-grid .panel{min-height:0;padding:clamp(16px,2.2dvh,24px)}
 body:has(#setup:not([hidden])) .setup-grid h2{margin:6px 0 clamp(10px,1.8dvh,18px)}
 body:has(#setup:not([hidden])) .setup-grid label{gap:5px;margin-bottom:clamp(8px,1.4dvh,14px)}
 body:has(#setup:not([hidden])) .setup-grid input,
 body:has(#setup:not([hidden])) .setup-grid select{min-height:42px;padding:9px 12px}
 body:has(#setup:not([hidden])) .setup-grid form>.secondary{min-height:0;margin:auto 0 12px;padding-top:8px;line-height:1.4}
 body:has(#setup:not([hidden])) .setup-grid .primary{min-height:46px;padding:11px 20px}
 body:has(#setup:not([hidden])) .rules,
 body:has(#setup:not([hidden]))>footer{display:none}
}

/* A separate copy keeps score feedback alive while the next turn refreshes. */
.row.score-lift{position:fixed;z-index:30;margin:0;pointer-events:none;border:1px solid var(--gold);border-radius:10px;background:linear-gradient(110deg,#49306e,#28203e);color:#fff;transform-origin:center;animation:score-row-lift 1.8s ease-in-out both}
.row.score-lift b{color:var(--gold);background:#f5fd741a}
@keyframes score-row-lift{0%,100%{transform:translateY(0) scale(1);box-shadow:0 0 0 transparent}18%,72%{transform:translateY(-7px) scale(1.08);box-shadow:0 16px 30px #0009,0 0 24px #f5fd7440}}
@media(prefers-reduced-motion:reduce){.row.score-lift{animation:none;box-shadow:0 0 18px #f5fd7440}}