/* ── Sandman ─────────────────────────────────────────────────────────────
   The UI is authored at a fixed 1600×900 and scaled to fit the viewport, so
   the workbench always lands where it should. The background video sits
   behind all of it, covering the whole window.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --ink:        #05070f;
  --gold:       #e8c56a;
  --gold-soft:  rgba(232, 197, 106, .38);
  --gold-faint: rgba(232, 197, 106, .14);
  --parch:      #f2e5c8;
  --text:       #e7e3f5;
  --text-dim:   #a49fc0;
  --panel-bg:   linear-gradient(158deg, rgba(23, 24, 56, .82), rgba(8, 9, 26, .92));
  --display: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── background ───────────────────────────────────────────────────────── */

#bg { position: fixed; inset: 0; overflow: hidden; background: var(--ink); }
.bg-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
#sky-tint {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 8%, rgba(70, 90, 190, .08), transparent 60%),
    /* Keep these light. The bay sits under the right band and the cloud bank
       under the bottom one — crank them up and the background stops moving. */
    radial-gradient(90% 55% at 50% 108%, rgba(5, 6, 20, .55), transparent 62%),
    linear-gradient(to right, rgba(4, 5, 16, .46) 0 11%, transparent 24% 78%, rgba(4, 5, 16, .40) 90% 100%);
}

/* ── stage ────────────────────────────────────────────────────────────── */

#stage {
  position: absolute; top: 0; left: 0;
  width: 1600px; height: 900px;
  transform-origin: top left;
}

/* ── shared panel chrome ──────────────────────────────────────────────── */

.panel {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--gold-soft);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(7px) saturate(1.15);
  padding: 14px 16px;
}
.panel::before {
  content: ''; position: absolute; inset: 5px;
  border: 1px solid var(--gold-faint); border-radius: 11px;
  pointer-events: none;
}
.panel-title {
  margin: 0 0 8px;
  font: 600 11px/1 var(--ui);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold);
  opacity: .85;
}

/* ── left HUD ─────────────────────────────────────────────────────────── */

#hud-left {
  position: absolute; left: 26px; top: 24px; width: 238px;
  display: flex; flex-direction: column; gap: 14px;
}

.night-row { display: flex; align-items: center; gap: 8px; }
.moon { font-size: 20px; filter: drop-shadow(0 0 8px rgba(255, 226, 150, .7)); }
.night-title {
  margin: 0; font: 400 24px/1 var(--display);
  letter-spacing: .06em; text-transform: uppercase; color: var(--parch);
}
.night-title b { color: var(--gold); font-weight: 400; }
.score-line { margin-top: 10px; font: 400 15px/1.2 var(--display); color: var(--text-dim); }
.score-line b { font-size: 26px; color: var(--gold); font-weight: 400; letter-spacing: .02em; }
.delivered-line { margin-top: 6px; font-size: 11.5px; color: var(--text-dim); letter-spacing: .04em; }
.delivered-line b { color: var(--parch); font-weight: 600; }

.meter {
  height: 7px; margin-top: 7px; border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--gold-faint); overflow: hidden;
}
.meter i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #b98b31, var(--gold) 60%, #fff3c9);
  box-shadow: 0 0 12px rgba(232, 197, 106, .7);
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}
.stars { margin-top: 8px; letter-spacing: 5px; font-size: 15px; color: rgba(255, 255, 255, .18); }
.stars .on { color: var(--gold); text-shadow: 0 0 10px rgba(232, 197, 106, .8); }

.panel--queue { flex: 0 1 auto; }
#queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.queue-item {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 7px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .18s, border-color .18s, transform .18s;
}
.queue-item:hover { background: rgba(255, 255, 255, .06); transform: translateX(2px); }
.queue-item.is-selected {
  background: linear-gradient(90deg, rgba(232, 197, 106, .22), rgba(232, 197, 106, .04));
  border-color: var(--gold-soft);
}
.queue-item.is-done { opacity: .38; cursor: default; }
.queue-item.is-done:hover { transform: none; background: none; }
.queue-item .avatar { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; }
.queue-name { flex: 1; font-size: 13px; font-family: var(--display); letter-spacing: .02em; }
.queue-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.queue-score { font-size: 11px; color: var(--gold); font-variant-numeric: tabular-nums; }

