/* ---------- DUNGEON DJ ----------
   Neon rave in a dungeon: the map lives on the canvas, everything here is the DOM HUD on top of it.
   Layout: .dj = column (top bar, middle, bottom). The canvas draws the map into .dj-stage's rectangle,
   so the map always fits the space between the HUD parts. Only buttons take pointer events. */
.dj-root { --dj-pink: #ff3ea5; --dj-cyan: #29e0ff; --dj-lime: #9dff4a; --dj-gold: #ffd166; --dj-violet: #8b5cff; --beat: 0; } /* --beat (0..1) is pushed from JS on every beat */
.dj { position: absolute; inset: 0; display: flex; flex-direction: column; pointer-events: none; color: var(--text); font-family: var(--font); user-select: none; -webkit-user-select: none; }
.dj button { font: inherit; color: inherit; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dj [hidden] { display: none !important; }

/* top bar */
.dj-top { display: flex; align-items: stretch; justify-content: center; gap: 8px; padding: 8px 10px 4px; flex-wrap: wrap; }
.dj-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 14px; font-weight: 900; font-size: 15px; white-space: nowrap;
  background: rgba(14, 7, 36, .82); border: 1px solid rgba(255, 62, 165, .35); /* no backdrop-filter: the canvas behind redraws every frame */
  box-shadow: 0 0 calc(4px + 10px * var(--beat)) rgba(255, 62, 165, calc(.12 + .28 * var(--beat)));
}
.dj-round { color: var(--dj-gold); letter-spacing: .5px; }
.dj-time { font-family: var(--display); font-size: 20px; min-width: 76px; justify-content: center; font-variant-numeric: tabular-nums; color: #fff; }
.dj-time.low { color: #ff5470; animation: dj-blink .6s ease-in-out infinite alternate; }
@keyframes dj-blink { to { opacity: .45; } }
.dj-djbox { flex-direction: column; align-items: stretch; gap: 3px; padding: 5px 12px 6px; border-color: rgba(41, 224, 255, .45); }
.dj-djhead { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.dj-djtag { font: 900 10px var(--font); letter-spacing: 2px; color: var(--dj-cyan); }
.dj-djname { font-size: 15px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.dj-eqrow { display: flex; align-items: center; gap: 6px; }
.dj-bolt { font-size: 13px; }
.dj-eq { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; width: 150px; height: 14px; align-items: end; }
.dj-eq i { display: block; height: 100%; border-radius: 2px; background: rgba(255, 255, 255, .1); transition: background .08s, box-shadow .12s; }
.dj-eq i.on { background: var(--sc, #31f08a); box-shadow: 0 0 6px var(--sc, #31f08a); transform: scaleY(calc(.85 + .15 * var(--beat))); }
.dj-en { font-size: 13px; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; color: #fff; }
.dj-load { font: 800 11px var(--font); color: #ffb02e; animation: dj-blink .8s ease-in-out infinite alternate; }
.dj-mute { align-self: center; background: rgba(14, 7, 36, .82); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 6px 10px; font-size: 16px; }

/* middle: stage (the canvas shows through) + scoreboard */
.dj-mid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dj-stage { position: relative; flex: 1; min-height: 0; min-width: 0; }
.dj-side { order: -1; padding: 2px 10px 0; display: flex; flex-direction: column; gap: 4px; }
.dj-board { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.dj-row {
  display: flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: rgba(14, 7, 36, .78); border: 1px solid rgba(255, 255, 255, .12); max-width: 100%;
}
.dj-row.me { border-color: var(--dj-gold); box-shadow: 0 0 0 1px rgba(255, 209, 102, .35); }
.dj-row.isdj { border-color: var(--dj-cyan); background: rgba(14, 40, 62, .8); }
.dj-row.down { opacity: .6; }
.dj-row.fin { border-color: rgba(6, 214, 160, .7); }
.dj-row.spec { opacity: .55; }
.dj-av { display: none; flex: none; }
.dj-ic { width: 16px; text-align: center; flex: none; }
.dj-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dj-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 92px; }
.dj-hearts { color: #ff5470; letter-spacing: -1px; font-size: 11px; white-space: nowrap; }
.dj-pts { font-family: var(--display); color: var(--dj-gold); font-size: 13px; font-variant-numeric: tabular-nums; }
.dj-fin { font-size: 11px; font-weight: 800; color: #b9b0e8; text-align: center; min-height: 14px; }

/* feed, toast, overlays inside the stage */
.dj-feed { position: absolute; left: 8px; top: 6px; display: flex; flex-direction: column; gap: 3px; max-width: 70%; }
.dj-line { font-size: 12px; font-weight: 800; padding: 2px 9px; border-left: 3px solid var(--lc, #889); background: rgba(10, 5, 28, .75); border-radius: 0 9px 9px 0; animation: dj-in .25s both; }
@keyframes dj-in { from { opacity: 0; transform: translateX(-10px); } }
.dj-toast {
  position: absolute; left: 50%; top: 12%; transform: translateX(-50%); font-family: var(--display); font-size: clamp(22px, 5.2vw, 44px); letter-spacing: 1px; text-align: center;
  color: var(--tc, #fff); text-shadow: 0 0 18px var(--tc, #fff), 0 3px 0 rgba(10, 5, 28, .9); white-space: nowrap; animation: dj-pop .45s cubic-bezier(.2, 1.4, .3, 1) both;
}
.dj-toast.go { --tc: var(--dj-lime); }
.dj-toast.bad { --tc: #ff5470; }
.dj-toast.good { --tc: var(--dj-gold); }
.dj-toast.err { --tc: #ff8a9a; font-size: clamp(16px, 3.4vw, 26px); }
@keyframes dj-pop { from { opacity: 0; transform: translateX(-50%) scale(.6); } }
@keyframes dj-card { from { opacity: 0; transform: scale(.92) translateY(8px); } }
.dj-over { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 7px 16px; border-radius: 999px; font-weight: 900; font-size: 14px; background: rgba(14, 7, 36, .88); border: 1px solid var(--dj-gold); color: var(--dj-gold); white-space: nowrap; }
.dj-ov { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; pointer-events: none; }
.dj-ov-card {
  width: min(520px, 100%); max-height: 100%; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 16px;
  background: rgba(12, 5, 32, .9); border: 2px solid var(--dj-pink); border-radius: 20px; animation: dj-card .4s both;
  box-shadow: 0 0 calc(18px + 26px * var(--beat)) rgba(255, 62, 165, calc(.25 + .3 * var(--beat))), 0 18px 50px rgba(0, 0, 0, .5);
}
.dj-ov-tag { font-family: var(--display); font-size: clamp(26px, 7vw, 44px); letter-spacing: 3px; color: #fff; text-shadow: 0 0 20px var(--dj-pink), 0 0 6px var(--dj-cyan); }
.dj-ov-dj { font-weight: 900; font-size: 16px; color: var(--dj-cyan); }
.dj-ov-msg { font-size: 14px; font-weight: 700; line-height: 1.4; color: #f4f0ff; }
.dj-ov-tip { font-size: 12px; color: #a99fe0; line-height: 1.35; }
.dj-ov-count { font-family: var(--display); font-size: 18px; color: var(--dj-gold); }
.dj-rt { width: 100%; display: flex; flex-direction: column; gap: 3px; margin: 4px 0 2px; }
.dj-rt-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 13px; font-weight: 800; text-align: left; }
.dj-rt-row.me { outline: 1px solid var(--dj-gold); }
.dj-rt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dj-rt-name small { display: block; font-size: 10px; font-weight: 700; color: #a99fe0; }
.dj-rt-pts { color: var(--dj-lime); font-family: var(--display); font-size: 14px; }
.dj-rt-tot { color: var(--dj-gold); font-family: var(--display); font-size: 14px; min-width: 34px; text-align: right; }

/* bottom: DJ palette or runner bar (base = portrait phone: room under the controls for the global "Verlassen" button) */
.dj-bot { padding: 4px 10px 54px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; }
.dj-djgrp { display: flex; flex-direction: column; gap: 6px; max-width: 820px; width: 100%; margin: 0 auto; }
.dj-hintrow { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 10px; border-radius: 12px; background: rgba(14, 7, 36, .82); border: 1px solid rgba(255, 255, 255, .14); }
.dj-hint { flex: 1; font-size: 13px; font-weight: 700; line-height: 1.3; color: #e4defa; }
.dj-errline { flex: 1; font-size: 13px; font-weight: 900; line-height: 1.3; color: #ff6b81; animation: dj-in .2s both; }
.dj-rot { flex: none; padding: 7px 12px; border-radius: 10px; font-weight: 900; font-size: 13px; background: rgba(41, 224, 255, .15); border: 1px solid var(--dj-cyan); min-height: 36px; }
.dj-pal { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.dj-trk {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 68px; padding: 6px 2px 5px; overflow: hidden;
  border-radius: 14px; background: linear-gradient(180deg, rgba(30, 16, 70, .92), rgba(14, 7, 36, .92)); border: 2px solid rgba(255, 255, 255, .16);
  transition: transform .08s, border-color .15s, box-shadow .15s, opacity .15s;
}
.dj-trk:hover { border-color: var(--tc, #fff); }
.dj-trk:active { transform: scale(.96); }
.dj-trk.sel { border-color: var(--tc, #fff); background: linear-gradient(180deg, rgba(60, 28, 110, .95), rgba(24, 10, 60, .95)); box-shadow: 0 0 calc(8px + 14px * var(--beat)) var(--tc, #fff), inset 0 0 14px rgba(255, 255, 255, .12); }
.dj-trk.off { opacity: .5; filter: saturate(.55); }
.dj-trk.off.sel { opacity: .8; }
.dj-key { position: absolute; left: 5px; top: 3px; font: 900 10px var(--font); color: #b9b0e8; background: rgba(255, 255, 255, .1); border-radius: 5px; padding: 0 5px; }
.dj-ico { font-size: 24px; line-height: 1.1; filter: drop-shadow(0 0 6px var(--tc, #fff)); }
.dj-tnm { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dj-cost { font-size: 11px; font-weight: 800; color: var(--dj-cyan); }
.dj-trk.poor .dj-cost { color: #ff8a9a; }
.dj-cdov { --cd: 0; position: absolute; inset: 0; pointer-events: none; background: conic-gradient(rgba(6, 3, 18, .72) calc(var(--cd) * 1turn), transparent 0); }
.dj-cdt { position: absolute; right: 5px; top: 3px; font: 900 11px var(--font); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }

.dj-rungrp { display: flex; align-items: center; gap: 12px; max-width: 820px; width: 100%; margin: 0 auto; }
.dj-hearts-big { font-size: 26px; color: #ff5470; letter-spacing: 1px; min-width: 82px; text-shadow: 0 0 10px rgba(255, 84, 112, .6); }
.dj-hearts-big .lost { color: rgba(255, 255, 255, .25); text-shadow: none; }
.dj-runtxt { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 12px; background: rgba(14, 7, 36, .78); border: 1px solid rgba(255, 255, 255, .12); }
.dj-goal { font-size: 14px; font-weight: 900; }
.dj-ctlhint { font-size: 11px; font-weight: 700; color: #a99fe0; margin-top: 2px; line-height: 1.3; }
.dj-dash {
  --cd: 0; position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  font: 900 12px var(--font); letter-spacing: .5px; background: radial-gradient(circle at 35% 30%, rgba(41, 224, 255, .5), rgba(14, 7, 36, .92) 70%); border: 3px solid var(--dj-cyan);
  box-shadow: 0 0 12px rgba(41, 224, 255, .5);
}
.dj-dash::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(6, 3, 18, .75) calc(var(--cd) * 1turn), transparent 0); pointer-events: none; }
.dj-dash.cool { border-color: #4a5a8a; box-shadow: none; }
.dj-dash:active { transform: scale(.94); }
.dj-dash span { position: relative; z-index: 1; }

.dj-rungrp { padding-right: 96px; }
.dj-hearts-big { font-size: 22px; min-width: 66px; }
.dj-dash { position: absolute; right: 14px; bottom: 60px; width: 84px; height: 84px; font-size: 14px; z-index: 2; }

/* desktop and landscape phones: scoreboard as a column on the right, runner bar inline, "Verlassen" button sits right of the controls */
@media (min-width: 640px) and (orientation: landscape), (min-width: 820px) {
  .dj-mid { flex-direction: row; }
  .dj-side { order: 0; width: 236px; flex: none; padding: 4px 10px 0 0; }
  .dj-board { flex-direction: column; flex-wrap: nowrap; gap: 5px; }
  .dj-row { padding: 4px 10px; font-size: 13px; border-radius: 14px; }
  .dj-av { display: grid; place-items: center; width: 26px; height: 26px; }
  .dj-nm { flex: 1; max-width: none; }
  .dj-hearts { font-size: 12px; }
  .dj-fin { text-align: left; }
  .dj-bot { padding: 4px 10px 10px; padding-right: 114px; }
  .dj-rungrp { padding-right: 0; }
  .dj-hearts-big { font-size: 26px; min-width: 82px; }
  .dj-dash { position: relative; right: auto; bottom: auto; width: 64px; height: 64px; font-size: 12px; }
}
/* short screens (landscape phones): squeeze the HUD so the map keeps its room */
@media (max-height: 520px) {
  .dj-top { padding: 4px 8px 2px; gap: 6px; }
  .dj-chip { padding: 3px 10px; font-size: 13px; }
  .dj-time { font-size: 16px; }
  .dj-djbox { padding: 3px 10px; gap: 1px; }
  .dj-djtag { display: none; }
  .dj-board { gap: 3px; }
  .dj-row { padding: 2px 8px; font-size: 12px; }
  .dj-av { display: none; }
  .dj-bot { padding-bottom: 6px; }
  .dj-djgrp { gap: 4px; }
  .dj-hintrow { min-height: 26px; padding: 2px 8px; }
  .dj-hint, .dj-errline { font-size: 12px; }
  .dj-trk { min-height: 48px; padding: 3px 2px; }
  .dj-ico { font-size: 18px; }
  .dj-tnm { font-size: 10px; }
  .dj-hearts-big { font-size: 20px; min-width: 60px; }
  .dj-dash { width: 52px; height: 52px; font-size: 11px; }
  .dj-ov-card { padding: 8px 12px; gap: 3px; }
  .dj-ov-tip { display: none; }
  .dj-rt-row { padding: 2px 8px; font-size: 12px; }
}
@media (max-width: 460px) {
  .dj-top { gap: 5px; padding: 6px 6px 3px; }
  .dj-chip { padding: 5px 9px; font-size: 13px; }
  .dj-time { font-size: 17px; min-width: 60px; }
  .dj-eq { width: 104px; }
  .dj-djname { max-width: 110px; font-size: 13px; }
  .dj-trk { min-height: 64px; }
  .dj-ico { font-size: 22px; }
  .dj-tnm { font-size: 10px; }
}
