* { box-sizing: border-box; }
body { margin: 0; color: var(--rl-foam); font-family: var(--rl-font-body); line-height: 1.7; }
button { font: inherit; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--rl-sun); outline-offset: 4px; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 100; padding: 12px 18px; background: var(--rl-foam); color: var(--rl-ink); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.ski-shell { width: min(100% - 48px, 1600px); margin: 24px auto 64px; }
.game-window { position: relative; overflow: hidden; border: 1px solid var(--rl-boundary); border-radius: var(--rl-radius); background: #10232d; }
.game-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 8px 20px; background: var(--rl-abyss); }
.game-toolbar h1 { margin: 0; font-family: var(--rl-font-display); font-size: 1.6rem; line-height: 1.2; font-weight: 800; }
#fullscreen-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; min-height: 44px; padding: 8px 14px; border: 1px solid #bfd4d580; border-radius: var(--rl-radius-small); background: transparent; color: var(--rl-foam); cursor: pointer; font-size: .875rem; font-weight: 700; }
#fullscreen-button:hover { background: var(--rl-deep); }
#fullscreen-button:disabled { opacity: .6; cursor: wait; }
#fullscreen-button svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#game-frame { display: block; width: 100%; height: clamp(560px, calc(100svh - 184px), 1000px); border: 0; background: #10232d; }
.fullscreen-status { position: absolute; right: 16px; top: 64px; left: 16px; z-index: 1; margin: 0; padding: 10px 14px; background: var(--rl-abyss); font-size: .875rem; }
.fullscreen-status:empty { display: none; }
.game-guide { max-width: 1280px; margin: 36px auto 0; }
.game-guide h2 { margin: 0 0 8px; font-size: 1.5rem; }
.game-guide p { max-width: 72ch; margin: 0 0 20px; color: #d5e8ec; }
.key-guide { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 32px; margin: 0 0 24px; }
.key-guide > div { padding: 18px 0; border-top: 1px solid #bfd4d550; }
.key-guide dt { margin: 0 0 10px; }
.key-guide dd { margin: 0; font-size: .9375rem; }
kbd { display: inline-block; min-width: 30px; padding: 2px 8px; border: 1px solid #bfd4d580; border-radius: 4px; color: var(--rl-foam); font: 700 .875rem/1.6 var(--rl-font-display); text-align: center; }
.game-guide .fullscreen-help { font-size: .875rem; }
.game-window:fullscreen, .game-window.is-expanded { display: flex; flex-direction: column; width: 100%; height: 100dvh; max-width: none; margin: 0; border: 0; border-radius: 0; }
.game-window:fullscreen #game-frame, .game-window.is-expanded #game-frame { flex: 1; min-height: 0; height: 0; }
.game-window:fullscreen .game-toolbar, .game-window.is-expanded .game-toolbar { flex-shrink: 0; padding-top: max(8px, env(safe-area-inset-top)); }
.game-window::backdrop { background: #10232d; }
.game-window.is-expanded { position: fixed; inset: 0; z-index: 1000; }
html.game-expanded { overflow: hidden; }
@media (max-width: 800px) {
  .ski-shell { width: calc(100% - 24px); margin-top: 16px; }
  .game-toolbar { padding-inline: 12px; }
  .game-toolbar h1 { font-size: 1.25rem; }
  #fullscreen-button { padding-inline: 10px; font-size: .8125rem; }
  .key-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .game-guide { padding-inline: 4px; }
}
@media (max-width: 650px) and (orientation: portrait) {
  #game-frame { height: max(720px, calc(100svh - 176px)); }
}
@media (max-width: 380px) {
  .game-toolbar { gap: 8px; }
  #fullscreen-button { gap: 5px; }
  #fullscreen-button svg { width: 16px; }
}