.panel--timer { display: flex; align-items: center; gap: 12px; }
.hourglass { font-size: 26px; color: var(--gold); opacity: .8; }
.timer-label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-dim); }
.timer-value {
  font: 400 30px/1 var(--display); color: var(--parch);
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.panel--timer.is-urgent .timer-value { color: #ff9a7a; animation: pulse 1s ease-in-out infinite; }

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

/* ── the town + dream bubbles ─────────────────────────────────────────── */

#town { position: absolute; inset: 0; pointer-events: none; }

.bubble {
  position: absolute; width: 172px; margin: -52px 0 0 -86px;
  pointer-events: auto; cursor: pointer;
  animation: bob 6s ease-in-out infinite;
  transition: transform .2s;
}
.bubble.is-new { animation: bob 6s ease-in-out infinite, popIn .5s cubic-bezier(.2, 1.5, .4, 1); }
.bubble:hover { transform: scale(1.06); z-index: 5; }
.bubble.is-selected { z-index: 6; }
.bubble.is-leaving { animation: bubbleOut .55s ease-in forwards; pointer-events: none; }

@keyframes bob { 50% { transform: translateY(-9px); } }
@keyframes popIn { from { opacity: 0; transform: scale(.4) translateY(18px); } }
@keyframes bubbleOut { to { opacity: 0; transform: scale(.5) translateY(-40px); } }

.bubble__cloud {
  position: relative; padding: 16px 18px 16px 14px; min-height: 84px;
  display: flex; align-items: center; gap: 11px;
  border-radius: 44% 56% 46% 54% / 52% 48% 52% 48%;
  background: radial-gradient(120% 130% at 30% 20%, rgba(233, 236, 255, .96), rgba(178, 188, 232, .84) 62%, rgba(140, 152, 205, .72));
  box-shadow: 0 10px 30px rgba(3, 5, 22, .6), inset 0 -8px 18px rgba(90, 100, 160, .35), 0 0 26px rgba(160, 180, 255, .22);
}
.bubble.is-selected .bubble__cloud {
  box-shadow: 0 10px 32px rgba(3, 5, 22, .6), inset 0 -8px 18px rgba(90, 100, 160, .35), 0 0 0 3px rgba(232, 197, 106, .85), 0 0 34px rgba(232, 197, 106, .55);
}
.bubble__cloud::before, .bubble__cloud::after {
  content: ''; position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(233, 236, 255, .95), rgba(168, 178, 224, .8));
}
.bubble__cloud::before { width: 34px; height: 34px; left: -12px; top: 16px; }
.bubble__cloud::after  { width: 26px; height: 26px; right: -9px; bottom: 12px; }

.bubble__ring {
  position: relative; width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--ring, #7cf) calc(var(--p, 1) * 1turn), rgba(40, 44, 80, .35) 0);
  padding: 3px; z-index: 1;
}
.bubble__ring .avatar { width: 40px; height: 40px; border-radius: 50%; display: block; }
.bubble__tags { display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.bubble__name {
  font: 400 13px/1 var(--display); color: #1b1e3a; letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}
.bubble__hints { display: flex; gap: 4px; }
.bubble__hint { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .35); }
.bubble__tail {
  position: absolute; left: 40px; bottom: -24px; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bubble__tail i { display: block; border-radius: 50%; background: rgba(210, 218, 255, .75); }
.bubble__tail i:nth-child(1) { width: 11px; height: 11px; }
.bubble__tail i:nth-child(2) { width: 7px; height: 7px; opacity: .8; }
.bubble__tail i:nth-child(3) { width: 4px; height: 4px; opacity: .6; }
.bubble.is-panicked { animation: bob 6s ease-in-out infinite, panic .7s ease-in-out infinite; }
@keyframes panic { 50% { filter: drop-shadow(0 0 14px rgba(255, 120, 90, .85)); } }

/* ── ticket ───────────────────────────────────────────────────────────── */

#ticket {
  position: absolute; right: 26px; top: 24px; width: 356px; max-height: 852px;
  overflow: auto; padding: 16px 18px 18px;
  scrollbar-width: thin; scrollbar-color: var(--gold-soft) transparent;
}
#ticket.is-empty { display: flex; align-items: center; justify-content: center; min-height: 200px; }
.ticket-empty { text-align: center; color: var(--text-dim); font-family: var(--display); font-size: 15px; line-height: 1.6; max-width: 240px; }

.ticket-head { display: flex; align-items: center; gap: 12px; }
.ticket-head .avatar { width: 62px; height: 62px; border-radius: 50%; flex: 0 0 auto; }
.ticket-name { margin: 0; font: 400 26px/1.1 var(--display); color: var(--parch); }
.ticket-sub { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin-top: 4px; }

.ticket-section { margin-top: 16px; }
.ticket-label {
  font: 600 10px/1 var(--ui); letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); opacity: .8; margin-bottom: 6px;
}
.event-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07);
}
.event-text { flex: 1; font-size: 13px; line-height: 1.35; font-family: var(--display); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip .dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 8px currentColor, inset 0 -2px 3px rgba(0, 0, 0, .4); }
.chip b { font-weight: 700; }

