/* Control kit: dark glass discs with a brass rim and ivory glyphs, laid out by the existing SDK-style bar.
   Glyph colour only (the icons draw with currentColor; their own fill/stroke rules stay). Loaded after every other sheet. */
#game .control { color: #f1e4c6; }

#game .menu-button .control-face,
#game .auto-button .control-face,
#game .speed-button .control-face {
  width: 38px; height: 38px; padding: 8px; box-sizing: border-box;
  background: radial-gradient(circle at 50% 32%, #2a3442, #0c1118 72%);
  border: 1.5px solid #c9a35c; border-radius: 50%; color: #f1e4c6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
}
#game .menu-button .control-face { padding: 10px; }

#game .spin-button {
  background: radial-gradient(circle at 50% 30%, #2b3543, #0b1017 74%);
  border: 3px solid #c9a35c; color: #f1e4c6;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .6), 0 0 0 1px rgba(201, 163, 92, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}
#game .spin-button .control-face { color: #f1e4c6; }
#game .spin-count { color: #f1e4c6; }
#game .replay-label { color: #e8c278; }
#game .spin-button.is-holding::after {
  background: conic-gradient(#e8c278 var(--hold-progress, 0deg), rgba(201, 163, 92, .2) 0);
}

#game .bonus-button {
  background: linear-gradient(#202833, #0c1118); color: #e8c278;
  border: 1.5px solid #c9a35c; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
}
#game .bonus-button .bonus-label { color: #e8c278; }
#game .bonus-button .native-symbol { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .7)); }

/* states */
#game .control:active .control-face, #game .spin-button:active { filter: brightness(1.15); }
#game .control.is-active .control-face {
  background: radial-gradient(circle at 50% 32%, #3a4a5c, #141c26 72%); border-color: #e8c278; color: #fff;
}
#game .speed-button.is-fast .control-face {
  border-color: #e8c278; box-shadow: 0 2px 8px rgba(0, 0, 0, .55), 0 0 0 2px rgba(232, 194, 120, .35);
}
#game .auto-count { border-color: #c9a35c; background: #0c1118; color: #f1e4c6; }
#game[data-theme="atlas"] .bonus-button:disabled {
  background: #141a22; color: #7b8794; border-color: #4b5563;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
#game[data-theme="atlas"] .bonus-button:disabled .bonus-label { color: #7b8794; }
#game[data-theme="atlas"] .auto-button:disabled:not(.is-active) .control-face {
  background: #141a22; color: #7b8794; border-color: #4b5563; box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

/* Speed control: three states that read at a glance. Normal keeps the navy face; fast turns the face gold with a
   dark bolt and a FAST tag; turbo turns it hot amber with a double bolt and a TURBO tag. */
#game .speed-button .control-face { position: relative; }
#game .speed-button.is-fast:not(.is-active) .control-face {
  background: radial-gradient(circle at 50% 30%, #fbe6ad, #e2b456 55%, #a8741f 100%);
  border-color: #fff1c9; color: #141c26;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55), inset 0 0 0 1.5px #fff6dc;
}
#game .speed-button.is-fast.is-active .control-face {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 28'%3E%3Cg fill='%23141c26'%3E%3Cpath d='M13 1 3 16h8L9 27 22 10h-9l3-9z' transform='translate(0 1) scale(.92)'/%3E%3Cpath d='M13 1 3 16h8L9 27 22 10h-9l3-9z' transform='translate(17 1) scale(.92)'/%3E%3C/g%3E%3C/svg%3E") center / 80% no-repeat,
    radial-gradient(circle at 50% 30%, #ffe08a, #f59e2c 55%, #c2410c 100%);
  border-color: #fff3d6; color: #141c26;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55), inset 0 0 0 1.5px #fff6dc;
}
#game .speed-button.is-fast.is-active .control-face svg { opacity: 0; }
#game .speed-button.is-fast .control-face::after {
  content: "FAST"; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  padding: 2px 4px 1.5px; border-radius: 5px; background: #141c26; border: 1px solid #e8c278; color: #f6d98f;
  font-family: inherit; font-size: 8px; font-weight: 800; line-height: 1; letter-spacing: .08em; white-space: nowrap;
  pointer-events: none;
}
#game .speed-button.is-fast.is-active .control-face::after { content: "TURBO"; border-color: #f59e2c; color: #ffd08a; }

/* rev 186: SPIN leads the controls (hierarchy G4 on the phone): a brighter brass rim and a lighter glyph; the
   small keys' glyphs and rims step back. BUY BONUS shows a flat cream key like the other glyphs. */
