:root{color-scheme:dark;--background:#1e2831;--text:#d8cfba;--muted:#b8ad97;--panel:#d8cfba;--panel-text:#263039;--surface:#2d363d;--border:#485159;--accent:#b7683c}
:root[data-theme="light"]{color-scheme:light;--background:#eee9de;--text:#263039;--muted:#655c4e;--surface:#e1dbce;--border:#bcb3a3;--accent:#a6532c}
body{margin:0;min-height:100dvh;background:var(--background);color:var(--text);font-family:Arial,sans-serif;display:flex;flex-direction:column}button{cursor:pointer}[hidden]{display:none!important}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
#mesa-preview .mesa-stage{padding:24px 12px;min-height:758px;display:flex;justify-content:center;align-items:flex-start;box-sizing:border-box}
#mesa-preview .mesa-phone{--mesa-accent:#efba65;--mesa-radius:18px;width:100%;max-width:390px;min-height:698px;box-sizing:border-box;background:#1d222e;color:var(--text);border-radius:28px;padding:26px 24px 22px;font-family:Arial,sans-serif;box-shadow:0 18px 50px #00000024;overflow:hidden}
#mesa-preview *{box-sizing:border-box}
#mesa-preview h2{font-size:34px;line-height:1.12;font-weight:500;letter-spacing:-1.1px;color:var(--text);margin:22px 0 12px}
#mesa-preview .mesa-intro{font-size:14px;line-height:1.5;color:var(--muted);margin:0 0 26px;max-width:280px}
#mesa-preview .mesa-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#mesa-preview button{font-family:inherit}
#mesa-preview .mesa-choice{position:relative;min-height:161px;border:0;border-radius:var(--mesa-radius);background:var(--panel);color:var(--panel-text);padding:19px 16px;text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:13px}
#mesa-preview .mesa-choice svg{width:25px;height:25px;stroke-width:1.5}
#mesa-preview .mesa-choice b{font-size:16px;line-height:1.25;font-weight:600;display:block}
#mesa-preview .mesa-choice small{font-size:12px;line-height:1.45;color:var(--panel-text);display:block;margin-top:6px}
#mesa-preview .mesa-choice:hover{background:#fff9ed;transform:translateY(-2px)}
#mesa-preview .mesa-choice:last-child{background:var(--mesa-accent)}
#mesa-preview .mesa-choice:last-child small{color:var(--panel-text)}
#mesa-preview .mesa-label{margin:26px 0 11px;color:var(--muted);font-size:11px;letter-spacing:1.4px;text-transform:uppercase}
#mesa-preview .mesa-continue{display:flex;align-items:center;gap:12px;width:100%;padding:15px 14px;background:var(--surface);border:1px solid var(--border);border-radius:14px;text-align:left;color:var(--text)}
#mesa-preview .mesa-continue svg{width:20px;height:20px;color:var(--mesa-accent);flex-shrink:0}
#mesa-preview .mesa-continue span{flex:1;font-size:14px}
#mesa-preview .mesa-continue small{display:block;font-size:12px;color:var(--muted);margin-top:5px}
#mesa-preview .mesa-back{border:0;background:transparent;color:var(--muted);display:flex;align-items:center;gap:7px;padding:0;min-height:36px;font-size:13px;margin-bottom:10px}
#mesa-preview .mesa-back svg{width:16px;height:16px}
#mesa-preview .mesa-form label{display:block;font-size:13px;color:var(--muted);margin:20px 0 9px}
#mesa-preview .mesa-form input,#mesa-preview .mesa-form select{width:100%;background:var(--surface);color:var(--text);border:1px solid var(--border);padding:14px;border-radius:12px;font-family:inherit;font-size:16px}
#mesa-preview .mesa-main{margin-top:24px;min-height:48px;padding:12px 18px;width:100%;border:0;border-radius:12px;background:var(--mesa-accent);color:var(--panel-text);font-size:15px;font-weight:600}
#mesa-preview .mesa-result{color:var(--text);font-size:15px;line-height:1.6;margin:22px 0;min-height:28px}
#mesa-preview .mesa-results{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}
#mesa-preview .mesa-die{width:48px;height:48px;display:grid;place-items:center;border-radius:10px;background:var(--panel);color:var(--panel-text);font-size:23px}
#mesa-preview .mesa-score{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);padding:15px 0;font-size:16px;gap:10px}
#mesa-preview .mesa-score button{background:var(--surface);border:0;border-radius:8px;color:var(--mesa-accent);width:42px;height:42px;font-size:20px}
#mesa-preview .mesa-score strong{font-size:23px;font-weight:500;min-width:30px;text-align:center}
#mesa-preview .mesa-score span{flex:1;overflow-wrap:anywhere}
@media(max-width:380px){#mesa-preview .mesa-stage{padding:12px 0;min-height:758px}#mesa-preview .mesa-phone{padding:24px 18px;border-radius:22px}#mesa-preview .mesa-choice{padding:16px 12px}#mesa-preview h2{font-size:30px}}
#mesa-preview{width:100%;max-width:540px;margin:0 auto;flex:1}
#mesa-preview .mesa-phone{--mesa-accent:var(--accent);--mesa-radius:9px;max-width:none;min-height:0;background:transparent;border-radius:0;box-shadow:none;padding:36px 24px 24px}
#mesa-preview h2{font-size:30px;margin:0 0 12px;color:var(--text)}
#mesa-preview .mesa-choice{min-height:174px}
#mesa-preview .mesa-choice:hover{background:var(--panel);filter:brightness(1.06)}
#mesa-preview .mesa-choice:last-child,#mesa-preview .mesa-choice:last-child:hover{background:var(--accent);color:#fff5e8}
#mesa-preview .mesa-choice:last-child small{color:#fff5e8}
#mesa-preview .mesa-label{text-transform:none;letter-spacing:0}
#mesa-preview .mesa-continue{border:0;border-radius:9px}
.site-footer{box-sizing:border-box;width:100%;max-width:540px;margin:0 auto;padding:36px 24px 26px;display:flex;justify-content:space-between;align-items:center;gap:20px}.site-footer a{color:var(--accent);font-size:18px;font-weight:700;letter-spacing:.6px;text-decoration:none}.site-footer a:hover{text-decoration:underline}.site-footer small{display:block;color:var(--muted);font-size:11px;font-style:italic;margin-top:5px}#theme-toggle{width:42px;height:42px;border:0;border-radius:9px;background:var(--surface);color:var(--text);display:grid;place-items:center}#theme-toggle svg{width:23px;height:23px}
@media(prefers-reduced-motion:reduce){#mesa-preview .mesa-choice:hover{transform:none}}
.players-setup,.round-score{display:flex;flex-direction:column;min-height:440px;gap:12px}
.player-actions{display:flex;gap:8px}.player-actions button{flex:1;border:0;border-radius:9px;background:var(--surface);color:var(--text);padding:12px;font-weight:600}
.player-actions button.accent,.theme-choice button[aria-pressed="true"]{background:var(--accent);color:#fff5e8}
.player-block{display:grid;gap:12px}.player-card{display:flex;gap:14px;align-items:center;background:var(--surface);border:2px solid transparent;border-radius:9px;padding:10px}.player-card.selected{border-color:var(--muted)}.player-card>span:not(.player-badge){flex:1;overflow-wrap:anywhere}
.player-badge{background:var(--player-color);width:32px;height:32px;flex:0 0 32px;border-radius:50%;display:grid;place-items:center;color:#fff;box-shadow:inset 0 0 0 1px #ffffff30;font-size:15px}
.player-card button{border:0;background:transparent;color:var(--text);padding:8px;display:grid;place-items:center}.player-card svg{width:19px;height:19px}
.add-player,.delete-player{border:0;border-radius:9px;padding:16px;background:var(--surface);color:var(--text);width:100%}.delete-player{color:var(--accent)}.start-game{margin-top:auto!important}
.player-editor label,.player-editor legend{font-size:13px;color:var(--muted);display:block;margin:8px 0 12px}.player-editor input{width:100%;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:9px;padding:12px;font-size:16px}.player-editor fieldset{border:0;padding:0;margin:22px 0 16px}.player-palette{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}.color-swatch{aspect-ratio:1;min-width:0;border:2px solid transparent;border-radius:8px;background:var(--swatch);position:relative}.color-swatch[aria-pressed="true"]{outline:2px solid var(--text);outline-offset:2px}.color-swatch.used:after{content:"";position:absolute;width:80%;height:3px;background:#eee7dc;left:10%;top:48%;transform:rotate(-45deg)}
.player-error{font-size:13px;color:var(--text);margin:8px 0}.player-error:empty{display:none}
#mesa-preview .round-score .mesa-score{padding:14px 0}#mesa-preview .round-score .mesa-score .player-badge{flex:0 0 32px}#mesa-preview .round-score .mesa-score button{width:auto;min-width:36px;padding:8px;font-size:18px}#mesa-preview .round-score .mesa-score button:disabled{opacity:.3;cursor:default}
.operations{display:flex;gap:6px}.operations button{flex:0 0 34px;border:0;background:var(--surface);color:var(--accent);border-radius:8px;font-size:22px;min-height:38px}.operations button[aria-pressed="true"]{background:var(--accent);color:#fff5e8}.operations input{width:100%;min-width:0;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px;text-align:center;font-size:16px}.operation-cancel,.reset-link{background:transparent;border:0;color:var(--muted);padding:12px 0;font-size:13px}.reset-area{margin-top:auto;padding-top:50px}.reset-area p{font-size:13px;color:var(--muted)}button:disabled{cursor:default}.start-game:disabled{opacity:.4}
body[data-page="inner"] .site-footer{display:none}
body[data-page="inner"] #mesa-preview .mesa-phone{padding-top:18px;padding-bottom:118px}
body[data-page="inner"] #mesa-preview .mesa-back{margin-bottom:14px}
.bottom-action,.start-game{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:calc(100% - 48px)!important;max-width:492px;z-index:10}
.bottom-action{padding:24px 0 18px;background:linear-gradient(to bottom,transparent,var(--background) 30%)}
.bottom-action:before,.start-game:before{pointer-events:none}
#mesa-preview .bottom-action .mesa-main{margin:0}
#mesa-preview .start-game{bottom:18px;margin:0;box-shadow:0 18px 0 18px var(--background)}
.players-setup:has(.start-game):after{content:"";position:fixed;bottom:0;left:0;right:0;height:112px;pointer-events:none;background:linear-gradient(to bottom,transparent,var(--background) 45%);z-index:9}
.selector-label{border:0;background:transparent;color:var(--muted);padding:0;margin:0 0 12px;text-align:left;font-size:14px;display:flex;align-items:center;gap:16px}
.dice-selectors section{margin-bottom:24px}.dice-options{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.dice-options button{border:0;background:var(--surface);color:var(--text);border-radius:8px;padding:10px;font-size:14px;font-weight:600}.dice-options button[aria-pressed="true"]{background:var(--accent);color:#fff5e8}.dice-options:has(button:only-child){width:74px;grid-template-columns:1fr}.dice-options:has(button:only-child) button{background:var(--surface);color:var(--text)}
.current-roll .mesa-results{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
#mesa-preview .current-roll .mesa-die{width:100%;height:auto;aspect-ratio:1;max-height:80px;font-size:clamp(20px,6vw,27px)}
.roll-total{font-size:13px;color:var(--muted);margin:16px 0 24px}.history-roll{display:flex;gap:12px;align-items:center;margin-bottom:12px}.history-values{display:flex;gap:6px;flex:1;min-width:0}#mesa-preview .history-values .mesa-die{background:var(--surface);color:var(--text);width:auto;max-width:44px;flex:1;height:38px;font-size:14px}.history-roll>span{font-size:12px;color:var(--muted);white-space:nowrap}
.game-tabs{display:flex;border-bottom:1px solid var(--border);margin:8px 0 24px}.game-tabs button{flex:1;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);padding:14px;font-size:14px}.game-tabs button[aria-selected="true"]{color:var(--text);border-bottom-color:var(--accent)}
.combined-player-view>.mesa-back,.combined-player-view>h2,.combined-player-view>.mesa-intro{display:none}
.combined-player-view[hidden],#combined-dice[hidden]{display:none!important}
.combined-player-view[hidden] .start-game{display:none}
#mesa-preview .current-roll .mesa-results{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
#mesa-preview .mesa-main{color:#fff5e8}
body[data-page="inner"] #mesa-preview .mesa-form>.mesa-main{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);width:calc(100% - 48px);max-width:492px;z-index:10;margin:0;box-shadow:0 18px 0 18px var(--background)}
body[data-page="inner"] .mesa-form:has(>.mesa-main):after{content:"";position:fixed;bottom:0;left:0;right:0;height:112px;pointer-events:none;background:linear-gradient(to bottom,transparent,var(--background) 45%);z-index:9}
.reentry{display:inline-block;margin-left:10px;color:var(--accent);font-size:13px;font-weight:700}.game-winner{padding:18px;background:var(--surface);border-left:3px solid var(--accent);font-size:20px;border-radius:8px}.game-notice{color:var(--muted);font-size:14px;line-height:1.5}
.pitos-score{min-height:440px;display:flex;flex-direction:column}.pitos-modules{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;margin:12px 0}.pitos-modules button{border:0;border-radius:9px;min-width:0;padding:10px 2px;background:var(--surface);color:var(--text);display:flex;flex-direction:column;align-items:center;gap:7px}.pitos-modules button[aria-pressed="true"]{background:var(--accent);color:#fff5e8}.pitos-placeholder{display:inline-block;width:22px;height:22px;border-radius:50%;background:var(--text);flex:none}.pitos-modules small{font-size:10px;opacity:.8}.pitos-modules b{font-size:13px;overflow-wrap:anywhere;max-width:100%}.pitos-value{display:grid;grid-template-columns:42px minmax(0,1fr) 42px;gap:8px}.pitos-value button{border:0;border-radius:8px;background:var(--surface);color:var(--accent);font-size:24px}.pitos-value input{width:100%;text-align:center;padding:10px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);font:inherit}.pitos-value .player-error{grid-column:1/-1}.negative{color:var(--accent)}
#mesa-preview .pitos-score .mesa-score .player-badge{flex:0 0 32px;width:32px;height:32px}
#mesa-preview .pitos-score .mesa-score button{width:auto;min-width:42px;padding:8px;font-size:15px}
#mesa-preview .score-actions{display:flex;gap:8px;flex:0 0 92px;justify-content:flex-end}
#mesa-preview .score-actions button{width:42px;flex:0 0 42px;padding:8px}
#mesa-preview .mesa-score .score-done{width:92px;min-width:92px;flex:0 0 92px}
.view-score svg{width:20px;height:20px}.pitos-modules button:disabled{opacity:1;cursor:default}
#mesa-preview .mesa-score button:disabled:not(.view-score){opacity:.3}
.reset-area{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:calc(100% - 48px);max-width:492px;padding:28px 0 18px;margin:0;z-index:11;background:linear-gradient(to bottom,transparent,var(--background) 28%)}
.reset-link{display:flex;align-items:center;gap:8px;min-height:42px}.reset-link svg{width:18px;height:18px}
.footer-brand{display:flex;align-items:center;gap:16px}.brand-logo{color:var(--accent);display:flex;width:30px;height:50px}.brand-logo svg{width:100%;height:100%}.footer-brand small{font-weight:400;letter-spacing:0}.footer-brand b{font-size:18px}
.pitos-symbol{display:flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--panel)}.pitos-symbol svg{width:100%;height:100%}
.die-symbol{width:62%;height:62%;display:flex;align-items:center;justify-content:center}.die-symbol svg,.die-logo svg{width:100%;height:100%}.die-symbol.red{color:#b83f42}.die-symbol.ink{color:var(--background)}
.die-logo{display:flex;align-items:center;justify-content:center;width:34%;height:65%;color:var(--accent)}
#mesa-preview .mesa-die{color:var(--background)}
#mesa-preview .history-values .die-symbol{width:20px;height:20px}#mesa-preview .history-values .die-logo{width:13px;height:23px}
.brand-logo svg,.die-logo svg{fill:currentColor}
#mesa-preview .mesa-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
#mesa-preview .mesa-choice{width:100%;aspect-ratio:1 / 1;min-width:0;min-height:0;height:auto;padding:18px 16px;gap:12px}
#mesa-preview .mesa-choice svg{width:32px;height:32px;flex:0 0 32px}
#mesa-preview .mesa-choice b{font-size:16px;line-height:1.25}
#mesa-preview .mesa-choice small{font-size:12px;line-height:1.4;margin-top:6px}
.footer-brand{align-items:stretch;gap:14px}
.brand-logo{position:relative;height:auto;width:21px;flex:0 0 21px;align-self:stretch}
.brand-logo svg{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.footer-brand b,.site-footer a{font-weight:500}
@media(max-width:420px){#mesa-preview .mesa-choice{padding:14px 12px;gap:9px}#mesa-preview .mesa-choice small{font-size:11px;margin-top:5px}}
@media(max-width:340px){#mesa-preview .mesa-choice{padding:12px 9px;gap:7px}#mesa-preview .mesa-choice b{font-size:14px}#mesa-preview .mesa-choice svg{width:29px;height:29px;flex-basis:29px}}
@media(max-width:290px){#mesa-preview .mesa-grid{grid-template-columns:1fr}}
#mesa-preview .mesa-choice[data-mode="3"] svg{transform:scale(.88);transform-origin:center}
#mesa-preview .mesa-choice,.mesa-continue{transition:transform .18s ease,filter .18s ease,box-shadow .18s ease}
@media(hover:hover) and (pointer:fine){
 #mesa-preview .mesa-choice:hover,#mesa-preview .mesa-continue:hover{filter:brightness(1.08);transform:translateY(-3px);box-shadow:0 7px 18px #00000024}
}
#mesa-preview .mesa-choice:active,#mesa-preview .mesa-continue:active{transform:translateY(0);filter:brightness(.97);box-shadow:none}
@media(prefers-reduced-motion:reduce){#mesa-preview .mesa-choice,#mesa-preview .mesa-continue{transition:none}#mesa-preview .mesa-choice:hover,#mesa-preview .mesa-continue:hover{transform:none}}
:root{--selection:#d8cfba;--submenu-size:14px}
#mesa-preview .mesa-intro{opacity:.8}
#mesa-preview .players-setup>.mesa-label,#mesa-preview .round-label{font-size:var(--submenu-size);line-height:1.5}
#mesa-preview .mesa-back,#mesa-preview .reset-link{font-size:var(--submenu-size);color:var(--accent)}
#mesa-preview button:focus-visible,#mesa-preview input:focus-visible,#mesa-preview select:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--selection)}
#mesa-preview .player-editor input,#mesa-preview .operations input,#mesa-preview .pitos-value input{border-color:transparent}
#mesa-preview .color-swatch{border:0;outline:none}
#mesa-preview .color-swatch[aria-pressed="true"]{outline:none;box-shadow:inset 0 0 0 2px var(--selection)}
#mesa-preview .player-card{border:0;padding:12px}
#mesa-preview .player-card.selected{border:0;box-shadow:inset 0 0 0 2px var(--selection)}
#mesa-preview .player-editor>.player-actions{margin-top:16px}
#mesa-preview .score-block{border-bottom:1px solid var(--border);padding-bottom:12px}
#mesa-preview .score-block>.mesa-score{border-bottom:0}
#mesa-preview .operations button{width:36px;height:36px;min-height:36px;flex:0 0 36px;padding:0;aspect-ratio:1}
#mesa-preview .operations input{height:36px}
#mesa-preview .mesa-score button:not(.score-done){width:42px;height:42px;min-width:42px;flex:0 0 42px;padding:0;aspect-ratio:1}
#mesa-preview .mesa-score button.score-done{height:42px;aspect-ratio:auto}
#mesa-preview .pitos-value button{width:42px;height:42px;padding:0;aspect-ratio:1}
:root{--submenu-size:16px}
#mesa-preview h2{font-size:32px}
#mesa-preview .mesa-intro{font-size:16px;opacity:.64}
.reuse-panel{display:grid;gap:12px}.reuse-list{display:grid;gap:8px}.reuse-player{position:relative;display:flex;align-items:center;gap:12px;padding:12px;background:var(--surface);border-radius:9px;cursor:pointer;font-size:15px}.reuse-player input{position:absolute;width:24px;height:24px;left:12px;opacity:0}.reuse-check{width:24px;height:24px;flex:0 0 24px;border:2px solid var(--selection);border-radius:50%;box-sizing:border-box}.reuse-player input:checked+.reuse-check{background:var(--selection)}.reuse-player:has(input:focus-visible){box-shadow:inset 0 0 0 2px var(--selection)}.reuse-player:has(input:disabled){opacity:.45;cursor:default}.reuse-note{font-size:12px;color:var(--muted);margin:0}
:root{--control-height:42px}
#mesa-preview button:not(.mesa-choice):not(.selector-label){height:var(--control-height);min-height:var(--control-height);padding-top:0;padding-bottom:0;box-sizing:border-box}
#mesa-preview .mesa-main{display:flex;align-items:center;justify-content:center}
#mesa-preview .mesa-score .score-confirm,#mesa-preview .mesa-score .score-cancel,#mesa-preview .operations button,#mesa-preview .pitos-value button{width:var(--control-height);min-width:var(--control-height);flex:0 0 var(--control-height);height:var(--control-height);aspect-ratio:1;font-size:23px;padding:0}
#mesa-preview .score-actions{flex-basis:92px}
#mesa-preview .operations input,#mesa-preview .pitos-value input,#mesa-preview .player-editor input{height:var(--control-height)}
#mesa-preview .color-swatch{width:42px;aspect-ratio:1}
#mesa-preview .player-palette{grid-template-columns:repeat(auto-fit,42px);gap:8px}
#mesa-preview .pitos-modules button{height:auto;min-height:90px;padding:10px 2px}
#mesa-preview .selector-label{height:42px;display:flex;align-items:center}
#mesa-preview .player-actions button{padding-left:10px;padding-right:10px}
#mesa-preview .mesa-continue{height:auto;min-height:76px;padding-top:15px;padding-bottom:15px}
#mesa-preview .pitos-modules button[type="button"]{height:auto;min-height:90px;padding:10px 2px}
#mesa-preview .mesa-continue[type="button"]{height:auto;min-height:76px;padding-top:15px;padding-bottom:15px}
#mesa-preview .score-block{padding-bottom:24px}
#mesa-preview .mesa-score button,#mesa-preview .operations button,#mesa-preview .pitos-value button{display:inline-flex;align-items:center;justify-content:center;line-height:1;padding:0;font-size:27px}
#mesa-preview .mesa-score .score-confirm,#mesa-preview .mesa-score .score-cancel,#mesa-preview .operations button,#mesa-preview .pitos-value button{font-size:27px}
#mesa-preview .view-score svg{width:25px;height:25px;display:block}
#mesa-preview .player-card button{display:inline-flex;align-items:center;justify-content:center}
#mesa-preview .player-card button svg{width:23px;height:23px;display:block}
#mesa-preview .mesa-phone:has(.round-score)>.mesa-intro{margin-bottom:18.2px}
#mesa-preview .round-label{font-size:14px;margin-top:18.2px;margin-bottom:0}
#mesa-preview .round-score .mesa-score button,#mesa-preview .pitos-score .mesa-score button{font-size:27px;line-height:1;display:inline-flex;align-items:center;justify-content:center;padding:0}
#mesa-preview .round-score .mesa-score button.score-confirm,#mesa-preview .pitos-score .mesa-score button.score-confirm{font-size:23px}
#mesa-preview .score-block:not(:has(~ .score-block)){border-bottom:0}
.dice-selectors{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px;margin-bottom:24px}
.dice-selectors section{margin:0}
#mesa-preview .selector-label{font-size:16px;margin:0 0 8px}
.selected-die-option{width:74px;border:0;border-radius:8px;background:var(--surface);color:var(--text);font-weight:600}
.selected-die-option[aria-expanded="true"]{box-shadow:inset 0 0 0 2px var(--selection)}
.expanded-options{grid-column:1/-1}
#mesa-preview .current-roll>.mesa-label,#mesa-preview .roll-history>.mesa-label{font-size:16px}
#mesa-preview .current-roll .mesa-results{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#mesa-preview .current-roll .mesa-die{max-height:none;font-size:clamp(28px,8vw,40px)}
.roll-total,.history-roll>span{color:var(--accent)}
.bottom-action,.reset-area{background:var(--background)}
.bottom-action:before,.reset-area:before{content:"";position:absolute;left:-24px;right:-24px;bottom:100%;height:64px;background:linear-gradient(to bottom,transparent,var(--background));pointer-events:none}
.bottom-action:after,.reset-area:after{content:"";position:absolute;left:-24px;right:-24px;top:0;bottom:0;background:var(--background);z-index:-1;pointer-events:none}
.dice-selectors{container-type:inline-size}
#mesa-preview .current-roll>.mesa-label{margin-top:42px}
#mesa-preview .roll-history>.mesa-label{margin-top:42px}
#mesa-preview .current-roll .mesa-die{font-size:clamp(36px,10vw,48px);font-weight:700}
#mesa-preview .current-roll .die-logo{width:27%;height:50%}
#mesa-preview .expanded-options[data-kind="count"]{grid-template-columns:repeat(6,minmax(0,1fr));gap:7px}
#mesa-preview .expanded-options button[type="button"]{height:calc((100cqw - 35px)/6);min-height:0;padding:0;display:flex;align-items:center;justify-content:center}
#mesa-preview .expanded-options[data-kind="count"] button{aspect-ratio:1}
#mesa-preview .current-roll .mesa-die{font-size:clamp(46px,13vw,62px)}
#mesa-preview .history-values .die-logo{width:9px;height:15px;color:var(--panel)}
.reuse-row{display:flex;align-items:center;background:var(--surface);border-radius:9px;gap:6px;padding-right:6px}.reuse-row .reuse-player{flex:1;min-width:0;background:transparent}.reuse-row .reuse-player>span:last-child{overflow-wrap:anywhere}
.reuse-delete{display:flex;align-items:center;justify-content:center;width:42px;flex:0 0 42px;border:0;background:transparent;color:var(--text);border-radius:8px}.reuse-delete svg{width:23px;height:23px}
#mesa-preview .combined-player-view>.mesa-back,#mesa-preview .combined-player-view>h2,#mesa-preview .combined-player-view>.mesa-intro{display:none}
#mesa-preview .combined-game .game-tabs button{font-size:20px;font-weight:500}
#mesa-preview .reuse-row label.reuse-player{display:flex;align-items:center;gap:12px;margin:0;padding:12px;flex:1;min-width:0}
#mesa-preview .reuse-row .reuse-player input[type="checkbox"]{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:24px;height:24px;min-width:24px;padding:0;margin:0;opacity:0;border:0}
body[data-page="home"] #mesa-preview .mesa-continue{height:75.6px;min-height:75.6px;padding:16px}
body[data-page="home"] #mesa-preview .mesa-phone>.mesa-label{font-size:16px;line-height:1.5}
body[data-page="home"] .brand-logo,body[data-page="home"] .footer-brand small{color:var(--muted);opacity:.64}
#mesa-preview .pitos-modules button[type="button"]{min-height:110px;gap:8px;padding-top:12px;padding-bottom:12px}
#mesa-preview .pitos-modules .pitos-symbol{height:28px;width:28px}
#mesa-preview .pitos-modules button:not([data-module="0"]) .pitos-symbol svg{height:25px;width:25px}
#mesa-preview .pitos-modules small{opacity:.56}
#mesa-preview .pitos-modules b{margin-top:auto;padding-top:12px}
#mesa-preview .pitos-modules button[type="button"]{min-height:100px}
#mesa-preview .pitos-modules small{opacity:1;color:var(--accent)}
#mesa-preview .history-values .die-symbol{color:var(--panel)}
.dice-selectors{grid-template-columns:repeat(3,minmax(0,1fr))}
#mesa-preview .selected-die-option{width:100%;font-size:12px;padding-left:4px;padding-right:4px}
#mesa-preview .expanded-options[data-kind="style"]{grid-template-columns:repeat(2,minmax(0,1fr))}
#mesa-preview .expanded-options[data-kind="style"] button{height:auto;min-height:42px;font-size:13px;padding:8px}
.custom-faces{margin:20px 0;font-size:14px;color:var(--muted)}.custom-face-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-height:280px;overflow:auto}.custom-face-list label{display:grid;gap:6px}.custom-face-list input{width:100%;min-width:0;padding:10px;background:var(--surface);color:var(--text);border:0;border-radius:8px;font:inherit}
.pip-grid{width:60%;height:60%;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:4px;align-items:center;justify-items:center}.pip-grid i{width:70%;height:70%;border-radius:50%}.pip-grid .pip{background:currentColor}
.face-label{font-size:clamp(20px,6vw,32px);max-width:90%;overflow-wrap:anywhere;text-align:center;line-height:1.1}.face-text{font-size:clamp(14px,4vw,21px)}.face-emoji{font-size:40px}.color-face{display:flex;flex-direction:column;align-items:center;gap:6px}.color-face i{width:30px;height:30px;border-radius:50%;box-shadow:inset 0 0 0 1px #ffffff30}.color-face small{font-size:12px}
#mesa-preview .history-values .face-label,#mesa-preview .history-values .face-text{font-size:10px}#mesa-preview .history-values .face-emoji{font-size:20px}#mesa-preview .history-values .color-face{gap:2px}#mesa-preview .history-values .color-face i{width:12px;height:12px}#mesa-preview .history-values .color-face small{font-size:8px}#mesa-preview .history-values .pip-grid{gap:1px}
#mesa-preview .expanded-options[data-kind="style"] button:disabled{opacity:.35;cursor:default}
.color-config{margin:20px 0;font-size:14px;color:var(--muted)}.color-face-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.color-face-settings label{display:grid;gap:6px}.color-face-settings input{width:100%;min-width:0;height:42px;border:0;border-radius:8px;background:var(--surface);color:var(--text);padding:6px;font:inherit}.color-face-settings input[type="color"]{cursor:pointer}
.sex-symbol{display:flex;align-items:center;justify-content:center;width:78%;height:78%;color:var(--background)}.sex-symbol svg{width:100%;height:100%;fill:currentColor}
#mesa-preview .history-values .sex-symbol{width:26px;height:26px;color:var(--panel)}
#mesa-preview .current-roll .pip-grid i{width:88%;height:88%}
#mesa-preview .current-roll .face-letter,#mesa-preview .current-roll .face-yesno{font-size:clamp(46px,13vw,62px);font-weight:700}
#mesa-preview .history-values .die-logo{color:var(--accent)}
.coin-symbol{display:flex;align-items:center;justify-content:center;width:64%;height:64%}.coin-symbol svg{width:100%;height:100%}
#mesa-preview .history-values .coin-symbol{width:24px;height:24px;color:var(--panel)}
.color-slots{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:22px 0 28px}.color-slot{width:100%;border:0;border-radius:9px;background:var(--surface)}
#mesa-preview .color-slots button[type="button"]{height:auto;min-height:0;aspect-ratio:1;padding:0}
.color-slot[aria-pressed="true"]{box-shadow:inset 0 0 0 2px var(--selection)}
.face-color-palette{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
#mesa-preview .face-color-palette button[type="button"]{position:relative;width:100%;height:auto;min-height:0;aspect-ratio:1;padding:0;border:0;border-radius:8px}
.face-color-swatch.used:after{content:"";position:absolute;left:10%;top:48%;width:80%;height:3px;background:var(--selection);transform:rotate(-45deg)}
.color-hint{font-size:12px;line-height:1.5;color:var(--muted)}.roll-button:disabled{opacity:.45;cursor:default}
#mesa-preview .current-roll .color-face{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
#mesa-preview .current-roll .color-face i{width:64%;height:64%;border-radius:50%}
#mesa-preview .history-values .color-face i{width:22px;height:22px}
.coin-head{color:var(--accent)}.coin-tail{color:var(--background)}.coin-symbol svg{fill:currentColor}
#mesa-preview .history-values .coin-symbol{color:var(--panel)}
#mesa-preview .current-roll .coin-symbol{width:78%;height:78%}
#mesa-preview .current-roll .color-face i{width:78%;height:78%}
.bottle-tabs button{font-size:20px}.bottle-turn{font-size:20px;margin:12px 0}.bottle-circle{position:relative;width:100%;aspect-ratio:1;max-width:430px;margin:30px auto}
.bottle-player{position:absolute;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:5px;text-align:center;width:76px;font-size:12px}.bottle-player>span:last-child{max-width:76px;overflow-wrap:anywhere}
.bottle-player.is-turn{color:var(--accent)}.bottle-player.is-target{font-weight:700}.bottle-player.is-target .player-badge{box-shadow:0 0 0 3px var(--selection)}
.bottle-spinner{position:absolute;left:50%;top:50%;width:38px;height:130px;color:var(--accent);transform-origin:center}.bottle-spinner svg{width:100%;height:100%}
.bottle-result{text-align:center;font-size:18px;min-height:24px}.bottle-actions .reset-link{margin-top:8px}.bottle-actions p{font-size:14px;color:var(--muted)}#bottle-board{padding-bottom:40px}
.bottle-ring{width:100%;height:100%;display:block}.bottle-sector path{fill:var(--surface);transition:fill .1s,filter .1s}.bottle-sector text{fill:var(--text);font-size:8px;pointer-events:none;font-weight:500}
.bottle-sector.passing path,.bottle-sector:hover path{fill:color-mix(in srgb,var(--surface),var(--text) 6%)}
.bottle-sector.chosen path{fill:var(--sector-color)}.bottle-sector.chosen text{fill:var(--text);font-weight:700}
.bottle-circle{margin:26px auto 12px}
.bottle-turn{display:flex;align-items:center;gap:12px}.bottle-spinner{color:var(--muted);width:34px;height:110px}
@media(prefers-reduced-motion:reduce){.bottle-sector path{transition:none}}
#bottle-board{display:flex;flex-direction:column;height:calc(100dvh - 218px);min-height:420px;padding-bottom:0}
#bottle-board[hidden]{display:none}
#bottle-board>.round-label{margin-top:18px;margin-bottom:0}
#bottle-board .bottle-turn{margin-top:22px;margin-bottom:0}
#bottle-board .bottle-turn .player-badge{width:24px;height:24px;flex:0 0 24px}
.bottle-scene{container-type:inline-size;--ring-size:min(100cqw,calc(100dvh - 350px));display:grid;grid-template-rows:minmax(24px,1fr) var(--ring-size) minmax(48px,1fr);flex:1;min-height:0;align-items:center;justify-items:center}
#bottle-board .bottle-circle{width:var(--ring-size);height:var(--ring-size);max-width:none;margin:0;grid-row:2}
#bottle-board .bottle-result{grid-row:3;align-self:center;justify-self:center;margin:0;padding:0 8px;text-align:center;font-size:18px;line-height:1.4}
.bottle-actions{padding-bottom:18px}
body[data-page="inner"] #mesa-preview .mesa-phone:has(#bottle-board){padding-bottom:0}
#bottle-board{min-height:300px}
.bottle-scene{grid-template-rows:minmax(12px,1fr) var(--ring-size) minmax(40px,1fr);min-height:224px}
#bottle-board .bottle-spinner{height:calc(var(--ring-size)*.48);width:calc(var(--ring-size)*.15)}
@media(max-height:650px){#bottle-board>.round-label{margin-top:8px}#bottle-board .bottle-turn{margin-top:12px}.bottle-tabs{margin-bottom:12px}}
#bottle-board .bottle-spinner{height:calc(var(--ring-size)*.432);width:calc(var(--ring-size)*.135)}
button,.reuse-player,.player-card{transition:background-color .16s ease,color .16s ease,box-shadow .16s ease,filter .16s ease}
@media(hover:hover) and (pointer:fine){
 #mesa-preview button:not(:disabled):not(.mesa-choice):not(.mesa-continue):hover,#theme-toggle:hover{filter:brightness(1.08);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--selection),transparent 65%)}
 #mesa-preview .reuse-player:has(input:not(:disabled)):hover{background:color-mix(in srgb,var(--surface),var(--text) 6%)}
 #mesa-preview .bottle-sector:hover path{fill:color-mix(in srgb,var(--surface),var(--text) 6%)}
}
#mesa-preview button:not(:disabled):active{filter:brightness(.96)}
#mesa-preview .player-block,#mesa-preview .score-block{transition:padding .18s ease}
.motion-exit{font-family:Arial,sans-serif;color:var(--text)}
@media(prefers-reduced-motion:reduce){button,.reuse-player,.player-card,#mesa-preview .player-block,#mesa-preview .score-block{transition:none!important}}
@media(hover:hover) and (pointer:fine){
 #mesa-preview button:not(:disabled):not(.mesa-choice):not(.mesa-continue):hover,#theme-toggle:hover{filter:brightness(1.16);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--selection),transparent 45%)}
}
#mesa-preview button:not(:disabled):active{filter:brightness(.86)}
#mesa-preview .mesa-choice:hover,#mesa-preview .mesa-continue:hover{filter:brightness(1.15);box-shadow:inset 0 0 0 2px var(--selection),0 6px 16px #00000020}
#mesa-preview button:not(:disabled):not(.mesa-choice):not(.mesa-continue):hover,#theme-toggle:hover{filter:brightness(1.18);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--selection),transparent 35%)}
#mesa-preview .reuse-player:has(input:not(:disabled)):hover{background:color-mix(in srgb,var(--surface),var(--text) 10%)}
/* El hover no representa una selección y no deja bordes en pantallas táctiles. */
#mesa-preview button:not(:disabled):not(.mesa-choice):not(.mesa-continue):hover,#theme-toggle:hover{box-shadow:none}
@media(hover:none),(pointer:coarse){
 #mesa-preview button:not(:disabled):hover,#theme-toggle:hover{filter:none;transform:none;box-shadow:none}
 #mesa-preview .selected-die-option[aria-expanded="true"]{box-shadow:inset 0 0 0 2px var(--selection)}
 #mesa-preview .color-swatch[aria-pressed="true"],#mesa-preview .color-slot[aria-pressed="true"]{box-shadow:inset 0 0 0 2px var(--selection)}
}
#mesa-preview .score-block:not(:has(.operation-form,.pitos-modules)){padding-bottom:10px}
@media(hover:none),(pointer:coarse){
 body[data-page] #mesa-preview button:not(:disabled):not(.mesa-choice):not(.mesa-continue):hover{filter:none;box-shadow:none}
}
#mesa-preview .selected-die-option[aria-expanded="true"]{box-shadow:inset 0 0 0 2px var(--selection)!important}
#mesa-preview .color-swatch[aria-pressed="true"],#mesa-preview .color-slot[aria-pressed="true"]{box-shadow:inset 0 0 0 2px var(--selection)!important}
