:root { --sbm-toolbar: 44px; --sbm-release: 0px; --sbm-safe-top: env(safe-area-inset-top, 0px); --sbm-safe-bottom: env(safe-area-inset-bottom, 0px); }
.sbm-release-strip { box-sizing: border-box; flex: 0 0 18px; width: 100%; height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 8px; background: #fff0b8; color: #302600; font: 10px/18px system-ui, sans-serif; }
body { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; height: 100vh; height: 100dvh; padding-bottom: var(--sbm-safe-bottom); }
#sbm-game-toolbar { box-sizing: border-box; display: flex; align-items: center; gap: 12px; flex: 0 0 auto; width: 100%; height: calc(var(--sbm-toolbar) + var(--sbm-safe-top)); padding: var(--sbm-safe-top) max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px)); background: #f6f4ec; border-bottom: 1px solid #dddccf; color: #253b30; font: 13px/1.2 system-ui, sans-serif; }
#sbm-game-toolbar a, #sbm-game-toolbar button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; color: inherit; white-space: nowrap; }
#sbm-game-toolbar a { text-decoration: none; }
#sbm-game-toolbar a:hover { text-decoration: underline; }
#sbm-game-toolbar a:focus-visible, #sbm-game-toolbar button:focus-visible { outline: 2px solid #295443; outline-offset: -2px; }
.sbm-game-name { margin-right: auto; font-weight: 650; white-space: nowrap; }
#sbm-game-toolbar button { min-width: 44px; border: 0; padding: 0 5px; background: transparent; font: inherit; cursor: pointer; }
#sbm-game-toolbar button:disabled { opacity: .55; cursor: default; }
#game { --sbm-game-max-width: 100vw; flex: 0 0 auto; margin: auto 0; width: min(var(--sbm-game-max-width), 100vw, calc((100vh - var(--sbm-toolbar) - var(--sbm-release) - var(--sbm-safe-top) - var(--sbm-safe-bottom)) * .5625)); height: min(calc(var(--sbm-game-max-width) * 1.777778), calc(100vh - var(--sbm-toolbar) - var(--sbm-release) - var(--sbm-safe-top) - var(--sbm-safe-bottom)), 177.7778vw); }
#game[data-sbm-game="sudoku-q"] { --sbm-game-max-width: 480px; }
@supports (height: 100dvh) { #game { width: min(var(--sbm-game-max-width), 100vw, calc((100dvh - var(--sbm-toolbar) - var(--sbm-release) - var(--sbm-safe-top) - var(--sbm-safe-bottom)) * .5625)); height: min(calc(var(--sbm-game-max-width) * 1.777778), calc(100dvh - var(--sbm-toolbar) - var(--sbm-release) - var(--sbm-safe-top) - var(--sbm-safe-bottom)), 177.7778vw); } }
html:fullscreen #game, html.sbm-focus #game { --sbm-game-max-width: 100vw; }
#sbm-game-status { position: fixed; bottom: max(8px, env(safe-area-inset-bottom, 0px)); left: 8px; right: 8px; z-index: 20; width: fit-content; max-width: calc(100% - 16px); margin: auto; padding: 8px 12px; border-radius: 6px; background: #fff8dc; color: #302c1c; font: 13px/1.4 system-ui, sans-serif; pointer-events: none; }
#sbm-game-status[hidden] { display: none; }
#sbm-game-exit-fullscreen { display: none; position: fixed; right: max(8px, env(safe-area-inset-right, 0px)); bottom: max(4px, env(safe-area-inset-bottom, 0px)); z-index: 21; min-height: 28px; padding: 3px 8px; border: 1px solid #a6ad9f; border-radius: 5px; background: #f6f4ec; color: #253b30; font: 12px/1.3 system-ui, sans-serif; cursor: pointer; }
html:fullscreen #sbm-game-exit-fullscreen { display: block; }
#loading { grid-template-columns: minmax(0, 1fr); padding: 12px; }
#loading progress { width: 80%; max-width: 260px; justify-self: center; }
html:fullscreen { --sbm-toolbar: 0px; --sbm-release: 0px !important; }
html:fullscreen #sbm-game-toolbar { display: none; }
html:fullscreen .sbm-release-strip { display: none; }
html.sbm-focus { --sbm-toolbar: 0px; --sbm-release: 0px !important; }
html.sbm-focus #sbm-game-toolbar, html.sbm-focus .sbm-release-strip { display: none; }
html.sbm-focus #sbm-game-exit-fullscreen { display: block; }
@media (max-width: 359px) { #sbm-game-toolbar { gap: 8px; font-size: 12px; } }
