/* Vota::rio — Vota::tv, mobile-first.
   Tokens: ink, paper, mute, amber. Display Anton, UI Outfit. */

:root {
  --bg: #0e0c0a;
  --surface: #17140f;
  --fg: #f6f1e7;
  --muted: #a39888;
  --accent: #e8a317;
  --line: rgba(246, 241, 231, 0.16);
  --ink: rgba(14, 12, 10, 0.9);
  --font-display: "Anton", "Arial Narrow", Impact, sans-serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 180ms;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  height: 100dvh;
  display: flex;
  background: var(--bg);
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}

.layers {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  overflow: hidden;
  will-change: opacity, transform, clip-path;
}

.layer video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
}

.fxchip {
  position: absolute;
  top: calc(78px + env(safe-area-inset-top));
  left: 16px;
  z-index: 6;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}

.fxchip.is-on {
  opacity: 1;
}

.gesture {
  position: absolute;
  inset: 0;
  z-index: 2;
  touch-action: none;
}

.hair {
  position: absolute;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom);
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}

.app.is-playing:not(.is-chrome) .hair {
  opacity: 1;
}

.bar,
.deck {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  transition:
    transform var(--fast) var(--ease),
    opacity var(--fast) var(--ease);
}

.bar {
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 12px 28px 16px;
}

.bar::before,
.deck::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: -1;
}

.bar::before {
  top: 0;
  height: 112px;
  background: linear-gradient(to bottom, var(--ink), transparent);
}

.deck {
  bottom: 0;
  display: grid;
  gap: 6px;
  padding: 36px 16px calc(12px + env(safe-area-inset-bottom));
}

.deck::before {
  bottom: 0;
  height: 100%;
  background: linear-gradient(to top, var(--ink) 62%, transparent);
}

.app:not(.is-on) .bar,
.app:not(.is-on) .deck,
.app:not(.is-on) .hair,
.app.is-ended .bar,
.app.is-ended .deck {
  opacity: 0;
  pointer-events: none;
}

.app.is-playing:not(.is-chrome) .bar {
  transform: translateY(-120%);
  pointer-events: none;
}

.app.is-playing:not(.is-chrome) .deck {
  transform: translateY(120%);
  pointer-events: none;
}

.brand {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mark {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: none;
}

.mark-sm {
  font-size: 1.55rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.as-typed {
  text-transform: none;
  letter-spacing: 0.01em;
}

.pip {
  width: 7px;
  height: 7px;
  background: var(--accent);
  flex: none;
}

.app.is-playing .pip {
  animation: blink 1.2s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

.bar-actions,
.sheet-row,
.transport,
.meta,
.times {
  display: flex;
  align-items: center;
}

.bar-actions,
.sheet-row {
  gap: 4px;
}

.meta,
.times {
  justify-content: space-between;
  gap: 12px;
}

.icon,
.key {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  padding: 0;
}

.icon svg,
.key svg {
  width: 24px;
  height: 24px;
  display: block;
}

.menu-word {
  display: none;
}

.icon svg,
.key svg.ic-vol,
.key svg.ic-mute {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.key svg.ic-play,
.key svg.ic-pause,
#prev svg,
#next svg {
  fill: currentColor;
  stroke: none;
}

.app.is-playing .ic-play,
.app:not(.is-playing) .ic-pause,
.app.is-muted .ic-vol,
.app:not(.is-muted) .ic-mute {
  display: none;
}

.key:active,
.icon:active,
.go:active {
  transform: scale(0.97);
}

.key-play {
  width: 76px;
  height: 56px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
}

.key-rate {
  width: auto;
  min-width: 48px;
  padding: 0 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.key-rate.is-hot {
  color: var(--accent);
}

.title,
.encore h2,
.gate h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.gate h1 {
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.045em;
  font-size: clamp(3.4rem, 14vw, 6.2rem);
  line-height: 0.9;
}

.duo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.duo button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-weight: 600;
}

.duo button[data-who="lula"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.duo-sep {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
}

.upnext,
.count,
.times {
  margin: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.chapters {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.app.is-library .chapters {
  display: none;
}

.chap {
  flex: 1;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  align-items: center;
}

.chap span {
  display: block;
  height: 3px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.chap.is-done span {
  background: var(--accent);
}

.chap.is-now span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

.range {
  --p: 0%;
  --b: 0%;
  width: 100%;
  height: 32px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  touch-action: none;
}

.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p));
}

#scrub::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--p),
    rgba(246, 241, 231, 0.38) var(--p) var(--b),
    var(--line) var(--b) 100%
  );
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
}

.range::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
}

.range::-moz-range-progress {
  height: 3px;
  background: var(--accent);
}

.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
}

.deck-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.deck-copy[hidden] {
  display: none !important;
}

.transport {
  justify-content: space-between;
  gap: 2px;
  margin-top: 2px;
}

.transport .key {
  width: 44px;
  height: 44px;
}

.transport .key-play {
  width: 64px;
  height: 52px;
}

.transport .key-rate {
  min-width: 40px;
  padding: 0 4px;
}

.key-tool svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#fit .ic-fill,
#copy .ic-show,
#fit.is-on .ic-fit,
#copy.is-on .ic-hide {
  display: none;
}

#fit.is-on .ic-fill,
#copy.is-on .ic-show {
  display: block;
}

#fit.is-on,
#copy.is-on {
  color: var(--accent);
}

.gate,
.encore {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ink) 16%, rgba(14, 12, 10, 0.55) 52%, rgba(14, 12, 10, 0.18));
}

.app.is-on .gate,
.encore[hidden],
.gate[hidden] {
  display: none;
}

