.puzzle-shell { width: min(100% - 32px, 720px); min-height: 100vh; margin: auto; padding: 24px 0 40px; }
.puzzle-header { display: flex; align-items: center; justify-content: space-between; color: var(--accent-bright); }
.puzzle-header a { color: var(--muted); font-size: .82rem; text-decoration: none; }
.puzzle-header a:hover { color: var(--accent-bright); }
.puzzle-app { padding-top: 44px; }
.puzzle-title-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.puzzle-title-row h1 { font-size: clamp(3rem, 11vw, 5rem); }
.puzzle-title-row h1 span { display: inline; }
.puzzle-stats { display: flex; gap: 18px; padding-bottom: 8px; color: var(--muted); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.puzzle-stats span { display: grid; gap: 3px; }
.puzzle-stats strong { color: var(--ink); font-size: 1rem; letter-spacing: 0; }
.puzzle-toolbar { display: flex; justify-content: space-between; gap: 16px; margin: 26px 0 14px; }
.mode-switch { display: flex; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.mode-switch button, .new-game, .cheat-toggle { padding: 9px 14px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; font: 600 .76rem/1 "DM Sans", sans-serif; cursor: pointer; }
.mode-switch button.active { color: var(--ink); background: rgba(216, 88, 61, .22); }
.puzzle-actions { display: flex; gap: 8px; }
.new-game, .cheat-toggle { color: var(--ink); border: 1px solid rgba(237, 117, 89, .48); }
.cheat-toggle[aria-pressed="true"] { color: var(--accent-bright); background: rgba(216, 88, 61, .12); }
.mode-switch button:focus-visible, .new-game:focus-visible, .cheat-toggle:focus-visible, .tile:focus-visible, .blank:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.puzzle-board { position: relative; width: min(100%, 600px); aspect-ratio: 1; margin-inline: auto; overflow: hidden; background: #090706; border: 8px solid #251b17; border-radius: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); touch-action: manipulation; }
.tile { position: absolute; width: 25%; height: 25%; padding: 4px; background: transparent; border: 0; transition: transform 140ms ease; cursor: pointer; }
.tile::before { content: ""; position: absolute; inset: 4px; z-index: -1; background: linear-gradient(145deg, #34251f, #1b1411); border: 1px solid rgba(247, 239, 229, .16); border-radius: 7px; box-shadow: inset 0 1px rgba(255,255,255,.05); }
.tile span { display: grid; width: 100%; height: 100%; place-items: center; color: var(--ink); font: 700 clamp(1.5rem, 8vw, 3.5rem)/1 "Playfair Display", serif; }
.blank { position: absolute; z-index: 2; width: 25%; height: 25%; padding: 8px; color: transparent; background: transparent; border: 0; border-radius: 8px; pointer-events: none; transition: transform 140ms ease, background 180ms ease; }
.puzzle-board.cheat .blank { color: var(--accent-bright); background: rgba(216, 88, 61, .08); border: 1px dashed rgba(237, 117, 89, .45); cursor: help; pointer-events: auto; }
.puzzle-board.cheat .blank::after { content: "?"; display: grid; height: 100%; place-items: center; font: 700 clamp(1.3rem, 5vw, 2.4rem)/1 "Playfair Display", serif; opacity: .75; }
.puzzle-board.thinking .blank::after { content: "…"; }
.puzzle-board.image .tile { padding: 1px; background-image: url("/SovereignSteak.jpg"); background-size: 400% auto; background-origin: border-box; border: 1px solid rgba(16, 13, 11, .88); }
.puzzle-board.image .tile::before { display: none; }
.puzzle-board.image .tile span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.puzzle-message { min-height: 24px; margin: 18px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.puzzle-message.won { color: var(--accent-bright); font-weight: 600; }
@media (max-width: 520px) {
  .puzzle-app { padding-top: 32px; }
  .puzzle-title-row { align-items: start; flex-direction: column; gap: 14px; }
  .puzzle-stats { padding: 0; }
  .puzzle-toolbar { align-items: stretch; flex-direction: column; }
  .puzzle-actions { justify-content: space-between; }
  .puzzle-actions button { flex: 1; }
  .puzzle-board { border-width: 5px; }
  .tile { padding: 3px; }
  .tile::before { inset: 3px; }
}
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }
