﻿:root {
  --black: #080808;
  --panel: #101010;
  --metal: #1a1a1a;
  --fire-red: #ff2d00;
  --fire-orange: #ff5c00;
  --fire-gold: #ff8a00;
  --fire-yellow: #ffd000;
  --spark: #ffaa00;
  --text: #ffe6aa;
  --muted: #b98659;
  --pixel: 4px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--black);
  font-family: "Courier New", Courier, monospace;
  image-rendering: pixelated;
}

button,
input {
  font: inherit;
}

#world,
.lava-grid,
.scanlines,
.flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#world {
  z-index: 0;
}

.lava-grid {
  z-index: 1;
  opacity: .58;
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255, 45, 0, .22) 36% 37%, transparent 38%),
    linear-gradient(65deg, transparent 0 52%, rgba(255, 138, 0, .17) 53% 54%, transparent 55%),
    radial-gradient(circle at 28% 100%, rgba(255, 92, 0, .22), transparent 28%),
    radial-gradient(circle at 72% 100%, rgba(255, 45, 0, .14), transparent 24%);
  filter: blur(.2px);
  animation: heat 2.2s steps(2) infinite;
}

.scanlines {
  z-index: 5;
  opacity: .22;
  mix-blend-mode: screen;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, .08) 0,
    rgba(255, 255, 255, .08) 1px,
    transparent 2px,
    transparent 5px
  );
}

.flash {
  z-index: 8;
  background: rgba(255, 20, 0, 0);
}

.flash.active {
  animation: warningFlash .36s steps(2) 4;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -15%, rgba(255, 92, 0, .18), transparent 35%),
    linear-gradient(to bottom, rgba(255, 208, 0, .05), transparent 35%, rgba(255, 45, 0, .12));
  animation: flicker 3s steps(4) infinite;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #050505;
  transition: opacity .45s ease, visibility .45s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader__frame {
  width: min(420px, calc(100vw - 40px));
  padding: 20px;
  border: var(--pixel) solid var(--fire-red);
  box-shadow: 0 0 0 var(--pixel) #3d1308, 0 0 40px rgba(255, 92, 0, .7);
  text-align: center;
  color: var(--fire-yellow);
  text-shadow: 0 0 18px var(--fire-orange);
}

.loader__bar {
  display: block;
  height: 22px;
  margin-bottom: 16px;
  background:
    linear-gradient(90deg, var(--fire-red), var(--fire-gold), var(--fire-yellow)) 0 0 / 34% 100% no-repeat,
    #1c0b05;
  border: 2px solid var(--fire-gold);
  animation: loading 1.1s steps(8) infinite;
}

.sound-toggle {
  position: fixed;
  z-index: 12;
  top: 18px;
  right: 18px;
  padding: 10px 12px;
  border: 3px solid var(--fire-gold);
  color: var(--fire-yellow);
  background: #130905;
  box-shadow: 0 0 18px rgba(255, 92, 0, .55), inset 0 0 14px rgba(255, 45, 0, .35);
  cursor: pointer;
}

.social-links {
  position: fixed;
  z-index: 12;
  top: 18px;
  left: 18px;
  display: flex;
  gap: 10px;
}

.social-links a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid var(--fire-gold);
  color: var(--fire-yellow);
  background: #130905;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(255, 92, 0, .55), inset 0 0 14px rgba(255, 45, 0, .35);
  transition: transform .12s ease, filter .12s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  filter: brightness(1.2);
  transform: translateY(2px);
  outline: 0;
}

.social-links a:nth-child(2) span {
  font-size: .82rem;
}

.arcade {
  position: relative;
  z-index: 4;
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 64px 0 42px;
}

.hero {
  min-height: min(520px, 72vh);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 24px 0 34px;
}

.coin-row {
  display: flex;
  gap: 12px;
  margin: 0 0 18px;
}

.coin-row span {
  width: 20px;
  height: 20px;
  background: var(--fire-yellow);
  box-shadow: 0 0 0 4px var(--fire-orange), 0 0 20px var(--fire-gold);
  animation: coinPulse 1.1s steps(2) infinite;
}