#game .spin-button { border-color: #e4c27a; box-shadow: 0 3px 12px rgba(0, 0, 0, .6), 0 0 0 1px #8a6a32, inset 0 0 0 1.5px #f3dca2; }
#game .spin-button .control-face, #game .spin-count { color: #fff6e2; }
#game .menu-button .control-face, #game .auto-button .control-face, #game .speed-button:not(.is-fast) .control-face { color: #b9ab8c; border-color: #9c7f48; }
#game .bonus-button .control-face .native-symbol { display: none !important; }
#game .bonus-button .control-face { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 30'%3E%3Cg fill='none' stroke='%23f1e4c6' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='7.6' r='4.9'/%3E%3Cpath d='M12 12.6V27.4M12 21.2h4.6M12 25.4h3.6'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
/* fix164 begin */
/* Bonus entry: the controls stay in place until the map ink starts (class set at the ink seed), then fade out with
   the ink; the covered state hides them as before once the map covers the screen. */
#game.hud-ink-out #ui-layer { opacity: 0; transition: opacity .7s ease-in .12s; }

/* Autoplay panel: START follows the count choices and stays on screen while the panel scrolls; the count chips are
   48 px tall and never narrower than 44 px (they wrap onto a second row where five do not fit). */
#game.atlas-folio-v4 .atlas-navigation-folio .modal-body.atlas-clear-auto { display: flex; flex-direction: column; }
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto > * { flex: 0 0 auto; }
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-options {
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 6px; margin: 14px 0;
}
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-choice { min-width: 44px; min-height: 48px; }
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .modal-actions {
  order: 1; position: sticky; bottom: calc(-1 * var(--fb, 15px)); z-index: 2; margin: 12px 0 0; padding-top: 6px;
  padding-bottom: var(--fb, 15px); background: linear-gradient(#f0dfb500, #f0dfb5 6px);
}
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .atlas-rule-note { order: 2; margin-top: 12px; }
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .modal-actions {
  display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.45fr); gap: 8px;
}
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .modal-actions > * { min-width: 0; padding-left: 8px; padding-right: 8px; }

/* Narrow or short screens: compact copy, START alone at full width (the corner close button stays). */
@media (max-width: 379px), (max-height: 520px) {
  #game.atlas-folio-v4 .atlas-navigation-folio .modal-body.atlas-clear-auto { padding-left: 7px; padding-right: 7px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto > p:not(.atlas-rule-note) { font-size: 14px; line-height: 1.3; margin: 4px 0 2px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-options { gap: 3px; margin: 10px 0; }
  #game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .atlas-rule-note { font-size: 13px; line-height: 1.3; padding: 7px 9px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .modal-actions { margin-top: 8px; grid-template-columns: minmax(0, 1fr); }
  #game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .modal-actions .secondary-action { display: none !important; }
  #game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .modal-actions .atlas-auto-start {
    flex: 1 1 100%; min-height: 48px; padding: 8px 8px 10px;
  }
  #game.atlas-folio-v4 .atlas-clear-auto .atlas-auto-start-copy { gap: 5px; }
  #game.atlas-folio-v4 .atlas-clear-auto .atlas-auto-verb,
  #game.atlas-folio-v4 .atlas-clear-auto .atlas-auto-noun { font-size: 13px; }
  #game.atlas-folio-v4 .atlas-clear-auto .atlas-auto-count { font-size: 21px; padding: 2px 6px 3px; min-width: 30px; }
}
@media (max-height: 420px) {
  #game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto > p:not(.atlas-rule-note) { display: none; }
  #game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-options { gap: 3px; margin: 4px 0 8px; }
}
@media (max-height: 320px) {
  #game.atlas-folio-v4 .atlas-clear-auto .atlas-auto-noun { display: none; }
}

/* Free-spins rail in short landscape: a dark plate under the labels, which otherwise sit on the bright shelf art. */
#game.atlas-transparent-awards.is-short-landscape .board-status.atlas-painted-feature-rail {
  background: linear-gradient(90deg, #05262dc8, #113b3be6, #05262dc8) !important;
  border: 1px solid #b8955870 !important; border-radius: 4px; box-shadow: 0 2px 8px #0008 !important;
}

