@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --ink: #172621;
  --muted: #475b51;
  --line: #d3ddd1;
  --track: #a33122;
  --dark: #152921;
  --dark-line: #365248;
  --light: #f9f6e9;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  font: 1rem/1.65 Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--track); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: .15em; }
button { cursor: pointer; font: inherit; }
:focus-visible { outline: 3px solid #b64732; outline-offset: 4px; }
.skip { position: absolute; z-index: 3; left: 1rem; padding: .75rem; transform: translateY(-150%); background: var(--light); }
.skip:focus { transform: none; }
.wrap { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }
.site-header { border-top: 5px solid var(--track); border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem 2rem; padding-block: .85rem; }
.brand { display: inline-flex; flex: none; align-items: center; gap: .55rem; color: inherit; font: 800 1.65rem/1 var(--display); text-decoration: none; letter-spacing: .02em; }
.brand img { display: block; }
.brand-dot { color: var(--track); }
nav { display: flex; flex-wrap: wrap; gap: 0 clamp(.8rem, 2.8vw, 2rem); }
nav a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; font-weight: 650; font-size: .9rem; }
nav a:hover { text-decoration: underline; }
.hero { padding: clamp(1.5rem, 4vw, 3rem) 0 1.45rem; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--display); font-weight: 800; line-height: .97; letter-spacing: -.015em; }
h1 { font-size: clamp(3rem, 8vw, 6.25rem); text-transform: uppercase; margin-bottom: .8rem; }
h2 { font-size: clamp(2.35rem, 5vw, 3.65rem); margin-bottom: .65rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.32rem); margin-bottom: .55rem; line-height: 1.3; }
.hero p, .section-heading p { color: var(--muted); margin-bottom: 0; }
.hero kbd { font-weight: 750; color: var(--ink); }
.player { background: var(--dark); color: var(--light); border-radius: 12px; padding: .55rem; box-shadow: 0 14px 36px #27332b24; }
.player-bar, .player-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .35rem 1rem; padding: .45rem .65rem; }
.player-bar { min-height: 54px; }
.player-title { font: 800 1.4rem/1 var(--display); letter-spacing: .025em; }
.player-title span { margin-left: .25rem; font: 500 .8rem/1 Inter, system-ui, sans-serif; color: #c7d7cb; }
.player-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.player-actions button { min-height: 44px; padding: .25rem .65rem; border: 1px solid var(--dark-line); color: var(--light); background: transparent; border-radius: 5px; font-size: .83rem; }
.player-actions button:hover { background: var(--dark-line); }
.player-foot { align-items: baseline; color: #deeadf; font-size: .85rem; }
.player-foot p { margin: .15rem 0; }
.player-foot a { color: inherit; }
.player-foot a:focus-visible, .player-actions button:focus-visible { outline-color: #ffc96c; }
.stage { position: relative; overflow: hidden; isolation: isolate; border-radius: 6px; background: #223e33; aspect-ratio: 1050 / 560; container-type: inline-size; }
.game-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: .7rem; background: var(--dark); color: var(--light); pointer-events: none; }
.game-spinner { width: 2rem; height: 2rem; border: 3px solid var(--dark-line); border-top-color: #ffc96c; border-radius: 50%; animation: game-spin .8s linear infinite; }
@keyframes game-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .game-spinner { animation: none; } }
.start-button { display: inline-flex; align-items: center; justify-content: center; gap: .7rem; padding: .7rem 1.2rem; background: #ffc96c; color: #20281c; border: 1px solid #ffda9f; border-radius: 5px; min-height: 50px; font-weight: 800; text-decoration: none; box-shadow: 0 4px 0 #502b20, 0 8px 26px #171b17a8; }
.start-button:hover { background: #ffdb95; }
#game-frame { display: block; position: absolute; inset: 0; width: 1050px; height: 560px; transform: scale(tan(atan2(100cqw, 1050px))); transform-origin: top left; border: 0; background: #171a18; }
.player:is(:fullscreen, .is-expanded) { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; height: 100%; border-radius: 0; }
.player.is-expanded { position: fixed; z-index: 5; inset: 0; }
body:has(.player.is-expanded) { overflow: hidden; }
.player:is(:fullscreen, .is-expanded) .stage { width: 100%; height: 100%; aspect-ratio: auto; container-type: size; background: #171a18; }
.player:is(:fullscreen, .is-expanded) #game-frame { left: 50%; top: 50%; transform-origin: center; transform: translate(-50%, -50%) scale(min(tan(atan2(100cqw, 1050px)), tan(atan2(100cqh, 560px)))); }
.editorial { border-top: 1px solid var(--line); padding-block: clamp(1.75rem, 5vw, 3.5rem); }
.player + .editorial { border-top: 0; }
.section-heading { margin-bottom: 1.45rem; }
.key-grid, .columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem clamp(1rem, 6vw, 4rem); }
.key-grid { margin-bottom: 1.6rem; gap: .65rem; }
.key-grid div { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .7rem; border-radius: 7px; background: #e6ece1; border: 1px solid var(--line); font-weight: 700; }
.key-grid span { margin-left: .3rem; }
.key-grid kbd { display: grid; place-items: center; min-width: 2.25rem; aspect-ratio: 1; padding: .1rem; border: 1px solid #476154; border-bottom-width: 3px; border-radius: 4px; background: var(--light); font-weight: 800; }
.columns p:last-child, .practice p:last-child { margin-bottom: 0; }
.game-screenshot { max-width: 30rem; margin: 1rem 0 0; }
.game-screenshot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 7px; }
.game-screenshot figcaption { margin-top: .4rem; color: var(--muted); font-size: .85rem; }
.practice { display: grid; gap: 1.25rem; }
.practice article { border-left: 3px solid var(--track); padding-left: 1rem; max-width: 78ch; }
.back-to-game { display: inline-flex; align-items: center; min-height: 44px; gap: .35rem; margin-top: 1.2rem; font-weight: 700; }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; padding: .85rem .2rem; }
details p { max-width: 75ch; margin: 0 0 1rem 1.1rem; }
.site-footer { background: #e6ece1; border-bottom: 5px solid var(--track); border-top: 1px solid var(--line); }
.site-footer .footer-inner { padding-block: 1.3rem; }
.site-footer p { color: var(--muted); margin: .4rem 0 0; font-size: .86rem; }
.prose { max-width: 74ch; padding: clamp(2rem, 6vw, 4rem) 0; }
.prose h1 { font-size: clamp(2.9rem, 7vw, 5.2rem); margin-bottom: 1.2rem; }
.prose h2 { font-size: 2rem; margin-top: 1.8rem; }
@media (max-width: 625px) {
  .wrap { width: calc(100% - 1.5rem); }
  .header-inner, .footer-inner { flex-wrap: wrap; }
  .header-inner { gap: .35rem 1rem; padding-block: .45rem; }
  .columns { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 690 / 560; }
  .player:not(:fullscreen, .is-expanded) #game-frame { transform: scale(tan(atan2(100cqw, 690px))) translateX(-180px); }
}
@media (max-width: 375px) {
  .header-inner nav { width: 100%; justify-content: space-between; }
}