.coin-row span:nth-child(even) {
  animation-delay: .25s;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 11vw, 9.5rem);
  line-height: .9;
  letter-spacing: 0;
  color: transparent;
  background: linear-gradient(#ffd000 0 18%, #ff8a00 36%, #ff2d00 74%, #751300 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow:
    0 0 10px rgba(255, 208, 0, .9),
    0 0 28px rgba(255, 92, 0, .82),
    6px 6px 0 #250600;
  filter: drop-shadow(0 0 20px rgba(255, 45, 0, .82));
  animation: logoForge 1.45s steps(3) infinite;
}

.tagline {
  margin: 20px 0 8px;
  color: var(--fire-yellow);
  font-weight: 900;
  text-shadow: 0 0 12px var(--fire-red);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
}

.brief {
  max-width: 760px;
  margin: 0;
  color: #ffc489;
  line-height: 1.6;
}

.machine {
  position: relative;
  padding: 22px;
  border: 5px solid #3a1308;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .04) 0 12%, transparent 13%),
    repeating-linear-gradient(45deg, #161616 0 12px, #111 13px 24px);
  box-shadow:
    0 0 0 4px #070707,
    0 0 0 8px #4b1708,
    0 0 60px rgba(255, 68, 0, .5),
    inset 0 0 60px rgba(0, 0, 0, .85);
}

.machine__lights {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.machine__lights span {
  width: 24px;
  height: 24px;
  background: var(--fire-red);
  box-shadow: 0 0 18px var(--fire-red);
  animation: lightBlink .9s steps(2) infinite;
}

.machine__lights span:nth-child(2) {
  background: var(--fire-gold);
  animation-delay: .18s;
}

.machine__lights span:nth-child(3) {
  background: var(--fire-yellow);
  animation-delay: .36s;
}

.machine__plate {
  display: grid;
  gap: 18px;
  padding: clamp(16px, 4vw, 34px);
  border: 4px solid #66200c;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 92, 0, .18), transparent 40%),
    #0d0d0d;
  box-shadow: inset 0 0 34px rgba(255, 68, 0, .25);
}

.ca-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: #ffbd7a;
  font-size: .88rem;
  font-weight: 700;
  opacity: .86;
}

.ca-line span {
  color: var(--fire-yellow);
  text-shadow: 0 0 10px var(--fire-orange);
}

.ca-line code {
  color: #9b5d38;
  font-family: inherit;
  overflow-wrap: anywhere;
}

#contractInput {
  width: 100%;
  min-height: 68px;
  padding: 18px;
  border: 4px solid var(--fire-orange);
  outline: 0;
  color: var(--fire-yellow);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 3px, transparent 4px 9px),
    #080808;
  box-shadow: inset 0 0 24px rgba(255, 92, 0, .24), 0 0 24px rgba(255, 92, 0, .3);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

#contractInput::placeholder {
  color: #9b5d38;
}

.terminate {
  position: relative;
  min-height: clamp(82px, 12vw, 124px);
  border: 0;
  color: #fff2bf;
  background:
    linear-gradient(#ffb000, #ff4b00 45%, #9e1200 46%, #4b0700);
  box-shadow:
    0 8px 0 #250400,
    0 0 0 5px #ff8a00,
    0 0 42px rgba(255, 45, 0, .75),
    inset 0 0 24px rgba(255, 255, 255, .2);
  cursor: pointer;
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 5.2rem);
  text-shadow: 4px 4px 0 #440800, 0 0 18px #ffd000;
  transition: transform .12s ease, filter .12s ease;
}

.terminate:hover,
.terminate:focus-visible {
  filter: brightness(1.22);
  transform: translateY(2px);
  animation: buttonShake .22s steps(2) infinite;
}

.terminate:disabled {
  cursor: not-allowed;
  filter: grayscale(.55) brightness(.58);
  box-shadow: 0 8px 0 #160300, 0 0 0 5px #6b2a0a, inset 0 0 24px rgba(0, 0, 0, .45);
}

