/* Bonus Buy — stream overlay (OBS browser source, transparent background) */

:root {
  --bg-top: #142456;
  --bg-bottom: #0a1230;
  --card: #050b2299;
  --line: #ffffff14;
  --text: #eef3ff;
  --muted: #8ea4d6;
  --accent: #6fa3ff;
  --brand: #2f6bff;
  --good: #3ee07f;
  --bad: #ff5a6a;

  --row-h: 36px;
  --cover-w: 150px;
  --rows-visible: 6;

  --font-pixel: 'Press Start 2P', Consolas, monospace;
  --font-display: 'Montserrat', 'Arial Black', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 20px;               /* room for the frame's glow so OBS doesn't clip it */
  background: transparent;
  color: var(--text);
  font-family: var(--font-pixel);
}

.icon { display: block; flex: none; }

.good { color: var(--good); }
.bad  { color: var(--bad); }

/* ---------------------------------------------------------------- frame */

.overlay {
  width: 700px;
  padding: 16px 16px 14px;
  transform-origin: top left;
  border: 1px solid #2f6bff40;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  box-shadow: 0 10px 40px #0009, 0 0 30px #2f6bff22;
}

.card {
  background: var(--card);
  border-radius: 14px;
}

/* --------------------------------------------------------------- header */

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.header__logo { display: flex; }
.header__logo img { display: block; height: 46px; max-width: 120px; border-radius: 12px; object-fit: contain; }
.header__logo img.is-brand { height: 42px; max-width: none; border-radius: 0; filter: drop-shadow(0 3px 8px #0008); }
.header__logo .icon { width: 46px; height: 46px; }

.header__title {
  font: 800 32px/1 var(--font-display);
  letter-spacing: .5px;
}

.header__nick {
  margin-top: 3px;
  font: 800 12px var(--font-display);
  letter-spacing: 1.5px;
  color: var(--accent);
}

/* ---------------------------------------------------------------- stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px;
}

.stat {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
}

.stat + .stat::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  border-left: 1px solid var(--line);
}

/* highlight while the info card explains this stat */
.stat::after {
  content: '';
  position: absolute;
  inset: 0 8px;
  z-index: -1;
  border-radius: 10px;
  background: #ffffff12;
  opacity: 0;
  transition: opacity .4s;
}

.stat .icon { width: 24px; height: 24px; transition: transform .4s; }
.stat.is-active::after { opacity: 1; }
.stat.is-active .icon { transform: scale(1.18); }

/* pixel font sizes stay on multiples of 4px so they land on whole pixels (sharp at 1x and 2x) */
.stat__value { font-size: 16px; line-height: 1.2; }

/* how much of the starting balance the listed bonuses take */
.budget {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 10px;
  font-size: 8px;
  color: var(--muted);
}
.budget[hidden] { display: none; }
.budget__label { font: 800 10px var(--font-display); letter-spacing: 1.2px; color: var(--accent); }
.budget__track {
  position: relative;
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: #ffffff12;
}
.budget__track i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f5bff, #6fb0ff);
  box-shadow: 0 0 10px #2f6bff88;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(.2, .8, .2, 1), background .4s;
}
.budget.is-over .budget__track i { background: linear-gradient(90deg, #e8304a, #ff7a86); box-shadow: 0 0 10px #ff5a6a88; }
.budget__value { white-space: nowrap; color: var(--text); }

/* ------------------------------------------------------- rotating info card */

.ticker {
  position: relative;
  height: 82px;
  margin-top: 12px;
  overflow: hidden;
}

.ticker__slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  transition: opacity .35s ease, transform .35s ease;
}

.ticker__slide.is-leaving  { opacity: 0; transform: translateY(-10px); }
.ticker__slide.is-entering { opacity: 0; transform: translateY(10px); transition: none; }

.ticker__line {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.5;
}
.ticker__line .icon { width: 22px; height: 22px; }
.ticker__line > span { overflow: hidden; text-overflow: ellipsis; }

.ticker__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 12px var(--font-display);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.ticker__title .icon { width: 22px; height: 22px; }

.ticker__text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.5;
}

.ticker__progress {
  position: absolute;
  left: 18px; right: 18px; bottom: 6px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: #ffffff0d;
}
.ticker__progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  opacity: .5;
  transform-origin: left;
  animation: ticker-progress var(--ticker-ms, 5000ms) linear;
}
@keyframes ticker-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ------------------------------------------------- list + cover spotlight */

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.board.has-spot { grid-template-columns: minmax(0, 1fr) var(--cover-w); }

/* cover of the bonus being opened (or the best one once everything is opened) */
.spot {
  position: relative;
  display: none;
  height: calc(var(--row-h) * var(--rows-visible));
  overflow: hidden;
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 0 0 1px #2f6bff66, 0 0 26px #2f6bff33;
}
.board.has-spot .spot { display: block; }

.spot__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity .6s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1);
}
.spot__img.is-visible { opacity: 1; transform: scale(1); }

/* soft shine sweeping across on every change */
.spot::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(105deg, transparent 35%, #ffffff40 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}
.spot.is-shining::after { animation: spot-shine 1.1s ease .15s; }
@keyframes spot-shine { to { transform: translateX(120%); } }

.spot__tag {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--brand);
  box-shadow: 0 2px 10px #0008;
  font: 800 11px var(--font-display);
  letter-spacing: 1.2px;
  color: #fff;
  transform: translateX(-50%);
  white-space: nowrap;
}
.spot__tag.is-top { background: linear-gradient(180deg, #ffe680, #f5a623); color: #3a2500; }

/* ---------------------------------------------------------------- list */

.divider {
  margin: 12px 0 10px;
  border: 0;
  border-top: 1px solid var(--line);
}

.list {
  position: relative;
  max-height: calc(var(--row-h) * var(--rows-visible));
  overflow: hidden;
  font-size: 12px;
  line-height: 1.5;
}
.list.is-scrollable {
  --fade: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: var(--fade);
          mask-image: var(--fade);
}
.list__track { will-change: transform; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--row-h);
  padding: 0 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.row__name { flex: 1; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.row__sum { color: var(--muted); }

.row.is-done .row__name { color: var(--muted); }

.row.is-current {
  background: linear-gradient(90deg, var(--brand), #1d3f9e);
  box-shadow: 0 0 14px #2f6bff55;
}
.row.is-current .row__name::before { content: '> '; }
.row.is-current .row__value::after { content: ' <'; }
