:root {
  --gold: #f4c542;
  --gold-2: #ff9d2e;
  --ink: #0a0b0f;
  --paper: #f3efe4;
  --red: #e33b3b;
  --green: #63d471;
  --blue: #53a7ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #07080b;
  color: var(--paper);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  cursor: crosshair;
  background: #0b2a3a;
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.14), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.22));
  mix-blend-mode: multiply;
}

#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.7) 0px,
    rgba(255, 255, 255, 0.7) 1px,
    transparent 1px,
    transparent 3px
  );
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 4vw;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(39, 52, 78, 0.45), transparent 58%),
    linear-gradient(180deg, rgba(5, 7, 12, 0.82), rgba(5, 7, 12, 0.72) 55%, rgba(5, 7, 12, 0.9));
  backdrop-filter: blur(3px);
}

.screen.hidden { display: none; }

/* Used by still-frame screenshots so entrance animations finish instantly. */
.still .screen-inner,
.still .play-btn,
.still .end-title { animation: none !important; }

.screen-inner {
  width: min(980px, 94vw);
  text-align: center;
  animation: rise 0.5s ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-size: clamp(9px, 1.1vw, 12px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #c8b98f;
  opacity: 0.85;
  margin-bottom: 18px;
  font-weight: 700;
}

.logo {
  margin: 0;
  line-height: 0.82;
  font-family: "Arial Black", "Helvetica Neue", Impact, sans-serif;
  text-transform: uppercase;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.6));
}

.logo-top {
  display: block;
  font-size: clamp(26px, 6.1vw, 78px);
  letter-spacing: 0.015em;
  background: linear-gradient(180deg, #fff7d6 0%, #f7d87a 38%, #e9a93a 68%, #b96d1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(30, 16, 0, 0.35);
}

.logo-num {
  display: block;
  font-size: clamp(70px, 17vw, 224px);
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #fffbe8 0%, #ffd86b 30%, #f0a12c 58%, #8e4c0e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px rgba(20, 10, 0, 0.45);
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  margin-top: 0.03em;
}

.tagline {
  margin: 22px 0 0;
  font-size: clamp(13px, 1.6vw, 19px);
  letter-spacing: 0.06em;
  color: #ded6c4;
  font-style: italic;
}

.play-btn {
  margin: 32px auto 0;
  display: block;
  padding: 17px 46px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(15px, 1.6vw, 20px);
  letter-spacing: 0.16em;
  color: #181204;
  background: linear-gradient(180deg, #ffe89a, #f2b735 55%, #d8901b);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 8px 0 #7a4b0c, 0 14px 34px rgba(0, 0, 0, 0.55);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  animation: pulse 2.4s ease-in-out infinite;
}

.play-btn:hover { filter: brightness(1.07); }
.play-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 #7a4b0c, 0 8px 18px rgba(0, 0, 0, 0.5); animation: none; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

.controls {
  margin: 38px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px 18px;
  width: min(820px, 92vw);
}

.controls div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 4px;
}

.controls b {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--gold);
  white-space: nowrap;
}

.controls span {
  font-size: 11px;
  color: #b9b3a6;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fineprint {
  margin: 26px auto 0;
  max-width: 640px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f6a60;
}

.compact { width: min(560px, 92vw); }

.sub-logo {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(42px, 8vw, 84px);
  letter-spacing: 0.02em;
  color: #f0e8d4;
  text-shadow: 0 5px 0 #000;
}

.stats {
  margin: 26px auto 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(420px, 90vw);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #cfc8b7;
}

.stats span {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.stats b { color: var(--gold); }

.screen.end { background: rgba(8, 3, 3, 0.82); }

.end-title {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(68px, 15vw, 190px);
  line-height: 0.9;
  margin: 0;
  letter-spacing: 0.02em;
  color: #cf2f2f;
  text-shadow: 0 0 40px rgba(220, 40, 40, 0.45), 0 8px 0 #330808;
  animation: endIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.end .tagline { color: #a99b96; }

@keyframes endIn {
  from { opacity: 0; transform: scale(1.35); filter: blur(8px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* Test report */
#testScreen {
  align-items: flex-start;
  overflow: auto;
  background: #07090d;
  backdrop-filter: none;
}

.test-inner {
  width: min(1100px, 96vw);
  margin: 20px auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.test-inner h2 {
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 0.18em;
  border-bottom: 1px solid #26303d;
  padding-bottom: 12px;
}

#testReport {
  font-size: 12.5px;
  line-height: 1.65;
  color: #b9c4d3;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .controls { grid-template-columns: repeat(2, 1fr); }
  .screen { padding: 2vh 3vw; }
  .logo-num { font-size: 26vw; }
}
