:root {
  --ink: #f4e7c8;
  --muted: #c9b89a;
  --amber: #ffb04a;
  --slot: #ff7a3c;
  --night: #0b0d18;
  --steel: #8ea0c4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #05060c;
  color: var(--ink);
  font-family: Outfit, system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#frame {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 700px at 50% 40%, #14182c, #05060c 70%);
}

#game {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  display: block;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  background: #0c1020;
}

.panel, #hud {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.panel { pointer-events: auto; overflow: hidden; border-radius: 10px; }

.hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
}

.veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6,7,14,.78) 0%, rgba(6,7,14,.35) 48%, rgba(6,7,14,.15) 100%),
    radial-gradient(80% 80% at 70% 45%, transparent 30%, rgba(5,6,12,.45) 100%);
}
.veil.thick {
  background: rgba(6,7,14,.72);
  backdrop-filter: blur(6px);
}

.title-copy, .over-copy {
  position: absolute;
  left: 6.5%;
  bottom: 9%;
  max-width: 520px;
  z-index: 2;
}

.over-copy {
  left: 50%;
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: 560px;
}

.eyebrow {
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--amber);
  margin-bottom: 10px;
}

h1, h2 {
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(56px, 9vw, 108px);
  line-height: .9;
  letter-spacing: -0.03em;
  text-shadow: 0 10px 40px rgba(0,0,0,.55);
}

h2 { font-size: clamp(48px, 8vw, 88px); color: #ffd7a1; }

.tag {
  margin-top: 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
  max-width: 28ch;
}

.over-copy .tag { margin-left: auto; margin-right: auto; }

.how {
  margin-top: 10px;
  color: var(--steel);
  font-size: 14px;
  max-width: 36ch;
}

button {
  pointer-events: auto;
  margin-top: 22px;
  border: 0;
  background: linear-gradient(180deg, #ffcf7a, #ff9a3c);
  color: #2a1604;
  font-family: Outfit, sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .04em;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(255, 140, 40, .28);
}
button:hover { filter: brightness(1.06); transform: translateY(-1px); }
button:active { transform: translateY(1px); }

.best {
  margin-top: 12px;
  color: #9aa6c4;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.final {
  margin-top: 18px;
  font-family: Fraunces, Georgia, serif;
  font-size: 56px;
  color: var(--ink);
}

#hud {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 28px;
  z-index: 3;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
}

#hud[hidden], .panel[hidden], #combo[hidden] { display: none !important; }

.score-label, .lives-label, .clock-sub {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #d7c39a;
  opacity: .8;
}

#score {
  font-family: Fraunces, Georgia, serif;
  font-size: 40px;
  line-height: 1;
  margin-top: 2px;
}

.combo {
  display: inline-block;
  margin-top: 6px;
  background: #ffb04a;
  color: #2a1604;
  font-weight: 600;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  text-shadow: none;
}

.hud-mid { text-align: center; }
#clock {
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  font-size: 26px;
}
.hud-right { text-align: right; }
#lives { margin-top: 6px; font-size: 22px; letter-spacing: 3px; }

#mute {
  position: absolute;
  right: max(18px, calc(50vw - min(50vw, 50vh * 16 / 9) + 16px));
  top: max(18px, calc(50vh - min(50vh, 50vw * 9 / 16) + 16px));
  z-index: 5;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: rgba(12,14,24,.55);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid rgba(255,255,255,.12);
  font-size: 16px;
}
#mute.off { opacity: .45; }

@media (max-width: 720px) {
  .title-copy { left: 6%; bottom: 7%; max-width: 88%; }
  h1 { font-size: 56px; }
  .tag, .how { font-size: 14px; }
  #score { font-size: 28px; }
  #clock { font-size: 18px; }
}
