:root {
  --asphalt: #17120E;
  --umber: #7A3E22;
  --ochre: #C49A4F;
  --clay: #B94F2E;
  --cream: #F0D8A8;
  --green: #3FA46A;
  --gold: #E2B84C;
  --display: "EB Garamond", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, serif;
  --pixel: "Press Start 2P", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--cream);
  font-family: var(--body);
  overflow-x: hidden;
}

body.entered .gate-table { filter: drop-shadow(0 0 26px rgba(226, 184, 76, .55)); }

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 1px, transparent 1px 5px);
  mix-blend-mode: overlay;
}

.bokeh-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(226,184,76,.14), transparent 22%),
    radial-gradient(circle at 78% 28%, rgba(185,79,46,.13), transparent 23%),
    linear-gradient(135deg, #17120E 0%, #22150f 48%, #0f0c09 100%);
}

.lamp {
  position: absolute;
  width: 15vmin;
  height: 15vmin;
  border-radius: 50%;
  background: var(--gold);
  opacity: .18;
  filter: blur(18px);
  animation: breathe 7s ease-in-out infinite;
}

.lamp-one { left: 12%; top: 13%; }
.lamp-two { right: 14%; top: 18%; animation-delay: -2s; background: var(--ochre); }
.lamp-three { left: 42%; top: 58%; animation-delay: -4s; background: var(--clay); }
.lamp-four { right: 22%; bottom: 8%; animation-delay: -1s; }
.lamp-five { left: 6%; bottom: 17%; animation-delay: -5s; background: var(--green); }

@keyframes breathe { 50% { transform: scale(1.35); opacity: .31; } }

.auction-marquee {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 74px;
  z-index: 50;
  display: grid;
  grid-template-columns: 190px 1fr 190px;
  border-bottom: 5px solid var(--umber);
  background: linear-gradient(180deg, rgba(23,18,14,.98), rgba(61,35,20,.94));
  box-shadow: 0 10px 0 rgba(0,0,0,.35), inset 0 -2px 0 var(--gold);
  font-family: var(--pixel);
  font-size: 11px;
}

.marquee-block, .reserve-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  border-right: 3px solid var(--umber);
  text-shadow: 3px 3px 0 #000;
}

.reserve-panel { border-right: 0; border-left: 3px solid var(--umber); color: var(--cream); gap: 10px; }

.reserve-light {
  width: 18px;
  height: 18px;
  background: var(--clay);
  box-shadow: 0 0 0 4px #000, 0 0 18px var(--clay);
  animation: reserveBlink .8s steps(2) infinite;
}

.reserve-light.awake { background: var(--green); box-shadow: 0 0 0 4px #000, 0 0 26px var(--green); }

@keyframes reserveBlink { 50% { opacity: .25; } }

.ticker-wrap { overflow: hidden; display: flex; align-items: center; }
.ticker { white-space: nowrap; animation: ticker 16s linear infinite; color: var(--ochre); }
@keyframes ticker { to { transform: translateX(-50%); } }

.salvage-rail {
  position: fixed;
  left: 24px;
  top: 104px;
  bottom: 34px;
  width: 154px;
  z-index: 45;
  border-left: 4px solid var(--green);
  background: linear-gradient(90deg, rgba(23,18,14,.9), transparent);
}

.rail-tab {
  display: block;
  margin: 0 0 18px 16px;
  padding: 12px 10px;
  width: 130px;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--pixel);
  font-size: 9px;
  background: var(--umber);
  box-shadow: 5px 5px 0 #000;
  transform: skewY(-2deg);
  transition: transform .25s ease, background .25s ease;
}

.rail-tab span { color: var(--gold); display: block; margin-bottom: 8px; }
.rail-tab.active, .rail-tab:hover { background: var(--clay); transform: translateX(10px) skewY(-2deg); }

.rail-note {
  margin: 26px 0 0 16px;
  padding: 14px;
  width: 132px;
  color: var(--asphalt);
  background: var(--ochre);
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.7;
  box-shadow: 5px 5px 0 #000;
}

.circuit-spine { position: absolute; left: -8px; top: 0; bottom: 0; width: 12px; }
.circuit-spine i { position: absolute; width: 14px; height: 14px; background: var(--green); box-shadow: 0 0 14px var(--green); }
.circuit-spine i:nth-child(1) { top: 5%; }.circuit-spine i:nth-child(2) { top: 32%; }.circuit-spine i:nth-child(3) { top: 61%; }.circuit-spine i:nth-child(4) { bottom: 4%; }

main { position: relative; z-index: 5; }

.scene {
  min-height: 100vh;
  padding: 124px 7vw 80px 230px;
  position: relative;
  display: grid;
  gap: 4vw;
  align-items: center;
}

.gate-scene { grid-template-columns: minmax(320px, .95fr) minmax(320px, 1.05fr); }
.copper-scene { grid-template-columns: 1.4fr .7fr; }
.bidding-scene { grid-template-columns: .95fr .7fr; }
.hammerfall-scene { grid-template-columns: .8fr 1fr; }