/* Free-spins banners: themed plate, readable copy; the bundle places them off the board (data-place164). */
#game .charge-beat {
  padding: 7px 14px 8px; border: 1px solid #c9a35e; border-radius: 4px;
  background: linear-gradient(180deg, #0f2f34f5, #0a2126f5); box-shadow: 0 3px 10px #000a, inset 0 1px #f3d59a33;
  color: #ffe3a6; text-shadow: 0 1px #041214;
}
#game .charge-beat strong { font: 400 15px/1.15 var(--atlas-heading, 'Atlas Fell SC', Georgia, serif); letter-spacing: .03em; }
#game .charge-beat span { font: 600 12.5px/1.25 var(--atlas-body, 'Atlas Alegreya', Georgia, serif); margin-top: 2px; color: #f3dfb4; }
#game .charge-beat[data-place164] { transform: translate(-50%, 0); }

/* Autoplay "Stop when free spins begin": themed check box; the whole 48 px row is the touch target. */
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-stop-bonus { min-height: 48px; gap: 12px; cursor: pointer; align-items: center; }
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-stop-bonus input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 30px; height: 30px; min-width: 30px; margin: 0 2px;
  border: 2px solid #9d7b44; border-radius: 3px; background: #f6e7c1; box-shadow: inset 0 1px 2px #6b4f2a66; cursor: pointer;
}
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-stop-bonus input[type=checkbox]:checked {
  border-color: #b79754; background: #17433f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='%23f1cf78' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 76% no-repeat;
}
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-stop-bonus input[type=checkbox]:focus-visible { outline: 2px solid #f1cf78; outline-offset: 2px; }
#game.atlas-folio-v4 .atlas-navigation-folio .atlas-clear-auto .auto-stop-bonus span { font: 600 15px/1.2 var(--atlas-body, Georgia, serif); color: #443623; }

/* Folio panels: the action row (BACK, CLOSE, BACK TO MENU) stays on screen at the bottom of a scrolling panel. */
#game.atlas-folio-v4 .atlas-navigation-folio .modal-body { --fb: 15px; }
#game.atlas-folio-v4 .atlas-navigation-folio .modal-body:not(:has(> .menu-options)) > .modal-actions,
#game.atlas-folio-v4 .atlas-navigation-folio .modal-body > .primary-action {
  position: sticky; bottom: calc(-1 * var(--fb)); z-index: 2; background: linear-gradient(#f0dfb500, #f0dfb5 8px);
  padding-top: 8px; padding-bottom: var(--fb);
}
@media (max-width: 400px) { #game.atlas-folio-v4 .atlas-navigation-folio .modal-body { --fb: 13px; } }

/* Sound & play speed: compact rows (switch beside its slider, speed caption beside its choices), title clear of the X. */
#game.atlas-folio-v4 .atlas-navigation-folio:has(.settings-content) .modal-header h2 { font-size: 21px; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .setting-section { position: relative; padding: 2px 0 4px; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .setting-toggle { position: static; min-height: 22px; padding-right: 64px; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .setting-toggle strong { font-size: 16px; line-height: 1.2; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .setting-toggle input { position: absolute; left: auto; top: auto; right: 0; bottom: 4px; width: 52px; height: 44px; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .setting-toggle .switch-track { position: absolute; right: 4px; bottom: 13px; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .volume-row { min-height: 44px; padding-top: 0; padding-right: 60px; gap: 8px; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .setting-section:has(.speed-options) {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 6px;
}
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content strong.setting-caption { font-size: 14px; line-height: 1.12; margin: 0; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .speed-options { gap: 4px; margin: 0; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .speed-choice { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 2px; font-size: 14px; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .modal-actions { flex-wrap: nowrap; gap: 6px; margin-top: 6px; }
#game.atlas-folio-v4 .atlas-navigation-folio .settings-content .modal-actions > * { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 6px 8px 8px; font-size: 17px !important; }

/* Bonus-buy card: BACK is a full 44 px target; on short screens the card content flows as one compact column. */
#game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-actions .secondary-action { min-height: 44px; }
@media (max-height: 520px) {
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-body.atlas-purchase {
    position: absolute; top: 24.5%; bottom: 8%; left: 12%; right: 12%; height: auto; padding: 0; overflow: hidden;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 5px;
  }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-body.atlas-purchase > * {
    position: static !important; inset: auto !important; margin: 0 !important; max-width: none; flex: 0 0 auto;
  }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .atlas-dialog-reward { flex-direction: column; align-items: center; gap: 1px; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-kicker { font-size: 11px; margin: 0; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-count { gap: 8px; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-count strong { font-size: 34px; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-count span { font-size: 15px; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-copy { font-size: 12px; line-height: 1.2; margin: 2px 0 0; text-align: center; }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .atlas-dialog-stake { gap: 2px; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-field-label { font-size: 12px; margin: 0; text-align: center; }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .purchase-stepper { min-height: 44px; padding: 0 4px; }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .atlas-purchase-cost { gap: 0 8px; padding: 2px 8px; background: #0b262bd9; border: 1px solid #b8955866; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-purchase-cost > small { font-size: 12px; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-factor { font-size: 11px; }
  #game.atlas-folio-v4 .atlas-painted-purchase .purchase-price { font-size: 22px; }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-body.atlas-purchase > .modal-actions {
    display: grid !important; grid-template-columns: auto minmax(0, 1fr); gap: 6px; height: auto; flex-direction: row;
  }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-actions > * { min-height: 44px; padding: 4px 8px 6px; font-size: 13px !important; }
}
@media (max-height: 340px) {
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-kicker,
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-copy,
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-factor { display: none; }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-body.atlas-purchase { gap: 3px; left: 10%; right: 10%; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-dialog-count strong { font-size: 28px; }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-actions > * { font-size: 11.5px !important; padding: 4px 6px 6px; }
}

/* Short or narrow screens: the speed caption goes back above its choices; the menu rows are compact and the menu's
   CLOSE gives way to the corner close button; folio titles stay clear of that button. */
@media (max-height: 520px), (max-width: 359px) {
  #game.atlas-folio-v4 .atlas-navigation-folio .settings-content .setting-section:has(.speed-options) { display: block; }
  #game.atlas-folio-v4 .atlas-navigation-folio .settings-content strong.setting-caption { font-size: 13px; margin: 0 0 3px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .settings-content .speed-choice { font-size: 13px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .settings-content .modal-actions > * { font-size: 14px !important; }
}
@media (max-height: 520px) {
  #game.atlas-folio-v4 .atlas-navigation-folio .modal-header h2 { font-size: 18px !important; white-space: nowrap; }
  #game.atlas-folio-v4 .atlas-navigation-folio .menu-options { gap: 4px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .menu-options .menu-action { min-height: 44px; padding-top: 4px; padding-bottom: 4px; font-size: 16px !important; }
  #game.atlas-folio-v4 .atlas-navigation-folio .modal-body:has(> .menu-options) > .modal-actions { display: none; }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-header h2 { font-size: 20px !important; white-space: nowrap; }
}
@media (max-height: 340px) {
  #game.atlas-folio-v4 .atlas-navigation-folio { width: min(480px, calc(100vw - 16px), calc((100dvh - 8px) * .667)); max-height: calc(100dvh - 8px); }
  #game.atlas-folio-v4 .atlas-navigation-folio .modal-header h2 { font-size: 16px !important; }
  #game.atlas-folio-v4 .atlas-navigation-folio .modal-body { padding-top: 4px; padding-bottom: 4px; --fb: 4px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .menu-options { gap: 1px; }
  #game.atlas-folio-v4 .atlas-navigation-folio:has(.settings-content) .modal-header h2 { font-size: 12px !important; }
  #game.atlas-folio-v4 .atlas-navigation-folio .settings-content .modal-actions > * { font-size: 11px !important; padding: 4px 3px 6px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .settings-content .setting-toggle strong { font-size: 13px; }
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-header h2 { font-size: 13px !important; }
}
/* Bonus-buy card on short screens: cost and actions sit together at the bottom, in the card's dark panel. */
@media (max-height: 520px) {
  #game.atlas-themed-panels-v3 .atlas-painted-purchase .modal-body.atlas-purchase > .atlas-purchase-cost { margin-top: auto !important; }
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-purchase-cost > small { white-space: nowrap; }
}
@media (max-height: 340px) {
  #game.atlas-folio-v4 .atlas-painted-purchase .atlas-purchase-cost > small { font-size: 11px; }
  #game.atlas-folio-v4 .atlas-painted-purchase .purchase-price { font-size: 18px; }
}

/* Menu on phones up to 700 px tall: compact rows so the four entries and CLOSE fit without scrolling. */
@media (max-height: 700px) and (min-height: 521px) {
  #game.atlas-folio-v4 .atlas-navigation-folio .menu-options { gap: 4px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .menu-options .menu-action { min-height: 46px; padding-top: 4px; padding-bottom: 4px; }
  #game.atlas-folio-v4 .atlas-navigation-folio .modal-body:has(> .menu-options) > .modal-actions { margin-top: 10px; }
}
/* fix164 end */
