:root {
  --pit: #161c27;      /* cavern navy, page ground */
  --pit-2: #1f2735;    /* raised band */
  --pit-3: #2a3446;    /* lines, wells */
  --bone: #f2eadb;     /* logo cream, main text */
  --hazard: #f5c518;   /* tape yellow */
  --sticker: #d7332b;  /* warning red */
  --steel: #9aa3b1;    /* quiet text */

  --display: "Dela Gothic One", "IBM Plex Sans KR", system-ui, sans-serif;
  --body: "IBM Plex Sans KR", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --measure: 34em;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--pit);
  color: var(--bone);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

h2 {
  font: 400 clamp(2rem, 1.2rem + 3.4vw, 3.5rem)/1.05 var(--display);
  letter-spacing: -0.01em;
}
h3 { font: 600 1.125rem/1.3 var(--body); }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--hazard); outline-offset: 3px; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--gutter);
  background: rgb(22 28 39 / .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--pit-3);
}
.bar-home img { width: 92px; }
.bar nav { display: flex; gap: clamp(12px, 2.4vw, 28px); font-weight: 600; font-size: .95rem; }
.bar nav a { text-decoration: none; color: var(--steel); padding: 6px 0; }
.bar nav a:hover { color: var(--bone); }
@media (max-width: 560px) {
  .bar nav a:nth-child(-n+2) { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: grid; align-items: center;
  padding: 64px var(--gutter) 120px;
  isolation: isolate;
  overflow: hidden;
}
.hero-art { position: absolute; inset: 0; z-index: -1; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--pit) 0%, rgb(22 28 39 / .86) 34%, rgb(22 28 39 / .1) 68%),
    linear-gradient(0deg, var(--pit) 0%, transparent 30%);
}
.hero-copy { max-width: 560px; }
.hero h1 img { width: min(100%, 520px); filter: drop-shadow(0 10px 24px rgb(0 0 0 / .5)); }
.sticker {
  display: inline-block;
  margin: 8px 0 28px 18%;
  padding: 8px 16px 10px;
  background: var(--sticker); color: #fff;
  font: 400 clamp(1.25rem, 1rem + 1.2vw, 1.75rem)/1 var(--display);
  transform: rotate(-4deg);
  box-shadow: 4px 5px 0 rgb(0 0 0 / .45);
  animation: slap .5s cubic-bezier(.2, 1.6, .4, 1) .35s both;
}
@keyframes slap {
  from { opacity: 0; transform: rotate(-14deg) scale(1.6); }
  to   { opacity: 1; transform: rotate(-4deg) scale(1); }
}
.hero-line { font: 400 clamp(1.4rem, 1.1rem + 1.3vw, 2rem)/1.2 var(--display); }
.hero-sub { margin-top: 14px; max-width: 30em; color: #d6d0c4; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-block; padding: 14px 22px;
  font-weight: 600; text-decoration: none; line-height: 1;
  border: 2px solid var(--bone);
}
.btn-go { background: var(--hazard); border-color: var(--hazard); color: var(--pit); }
.btn-go:hover { background: var(--bone); border-color: var(--bone); }
.btn-plain:hover { background: var(--bone); color: var(--pit); }

/* hazard tape across the bottom of the hero, like the key art */
.tape {
  position: absolute; left: -4%; right: -4%; bottom: 36px; height: 30px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 22px, #111 22px 44px);
  transform: rotate(-1.6deg);
  box-shadow: 0 6px 0 rgb(0 0 0 / .35);
  animation: tape .6s cubic-bezier(.3, .8, .3, 1) .1s both;
}
@keyframes tape { from { transform: translateX(-100%) rotate(-1.6deg); } }

@media (prefers-reduced-motion: reduce) {
  .sticker, .tape { animation: none; }
}

