@font-face { font-family: "Big Shoulders"; src: url("/s/fonts/BigShoulders-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("/s/fonts/WorkSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("/s/fonts/WorkSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0a0707;
  --bg-2: #140d0c;
  --panel: #191110;
  --line: #34231f;
  --ink: #efe6dc;
  --muted: #9a8b80;
  --red: #c8161d;
  --red-hi: #ff3b2f;
  --bone: #e3cf9f;
  --display: "Big Shoulders", "Impact", "Arial Narrow", sans-serif;
  --body: "Work Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--bone); }
code {
  font-family: Consolas, "Cascadia Mono", monospace;
  background: #00000080;
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--bone);
  word-break: break-all;
}
[hidden] { display: none !important; }

/* Film grain and a vignette over everything on the landing page. */
.grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .06em;
  color: #fff; text-decoration: none; background: var(--red);
  border: 0; padding: 12px 28px 11px; cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transition: background .15s, transform .15s;
}
.btn:hover, .btn:focus-visible { background: var(--red-hi); transform: translateY(-1px); outline: none; }
.btn-ghost { background: #ffffff14; color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: #ffffff26; }
.btn-steam { background: var(--bone); color: #1a0f0c; margin-top: 10px; }
.btn-steam:hover, .btn-steam:focus-visible { background: #fff; }

/* Landing hero */
.hero { position: relative; min-height: 460px; display: flex; align-items: flex-end; overflow: hidden; border-bottom: 3px solid var(--red); }
.hero-art {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, #0a070700 30%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, #0a0707b0 45%, #0a070700 75%),
    url("/s/keyart.png") right center / cover no-repeat;
}
.hero-inner { position: relative; padding: 48px 40px 40px; max-width: 760px; }
.hero-logo { width: min(520px, 100%); height: auto; display: block; filter: drop-shadow(0 6px 18px #000); }
.hero-tag {
  font-family: var(--display); font-size: 30px; letter-spacing: .14em; margin-top: 6px; color: var(--bone);
  text-shadow: 0 2px 0 #000;
}
.hero-tag b { color: var(--red-hi); }
.hero-copy { color: #d6c9bd; max-width: 520px; margin: 8px 0 18px; text-shadow: 0 1px 2px #000; }

main { max-width: 1240px; margin: 0 auto; padding: 0 40px; }
.block { margin: 48px 0; }
.block-title {
  font-family: var(--display); font-size: 34px; letter-spacing: .08em; margin: 0 0 18px;
  display: flex; align-items: center; gap: 16px;
}
.block-title::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--red), #c8161d00); }

/* Replay cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  display: block; text-decoration: none; color: inherit; background: var(--panel);
  border: 1px solid var(--line); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--red); box-shadow: 0 10px 30px #000a, 0 0 0 1px var(--red); outline: none; }
.card-pic { position: relative; aspect-ratio: 16 / 9; background: #000 radial-gradient(ellipse at 50% 60%, #3a0d0d 0%, #000 70%); overflow: hidden; }
.card-pic img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85) contrast(1.05); transition: transform .3s; }
.card:hover .card-pic img { transform: scale(1.04); }
.card-play {
  position: absolute; left: 14px; bottom: 12px; width: 44px; height: 44px; background: var(--red);
  clip-path: polygon(0 0, 100% 50%, 0 100%); transform: scale(.7); transform-origin: left bottom;
  opacity: .9; transition: transform .15s, opacity .15s;
}
.card:hover .card-play { transform: scale(1); opacity: 1; }
.card-body { padding: 12px 16px 14px; }
.card-map { font-family: var(--display); font-size: 15px; letter-spacing: .12em; color: var(--red-hi); }
.card-title { font-family: var(--display); font-size: 26px; line-height: 1.05; letter-spacing: .03em; margin: 2px 0 6px; overflow-wrap: anywhere; }
.card-stats { font-family: var(--display); font-size: 17px; letter-spacing: .08em; color: var(--bone); }
.card-players { color: var(--muted); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.card-date { color: #6f625a; font-size: 13px; margin-top: 6px; }
.empty { border: 1px dashed var(--line); padding: 28px; color: var(--muted); text-align: center; }

/* Drop zone */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 170px; padding: 24px; text-align: center; cursor: pointer;
  background: repeating-linear-gradient(-45deg, #140d0c 0 14px, #170f0e 14px 28px);
  border: 2px dashed #5a3a33; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--red-hi); background: repeating-linear-gradient(-45deg, #1d0f0e 0 14px, #231110 14px 28px); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-big { font-family: var(--display); font-size: 38px; letter-spacing: .08em; line-height: 1; }
.drop-big b { color: var(--red-hi); }
.drop-small { color: var(--muted); }
.drop-where { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.drop-error { margin-top: 12px; color: #ffb0a8; background: #3a0d0d; border-left: 3px solid var(--red-hi); padding: 10px 14px; }

.foot {
  max-width: 1240px; margin: 0 auto; padding: 28px 40px 48px; display: flex; flex-wrap: wrap; gap: 8px 24px;
  justify-content: space-between; color: #6f625a; font-size: 14px; border-top: 1px solid var(--line);
}

/* The viewer: the game's canvas fills the window; the stage sits over it. */
body.viewer, body.watching { overflow: hidden; height: 100vh; }
body.watching > header, body.watching > main, body.watching > footer, body.watching > .grain { display: none; }
#canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; background: #000; outline: none; touch-action: none; }
.stage {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px; overflow-y: auto;
}
.stage-art {
  position: absolute; inset: 0; opacity: .45;
  background:
    radial-gradient(ellipse at 50% 45%, #0a070740 0%, var(--bg) 75%),
    url("/s/keyart.png") center / cover no-repeat;
  filter: blur(2px) saturate(.8);
}
.stage-panel { position: relative; width: min(640px, 100%); text-align: center; }
.stage-logo img { width: min(360px, 80%); height: auto; filter: drop-shadow(0 6px 18px #000); }
.stage-kicker { font-family: var(--display); font-size: 18px; letter-spacing: .3em; color: var(--red-hi); margin-top: 10px; }
.stage-title { font-family: var(--display); font-size: clamp(34px, 6vw, 60px); line-height: 1; letter-spacing: .03em; margin: 4px 0 8px; text-shadow: 0 3px 0 #000; overflow-wrap: anywhere; }
.stage-sub { font-family: var(--display); font-size: 20px; letter-spacing: .1em; color: var(--bone); min-height: 1em; overflow-wrap: anywhere; }
.btn-go { margin-top: 26px; font-size: 32px; padding: 16px 48px 15px; animation: pulse 2s ease-in-out infinite; }
.btn-go .tri { width: 18px; height: 22px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 #ff3b2f00; } 50% { box-shadow: 0 0 36px 4px #ff3b2f55; } }
@media (prefers-reduced-motion: reduce) { .btn-go { animation: none; } }
.stage-size { color: var(--muted); font-size: 14px; margin-top: 12px; min-height: 1.5em; }
.progress { margin: 28px auto 0; width: min(520px, 100%); }
.progress-bar { height: 14px; background: #000; border: 1px solid var(--line); padding: 2px; }
.progress-bar i {
  display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7d0b10, var(--red-hi));
  box-shadow: 0 0 12px #ff3b2f80; transition: width .2s;
}
.progress.busy .progress-bar i { width: 100% !important; animation: busy 1.1s linear infinite; background: repeating-linear-gradient(-45deg, #7d0b10 0 12px, var(--red) 12px 24px); background-size: 34px 34px; }
@keyframes busy { to { background-position: 34px 0; } }
.progress-text { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-family: var(--display); font-size: 18px; letter-spacing: .08em; color: var(--bone); }
.stage-msg { margin: 26px auto 0; max-width: 520px; color: #ffd0c8; background: #2a0b0bcc; border-left: 3px solid var(--red-hi); padding: 12px 16px; text-align: left; white-space: pre-line; }
.stage-msg.calm { color: var(--ink); background: #00000080; border-left-color: var(--bone); }
.stage-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.stage-desk { display: none; margin-top: 22px; color: var(--muted); font-size: 14px; }

/* Not found */
body.lost { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.lost-logo { width: min(360px, 80vw); }
.lost-box h1 { font-family: var(--display); font-size: 40px; letter-spacing: .06em; margin: 12px 0 4px; }
.lost-box p { color: var(--muted); margin: 0 0 22px; }

@media (max-width: 760px) {
  .hero { min-height: 380px; }
  .hero-inner { padding: 32px 16px 28px; }
  .hero-tag { font-size: 22px; }
  main { padding: 0 16px; }
  .block { margin: 32px 0; }
  .block-title { font-size: 26px; }
  .drop-big { font-size: 28px; }
  .foot { padding: 24px 16px 40px; }
  .stage-desk { display: block; }
  .btn-go { font-size: 26px; padding: 14px 36px 13px; }
}