.gate-copy {
  display: grid;
  gap: 12px;
  width: min(100%, 28rem);
}

.lede {
  margin: 0;
  max-width: 34ch;
  font-size: 1.05rem;
  line-height: 1.45;
}

.run {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.run li {
  display: flex;
  gap: 12px;
  color: var(--muted);
}

.run span {
  width: 1.8rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.go,
.ghost {
  height: 56px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.05rem;
}

.go {
  background: var(--accent);
  color: var(--bg);
}

.ghost {
  background: transparent;
  color: var(--fg);
}

.encore h2 {
  font-size: clamp(3rem, 14vw, 5.2rem);
  line-height: 0.86;
}

.flash {
  position: absolute;
  top: 40%;
  z-index: 6;
  margin: 0;
  font-family: var(--font-display);
  font-size: 3.2rem;
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}

.flash.is-left {
  left: 10%;
}

.flash.is-right {
  right: 10%;
}

.flash.is-on {
  animation: pop 520ms var(--ease);
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
  }
}

.spin {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}

.app.is-waiting .spin {
  animation:
    spin 0.7s linear infinite,
    fadein 0s linear 280ms forwards;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadein {
  to {
    opacity: 1;
  }
}

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(76px + env(safe-area-inset-top));
  z-index: 7;
  margin: 0 auto;
  max-width: 28rem;
  padding: 12px 14px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 10px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.toast.is-on {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}

.scrim {
  display: none;
}

.sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  color: var(--fg);
}

.sheet-head {
  display: grid;
  gap: 12px;
  padding: 0 16px 12px;
}

.sheet-row {
  justify-content: space-between;
}

.handle {
  display: none;
}

.tabs,
.segctl {
  display: grid;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(246, 241, 231, 0.06);
}

.tabs {
  grid-template-columns: 1fr 1fr;
}

.segctl {
  grid-template-columns: repeat(3, 1fr);
}

.tab,
.segctl button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.tab[aria-selected="true"],
.segctl button[aria-checked="true"] {
  background: var(--fg);
  color: var(--bg);
}

.finder {
  display: flex;
  align-items: center;
  min-height: 48px;
  min-width: 0;
}

.finder-btn {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  padding: 0;
}

.finder-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finder.is-open .finder-btn {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.search {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  height: 48px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.finder.is-open {
  gap: 8px;
}

.finder.is-open .search {
  flex: 1 1 auto;
  width: auto;
  opacity: 1;
  padding: 0 14px;
  border-color: var(--line);
  pointer-events: auto;
}

.search::placeholder {
  color: var(--muted);
}

.vol {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.vol .range {
  flex: 1;
}

.foot,
.hints,
.empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.item {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  box-shadow: inset 0 1px 0 var(--line);
}

.item .n {
  width: 2rem;
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.item .name {
  display: block;
  font-weight: 600;
  line-height: 1.25;
}

.item .sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item.is-on {
  background: rgba(232, 163, 23, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}

.item.is-on .n,
.item.is-on .sub {
  color: var(--accent);
}

.empty {
  padding: 20px 16px;
}

.hints {
  display: none;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
}

.noscript {
  margin: 0;
  padding: 24px;
}

.app.is-finale .stage {
  box-shadow: inset 3px 0 0 var(--accent);
}

@media (max-width: 959px) {
  .layer video {
    object-fit: cover;
  }

  .gate {
    display: none;
  }

  .app:not(.is-on) .bar,
  .app:not(.is-on) .deck,
  .app:not(.is-on) .hair,
  .app.is-ended .bar {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .app:not(.is-on) .key-play {
    background: var(--accent);
    color: var(--bg);
  }

  .bar {
    z-index: 7;
  }

  .app.is-playing:not(.is-chrome) .bar {
    transform: none;
    pointer-events: none;
  }

  .app.is-playing:not(.is-chrome) .bar::before,
  .app.is-playing:not(.is-chrome) .brand,
  .app.is-playing:not(.is-chrome) #full {
    opacity: 0;
  }

  .app.is-playing:not(.is-chrome) #queue {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-btn {
    width: auto;
    height: 48px;
    padding: 0 14px 0 12px;
    gap: 8px;
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
  }

  .menu-word {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .resume {
    height: 48px;
  }

  .sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(92vw, 400px);
    height: 100dvh;
    z-index: 9;
    transform: translateX(104%);
    transition: transform 280ms var(--ease);
    border-left: 1px solid var(--line);
  }

  .sheet-head {
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  .app.is-sheet .sheet {
    transform: none;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 8;
    border: 0;
    padding: 0;
    background: rgba(8, 7, 6, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--fast) var(--ease);
  }

  .app.is-sheet .scrim {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 960px) {
  .sheet {
    position: relative;
    width: 400px;
    height: 100dvh;
    flex: none;
    border-left: 1px solid var(--line);
  }

  .sheet-head {
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  #queue,
  #sheet-close {
    display: none;
  }

  .hints {
    display: block;
  }

  .gate h1 {
    font-size: 6.4rem;
  }
}

@media (max-height: 520px) {
  .run,
  .upnext,
  .chapters,
  .hints {
    display: none;
  }

  .gate h1,
  .encore h2 {
    font-size: 3rem;
  }

  .title {
    font-size: 1.1rem;
  }

  .deck {
    gap: 2px;
    padding-top: 20px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .item:hover {
    background: rgba(246, 241, 231, 0.05);
  }

  .icon:hover,
  .key:hover {
    background: rgba(246, 241, 231, 0.06);
  }

  .key-play:hover {
    background: var(--accent);
    color: var(--bg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .app.is-waiting .spin {
    opacity: 1;
  }
}