.trait-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.trait-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: 8px; background: rgba(255, 255, 255, .04);
}
.trait-name { flex: 1; font-size: 12.5px; font-family: var(--display); }
.trait-fx { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fx { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-variant-numeric: tabular-nums; }
.fx .dot { width: 9px; height: 9px; border-radius: 50%; }
.fx.is-mult b { color: #ffd97a; }
.fx.is-up b { color: #9fe6a0; }
.fx.is-down b { color: #f09a9a; }

.aura-head { display: flex; align-items: baseline; justify-content: space-between; }
.aura-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.aura-bar .dot { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 8px currentColor; }
.aura-track { flex: 1; height: 11px; border-radius: 5px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.aura-fill { height: 100%; border-radius: 5px; box-shadow: 0 0 10px currentColor; transition: width .4s; }
.aura-num { width: 20px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--parch); }
.aura-hidden { text-align: center; padding: 14px 8px; }
.aura-hidden p { margin: 0 0 10px; font-size: 12px; color: var(--text-dim); line-height: 1.5; }

.complexity { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gold-faint); }
.complexity span { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); }

/* ── buttons ──────────────────────────────────────────────────────────── */

.btn {
  font: 600 12px/1 var(--ui); letter-spacing: .09em; text-transform: uppercase;
  padding: 10px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--gold-soft); color: var(--parch);
  background: rgba(255, 255, 255, .05);
  transition: transform .12s, background .18s, box-shadow .18s, opacity .18s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .11); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .34; cursor: not-allowed; }
