@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --bg: #0d0d1a;
  --panel: #17172b;
  --green: #39ff88;
  --red: #ff4d6d;
  --gold: #ffd23f;
  --text: #e6e6f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Press Start 2P', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hud {
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.title {
  text-align: center;
  font-size: clamp(18px, 4vw, 28px);
  color: var(--gold);
  text-shadow: 3px 3px 0 #000;
  margin: 0;
}

.countdown {
  text-align: center;
  font-size: 14px;
  background: var(--panel);
  border: 3px solid #000;
  padding: 10px;
  box-shadow: 0 0 0 3px #33335a;
}

.xp-bar-track {
  position: relative;
  height: 36px;
  background: #000;
  border: 3px solid #33335a;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 0.6s steps(20);
}

.xp-bar-fill.negative {
  background: linear-gradient(90deg, #7a0022, var(--red));
}

.xp-bar-fill.overflow {
  background: linear-gradient(90deg, var(--gold), #fff9c4);
  box-shadow: 0 0 16px var(--gold);
}

.xp-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-shadow: 2px 2px 0 #000;
}

.xp-sub {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  flex-wrap: wrap;
  gap: 8px;
}

.streak {
  color: var(--gold);
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 3px solid #33335a;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.sprite {
  font-size: 20px;
}

.sprite.up { color: var(--green); }
.sprite.down { color: var(--red); }

.price {
  font-size: 16px;
}

.change.up { color: var(--green); }
.change.down { color: var(--red); }

.spark {
  width: 100%;
  height: 40px;
  background: #000;
}

.toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.toast {
  background: var(--gold);
  color: #000;
  border: 3px solid #000;
  padding: 10px 14px;
  font-size: 11px;
  box-shadow: 4px 4px 0 #000;
  animation: pop 0.3s ease-out;
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
