@import url("/css/header-theme-tokens.css?v=20261030-homemenu3");
/* The home and race All Games utility sheets reuse the same palette contract
 * as the standalone menu subviews. This only themes four existing dialogs;
 * race settings, game logic, guides and translation content are untouched. */
/* The home sticky header has z-index:1200; modal controls must stay above it. */
body.game-portal[data-header-theme="light"] #main-menu,
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) {
  z-index:2000;
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) {
  color:var(--menu-text);
  color-scheme:light;
  background:rgba(18,31,52,.64);
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-content {
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  background:var(--menu-bg);
  color:var(--menu-text);
  border:1px solid var(--menu-line);
  box-shadow:0 28px 95px #17274455;
  border-radius:19px;
  width:min(970px,100%);
  max-width:970px;
  max-height:min(800px,calc(100dvh - 30px));
  min-height:0;
  margin:0;
  padding:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-color:#9bacca var(--menu-bg);
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-header {
  position:sticky;
  top:0;
  z-index:3;
  box-sizing:border-box;
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 44px;
  align-items:center;
  gap:12px;
  flex:0 0 auto;
  width:100%;
  background:var(--menu-bg);
  color:var(--menu-text);
  border-bottom:1px solid var(--menu-line);
  margin:0;
  padding:20px 26px;
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-header h2 {
  min-width:0;
  margin:0;
  font:800 21px/1.4 system-ui,"Apple SD Gothic Neo",sans-serif;
  text-align:center;
  letter-spacing:-.025em;
  color:var(--menu-text);
  text-shadow:none;
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-header :is(.back-button,.close-modal-button) {
  box-sizing:border-box;
  display:grid;
  place-items:center;
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  margin:0;
  border:1px solid var(--menu-line);
  border-radius:10px;
  background:var(--menu-surface);
  color:var(--menu-text);
  box-shadow:none;
  font:700 21px/1 system-ui,sans-serif;
  transform:none;
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-header .back-button {
  grid-column:1;
  grid-row:1;
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-header .modal-header-buttons {
  grid-column:3;
  grid-row:1;
  display:flex;
  justify-content:end;
  margin:0;
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-header h2 {
  grid-column:2;
  grid-row:1;
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-header :is(.back-button,.close-modal-button):hover {
  background:var(--menu-surface-hover);
  border-color:var(--menu-accent);
  color:var(--menu-accent);
}
body.game-portal[data-header-theme="light"] :is(
  #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) :is(button,a,input,summary):focus-visible {
  outline:3px solid var(--menu-focus);
  outline-offset:3px;
}
/* Align the detailed help directory with standalone game's guide cards. */
body.game-portal[data-header-theme="light"] #game-help-modal :is(#help-categories,#help-content-container) {
  padding:22px 30px 27px;
  margin:0;
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #game-help-modal #help-categories {
  gap:12px;
  align-content:start;
}
body.game-portal[data-header-theme="light"] #game-help-modal :is(
  .help-overview p,.help-group-title,.help-game-copy>span,.help-game-meta,
  .help-game-summary,.help-category-content,.help-category-content .help-lead,
  .help-rule-table caption,.help-rule-table tbody th,.help-question p,
  .home-game-guide-step p) {
  color:var(--menu-muted);
}
body.game-portal[data-header-theme="light"] #game-help-modal :is(
  .help-overview .help-intro,.help-game-copy strong,.help-category-content h3,
  .help-category-content .help-lead,.home-game-guide-step h3,
  .help-rule-table thead,.help-question summary) {
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #game-help-modal :is(
  .help-category-button,.help-game-button,.help-game-directory-grid .help-game-button) {
  background:var(--menu-panel);
  color:var(--menu-text);
  border:1px solid var(--menu-line);
  border-radius:12px;
  box-shadow:none;
  transform:none;
}
body.game-portal[data-header-theme="light"] #game-help-modal :is(
  .help-category-button:hover,.help-game-button:hover,.help-game-directory-grid .help-game-button:hover) {
  background:var(--menu-surface-hover);
  border-color:var(--menu-accent);
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #game-help-modal :is(
  .help-game-number,.help-game-arrow,.help-category-content strong,
  .help-game-search-label) {
  color:var(--menu-accent);
}
body.game-portal[data-header-theme="light"] #game-help-modal .help-steps li::marker {color:var(--menu-accent)}
body.game-portal[data-header-theme="light"] #game-help-modal :is(
  .help-more,.help-category-content h3,.help-rule-table th,.help-rule-table td,
  .help-question,.home-game-guide-step) {
  border-color:var(--menu-line);
}
body.game-portal[data-header-theme="light"] #game-help-modal :is(
  .help-more>summary,.help-game-search-label,.help-category-content strong) {
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #game-help-modal .help-game-search-input {
  background:var(--menu-panel);
  border:1px solid var(--menu-line);
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #game-help-modal .help-game-search-input::placeholder {color:var(--menu-muted)}
body.game-portal[data-header-theme="light"] #game-help-modal :is(
  .help-callout,.instruction-tip,.help-rule-table thead) {
  background:var(--menu-panel);
  color:var(--menu-text);
  border-color:var(--menu-line);
  border-left-color:var(--menu-accent);
}
body.game-portal[data-header-theme="light"] #game-help-modal .help-rule-table {
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #game-help-modal .help-rule-table th,
body.game-portal[data-header-theme="light"] #game-help-modal .help-rule-table td {
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #game-help-modal .help-question {
  background:var(--menu-panel);
}
body.game-portal[data-header-theme="light"] #game-help-modal .home-game-guide-steps {
  counter-reset:guide-step;
  list-style:none;
  padding:0;
  display:grid;
  gap:11px;
}
body.game-portal[data-header-theme="light"] #game-help-modal .home-game-guide-step {
  counter-increment:guide-step;
  position:relative;
  padding:18px 18px 17px 62px;
  border:1px solid var(--menu-line);
  border-radius:12px;
  background:var(--menu-panel);
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #game-help-modal .home-game-guide-step::before {
  content:counter(guide-step,decimal-leading-zero);
  position:absolute;
  top:17px;
  left:17px;
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border:1px solid var(--menu-line);
  border-radius:10px;
  background:var(--menu-selected);
  color:var(--menu-accent);
  font-size:11px;
  font-weight:850;
}
body.game-portal[data-header-theme="light"] #game-help-modal .home-game-guide-play,
body.game-portal[data-header-theme="light"] :is(#supporter-modal,#contact-modal) .btn-primary {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:47px;
  margin:8px 0 0;
  padding:11px 18px;
  border:1px solid var(--menu-accent);
  border-radius:10px;
  background:var(--menu-accent);
  color:#fff;
  font:800 13px/1.4 system-ui,"Apple SD Gothic Neo",sans-serif;
  text-decoration:none;
  box-shadow:none;
  transform:none;
}
body.game-portal[data-header-theme="light"] #game-help-modal .home-game-guide-play:hover,
body.game-portal[data-header-theme="light"] :is(#supporter-modal,#contact-modal) .btn-primary:hover {
  background:#244bc0;
  color:#fff;
}
/* Language choices: same three-up format and accessible selection state. */
body.game-portal[data-header-theme="light"] #language-setting-modal .language-settings-container {
  padding:27px 30px;
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #language-setting-modal .language-options-large {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin:0 0 20px;
}
body.game-portal[data-header-theme="light"] #language-setting-modal .language-option-large {
  min-width:0;
  min-height:128px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid var(--menu-line);
  border-radius:12px;
  background:var(--menu-panel);
  color:var(--menu-text);
  box-shadow:none;
  transform:none;
}
body.game-portal[data-header-theme="light"] #language-setting-modal .language-option-large:is(.active,[aria-pressed="true"]) {
  background:var(--menu-selected);
  border-color:var(--menu-accent);
  box-shadow:inset 0 0 0 1px var(--menu-accent);
}
body.game-portal[data-header-theme="light"] #language-setting-modal .language-option-large:hover {
  border-color:var(--menu-accent);
  background:var(--menu-surface-hover);
}
body.game-portal[data-header-theme="light"] #language-setting-modal .language-option-large .language-flag {
  font-size:32px;
  margin:0;
}
body.game-portal[data-header-theme="light"] #language-setting-modal .language-option-large .language-name {
  font-size:14px;
  font-weight:800;
  color:var(--menu-text);
}
body.game-portal[data-header-theme="light"] #language-setting-modal .language-info {
  background:var(--menu-panel);
  border:1px solid var(--menu-line);
  border-radius:11px;
  padding:18px;
  margin:0;
  color:var(--menu-muted);
  text-align:left;
  font-size:13px;
  line-height:1.75;
}
body.game-portal[data-header-theme="light"] #language-setting-modal :is(.language-info p,.current-language) {
  color:var(--menu-muted);
}
body.game-portal[data-header-theme="light"] #language-setting-modal #current-language-display {
  color:var(--menu-accent);
}
body.game-portal[data-header-theme="light"] :is(#supporter-modal,#contact-modal) :is(.supporter-section,.contact-section) {
  padding:27px 30px;
  color:var(--menu-text);
  font-size:13px;
  line-height:1.85;
}
body.game-portal[data-header-theme="light"] :is(#supporter-modal,#contact-modal) :is(.supporter-section p,.contact-section p) {
  color:var(--menu-muted);
}
body.game-portal[data-header-theme="light"] #supporter-modal .supporter-credits {
  border-color:var(--menu-line);
  padding:18px 0 0;
}
body.game-portal[data-header-theme="light"] #supporter-modal .supporter-credits h3 {
  color:var(--menu-text);
}
@media(max-width:700px){
  body.game-portal[data-header-theme="light"] :is(
    #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-content {
    border-radius:14px;
    max-height:calc(100dvh - 20px);
  }
  body.game-portal[data-header-theme="light"] :is(
    #game-help-modal,#language-setting-modal,#supporter-modal,#contact-modal) .help-modal-header {
    padding:16px;
    gap:8px;
  }
  body.game-portal[data-header-theme="light"] #game-help-modal :is(#help-categories,#help-content-container),
  body.game-portal[data-header-theme="light"] #language-setting-modal .language-settings-container,
  body.game-portal[data-header-theme="light"] :is(#supporter-modal,#contact-modal) :is(.supporter-section,.contact-section) {
    padding:19px 17px;
  }
  body.game-portal[data-header-theme="light"] #language-setting-modal .language-option-large {
    min-height:105px;
    padding:8px 4px;
    gap:8px;
  }
  body.game-portal[data-header-theme="light"] #language-setting-modal .language-option-large .language-flag {font-size:26px}
  body.game-portal[data-header-theme="light"] #language-setting-modal .language-option-large .language-name {font-size:12px}
  body.game-portal[data-header-theme="light"] #game-help-modal .home-game-guide-step {
    padding:15px 13px 15px 57px;
  }
  body.game-portal[data-header-theme="light"] #game-help-modal .home-game-guide-step::before {left:12px;top:15px}
}