.conveyor {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.conveyor span {
  height: 14px;
  background: #341006;
  box-shadow: inset 0 0 10px rgba(255, 92, 0, .35);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.stat-box,
.feed-panel {
  border: 4px solid #5d1d0a;
  background: rgba(12, 12, 12, .92);
  box-shadow: 0 0 26px rgba(255, 68, 0, .32), inset 0 0 24px rgba(255, 92, 0, .12);
}

.stat-box {
  min-height: 148px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
}

.stat-box span,
.feed-title {
  color: var(--muted);
  font-weight: 900;
}

.stat-box strong {
  color: var(--fire-yellow);
  font-size: clamp(2rem, 5vw, 3.4rem);
  text-shadow: 0 0 18px var(--fire-red);
}

.contract-box strong {
  max-width: 100%;
  padding: 10px 12px;
  border: 3px solid rgba(255, 138, 0, .8);
  color: #ffb36b;
  background: #090909;
  font-size: clamp(1rem, 2.8vw, 1.55rem);
  overflow-wrap: anywhere;
  box-shadow: inset 0 0 18px rgba(255, 92, 0, .16);
}

.rugh-box strong {
  color: #ffd000;
  text-shadow: 0 0 14px #ff8a00, 0 0 28px #ff2d00;
}

.stat-box.bump strong {
  animation: statFlip .38s steps(4);
}

.feed-panel {
  margin-top: 18px;
  padding: 16px;
}

.feed-title {
  margin-bottom: 10px;
}

.feed {
  height: 172px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

.feed li {
  display: flex;
  align-items: center;
  min-height: 32px;
  color: #ffbf74;
  border-top: 1px solid rgba(255, 92, 0, .24);
}

.feed li::before {
  content: ">";
  margin-right: 10px;
  color: var(--fire-red);
}

.token-sprite {
  position: fixed;
  z-index: 9;
  left: 50%;
  top: 50%;
  width: 124px;
  height: 124px;
  display: none;
  place-items: center;
  color: #130500;
  transform: translate(-50%, -50%) scale(0);
  font-weight: 900;
  filter: drop-shadow(0 0 18px rgba(255, 92, 0, .9));
}

.token-core {
  position: absolute;
  inset: 20px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.token-flame,
.token-burst {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  pointer-events: none;
}

.token-flame {
  bottom: 12px;
  width: 24px;
  height: 56px;
  background:
    linear-gradient(to top, #ff2d00 0 34%, #ff8a00 35% 68%, #ffd000 69% 100%);
  box-shadow:
    0 -18px 0 -6px #ff8a00,
    0 -34px 0 -12px #ffd000,
    0 0 22px #ff4400;
  transform-origin: 50% 100%;
  opacity: 0;
}

.token-flame--one {
  left: 17px;
}

.token-flame--two {
  left: 50px;
  height: 72px;
}

.token-flame--three {
  right: 17px;
}

.token-burst {
  inset: -12px;
  border: 8px solid transparent;
  box-shadow:
    0 -38px 0 -24px #ffd000,
    38px 0 0 -24px #ff8a00,
    0 38px 0 -24px #ff2d00,
    -38px 0 0 -24px #ff8a00;
  opacity: 0;
}

.token-burst--two {
  transform: rotate(45deg);
}

.token-sprite em {
  display: none;
}

.token-sprite.active {
  display: grid;
  animation: tokenPull 1.25s steps(10) forwards;
}

.token-sprite.active .token-core {
  animation: tokenIgnite .22s steps(2) infinite;
}

.token-sprite.active .token-flame {
  opacity: 1;
  animation: pixelFire .16s steps(2) infinite;
}

.token-sprite.active .token-flame--two {
  animation-delay: .05s;
}

.token-sprite.active .token-flame--three {
  animation-delay: .09s;
}

.token-sprite.active .token-burst {
  animation: tokenBurst 1.05s steps(6) forwards;
}

.legendary {
  position: fixed;
  z-index: 11;
  inset: 30% 0 auto;
  display: none;
  text-align: center;
  color: var(--fire-yellow);
  font-size: clamp(2.6rem, 9vw, 7rem);
  font-weight: 900;
  text-shadow: 0 0 16px var(--fire-yellow), 0 0 42px var(--fire-red), 6px 6px 0 #420700;
  animation: legendary .9s steps(4) forwards;
}

.legendary.show {
  display: block;
}

.modal-shell {
  position: fixed;
  z-index: 15;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  visibility: hidden;
  opacity: 0;
  background: rgba(0, 0, 0, .64);
  transition: opacity .25s ease, visibility .25s ease;
}

.modal-shell.open {
  visibility: visible;
  opacity: 1;
}

.success {
  position: relative;
  width: min(620px, 100%);
  padding: clamp(24px, 5vw, 42px);
  text-align: center;
  border: 5px solid var(--fire-orange);
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 92, 0, .25), transparent 40%),
    #0b0b0b;
  box-shadow: 0 0 0 5px #3c1006, 0 0 70px rgba(255, 68, 0, .75);
  transform: translateY(24px) scale(.94);
}

.modal-shell.open .success {
  animation: smokeIn .34s steps(4) forwards, burnFrame 1s steps(2) infinite;
}

.success h2 {
  margin: 0 0 16px;
  color: var(--fire-yellow);
  text-shadow: 0 0 18px var(--fire-red);
}

.success p {
  margin: 0 0 24px;
  line-height: 1.6;
}

.success button {
  min-height: 56px;
  padding: 0 24px;
  border: 4px solid var(--fire-yellow);
  color: #190600;
  background: linear-gradient(#ffd000, #ff8a00);
  box-shadow: 0 6px 0 #681000, 0 0 24px rgba(255, 138, 0, .55);
  cursor: pointer;
  font-weight: 900;
}

.success__corners::before,
.success__corners::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: -12px;
  background: var(--fire-yellow);
  box-shadow: 0 0 18px var(--fire-red);
  animation: cornerFire .35s steps(2) infinite;
}

.success__corners::before {
  left: -12px;
}

.success__corners::after {
  right: -12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-shake {
  animation: screenShake .55s steps(8);
}

@keyframes loading {
  to { background-position: 100% 0, 0 0; }
}

@keyframes heat {
  50% { transform: translate(2px, -1px) skewX(.5deg); }
}

@keyframes flicker {
  0%, 100% { opacity: .86; }
  34% { opacity: .7; }
  60% { opacity: .95; }
}

@keyframes warningFlash {
  50% { background: rgba(255, 0, 0, .45); }
}

@keyframes coinPulse {
  50% { transform: translateY(-8px); filter: brightness(1.35); }
}

@keyframes logoForge {
  40% { filter: drop-shadow(0 0 30px rgba(255, 138, 0, .96)); transform: translateX(1px); }
  70% { transform: translateX(-1px); }
}

@keyframes lightBlink {
  50% { opacity: .45; }
}

@keyframes buttonShake {
  50% { transform: translate(2px, 2px); }
}

@keyframes statFlip {
  50% { transform: translateY(-8px) scale(1.03); filter: brightness(1.4); }
}

@keyframes tokenIgnite {
  50% { opacity: 0; }
}

@keyframes pixelFire {
  0% { transform: translateY(0) scaleY(1); filter: brightness(1); }
  50% { transform: translateY(-10px) scaleY(1.28); filter: brightness(1.7); }
  100% { transform: translateY(-4px) scaleY(.9); filter: brightness(1.2); }
}

@keyframes tokenBurst {
  0% { opacity: 0; transform: scale(.3) rotate(0deg); }
  35% { opacity: 1; transform: scale(.9) rotate(0deg); }
  78% { opacity: .9; transform: scale(1.55) rotate(45deg); }
  100% { opacity: 0; transform: scale(2.3) rotate(90deg); }
}

@keyframes tokenPull {
  0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.15) rotate(8deg); opacity: 1; }
  48% { transform: translate(-50%, -50%) scale(1.28) rotate(-10deg); filter: drop-shadow(0 0 36px rgba(255, 208, 0, 1)); }
  76% { transform: translate(-50%, -50%) scale(.78) rotate(-22deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(.08) rotate(120deg); opacity: 0; }
}

@keyframes legendary {
  0% { transform: scale(.4); opacity: 0; }
  28% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

@keyframes smokeIn {
  to { transform: translateY(0) scale(1); }
}

@keyframes burnFrame {
  50% { box-shadow: 0 0 0 5px #3c1006, 0 0 94px rgba(255, 138, 0, .8); }
}

@keyframes cornerFire {
  50% { height: 34px; transform: translateY(-7px); }
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(8px, -4px); }
  24% { transform: translate(-10px, 6px); }
  36% { transform: translate(7px, 9px); }
  48% { transform: translate(-8px, -7px); }
  60% { transform: translate(10px, 3px); }
  72% { transform: translate(-5px, 8px); }
  84% { transform: translate(4px, -8px); }
}

@media (max-width: 720px) {
  .arcade {
    width: min(100% - 20px, 560px);
    padding-top: 82px;
  }

  .hero {
    min-height: 58vh;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .machine {
    padding: 14px;
  }

  .sound-toggle {
    top: 10px;
    right: 10px;
    font-size: .82rem;
  }

  .social-links {
    top: 10px;
    left: 10px;
  }

  .social-links a {
    width: 38px;
    height: 38px;
    font-size: .88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}






