:root {
  --ink: #f0f4ef;
  --mute: #9bb0a2;
  --gold: #d4b56a;
  --jade: #4a9a78;
  --panel: rgba(8, 18, 15, 0.55);
  --line: rgba(212, 181, 106, 0.28);
  --font-display: "Cormorant Garamond", "Noto Serif TC", serif;
  --font-body: "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050807;
  color: var(--ink);
  font-family: var(--font-body);
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, transparent 35%, rgba(0, 0, 0, 0.45) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 18%, transparent 72%, rgba(0, 0, 0, 0.55) 100%);
}

.hud {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1rem, 3vw, 2rem);
}

.top {
  text-align: center;
  animation: rise 0.9s ease both;
}

.eyebrow {
  margin: 0 0 0.3rem;
  letter-spacing: 0.4em;
  font-size: 0.72rem;
  color: var(--gold);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.top h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  letter-spacing: 0.16em;
  color: #f7f1e4;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.85), 0 0 40px rgba(74, 154, 120, 0.25);
}

.subtitle {
  margin: 0.4rem 0 0;
  color: var(--mute);
  font-size: 0.92rem;
  min-height: 1.2em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.now-panel {
  align-self: end;
  justify-self: center;
  text-align: center;
  margin-bottom: clamp(5.5rem, 14vh, 8rem);
  max-width: min(90vw, 40rem);
  animation: rise 1s ease 0.12s both;
}

.label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  color: var(--jade);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.name {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.05;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.9);
}

.song {
  margin: 0.55rem 0 0;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: #e2cfa0;
  min-height: 1.35em;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.85);
}

.timer {
  margin: 0.45rem 0 0;
  font-variant-numeric: tabular-nums;
  color: var(--mute);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
}

.rail {
  position: absolute;
  right: clamp(0.75rem, 2vw, 1.5rem);
  top: 50%;
  transform: translateY(-42%);
  width: min(17rem, 34vw);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: rise 1s ease 0.2s both;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card-label {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
}

.card-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.card-song {
  margin: 0.2rem 0 0;
  color: var(--mute);
  font-size: 0.85rem;
  min-height: 1.1em;
}

.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 11rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.queue li {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 0.86rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0;
}

.queue .ord {
  color: var(--gold);
  opacity: 0.85;
}

.queue .q-name,
.queue .q-song {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue .q-song {
  color: var(--mute);
  font-size: 0.75rem;
  max-width: 6.5rem;
  text-align: right;
}

.foot {
  text-align: center;
  align-self: end;
}

.note {
  margin: 0 0 0.3rem;
  color: #e2cfa0;
  min-height: 1.1em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hint {
  margin: 0;
  color: rgba(155, 176, 162, 0.65);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.hud.is-idle .name {
  color: var(--mute);
}

body.obs .rail,
body.obs .foot .hint,
body.obs .eyebrow {
  display: none;
}

body.obs .now-panel {
  margin-bottom: 18vh;
}

@media (max-width: 720px) {
  .rail {
    position: static;
    transform: none;
    width: 100%;
    margin-top: auto;
  }

  .hud {
    gap: 0.75rem;
  }

  .now-panel {
    margin-bottom: 0.5rem;
  }

  .queue-card {
    display: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
