/* Hallmark · editorial game cover · illustrated desert / petrol blue
 * macrostructure: opposing title and scene, shared baseline · pre-emit critique: P4 H5 E4 S5 R5 V4 */
:root {
  color-scheme: light;
  --paper: #efe8d8;
  --ink: #202d2d;
  --muted: #52594f;
  --rule: #a29d8c;
  --soft-rule: #c7beaa;
  --teal: #164c47;
  --teal-dark: #123a36;
  --vermilion: #993c27;
  --sand: #e1b878;
  --white: #fff8e8;
  --dark: #152626;
  --hud: rgb(21 38 38 / .92);
  --shade: rgb(12 22 23 / .56);
  --clear: transparent;
  --hit: #ffdd85;
  --danger: #e47050;
  --danger-shade: rgb(171 44 24 / .36);
  --focus: #722b1f;
  --focus-game: #f4c878;
  --shadow: rgb(25 31 30 / .35);
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --gutter: clamp(20px, 5.2vw, 80px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; min-height: 100%; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.5 var(--body); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: var(--clear); }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.menu { width: min(100%, 1640px); min-height: 100svh; margin-inline: auto; padding: 0 var(--gutter); display: grid; grid-template-rows: auto 1fr auto; }
.masthead, .field-guide { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.masthead { min-height: 78px; border-bottom: 1px solid var(--rule); }
.signature, .text-link { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; font-size: .875rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.site-address { color: var(--muted); font: 500 .76rem var(--mono); }
.mark {
  display: block; width: 23px; height: 23px; flex: 0 0 auto;
  border: 2px solid var(--teal);
  background: repeating-linear-gradient(135deg, var(--teal) 0 2px, var(--clear) 2px 5px);
}
.text-link { gap: 12px; }
.text-link span { font-size: 1.1rem; color: var(--teal); }
.text-link:hover, .signature:hover { text-decoration: underline; text-underline-offset: 5px; }

.cover {
  display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  align-items: center; column-gap: clamp(28px, 4.3vw, 76px);
  padding-block: clamp(32px, 5.2vh, 72px) clamp(26px, 4.3vh, 54px);
}
.intro { min-width: 0; align-self: center; padding-block-end: 24px; container-type: inline-size; }
.genre {
  margin: 0 0 21px; display: flex; align-items: center; gap: 9px;
  color: var(--vermilion); font: 800 .82rem var(--body); letter-spacing: .13em;
}
.genre::before { content: ""; width: 19px; height: 2px; background: currentColor; }
h1 {
  margin: 0;
  font: 950 clamp(2.4rem, 6.2vw, 7rem)/.87 var(--display);
  font: 950 clamp(2.4rem, 19cqw, 7rem)/.87 var(--display);
  letter-spacing: -.085em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
h1 > span { display: block; }
.title-dot { color: var(--vermilion); }
.summary { margin: 27px 0 25px; color: var(--muted); font-weight: 650; font-size: clamp(.97rem, 1.38vw, 1.16rem); line-height: 1.65; }
.launch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.button {
  border: 1px solid var(--teal);
  min-height: 52px; padding: 10px 19px; display: inline-flex; align-items: center; gap: 28px; justify-content: space-between;
  font-weight: 850; white-space: nowrap; text-align: left;
  transition: background-color 140ms, color 140ms, transform 140ms;
}
.button-primary { background: var(--teal); color: var(--white); }
.launch .button-primary { min-width: min(201px, 100%); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { color: var(--teal); background: var(--clear); }
.button-secondary:hover { background: var(--white); }
.button:active { transform: translateY(2px); }
.arrow { font-size: 1.38rem; line-height: 1; }
.launch-note { flex-basis: 100%; color: var(--vermilion); margin: 0; font-size: .87rem; }
.launch-note:empty { display: none; }
.mode-link, .fallback-link { border: 0; padding: 8px 0; min-height: 44px; background: var(--clear); color: var(--teal); font-size: .88rem; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.fallback-link { align-content: center; }

.poster { margin: 0; min-width: 0; }
.poster-image { overflow: hidden; border: 1px solid var(--ink); background: var(--sand); aspect-ratio: 4 / 3; }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster figcaption { min-height: 33px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.caption-tick { width: 7px; height: 7px; background: var(--teal); flex: 0 0 auto; }
.caption-end { margin-left: auto; font: 600 .67rem var(--mono); letter-spacing: .12em; white-space: nowrap; }

.field-guide { min-height: 75px; border-top: 1px solid var(--rule); }
.key-guide { display: flex; flex-wrap: wrap; gap: 8px clamp(12px, 2.2vw, 33px); margin: 0; }
.key-guide div { display: flex; align-items: center; gap: 7px; }
.key-guide dt { display: flex; align-items: center; gap: 2px; font-size: .81rem; font-weight: 800; white-space: nowrap; }
.key-guide dd { color: var(--muted); margin: 0; font-size: .79rem; white-space: nowrap; }
.key-guide .touch-guide { display: none; }
kbd { padding: 3px 5px 2px; min-width: 20px; text-align: center; font: 700 .72rem/1.1 var(--mono); border: 1px solid var(--soft-rule); border-bottom: 2px solid var(--rule); }
.personal-best { display: flex; align-items: baseline; gap: 9px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.personal-best strong { font: 850 1.14rem var(--mono); color: var(--teal); }

.play { position: fixed; inset: 0; color: var(--white); background: var(--dark); overscroll-behavior: none; user-select: none; }
.play :focus-visible { outline-color: var(--focus-game); }
#field { display: block; height: 100%; width: 100%; outline: none; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud-top, .hud-bottom {
  position: absolute; inset-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  display: flex; justify-content: space-between; gap: 14px;
}
.hud-top { top: max(16px, env(safe-area-inset-top)); }
.hud-bottom { bottom: max(16px, env(safe-area-inset-bottom)); align-items: end; }
.hud-piece { background: var(--hud); border-left: 3px solid var(--sand); min-width: 116px; padding: 6px 13px 8px; }
.hud-label, .hud-piece small { display: block; font-weight: 750; font-size: .75rem; line-height: 1.4; }
.hud-piece small { color: var(--sand); }
.hud-piece output { display: inline-block; font: 850 clamp(1.38rem, 3.2vw, 2rem)/1.12 var(--mono); font-variant-numeric: tabular-nums; }
.hud-score { position: relative; padding-right: 60px; }
.hud-pause {
  pointer-events: auto; color: var(--white); background: var(--clear); position: absolute; right: 4px; top: 4px;
  border: 1px solid var(--soft-rule); width: 44px; min-height: 44px;
  font-weight: 850; font-size: 1.08rem; line-height: 1;
}
.hud-pause:hover { background: var(--teal); }
.hud-escape { display: none; position: absolute; right: 10px; top: 12px; color: var(--sand); font: 800 .76rem var(--mono); }
.play[data-controls="mouse"] .hud-pause { display: none; }
.play[data-controls="mouse"] .hud-escape { display: block; }
.health-row { display: flex; align-items: center; gap: 8px; }
.health-row progress { display: block; appearance: none; width: clamp(42px, 9vw, 132px); height: 6px; border: 0; background: var(--muted); }
.health-row progress::-webkit-progress-bar { background: var(--muted); }
.health-row progress::-webkit-progress-value { background: var(--sand); }
.health-row progress::-moz-progress-bar { background: var(--sand); }
.hud-health[data-low="true"] { border-color: var(--danger); }
.hud-ammo { text-align: right; white-space: nowrap; }
.ammo-max { font: 700 .82rem var(--mono); color: var(--sand); }
.reticle {
  display: grid; place-items: center; position: absolute; color: var(--white);
  left: 50%; top: 50%; width: 27px; height: 27px; transform: translate(-50%, -50%); filter: drop-shadow(0 1px 1px var(--dark));
}
.reticle i, .reticle b { position: absolute; background: currentColor; }
.reticle i:nth-child(1), .reticle i:nth-child(2) { width: 6px; height: 2px; }
.reticle i:nth-child(1) { left: 0; }
.reticle i:nth-child(2) { right: 0; }
.reticle i:nth-child(3), .reticle i:nth-child(4) { width: 2px; height: 6px; }
.reticle i:nth-child(3) { top: 0; }
.reticle i:nth-child(4) { bottom: 0; }
.reticle b { width: 3px; height: 3px; }
.reticle[data-hit="true"] { color: var(--hit); transform: translate(-50%, -50%) rotate(45deg); }
.damage-overlay { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 0 7px var(--danger), inset 0 0 11vmin 3vmin var(--danger-shade); }
.damage-overlay span {
  position: absolute; top: 50%; left: 50%; width: 0; height: 0;
  transform: rotate(var(--damage-angle, 0rad));
}
.damage-overlay span::after {
  content: ""; position: absolute; bottom: clamp(48px, 11vmin, 110px); left: -9px;
  border-inline: 9px solid var(--clear); border-bottom: 11px solid var(--danger);
  filter: drop-shadow(0 1px 1px var(--dark));
}
.announcement {
  position: absolute; top: clamp(85px, 20%, 170px); left: 50%;
  translate: -50% 0; padding: 6px 16px; color: var(--white); background: var(--hud);
  border-bottom: 2px solid var(--sand); font-weight: 850; text-align: center; width: max-content; max-width: calc(100% - 32px);
}
.shade { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; background: var(--shade); padding: 16px; touch-action: pan-y; }
.panel {
  width: min(100%, 440px); margin: auto; padding: clamp(18px, 4vw, 35px);
  color: var(--ink); background: var(--paper); border-top: 5px solid var(--teal); box-shadow: 0 14px 38px var(--shadow);
}
.panel h2 { margin: 0; letter-spacing: -.06em; line-height: 1.12; font-size: clamp(1.7rem, 5vw, 2.5rem); }
.panel p { color: var(--muted); margin: 8px 0 14px; font-size: .9rem; }
.panel .launch-note { color: var(--vermilion); }
.panel :focus-visible { outline-color: var(--focus); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.run-results { margin: 15px 0; display: flex; justify-content: space-between; padding: 12px 0; border-block: 1px solid var(--rule); }
.run-results dt { font-size: .79rem; color: var(--muted); }
.run-results dd { margin: 0; font: 800 1.35rem var(--mono); color: var(--teal); }
.settings { display: grid; gap: 3px; margin: 12px 0 18px; padding: 8px 0; border-block: 1px solid var(--soft-rule); font-size: .88rem; font-weight: 750; }
.settings output { float: right; font-family: var(--mono); color: var(--teal); }
.settings input[type="range"] { width: 100%; min-height: 36px; margin: 0; accent-color: var(--teal); }
.sound-option { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.sound-option input { accent-color: var(--teal); width: 18px; height: 18px; }

.touch-controls { position: absolute; inset: 0; pointer-events: none; }
.touch-controls > * { pointer-events: auto; touch-action: none; }
.touch-stick {
  position: absolute; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 76px); left: max(17px, env(safe-area-inset-left));
  width: clamp(91px, 19vw, 120px); aspect-ratio: 1; border: 1px solid var(--white); border-radius: 50%; background: var(--shade); display: grid; place-items: center;
}
.touch-stick span { border: 1px solid var(--sand); background: var(--hud); width: 43%; aspect-ratio: 1; border-radius: 50%; }
.touch-button { position: absolute; color: var(--white); background: var(--hud); border: 1px solid var(--sand); font-weight: 800; border-radius: 50%; }
.touch-fire { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 78px); right: max(17px, env(safe-area-inset-right)); width: 72px; height: 72px; }
.touch-fire:active, .touch-reload:active { background: var(--teal); }
.touch-reload { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 156px); right: max(17px, env(safe-area-inset-right)); width: 48px; height: 48px; font-size: .75rem; }

[data-state="paused"] .hud, [data-state="won"] .hud, [data-state="lost"] .hud { visibility: hidden; }

@media (pointer: coarse) {
  .key-guide .desktop-guide { display: none; }
  .key-guide .touch-guide { display: flex; }
}
@media (max-width: 900px) {
  .cover { column-gap: 24px; }
}
@media (max-width: 700px) {
  .masthead { min-height: 60px; }
  .cover { grid-template-columns: minmax(0, 1fr); gap: 23px; padding-block: 28px 16px; }
  .intro { padding: 0; }
  .genre { margin-bottom: 15px; }
  h1 { font-size: clamp(2.4rem, 13vw, 6rem); font-size: clamp(2.4rem, 18.5cqw, 6rem); }
  .summary { margin: 19px 0 17px; }
  .poster-image { aspect-ratio: 16 / 10; }
  .field-guide { padding-block: 13px; min-height: 64px; align-items: start; }
}
@media (max-width: 430px) {
  .site-address { display: none; }
  .field-guide { flex-wrap: wrap; gap: 11px; }
  .key-guide { gap: 8px 13px; }
  .hud-piece { min-width: 88px; }
  .hud-top, .hud-bottom { inset-inline: max(9px, env(safe-area-inset-left)) max(9px, env(safe-area-inset-right)); }
  .caption-end { display: none; }
}
@media (max-height: 440px) and (pointer: coarse) {
  .touch-stick { width: 76px; bottom: 57px; }
  .touch-fire { bottom: 57px; width: 60px; height: 60px; }
  .touch-reload { bottom: 121px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .button:active { transform: none; }
}
