/* Dice-only tabletop identity. Shared header, game mechanics and other games are untouched. */
html[data-theme="light"] body.dice-standalone[data-local-game="dice"]{
 --dice-ink:#263a32;--dice-muted:#58675c;--dice-paper:#fffaf0;
 --dice-soft:#f6efe2;--dice-line:#d5c3a5;--dice-felt:#29614e;
 --dice-deep:#154036;--dice-brass:#9e713c;--dice-wood:#825737;
 --dice-action:#285d49;--dice-score:#a44436;
 background:radial-gradient(ellipse at 75% -10%,#e5d4b8,transparent 55%),#f2eadc;
 color:var(--dice-ink);color-scheme:light;
}
html[data-theme="dark"] body.dice-standalone[data-local-game="dice"]{
 --dice-ink:#f4ebdc;--dice-muted:#c5c7b7;--dice-paper:#20332f;
 --dice-soft:#1a2b2a;--dice-line:#625d4d;--dice-felt:#1c5241;
 --dice-deep:#102f2a;--dice-brass:#e2bb7d;--dice-wood:#553e2e;
 --dice-action:#e3bd83;--dice-score:#f2c186;
 background:radial-gradient(ellipse at 75% -10%,#365045,transparent 55%),
 radial-gradient(ellipse at 0 95%,#2a2d28,transparent 60%),#101e20;
 color:var(--dice-ink);color-scheme:dark;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero{
 border-bottom:1px solid var(--dice-line);margin-bottom:24px;padding-bottom:34px;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero h1{
 color:var(--dice-ink);font-weight:900;letter-spacing:-.06em;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero p{color:var(--dice-muted);}
html[data-theme] body.dice-standalone[data-local-game="dice"] .local-overline{color:var(--dice-brass);}
html[data-theme] body.dice-standalone[data-local-game="dice"] .local-tags span{
 color:var(--dice-ink);background:var(--dice-paper);border-color:var(--dice-line);
}
/* Polished wooden tray holding two ivory dice. */
html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero-art{
 position:relative;width:185px;height:165px;transform:none;
 background:radial-gradient(ellipse at 45% 28%,#ae7952,#6e462f 78%,#32251d);
 border:3px solid #a47d4f;border-radius:34px;
 box-shadow:0 14px 24px #21170e4a,inset 0 3px 4px #f9dfb681,inset 0 -8px 13px #29190db3;
 padding:8px 10px 13px;
}
html[data-theme="dark"] body.dice-standalone[data-local-game="dice"] .local-hero-art{
 background:radial-gradient(ellipse at 40% 30%,#785239,#403026 85%);border-color:#997248;
}
body.dice-standalone[data-local-game="dice"] .dice-hero-pair{
 display:block;position:relative;width:145px;height:112px;
}
body.dice-standalone[data-local-game="dice"] .dice-hero-die{
 display:block;position:absolute;width:68px;height:68px;border-radius:13px;
 border:2px solid #fdf7e8;background:linear-gradient(140deg,#fffef7,#ede9dd 65%,#c7bfae);
 box-shadow:inset 2px 3px 5px #fff,inset -4px -5px 8px #7c746674,3px 8px 5px #23190d9c;
}
body.dice-standalone[data-local-game="dice"] .dice-hero-die::before{
 content:"";position:absolute;left:28px;top:28px;width:9px;height:9px;
 background:#ad3630;border-radius:50%;
}
body.dice-standalone[data-local-game="dice"] .dice-hero-die--five{
 left:12px;top:17px;transform:rotate(-17deg);
}
body.dice-standalone[data-local-game="dice"] .dice-hero-die--five::before{
 box-shadow:-19px -19px 0 #ad3630,19px -19px 0 #ad3630,-19px 19px 0 #ad3630,19px 19px 0 #ad3630;
}
body.dice-standalone[data-local-game="dice"] .dice-hero-die--three{
 left:75px;top:33px;transform:rotate(16deg);
}
body.dice-standalone[data-local-game="dice"] .dice-hero-die--three::before{
 box-shadow:-19px 19px 0 #ad3630,19px -19px 0 #ad3630;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero-art small{
 color:#ffedcc;text-shadow:0 1px 2px #26170e;font-size:9px;letter-spacing:.1em;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal.local-play{
 border:1px solid var(--dice-line);border-top:5px solid var(--dice-wood);
 background:var(--dice-paper);color:var(--dice-ink);border-radius:21px;
 box-shadow:0 19px 48px #2d221e27;
}
html[data-theme="dark"] body.dice-standalone[data-local-game="dice"] #diceModal.local-play{
 box-shadow:0 20px 50px #0008;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .local-play-heading{
 background:linear-gradient(115deg,var(--dice-felt),var(--dice-deep));
 border-bottom:3px solid var(--dice-brass);color:#fff5dd;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .local-play-heading :is(h2,.local-overline){
 color:#f9edd2;text-shadow:0 1px 2px #06261da8;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-content{
 background:var(--dice-paper);color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal :is(.dice-intro,.dice-hint,.dice-member-count,#dice-round,#dice-status){
 color:var(--dice-muted);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal :is(.dice-field label,.dice-names-title,#dice-results-title){
 color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal :is(select,.dice-settings input){
 background:var(--dice-soft);color:var(--dice-ink);
 border:1px solid var(--dice-line);color-scheme:inherit;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-play-modes{
 background:var(--dice-soft);border-color:var(--dice-line);color:var(--dice-ink);color-scheme:inherit;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-play-modes .is-current{
 background:var(--dice-felt);border:1px solid #ead5a34a;color:#fff7e7;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-play-modes a{
 background:var(--dice-paper);border:1px solid var(--dice-line);color:var(--dice-ink);font-weight:750;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-play-modes a:hover{
 background:var(--dice-soft);border-color:var(--dice-brass);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-audio-controls{
 background:var(--dice-soft);border-color:var(--dice-line);color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-audio-controls button{
 background:var(--dice-paper);border-color:var(--dice-line);color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-audio-controls button[aria-pressed="true"]{
 background:var(--dice-felt);border-color:var(--dice-felt);color:#fff;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-audio-controls input[type="range"]{
 accent-color:var(--dice-brass);
}
/* Existing shared ParticipantEditor remains fully interactive. */
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster .dice-player-field.ug-participant-row{
 background:var(--dice-soft);color:var(--dice-ink);border-color:var(--dice-line);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster .dice-player-field.ug-participant-row:focus-within{
 background:var(--dice-paper);border-color:var(--dice-brass);box-shadow:0 0 0 3px #b48c542b;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster :is(.dice-name-number,.ug-participant-number){
 color:var(--dice-muted);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster .dice-player-avatar{
 background:var(--dice-paper);color:var(--dice-ink);border-color:var(--dice-line);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster input.ug-participant-name{
 background:var(--dice-paper)!important;color:var(--dice-ink)!important;
 -webkit-text-fill-color:var(--dice-ink);border-color:var(--dice-line);color-scheme:inherit;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster input.ug-participant-name::placeholder{
 color:var(--dice-muted)!important;-webkit-text-fill-color:var(--dice-muted);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster .dice-player-remove{
 background:var(--dice-paper);color:var(--dice-muted);border:1px solid var(--dice-line);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster .dice-player-remove:not(:disabled):hover{
 background:#863a35;color:#fff;border-color:#a55248;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster .dice-player-add{
 background:var(--dice-felt);color:#fff;border-color:var(--dice-felt);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-actions{
 background:var(--dice-soft);border-color:var(--dice-line);color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-actions .dice-hint{
 color:var(--dice-muted);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-actions :is(.btn-primary,.ug-result-replay){
 background:var(--dice-action);border:1px solid var(--dice-action);color:#fff;
 box-shadow:0 3px 0 #162e2540;
}
html[data-theme="dark"] body.dice-standalone[data-local-game="dice"] #diceModal .dice-actions :is(.btn-primary,.ug-result-replay){
 color:#2d251d;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-actions :is(.btn-primary,.ug-result-replay):hover{
 filter:brightness(1.1);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-actions :is(.btn-secondary,.ug-result-edit,.ug-result-home,.ug-copy-result-button){
 background:var(--dice-paper)!important;color:var(--dice-ink)!important;
 border:1px solid var(--dice-line)!important;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-actions :is(.btn-secondary,.ug-result-edit,.ug-result-home,.ug-copy-result-button):hover{
 background:var(--dice-soft)!important;border-color:var(--dice-brass)!important;
}
/* Preserve genuine felt and glossy 3D dice in both modes. */
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roll-stage.is-dice-arena{
 background:var(--dice-deep);border:2px solid var(--dice-brass);
 box-shadow:0 13px 27px #16231d52,inset 0 0 0 5px var(--dice-deep),inset 0 0 0 7px #f0dfb855;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-arena-participant{
 background:radial-gradient(ellipse at 52% 62%,#80b79438,transparent 72%),linear-gradient(155deg,#306b52,var(--dice-deep));
 border-color:#b4a27d8a;
}
html[data-theme="dark"] body.dice-standalone[data-local-game="dice"] #diceModal .dice-arena-participant{
 background:radial-gradient(ellipse at 52% 62%,#68997a35,transparent 72%),linear-gradient(155deg,#285746,#11332d);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-arena-participant :is(.dice-arena-caption,.dice-arena-placement){
 color:#ffedc8;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result{
 background:var(--dice-soft);border-color:var(--dice-line);box-shadow:inset 3px 0 0 var(--dice-felt);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result.is-winner{
 background:linear-gradient(105deg,#c29a502b,var(--dice-soft) 75%);border-color:var(--dice-brass);
 box-shadow:inset 4px 0 0 var(--dice-brass),0 4px 12px #4c371d25;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result :is(.dice-result-rank,.dice-result-name){
 color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result .dice-result-score{
 color:var(--dice-score);font-weight:850;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result .dice-winner-badge{
 background:var(--dice-felt);color:#fff4dc;border-color:var(--dice-brass);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result .dice-face{
 background:#fff9e9;color:#283932;border-color:#e9d9bc;box-shadow:0 3px 0 #8b8977;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-local-badge{
 background:var(--dice-felt);color:#fff5e5;border:1px solid var(--dice-brass);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] :is(.local-guide,.seo-related-games){
 background:var(--dice-paper);border-color:var(--dice-line);color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] :is(.local-guide h2,.seo-related-copy h2,.seo-related-links strong){
 color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] :is(.local-guide p,.seo-related-copy p,.seo-related-links small,.local-footer){
 color:var(--dice-muted);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] .seo-related-links a{
 background:var(--dice-soft);border-color:var(--dice-line);color:var(--dice-ink)!important;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] .seo-related-icon{background:var(--dice-paper);}
html[data-theme] body.dice-standalone[data-local-game="dice"] .seo-related-links a:hover{
 border-color:var(--dice-brass);background:var(--dice-paper);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal :is(button,a,select,input):focus-visible{
 outline:3px solid var(--dice-brass);outline-offset:2px;
}
@media(max-width:430px){
 html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero{
  margin-bottom:16px;padding-bottom:23px;
 }
 html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-play-modes{flex-wrap:wrap;}
 html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-play-modes > :is(span,a){flex:1 1 130px;}
}
@media(prefers-reduced-motion:reduce){
 html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero-art{transform:none;}
}

/* The shared roster uses !important theme rules; dice's final palette wins locally. */
html[data-theme="light"] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster .dice-player-field.ug-participant-row{
 background:var(--dice-soft)!important;border-color:var(--dice-line)!important;color:var(--dice-ink)!important;
}
html[data-theme="light"] body.dice-standalone[data-local-game="dice"] #diceModal .dice-roster .dice-player-field.ug-participant-row:focus-within{
 background:var(--dice-paper)!important;border-color:var(--dice-brass)!important;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal #dice-outcome{
 background:var(--dice-paper);color:var(--dice-ink);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result-heading{
 color:var(--dice-ink);
}

/* Strongly isolate the light roster from late common-participant backgrounds. */
html[data-theme="light"] body.dice-standalone[data-local-game="dice"] #diceModal .dice-names.dice-roster > .dice-name-field.dice-player-field.ug-participant-row{
 background-color:#f6efe2!important;background-image:none!important;
 border-color:#d5c3a5!important;color:#263a32!important;
}
html[data-theme="light"] body.dice-standalone[data-local-game="dice"] #diceModal .dice-names.dice-roster > .dice-name-field.dice-player-field.ug-participant-row:focus-within{
 background-color:#fffaf0!important;border-color:#9e713c!important;
}
html[data-theme="light"] body.dice-standalone[data-local-game="dice"] #diceModal .dice-settings > .dice-field{
 background:transparent!important;
}

/* Symmetric 4-column desktop / 2x2 mobile settings grid & responsive hero dice tray */
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-settings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--dice-line);
  border-radius: 14px;
  background: var(--dice-soft);
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-settings .dice-rule-field {
  grid-column: span 1;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-settings :is(select, input) {
  background: var(--dice-paper);
  font-weight: 700;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal #dice-rule-description {
  margin-top: 10px;
  padding: 9px 13px;
  border-left: 3px solid var(--dice-brass);
  border-radius: 0 9px 9px 0;
  background: var(--dice-soft);
  font-size: 12px;
  font-weight: 600;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result {
  align-items: center;
  padding: 14px;
  border-radius: 14px;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result .dice-result-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 44px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--dice-paper);
  border: 1px solid var(--dice-line);
  font-size: 12px;
  font-weight: 850;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result.is-winner .dice-result-rank {
  background: var(--dice-brass);
  border-color: var(--dice-brass);
  color: #fffaf0;
}
html[data-theme="dark"] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result.is-winner .dice-result-rank {
  color: #231c14;
}
html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-result .dice-result-score {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--dice-paper);
  border: 1px solid var(--dice-line);
  font-size: 14px;
}
@media (max-width: 820px) {
  html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 10px;
    padding: 12px;
  }
  html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-settings > .dice-field:first-child,
  html[data-theme] body.dice-standalone[data-local-game="dice"] #diceModal .dice-settings > .dice-rule-field {
    grid-column: span 1 !important;
  }
}
@media (max-width: 750px) {
  html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero-art {
    width: 142px;
    height: 128px;
    border-radius: 26px;
    padding: 6px 8px 10px;
  }
  body.dice-standalone[data-local-game="dice"] .dice-hero-pair {
    width: 145px;
    height: 86px;
    transform: scale(0.76);
    transform-origin: top center;
  }
}
@media (max-width: 480px) {
  html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero {
    gap: 12px;
    align-items: center;
  }
  html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero-art {
    display: grid !important;
    width: 106px;
    height: 98px;
    border-radius: 20px;
    border-width: 2px;
    padding: 4px 6px 7px;
  }
  body.dice-standalone[data-local-game="dice"] .dice-hero-pair {
    width: 145px;
    height: 66px;
    transform: scale(0.58);
    transform-origin: top center;
  }
  html[data-theme] body.dice-standalone[data-local-game="dice"] .local-hero-art small {
    font-size: 7px;
    letter-spacing: 0.08em;
  }
}
