@font-face {
  font-family: "DSEG7";
  src: url("/fonts/DSEG7Classic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}

:root {
  --gold: #ffb020;
  --gold-soft: #ffd27a;
  --red: #ff3b30;
  --green: #35d07f;
  --bg: #120a04;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: #fff;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  cursor: none;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 2.2vh 3vw 3vh;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 176, 32, 0.18), transparent 60%),
    linear-gradient(rgba(10, 5, 2, 0.55), rgba(10, 5, 2, 0.8)),
    url("/img/bg.jpg") center / cover no-repeat,
    linear-gradient(160deg, #2a1608, #0d0603);
}

.top { display: flex; justify-content: center; min-height: 2vh; }
.logo { display: block; object-fit: contain; filter: drop-shadow(0 0.6vh 1.2vh rgba(0, 0, 0, 0.6)); }
.logo[hidden] { display: none; }
#logoTop { max-height: 15vh; max-width: 50vw; }

.center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 2vw;
}
.side { display: flex; justify-content: center; }
.side .logo { max-width: 100%; max-height: 38vh; }

.clockwrap { text-align: center; position: relative; }

.status {
  min-height: 6vh;
  font-size: 3.4vh;
  font-weight: 800;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 1vh;
}

.clock {
  position: relative;
  display: inline-block;
  font-family: "DSEG7", monospace;
  font-weight: 700;
  font-size: 22vh;
  line-height: 1.1;
  padding: 1vh 3vw;
  border-radius: 2vh;
  background: rgba(0, 0, 0, 0.55);
  border: 0.5vh solid rgba(255, 176, 32, 0.35);
  box-shadow: 0 0 6vh rgba(255, 176, 32, 0.25), inset 0 0 4vh rgba(0, 0, 0, 0.7);
}
.clock.long { font-size: 16vh; }

.ghost {
  position: absolute;
  inset: 1vh 3vw;
  color: var(--gold);
  opacity: 0.07;
  text-align: center;
}
.digits {
  position: relative;
  color: var(--gold);
  text-shadow: 0 0 2vh rgba(255, 176, 32, 0.8), 0 0 6vh rgba(255, 140, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

.clock.paused .digits { animation: blink 1.2s steps(2, start) infinite; opacity: 0.85; }
.clock.low .digits { color: var(--red); text-shadow: 0 0 2vh rgba(255, 59, 48, 0.9), 0 0 6vh rgba(255, 59, 48, 0.6); animation: pulse 1s ease-in-out infinite; }
.clock.low .ghost { color: var(--red); }
.clock.done .digits { color: var(--red); text-shadow: 0 0 3vh rgba(255, 59, 48, 0.9); }
.clock.done { border-color: rgba(255, 59, 48, 0.6); }

@keyframes blink { 50% { opacity: 0.25; } }
@keyframes pulse { 50% { transform: scale(1.025); } }

.bump {
  position: absolute;
  left: 50%;
  top: 5vh;
  transform: translateX(-50%);
  font-size: 11vh;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 2vh rgba(0, 0, 0, 0.9);
}
.bump.show { animation: bump 2.4s ease-out forwards; }
.bump.plus { color: var(--green); }
.bump.minus { color: var(--red); }
@keyframes bump {
  0% { opacity: 0; transform: translate(-50%, 4vh) scale(0.7); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -9vh) scale(1); }
}

.panel {
  background: rgba(0, 0, 0, 0.55);
  border: 0.3vh solid rgba(255, 176, 32, 0.3);
  border-radius: 2vh;
  padding: 2vh 2vw;
  min-height: 27vh;
}
.panel h2 {
  font-size: 2.6vh;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4vh;
}

.recent { list-style: none; }
.recent li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2vw;
  font-size: 4vh;
  font-weight: 700;
  padding: 0.7vh 0;
  border-bottom: 0.2vh solid rgba(255, 255, 255, 0.08);
}
.recent li:last-child { border-bottom: 0; }
.recent li.new { animation: slidein 0.7s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateX(-4vw); } to { opacity: 1; transform: none; } }
.recent .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .gain { color: var(--green); }
.recent .loss { color: var(--red); }
.recent .when { font-size: 2.6vh; color: rgba(255, 255, 255, 0.5); font-weight: 500; flex: none; }
.empty { font-size: 3vh; color: rgba(255, 255, 255, 0.45); padding-top: 1vh; }

.finished {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(40, 0, 0, 0.72);
  z-index: 5;
}
.finished[hidden] { display: none; }
.finished-text {
  font-size: 12vh;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 4vh var(--red);
  animation: pulse 1s ease-in-out infinite;
  text-align: center;
  padding: 0 4vw;
}