.btn--gold {
  background: linear-gradient(180deg, #f2d183, #c79a3c);
  color: #2a1e05; border-color: #f6e0a6; font-weight: 800;
  box-shadow: 0 6px 20px rgba(232, 197, 106, .32);
}
.btn--gold:hover:not(:disabled) { background: linear-gradient(180deg, #fbe4a8, #d9ac4a); box-shadow: 0 8px 28px rgba(232, 197, 106, .5); }
.btn--gold:disabled { background: rgba(255, 255, 255, .06); color: var(--text-dim); border-color: var(--gold-faint); box-shadow: none; }
.btn--ghost { padding: 9px 12px; font-size: 11px; }
.btn--small { padding: 7px 11px; font-size: 10.5px; }

/* ── the workbench ────────────────────────────────────────────────────── */

#station {
  position: absolute; left: 286px; right: 400px; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-bottom: 18px;
}

#ingredient-strip { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.ing-group {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 12px; max-width: 780px;
  background: rgba(9, 10, 28, .78); border: 1px solid var(--gold-faint);
  backdrop-filter: blur(6px);
}
.ing-label {
  flex: 0 0 58px; font: 600 8.5px/1.35 var(--ui); letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); opacity: .8;
}
.ing-label em {
  display: block; margin-top: 2px; font: 400 8px/1.3 var(--ui);
  letter-spacing: .04em; text-transform: none; color: var(--text-dim); opacity: .8;
}
.ing-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.ing-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 7px; cursor: pointer;
  font: 400 11.5px/1.1 var(--display); color: var(--text); white-space: nowrap;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09);
  transition: all .16s;
}
/* The emotions a plot carries — without these the right pick is a coin toss. */
.ing-chip__aff { display: inline-flex; align-items: center; gap: 3px; }
.ing-chip__aff i {
  display: block; border-radius: 50%;
  box-shadow: 0 0 5px currentColor, inset 0 -1px 2px rgba(0, 0, 0, .4);
}
.ing-chip__aff i.is-none {
  width: 9px; height: 9px; background: none;
  border: 1px solid rgba(255, 255, 255, .3); box-shadow: none;
}
.ing-chip:hover { background: rgba(255, 255, 255, .12); }
.ing-chip.is-on {
  background: linear-gradient(180deg, rgba(232, 197, 106, .3), rgba(232, 197, 106, .12));
  border-color: var(--gold); color: #fff3d0; box-shadow: 0 0 16px rgba(232, 197, 106, .35);
}
.ing-chip:disabled { opacity: .3; cursor: not-allowed; }

.station-body { display: flex; align-items: flex-end; gap: 18px; }

