/* Shared, self-contained layout: no background refresh or third-party assets. */
* { box-sizing: border-box; }
body { margin: 0; background: #f3f6fa; color: #24364b; font: 16px/1.5 system-ui, sans-serif; }
a { color: #245788; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
.local-shell { max-width: 960px; margin: 0 auto; padding: 18px 14px 40px; }
.local-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.local-brand a { font-weight: 700; text-decoration: none; }
.local-panel { background: #fff; padding: clamp(14px, 4vw, 32px); border: 1px solid #dce4ee; border-radius: 18px; }
h1 { margin: 0 0 8px; font-size: clamp(24px, 5vw, 32px); }
.local-intro { margin: 0 0 20px; color: #526277; }
.local-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 16px; background: #eef3f9; border-radius: 10px; }
.local-stats p { margin: 0; }
.local-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.local-controls button { border: 1px solid #2c5282; background: #fff; color: #2c5282; border-radius: 8px; padding: 10px 14px; min-height: 44px; }
#local-new, .local-controls button[aria-pressed="true"] { background: #2c5282; color: #fff; }
.local-status { min-height: 3em; margin: 16px 0 8px; }
.local-board { display: grid; gap: 6px; width: 100%; margin: 0 auto 22px; }
.local-board-fifteen { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 384px; }
.local-board-lightsout { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 384px; }
.local-board-minesweeper { grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: 448px; gap: 3px; }
.local-cell { min-width: 0; padding: 0; aspect-ratio: 1; border: 1px solid #b5c5d8; border-radius: 8px; background: #dce7f4; color: #193d68; font-weight: 750; font-size: clamp(18px, 5vw, 28px); }
.local-cell:hover { border-color: #245788; }
.local-cell:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #a34b00; outline-offset: 2px; z-index: 1; }
.local-cell.is-empty { background: #f5f7fa; border-style: dashed; }
.local-board-lightsout .local-cell { background: #23354d; color: #fff; border-color: #23354d; }
.local-board-lightsout .local-cell.is-lit { background: #ffe499; color: #755005; border-color: #dca839; }
.local-board-minesweeper .local-cell { border-radius: 4px; font-size: clamp(15px, 4vw, 23px); }
.local-cell.is-open { background: #f1f4f8; border-color: #d6dfe9; }
.local-cell.is-mine { background: #ffe2e2; color: #a62020; }
.local-cell.is-flag { color: #ac3328; }
.local-cell[data-near="2"] { color: #226433; }
.local-cell[data-near="3"], .local-cell[data-near="4"] { color: #a42424; }
.local-help { border-top: 1px solid #dce4ee; padding-top: 18px; }
.local-help h2 { font-size: 18px; margin: 0; }
.local-help p { margin: 8px 0; }
.local-note { color: #526277; font-size: 14px; }
.local-footer { margin-top: 20px; text-align: center; font-size: 14px; }
.local-shell .game-nav-more-menu { max-width: calc(100vw - 28px); max-height: 60vh; overflow-y: auto; }
@media (max-width: 400px) {
  .local-shell { padding-inline: 8px; }
  .local-panel { padding: 12px; }
  .local-stats { padding: 10px; font-size: 14px; }
}
