/* Shared visual-only email choice. The native checkbox remains the form control. */
html[data-fm-clear-play] .fm-game-email-optin {
  --fm-optin-surface:#fff9ee;
  --fm-optin-ink:#302333;
  --fm-optin-border:#88708b;
  --fm-optin-check-border:#5b2e64;
  --fm-optin-focus:#2358b5;
  display:flex!important;
  align-items:flex-start!important;
  gap:11px!important;
  width:100%!important;
  min-width:0!important;
  min-height:48px!important;
  margin:10px 0 4px!important;
  padding:12px!important;
  border:2px solid var(--fm-optin-border)!important;
  border-radius:8px!important;
  background:var(--fm-optin-surface)!important;
  color:var(--fm-optin-ink)!important;
  font:600 14px/1.45 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  text-align:left!important;
  box-sizing:border-box!important;
  cursor:pointer!important;
  touch-action:manipulation;
}

html[data-fm-clear-play][data-fm-lounge-look="halloween"] .fm-game-email-optin {
  --fm-optin-surface:#26313f;
  --fm-optin-ink:#fff2dc;
  --fm-optin-border:#a89982;
  --fm-optin-check-border:#edd39f;
  --fm-optin-focus:#9ce7df;
}

/* Explicit child color prevents a game theme's inherited white text overriding
   the matching surface. This selector never touches names or email text fields. */
html[data-fm-clear-play] .fm-game-email-optin > span {
  display:block!important;
  min-width:0!important;
  color:var(--fm-optin-ink)!important;
  font:inherit!important;
  overflow-wrap:anywhere;
}

html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email] {
  -webkit-appearance:none!important;
  appearance:none!important;
  display:inline-grid!important;
  place-content:center!important;
  flex:0 0 24px!important;
  width:24px!important;
  min-width:24px!important;
  max-width:24px!important;
  height:24px!important;
  min-height:24px!important;
  max-height:24px!important;
  margin:1px 0 0!important;
  padding:0!important;
  box-sizing:border-box!important;
  border:2px solid var(--fm-optin-check-border)!important;
  border-radius:5px!important;
  background:#fffaf2!important;
  background-image:none!important;
  color:#ffffff!important;
  box-shadow:none!important;
  opacity:1!important;
  accent-color:#5b2e64!important;
  color-scheme:light;
  cursor:pointer!important;
  transition:none!important;
}

html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email]::before {
  content:"";
  display:block;
  width:6px;
  height:11px;
  box-sizing:content-box;
  border:solid #ffffff;
  border-width:0 3px 3px 0;
  margin-top:-3px;
  transform:rotate(45deg);
  opacity:0;
  pointer-events:none;
}

html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email]:checked {
  background:#5b2e64!important;
}
html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email]:checked::before {opacity:1;}
html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email]:focus-visible {
  outline:3px solid var(--fm-optin-focus)!important;
  outline-offset:3px!important;
}
html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email]:disabled {cursor:not-allowed!important;}

html[data-fm-clear-play] .fm-game-email-status {
  display:block!important;
  min-height:20px!important;
  margin:2px 0 7px!important;
  color:#5f4565!important;
  font:600 14px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
}
html[data-fm-clear-play] .fm-game-email-status[data-state="success"] {color:#17613b!important;}
html[data-fm-clear-play] .fm-game-email-status[data-state="error"] {color:#982335!important;}
html[data-fm-clear-play][data-fm-lounge-look="halloween"] :is(#start,#startScreen,#startScrim) .fm-game-email-status {color:#f3e7d4!important;}
html[data-fm-clear-play][data-fm-lounge-look="halloween"] :is(#start,#startScreen,#startScrim) .fm-game-email-status[data-state="success"] {color:#9ee0b8!important;}
html[data-fm-clear-play][data-fm-lounge-look="halloween"] :is(#start,#startScreen,#startScrim) .fm-game-email-status[data-state="error"] {color:#ffb5bf!important;}

/* Honor OS high-contrast mode with its own native checkbox and checkmark. */
@media(forced-colors:active) {
  html[data-fm-clear-play] .fm-game-email-optin {background:Canvas!important;color:CanvasText!important;border-color:CanvasText!important;}
  html[data-fm-clear-play] .fm-game-email-optin > span {color:CanvasText!important;}
  html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email] {
    -webkit-appearance:checkbox!important;
    appearance:auto!important;
    forced-color-adjust:auto!important;
    background:Canvas!important;
    border-color:ButtonText!important;
    accent-color:auto!important;
  }
  html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email]::before {display:none!important;}
  html[data-fm-clear-play] .fm-game-email-optin input[type="checkbox"][data-fm-daily-game-email]:focus-visible {outline-color:Highlight!important;}
}