.bowl-wrap { position: relative; width: 300px; height: 230px; }
#bowl { position: absolute; left: -70px; bottom: 0; width: 440px; height: 330px; pointer-events: none; }
.bowl-rim {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 268px; height: 74px; border-radius: 50%;
  border: 3px solid rgba(232, 197, 106, .5);
  box-shadow: 0 0 34px rgba(232, 197, 106, .22), inset 0 6px 20px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.bowl-caption {
  position: absolute; bottom: 2px; left: 0; right: 0; text-align: center;
  font: 400 12px/1 var(--display); letter-spacing: .1em; color: var(--text-dim);
}

#sand-bins { display: grid; grid-template-columns: repeat(4, 76px); gap: 8px; }
.bin {
  position: relative; padding: 8px 4px 6px; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, rgba(48, 36, 22, .74), rgba(26, 19, 12, .84));
  border: 1px solid rgba(232, 197, 106, .22);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  transition: transform .12s, box-shadow .18s, border-color .18s;
  user-select: none;
}
.bin:hover { transform: translateY(-2px); border-color: var(--gold-soft); }
.bin:active { transform: translateY(1px) scale(.97); }
.bin.is-locked { opacity: .4; cursor: not-allowed; }
.bin__mound {
  width: 46px; height: 27px;
  border-radius: 50% 50% 14% 14% / 96% 96% 12% 12%;
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, .45), inset 0 5px 8px rgba(255, 255, 255, .3), 0 0 16px var(--glow);
  background: radial-gradient(80% 120% at 40% 15%, var(--glow), var(--sand) 65%);
}
.bin__name { font: 600 9px/1 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: #e8dcc0; opacity: .82; }
.bin__key {
  position: absolute; top: 4px; left: 5px;
  font: 700 9px/1 var(--ui); color: rgba(255, 255, 255, .3);
}
.bin__count {
  position: absolute; top: 3px; right: 4px; min-width: 17px; height: 17px;
  border-radius: 9px; display: grid; place-items: center;
  font: 700 10px/1 var(--ui); color: #20180a;
  background: var(--sand); box-shadow: 0 0 10px var(--glow);
  opacity: 0; transform: scale(.5); transition: all .2s cubic-bezier(.2, 1.6, .4, 1);
}
.bin__count.is-on { opacity: 1; transform: scale(1); }

.recipe-sheet {
  width: 214px; min-height: 214px; padding: 14px 15px 12px;
  border-radius: 5px 5px 8px 8px;
  background: linear-gradient(170deg, #f6ecd2, #e4d3b0);
  color: #3a2c16;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55), inset 0 0 40px rgba(160, 130, 80, .22);
  transform: rotate(-1.1deg);
  display: flex; flex-direction: column;
}
.recipe-sheet h3 {
  margin: 0 0 8px; font: 400 17px/1 var(--display); text-align: center;
  letter-spacing: .04em; border-bottom: 1px solid rgba(90, 70, 35, .3); padding-bottom: 7px;
}
#recipe-list { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
#recipe-list li { display: flex; align-items: center; gap: 7px; font-size: 12px; }
#recipe-list .dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .35); }
#recipe-list .rname { flex: 1; font-family: var(--display); }
#recipe-list .rnum { font-weight: 700; font-variant-numeric: tabular-nums; }
.recipe-empty { color: rgba(58, 44, 22, .5); font-style: italic; font-size: 12px; text-align: center; padding: 16px 0; }
.recipe-total {
  margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(90, 70, 35, .3);
  display: flex; justify-content: space-between; font: 400 13px/1 var(--display);
}
.recipe-total b { font-variant-numeric: tabular-nums; }
.recipe-total.is-full b { color: #1c6b2e; }
.recipe-actions { display: flex; flex-direction: column-reverse; gap: 6px; margin-top: 10px; }
.recipe-actions .btn { width: 100%; white-space: nowrap; }
.recipe-actions .btn--gold:disabled { background: rgba(90, 70, 35, .14); color: rgba(58, 44, 22, .5); border-color: rgba(90, 70, 35, .28); }
.recipe-actions .btn--ghost { color: #5a4526; border-color: rgba(90, 70, 35, .35); background: rgba(90, 70, 35, .08); }
.recipe-actions .btn--ghost:hover { background: rgba(90, 70, 35, .18); }

/* ── toasts, delivery card ────────────────────────────────────────────── */

#toasts {
  position: absolute; left: 50%; top: 88px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  padding: 9px 20px; border-radius: 999px;
  background: rgba(8, 9, 26, .85); border: 1px solid var(--gold-soft);
  font: 400 15px/1 var(--display); letter-spacing: .04em; color: var(--parch);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: toastIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.is-out { animation: toastOut .4s ease-in forwards; }
.toast.good { border-color: rgba(150, 240, 170, .55); color: #d6ffe0; }
.toast.bad { border-color: rgba(255, 140, 120, .5); color: #ffd7cf; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

#delivery-card { position: absolute; right: 26px; bottom: 24px; width: 328px; pointer-events: none; }
.dcard {
  padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(30, 25, 60, .94), rgba(10, 9, 28, .96));
  border: 1px solid var(--gold-soft);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
  animation: cardIn .5s cubic-bezier(.2, 1.3, .3, 1);
}
.dcard-top { display: flex; gap: 12px; align-items: center; }
.dcard-parts { display: flex; gap: 6px; margin-top: 11px; }
.dcard-parts .part {
  flex: 1; text-align: center; padding: 4px 6px; border-radius: 6px;
  font: 600 9px/1.2 var(--ui); letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
  color: var(--text-dim);
}
.dcard-parts .part.good { color: #a8ecb0; border-color: rgba(150, 240, 170, .35); background: rgba(150, 240, 170, .1); }
.dcard-parts .part.mid { color: var(--gold); border-color: var(--gold-faint); }
.dcard-parts .part.bad { color: #f0a49a; border-color: rgba(255, 140, 120, .3); background: rgba(255, 140, 120, .08); }
.dcard-missed {
  margin-top: 8px; font: 400 11px/1.4 var(--display);
  color: var(--text-dim); text-align: center;
}
.dcard.is-out { animation: cardOut .45s ease-in forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateX(40px) scale(.94); } }
@keyframes cardOut { to { opacity: 0; transform: translateX(30px); } }
.dcard .avatar { width: 54px; height: 54px; border-radius: 50%; flex: 0 0 auto; }
.dcard-name { font: 400 15px/1.2 var(--display); color: var(--parch); }
.dcard-verdict { font: 600 9.5px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-top: 3px; }
.dcard-match { margin-left: auto; text-align: right; }
.dcard-match b { display: block; font: 400 30px/1 var(--display); color: var(--gold); }
.dcard-match small { font-size: 10px; color: var(--text-dim); }
.dcard-points { font-size: 11px; color: #9fe6a0; margin-top: 3px; }

/* ── overlay screens ──────────────────────────────────────────────────── */

#overlay { position: absolute; inset: 0; display: none; }
#overlay.is-open { display: grid; place-items: center; background: radial-gradient(70% 70% at 50% 45%, rgba(6, 7, 22, .74), rgba(3, 4, 14, .93)); backdrop-filter: blur(3px); animation: fadeIn .5s; }
@keyframes fadeIn { from { opacity: 0; } }

.screen { width: 760px; max-height: 840px; overflow: auto; text-align: center; padding: 34px 40px 30px; animation: cardIn .55s cubic-bezier(.2, 1.2, .3, 1); }
.screen h2 { margin: 0; font: 400 46px/1.05 var(--display); letter-spacing: .05em; color: var(--parch); }
.screen h2 em { font-style: normal; color: var(--gold); }
.screen .lede { margin: 12px auto 0; max-width: 540px; font: 400 16px/1.65 var(--display); color: var(--text-dim); }
.screen .actions { margin-top: 26px; display: flex; gap: 12px; justify-content: center; }

.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; text-align: left; }
.rule { padding: 14px; border-radius: 11px; background: rgba(255, 255, 255, .045); border: 1px solid var(--gold-faint); }
.rule h3 { margin: 0 0 6px; font: 400 15px/1.2 var(--display); color: var(--gold); }
.rule p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-dim); }
.rule .swatches { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.rule .swatch { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-dim); }
.rule .swatch i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 7px currentColor; }

.report-stars { font-size: 34px; letter-spacing: 10px; margin: 14px 0 4px; color: rgba(255, 255, 255, .16); }
.report-stars .on { color: var(--gold); text-shadow: 0 0 18px rgba(232, 197, 106, .8); }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 6px; }
.stat { padding: 12px 8px; border-radius: 11px; background: rgba(255, 255, 255, .045); border: 1px solid var(--gold-faint); }
.stat b { display: block; font: 400 27px/1 var(--display); color: var(--gold); }
.stat span { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }

.report-list {
  list-style: none; margin: 18px 0 0; padding: 0 4px 0 0;
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  max-height: 306px; overflow-y: auto;
  mask-image: linear-gradient(to bottom, #000 0 92%, transparent 100%);
}
.report-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, .04); }
.report-row .avatar { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; }
.report-who { flex: 0 0 108px; font: 400 14px/1.2 var(--display); }
.report-note { flex: 1; font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }
.report-match { font: 400 21px/1 var(--display); width: 54px; text-align: right; }
.report-match.good { color: #9fe6a0; }
.report-match.mid { color: var(--gold); }
.report-match.bad { color: #f0918a; }

/* ── misc ─────────────────────────────────────────────────────────────── */

.mute {
  position: absolute; left: 26px; bottom: 14px; width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; z-index: 9;
  background: rgba(8, 9, 26, .7); border: 1px solid var(--gold-faint); color: var(--gold);
  font-size: 15px; line-height: 1;
}
.mute.is-off { opacity: .4; text-decoration: line-through; }

.kbd {
  display: inline-block; min-width: 17px; padding: 2px 5px; margin: 0 1px;
  border-radius: 4px; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16); border-bottom-width: 2px;
  font: 600 10px/1.2 var(--ui); color: var(--parch);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--gold-soft); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