/* ---------- trapper mini game ---------- */
.trapper {
  display: grid; gap: 28px 56px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  align-items: center;
  padding: 96px var(--gutter);
}
.trapper-copy p { margin-top: 16px; max-width: var(--measure); color: #d6d0c4; }
.cabinet {
  background: #0d1118;
  border: 2px solid var(--pit-3);
  padding: 14px;
}
#trapper-canvas {
  display: block; width: 100%; aspect-ratio: 192 / 72;
  image-rendering: pixelated; image-rendering: crisp-edges;
  cursor: crosshair;
  background: #0b0e14;
}
.cabinet-controls {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 14px;
}
.fire {
  font: 400 1.25rem/1 var(--display);
  padding: 14px 30px 16px;
  color: #fff; background: var(--sticker);
  border: 0; border-bottom: 5px solid #8d1d18;
  cursor: pointer;
}
.fire:active, .fire.is-down { transform: translateY(3px); border-bottom-width: 2px; }
.fire[disabled] { background: #5a2a2a; border-bottom-color: #3a1b1b; color: #c9a3a0; cursor: wait; }
.tally { display: flex; gap: 20px; font-weight: 600; color: var(--steel); }
.tally b { font: 400 1.5rem/1 var(--display); color: var(--bone); margin-left: 6px; vertical-align: -2px; }
.restart {
  margin-left: auto;
  background: none; border: 0; padding: 6px 0;
  color: var(--steel); font: 600 .9rem var(--body);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.restart:hover { color: var(--bone); }
.cabinet-hint { margin-top: 10px; font-size: .85rem; color: var(--steel); }

@media (max-width: 860px) {
  .trapper { grid-template-columns: 1fr; padding-block: 72px; }
}

/* ---------- round ---------- */
.round { padding: 96px var(--gutter); background: var(--pit-2); }
.steps {
  counter-reset: step;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  margin-top: 48px;
}
.steps li { counter-increment: step; border-top: 4px solid var(--hazard); padding-top: 18px; }
.steps li::before {
  content: counter(step);
  display: block; margin-bottom: 10px;
  font: 400 2.25rem/1 var(--display); color: var(--hazard);
}
.steps p { margin-top: 8px; color: #d6d0c4; }
.round-shot { margin-top: 72px; }
.round-shot img { width: 100%; }
.round-shot figcaption { margin-top: 12px; color: var(--steel); font-size: .95rem; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- maps ---------- */
.maps { padding: 96px var(--gutter); }
.map-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px;
  margin-top: 48px;
}
.map img { width: 100%; image-rendering: pixelated; }
.map figcaption { margin-top: 14px; }
.map h3 { font: 400 1.5rem/1.15 var(--display); }
.map p { margin-top: 6px; color: #d6d0c4; max-width: var(--measure); }
.len { color: var(--hazard); font-weight: 600; white-space: nowrap; }
@media (max-width: 680px) { .map-list { grid-template-columns: 1fr; } }

/* ---------- traps hotbar ---------- */
.traps { padding: 96px var(--gutter); background: var(--pit-2); }
.traps-head p { margin-top: 12px; color: #d6d0c4; max-width: var(--measure); }
.hotbar {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px; margin-top: 44px;
  background: var(--pit-3); border: 2px solid var(--pit-3);
}
.hotbar li {
  position: relative;
  display: grid; grid-template-rows: auto auto 1fr auto;
  padding: 14px 16px 16px;
  background: var(--pit);
}
.hotbar kbd {
  position: absolute; top: 10px; left: 12px;
  font: 400 1.1rem/1 var(--display); color: var(--hazard);
}
.hotbar img { width: 96px; margin: 4px auto 10px; image-rendering: pixelated; }
.hotbar p { margin-top: 4px; font-size: .92rem; line-height: 1.45; color: var(--steel); }
.cost { margin-top: 12px; font-weight: 600; font-size: .9rem; color: var(--hazard); }
.cost::before { content: "Cost "; color: var(--steel); font-weight: 400; }
@media (max-width: 1000px) { .hotbar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .hotbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hotbar img { width: 80px; } }

/* ---------- team: a lobby roster ---------- */
.team { padding: 96px var(--gutter); }
.team-intro { margin-top: 16px; max-width: var(--measure); color: #d6d0c4; }
.roster { margin-top: 40px; max-width: 640px; border-top: 1px solid var(--pit-3); }
.roster li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 0; border-bottom: 1px solid var(--pit-3);
}
/* name tags float over heads in-game in the player's colour */
.tag { font: 400 1.5rem/1.1 var(--display); text-shadow: 0 0 12px currentColor; }
.tag-a { color: #8fd3ff; }
.tag-b { color: #ffb0c8; }
.tag-c { color: #b9f27c; }
.role { color: var(--steel); }

/* ---------- footer ---------- */
.foot {
  padding: 88px var(--gutter) 40px;
  border-top: 30px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--hazard) 0 22px, #111 22px 44px) 30;
}
.foot-ask { color: #d6d0c4; }
.foot-mail {
  display: inline-block; margin-top: 10px;
  font: 400 clamp(1.5rem, .6rem + 4.4vw, 3.75rem)/1.1 var(--display);
  text-decoration: none; overflow-wrap: anywhere;
}
.foot-mail:hover { color: var(--hazard); }
.foot-small { margin-top: 56px; font-size: .85rem; color: var(--steel); }

/* ---------- game page: studio credit ---------- */
.bar-brand { display: flex; align-items: center; gap: 14px; }
.studio-link {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .9rem; color: var(--steel); text-decoration: none;
  padding-right: 14px; border-right: 1px solid var(--pit-3);
}
.studio-link:hover { color: var(--bone); }
.studio-link img { width: 30px; }
.maker { padding: 96px var(--gutter); }
.maker p { margin: 16px 0 28px; max-width: var(--measure); color: #d6d0c4; }