.pixel-kicker {
  font-family: var(--pixel);
  color: var(--gold);
  font-size: 10px;
  line-height: 1.7;
  text-transform: uppercase;
}

h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: .86;
  margin: 0;
  text-shadow: 8px 8px 0 rgba(122,62,34,.85), 12px 12px 0 #000;
}

h1 { font-size: clamp(74px, 12vw, 182px); }
h2 { font-size: clamp(48px, 7vw, 104px); }

.pixel-underline {
  width: min(520px, 72vw);
  height: 18px;
  margin: 20px 0;
  background: repeating-linear-gradient(90deg, var(--clay) 0 20px, transparent 20px 29px, var(--gold) 29px 40px);
  box-shadow: 6px 6px 0 #000;
}

.catalogue-text {
  max-width: 650px;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
  color: rgba(240,216,168,.9);
}

.ritual-button {
  border: 0;
  background: var(--clay);
  color: var(--cream);
  font-family: var(--pixel);
  font-size: 11px;
  line-height: 1.5;
  padding: 18px 24px;
  box-shadow: 8px 8px 0 #000, inset 0 0 0 3px var(--gold);
  cursor: pointer;
  transform: rotate(-1deg);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.ritual-button:hover, .ritual-button.armed { transform: rotate(1deg) translateY(-5px); background: var(--green); box-shadow: 12px 12px 0 #000, inset 0 0 0 3px var(--gold); }
.ritual-button.small { font-size: 9px; padding: 14px 18px; }

.gate-table { position: relative; min-height: 540px; perspective: 900px; }

.pixel-hammer {
  position: absolute;
  top: 24px;
  left: 40%;
  width: 192px;
  height: 64px;
  background: var(--umber);
  box-shadow: 0 16px 0 #000, inset 0 0 0 8px var(--ochre);
  transform: rotate(-18deg);
  transform-origin: 25% 50%;
  animation: hoverHammer 3s ease-in-out infinite;
}

.pixel-hammer.strike { animation: strikeHammer .5s steps(3); }
.pixel-hammer span { position: absolute; width: 32px; height: 210px; background: var(--ochre); left: 72px; top: 42px; box-shadow: 10px 0 0 #000; }
@keyframes hoverHammer { 50% { transform: translateY(16px) rotate(-14deg); } }
@keyframes strikeHammer { 50% { transform: translateY(110px) rotate(20deg); } }

.scrap-pile { position: absolute; left: 5%; right: 2%; bottom: 32px; height: 340px; transform: rotateX(10deg) rotateY(-8deg); }
.scrap { position: absolute; image-rendering: pixelated; box-shadow: 10px 10px 0 #000; }
.monitor { width: 210px; height: 140px; left: 10%; bottom: 70px; background: linear-gradient(135deg, var(--umber) 0 62%, var(--asphalt) 62%); border: 12px solid var(--ochre); }
.keyboard { width: 270px; height: 78px; left: 32%; bottom: 38px; background: repeating-linear-gradient(90deg, var(--cream) 0 16px, var(--umber) 16px 22px); transform: rotate(-5deg); }
.board { width: 160px; height: 220px; right: 12%; bottom: 92px; background: var(--green); border: 10px solid #0b2617; background-image: linear-gradient(90deg, transparent 48%, var(--gold) 49% 51%, transparent 52%), linear-gradient(0deg, transparent 48%, var(--gold) 49% 51%, transparent 52%); }
.coil { width: 150px; height: 150px; left: 26%; bottom: 172px; border: 22px solid var(--clay); border-radius: 50%; background: transparent; }
.cartridge { width: 130px; height: 170px; right: 29%; bottom: 18px; background: var(--asphalt); border: 10px solid var(--cream); transform: rotate(8deg); }
.gate-stamp { position: absolute; right: 6%; top: 250px; padding: 18px; color: var(--asphalt); background: var(--gold); font-family: var(--pixel); font-size: 11px; line-height: 1.7; transform: rotate(8deg); box-shadow: 8px 8px 0 #000; }

.conveyor-belt {
  display: flex;
  gap: 24px;
  padding: 40px 34px;
  background: repeating-linear-gradient(-45deg, #241710 0 20px, #130e0b 20px 38px);
  border: 7px solid var(--umber);
  box-shadow: 14px 14px 0 #000;
  transform: rotate(-3deg);
  perspective: 1000px;
}

.salvage-lot {
  flex: 1;
  min-height: 440px;
  padding: 24px;
  background: rgba(122,62,34,.74);
  border: 4px solid var(--ochre);
  box-shadow: 8px 8px 0 #000;
  transform-style: preserve-3d;
  transition: transform .18s ease, filter .2s ease;
}

.salvage-lot.awake { filter: drop-shadow(0 0 18px rgba(63,164,106,.7)); }
.salvage-lot h2 { font-size: clamp(34px, 4vw, 58px); text-shadow: 5px 5px 0 #000; margin-top: 18px; }
.salvage-lot p { font-size: 22px; line-height: 1.05; }
.bid-value { font-family: var(--pixel); color: var(--gold); font-size: 18px; }
.bid-value::before { content: "BID "; color: var(--cream); font-size: 10px; }

.lot-token { width: 138px; height: 138px; margin: 0 auto; position: relative; filter: drop-shadow(8px 8px 0 #000); }
.copper-coil { border: 22px solid var(--clay); border-radius: 50%; box-shadow: inset 0 0 0 12px var(--ochre); }
.circuit-board { background: var(--green); border: 10px solid #17351f; background-image: repeating-linear-gradient(90deg, transparent 0 22px, var(--gold) 22px 26px), repeating-linear-gradient(0deg, transparent 0 28px, var(--gold) 28px 32px); }
.screw-jar { background: rgba(240,216,168,.22); border: 10px solid var(--cream); border-radius: 0 0 28px 28px; }
.screw-jar::after { content: ""; position: absolute; inset: 26px; background: radial-gradient(circle, var(--gold) 0 5px, transparent 6px), radial-gradient(circle at 80% 30%, var(--umber) 0 6px, transparent 7px), radial-gradient(circle at 35% 75%, var(--clay) 0 6px, transparent 7px); }
.side-copy { transform: translateY(-34px); }

.circuit-map { position: absolute; inset: 110px 4vw auto 210px; width: calc(100% - 260px); height: 60vh; opacity: .72; }
.circuit-map path { fill: none; stroke: var(--green); stroke-width: 8; stroke-linecap: square; stroke-dasharray: 34 18; animation: traceMove 2.8s linear infinite; filter: drop-shadow(0 0 8px var(--green)); }
.circuit-map circle { fill: var(--gold); filter: drop-shadow(0 0 9px var(--gold)); animation: reserveBlink 1.2s steps(2) infinite; }
.circuit-map.awake path { stroke: var(--gold); animation-duration: .8s; }
@keyframes traceMove { to { stroke-dashoffset: -104; } }

.bid-board { position: relative; z-index: 2; max-width: 620px; }
.bid-slip { margin: 18px 0; padding: 18px 20px; width: 90%; background: var(--cream); color: var(--asphalt); box-shadow: 8px 8px 0 #000; transform: rotate(-1deg); }
.bid-slip:nth-child(even) { margin-left: 42px; transform: rotate(2deg); }
.bid-slip span, .bid-slip em { display: block; font-family: var(--pixel); font-size: 9px; font-style: normal; color: var(--umber); }
.bid-slip strong { display: block; font-family: var(--display); font-size: 60px; line-height: .9; color: var(--clay); }
.bid-slip.active { background: var(--gold); }
.warning-stack { position: relative; z-index: 2; }
.warning-tape { padding: 20px; margin-bottom: 30px; color: var(--asphalt); font-family: var(--pixel); font-size: 13px; line-height: 1.6; background: repeating-linear-gradient(135deg, var(--gold) 0 18px, var(--clay) 18px 36px); box-shadow: 10px 10px 0 #000; transform: rotate(5deg); }
.paper-note { padding: 24px; margin-bottom: 26px; color: var(--asphalt); background: var(--ochre); font-size: 30px; line-height: 1; box-shadow: 8px 8px 0 #000; }

.final-crate { min-height: 420px; border: 8px solid var(--umber); background: repeating-linear-gradient(90deg, rgba(196,154,79,.24) 0 30px, rgba(122,62,34,.35) 30px 60px); box-shadow: 18px 18px 0 #000; position: relative; transform: rotate(-4deg); }
.pixel-skull { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 180px; height: 180px; display: grid; place-items: center; color: var(--asphalt); background: var(--green); font-size: 100px; box-shadow: 12px 12px 0 #000, 0 0 40px rgba(63,164,106,.55); }
.spark-grid span { position: absolute; width: 18px; height: 18px; background: var(--gold); box-shadow: 0 0 18px var(--gold); animation: spark 1.4s steps(2) infinite; }
.spark-grid span:nth-child(1) { left: 18%; top: 20%; }.spark-grid span:nth-child(2) { right: 18%; top: 29%; animation-delay: -.4s; }.spark-grid span:nth-child(3) { left: 28%; bottom: 18%; animation-delay: -.8s; }.spark-grid span:nth-child(4) { right: 24%; bottom: 22%; animation-delay: -1.1s; }
@keyframes spark { 50% { opacity: 0; transform: translateY(-14px); } }
.final-copy { max-width: 760px; }

@media (max-width: 920px) {
  .auction-marquee { grid-template-columns: 120px 1fr 130px; font-size: 8px; }
  .salvage-rail { display: none; }
  .scene { padding: 110px 24px 70px; grid-template-columns: 1fr; }
  .gate-scene, .copper-scene, .bidding-scene, .hammerfall-scene { grid-template-columns: 1fr; }
  .conveyor-belt { flex-direction: column; transform: rotate(-1deg); }
  .circuit-map { left: 0; width: 100%; opacity: .4; }
}
