:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  background: #101719;
  color: #edf0e9;
  --muted: #acb8b6;
  --line: #303c3c;
  --accent: #e7b867;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 70% 5%, #1a2b29 0, transparent 55%); min-height: 100vh; }
button, a, summary, [tabindex] { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
button { touch-action: manipulation; }
.shell { max-width: 1220px; margin: 0 auto; padding: 0 44px; }
.header { height: 100px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 20px; }
.brand { color: #f1f1e9; text-decoration: none; font-weight: 800; font-size: 36px; letter-spacing: -2px; display: flex; align-items: center; gap: 10px; }
.brand-icon { background: var(--accent); color: #192221; font-size: 27px; height: 37px; width: 37px; border-radius: 9px; display: grid; place-items: center; letter-spacing: 0; }
.brand-dot { color: var(--accent); margin-left: -10px; }
.header-note { font-size: 10px; letter-spacing: 2.5px; color: var(--muted); margin-right: auto; margin-left: 24px; }
.quiet-button { border: 1px solid var(--line); background: #1c2727; color: #e5ebe6; border-radius: 9px; padding: 11px 14px; font-size: 13px; min-height: 44px; }
.quiet-button:hover:not(:disabled) { background: #2c3937; border-color: #65726d; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 43px 0 32px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--accent); margin: 0 0 12px; }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #8fcca9; margin-right: 6px; vertical-align: middle; }
h1 { font-size: clamp(32px, 4vw, 49px); line-height: 1.12; letter-spacing: -1.8px; font-weight: 600; margin: 0; }
.intro-text { font-size: 14px; color: var(--muted); line-height: 1.9; margin-bottom: 3px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.game-card { background: #1b2525; border: 1px solid var(--line); border-radius: 16px; padding: 24px; overflow: hidden; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.game-heading .eyebrow { font-size: 9px; margin-bottom: 6px; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -.4px; margin: 0; }
.mode-tag { color: #bdcdc4; font-size: 9px; letter-spacing: 1px; white-space: nowrap; border: 1px solid #3a4a43; padding: 8px 10px; border-radius: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: #152020; border: 1px solid #2c3938; border-radius: 10px; padding: 13px 0; margin-bottom: 20px; }
.stats div { padding: 0 17px; border-right: 1px solid var(--line); }
.stats div:last-child { border: 0; }
.stats span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.stats strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stats div:first-child strong { color: var(--accent); }
.board-surround { position: relative; background: #0d1517; border-radius: 10px; padding: 15px; border: 1px solid #33423f; }
.board { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; border-radius: 4px; }
.cell { aspect-ratio: 1; min-width: 0; border-radius: 5px; background: #142021; border: 1px solid #1b2829; position: relative; }
.wall { background: linear-gradient(145deg, #324344, #273638); border: 1px solid #405153; box-shadow: inset 0 2px 0 #4b5b5960, inset 0 -3px 0 #12202070; }
.wall::after { content: ""; position: absolute; inset: 35% 27%; border-top: 1px solid #56686580; border-bottom: 1px solid #182828; }
.shaft:not(.tile):not(.elevator) { background: linear-gradient(90deg, #142021 42%, #45645e 43%, #45645e 47%, #142021 48%, #142021 53%, #45645e 54%, #45645e 58%, #142021 59%); }
.elevator { display: grid; place-items: center; background: #385b57; color: #e4f7df; border: 2px solid #82b6a5; font-size: clamp(16px, 2.6vw, 26px); box-shadow: inset 0 -5px 0 #e7b867; }
.elevator-controls:has(button:not([hidden])) { margin-bottom: 12px; }
.tile { display: grid; place-items: center; font-family: "Segoe UI Symbol", sans-serif; font-size: clamp(14px, 2.6vw, 28px); padding: 0; font-weight: bold; box-shadow: inset 0 2px 0 #ffffff40, inset 0 -4px 0 #00000025, 0 2px 6px #0005; transition: filter .12s; }
.tile:hover { filter: brightness(1.15); }
.type-1 { background: #e5b665; color: #342712; border-color: #efcf8f; }
.type-2 { background: #74c7b5; color: #14372e; border-color: #ade5d6; }
.type-3 { background: #a89adc; color: #2c2149; border-color: #ccc0ec; }
.type-4 { background: #e1917d; color: #462216; border-color: #f5b5a4; }
.type-5 { background: #89b6dd; color: #18334a; border-color: #bcdaee; }
.cell.selected { outline: 3px solid #fff4cc; outline-offset: 1px; z-index: 1; filter: brightness(1.12); }
.board:focus-visible .cell.cursor:not(.selected) { outline: 2px dashed #a5bcb6; outline-offset: -3px; }
.cell.pop { animation: pop .18s ease-out; background: #e7b86730; }
@keyframes pop { from { box-shadow: inset 0 0 16px #e7b867; transform: scale(.8); } to { box-shadow: none; transform: scale(1); } }
.status { color: var(--muted); font-size: 12px; min-height: 36px; margin: 14px 0 8px; line-height: 1.6; }
.game-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.move-controls, .utility-controls { display: flex; gap: 8px; }
.arrow-button { background: #2c3b37; border: 1px solid #4c6056; color: #ecf2e5; border-radius: 9px; width: 48px; min-height: 44px; font-size: 22px; }
.arrow-button:hover:not(:disabled) { background: #405348; }
kbd { color: #b2c0b9; background: #111c1b; border: 1px solid #3b4a44; border-radius: 4px; font-family: inherit; font-size: 9px; padding: 2px 4px; margin-left: 8px; }
.sidebar { display: grid; gap: 18px; }
.level-card, .how-card { border: 1px solid var(--line); background: #1b2525; padding: 21px; border-radius: 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 8px; }
.section-heading h2 { font-size: 15px; }
.section-heading span { color: var(--muted); font-size: 10px; }
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.level-button { min-height: 46px; color: #b8c4c0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; background: #233030; border: 1px solid #394645; border-radius: 7px; position: relative; }
.level-button:hover { border-color: #9bada2; background: #30403b; }
.level-button.solved { color: #b7dec7; background: #244238; border-color: #45654f; }
.level-button.solved::after { content: "✓"; font-size: 9px; position: absolute; right: 5px; bottom: 3px; }
.level-button.has-elevator::before { content: "↕"; font-size: 10px; position: absolute; right: 5px; top: 3px; }
.level-button.current { background: var(--accent); border-color: #f0d29d; color: #302516; font-weight: bold; }
.legend { display: flex; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 10px; }
.legend i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; }
.legend-current { background: var(--accent); }.legend-solved { background: #73a98a; }
.how-card h2 { font-size: 22px; margin-bottom: 18px; }
.how-card p, .hint-card p { font-size: 12px; color: var(--muted); line-height: 1.8; margin: 12px 0 0; }
.how-card .eyebrow { font-size: 9px; color: var(--accent); margin: 0 0 10px; }
.example { display: flex; align-items: center; justify-content: space-around; background: #142020; border-radius: 9px; padding: 12px; color: #aebeb5; }
.mini-tile { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 6px; font-size: 22px; box-shadow: inset 0 -3px 0 #0002; }
.spark { font-size: 34px; color: var(--accent); }
details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
summary { font-size: 12px; color: #dae3dc; cursor: pointer; min-height: 28px; }
.hint-card { margin: 0; border: 1px solid #534b36; background: #29291f; border-radius: 12px; padding: 17px; }
.hint-card summary { color: #e6c990; font-weight: 600; }
.hint-card p { color: #c2bea7; margin-top: 6px; }
.victory { position: absolute; inset: 0; border-radius: 10px; background: #102321ed; backdrop-filter: blur(5px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; z-index: 2; }
[hidden] { display: none !important; }
.victory h3 { font-size: 30px; letter-spacing: -.8px; margin: 4px 0 0; }
.victory > p:not(.eyebrow) { font-size: 14px; color: var(--muted); line-height: 1.6; }
.primary-button { border: 1px solid #eed29f; background: var(--accent); color: #2f2515; border-radius: 9px; padding: 14px 24px; min-height: 44px; font-size: 14px; font-weight: 600; }
.primary-button:hover { background: #f2cb89; }
.primary-button span { margin-left: 18px; }
footer { display: flex; justify-content: space-between; gap: 18px; color: #a3afaa; font-size: 10px; line-height: 1.8; border-top: 1px solid var(--line); margin: 30px 0 0; padding: 23px 0; }
@media (max-width: 1000px) {
  .shell { padding: 0 24px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
  .game-card { padding: 18px; }
  .board-surround { padding: 10px; }
  .mode-tag { display: none; }
  kbd { display: none; }
  .stats div { padding: 0 10px; }
  .utility-controls .quiet-button { padding: 9px; font-size: 12px; }
}
@media (max-width: 740px) {
  .shell { padding: 0 18px; }
  .header { height: 78px; }
  .header-note { display: none; }
  .intro { margin: 28px 0 25px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .intro-text { font-size: 12px; margin: 0; }
  .intro-text br { display: none; }
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .tile { font-size: clamp(16px, 4.5vw, 28px); }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hint-card { grid-column: 1 / -1; }
  footer { flex-direction: column; gap: 5px; margin-top: 24px; }
}
@media (max-width: 480px) {
  .shell { padding: 0 12px; }
  .game-card { padding: 14px; border-radius: 12px; }
  .game-heading { margin-bottom: 18px; }
  .stats { margin-bottom: 14px; }
  .stats div { padding: 0 8px; }
  .stats span { font-size: 9px; }
  .stats strong { font-size: 19px; }
  .board { gap: 3px; }
  .board-surround { padding: 7px; }
  .cell { border-radius: 3px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .level-grid { grid-template-columns: repeat(6, 1fr); }
  .game-controls { gap: 6px; }
  .arrow-button { width: 42px; }
  .move-controls, .utility-controls { gap: 5px; }
  .utility-controls .quiet-button { padding: 8px; font-size: 11px; }
  .victory h3 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
