:root {
  color-scheme: dark;
  --bg: #07060b;
  --panel: rgba(18, 15, 28, 0.84);
  --panel-2: rgba(27, 22, 41, 0.82);
  --card: rgba(12, 10, 19, 0.78);
  --card-solid: #110e1a;
  --fg: #fbfafc;
  --dim: #b9b4c7;
  --accent: #ffbf25;
  --accent-2: #8b4dff;
  --accent-3: #ec4899;
  --ok: #5ee694;
  --error: #ff7f96;
  --border: rgba(255, 255, 255, 0.1);
  --border-bright: rgba(255, 255, 255, 0.18);
  --radius: 20px;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42), 0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--bg);
}

body {
  display: flow-root;
  position: relative;
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  isolation: isolate;
  background:
    radial-gradient(1000px 640px at 0% -10%, rgba(139, 77, 255, 0.23), transparent 64%),
    radial-gradient(900px 620px at 105% 8%, rgba(255, 191, 37, 0.16), transparent 62%),
    radial-gradient(850px 620px at 50% 105%, rgba(236, 72, 153, 0.08), transparent 65%),
    linear-gradient(145deg, #08060d 0%, #0d0915 48%, #08070c 100%);
  color: var(--fg);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, transparent 0%, rgba(4, 3, 8, 0.16) 72%, rgba(4, 3, 8, 0.5) 100%),
    radial-gradient(700px 460px at 48% 0%, rgba(126, 74, 255, 0.055), transparent 72%);
  content: "";
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 191, 37, 0.62);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.logo-tapes {
  position: fixed;
  inset: -10vh 0;
  z-index: 0;
  display: grid;
  grid-template-rows: repeat(8, minmax(70px, 92px));
  align-content: space-around;
  gap: clamp(34px, 4.5vh, 66px);
  overflow: hidden;
  opacity: 0.105;
  pointer-events: none;
  transform: none;
}

.logo-tape {
  --tile: 300px;
  --travel: -300px;
  position: relative;
  width: 150vw;
  min-width: 150vw;
  margin-inline: -25vw;
  overflow: hidden;
  transform: rotate(-7deg);
  transform-origin: center;
}

.logo-flow {
  position: absolute;
  inset: -14px -420px;
  background: url("/static/data/tubespinclear.png") repeat-x center / var(--tile) auto;
  filter: saturate(0.86) brightness(0.78);
  opacity: 0.88;
  will-change: auto;
}

.logo-tape:nth-child(even) {
  --travel: 300px;
  opacity: 0.72;
}

.logo-tape:nth-child(3n) {
  --tile: 270px;
  --travel: -270px;
  opacity: 0.82;
}

.logo-tape:nth-child(6n) {
  --travel: 270px;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1140px, calc(100% - 40px));
  margin: 42px auto 26px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.brand {
  position: relative;
  isolation: isolate;
}

.brand::before {
  position: absolute;
  inset: 13% -3%;
  z-index: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(139, 77, 255, 0.68), rgba(236, 72, 153, 0.32), rgba(255, 191, 37, 0.48));
  filter: blur(29px);
  opacity: 0.82;
  content: "";
}

.brand img {
  display: block;
  position: relative;
  z-index: 1;
  width: auto;
  height: 61px;
  user-select: none;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.36));
  -webkit-user-drag: none;
}

.panel,
.card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  -webkit-backdrop-filter: blur(22px) saturate(132%);
  backdrop-filter: blur(22px) saturate(132%);
}

.panel {
  padding: 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 45%),
    linear-gradient(180deg, var(--panel), var(--panel-2));
}

.control-panel {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.control-panel::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 99, 255, 0.78), rgba(255, 191, 37, 0.72), transparent);
  content: "";
}

.control-panel::after {
  position: absolute;
  top: -110px;
  right: -90px;
  width: 250px;
  height: 210px;
  border-radius: 50%;
  background: rgba(139, 77, 255, 0.11);
  filter: blur(55px);
  pointer-events: none;
  content: "";
}

.control-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  margin: 0 2px 16px;
}

.control-heading > div:first-child {
  display: grid;
  gap: 1px;
}

.control-heading > div:first-child span {
  font-size: 15px;
  font-weight: 780;
}

.control-heading small {
  color: var(--dim);
  font-size: 12px;
}

.controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) repeat(3, minmax(132px, auto)) auto;
  gap: 12px;
  align-items: end;
}

.control-field {
  display: grid;
  gap: 7px;
}

.control-label,
.card-kicker {
  color: #aaa3b9;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.search {
  position: relative;
  display: block;
}

.search input,
select,
button {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--fg);
  background: var(--card);
}

.search input {
  width: 100%;
  padding: 11px 48px 11px 15px;
}

.search input::placeholder {
  color: #8f899e;
}

.search input:hover,
select:hover,
.ghost:hover {
  border-color: var(--border-bright);
}

.search input:focus,
select:focus {
  border-color: rgba(158, 105, 255, 0.58);
  background: rgba(15, 12, 23, 0.94);
  box-shadow: 0 0 0 4px rgba(139, 77, 255, 0.1);
}

.clear {
  position: absolute;
  top: auto;
  bottom: 7px;
  right: 7px;
  width: 35px;
  min-height: 35px;
  padding: 0;
  border: 0;
  transform: none;
  color: var(--dim);
  background: transparent;
  font-size: 22px;
  line-height: 1;
}

select,
button {
  padding: 10px 14px;
}

.primary {
  position: relative;
  min-width: 122px;
  min-height: 50px;
  overflow: hidden;
  border: 0;
  isolation: isolate;
  color: #100b18;
  background: linear-gradient(125deg, #ffca3a 0%, #ffb721 35%, #a461ff 72%, #7c3aed 100%);
  background-size: 180% 180%;
  font-weight: 850;
  letter-spacing: 0.01em;
  box-shadow: 0 11px 28px rgba(139, 77, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.primary::before {
  position: absolute;
  top: -90%;
  bottom: -90%;
  left: -48%;
  z-index: -1;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.44), transparent);
  content: "";
  transform: rotate(18deg);
}

.primary:disabled,
.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(285px, 0.85fr);
  gap: 17px;
  margin-top: 17px;
}

.player-panel {
  position: relative;
  align-self: start;
  padding: 12px;
}

.player {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 17px;
  background: #050408;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 15px 38px rgba(0, 0, 0, 0.34);
}

.player::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.player iframe,
.player img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player img {
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.detail-status {
  margin: 13px 5px 2px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 127, 150, 0.2);
  border-radius: 11px;
  color: var(--error);
  background: rgba(255, 127, 150, 0.07);
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  padding: 17px;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 46%),
    rgba(18, 15, 27, 0.88);
}

.meta .card:first-child {
  position: relative;
  overflow: hidden;
}

.meta .card:first-child::before {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 191, 37, 0.76), rgba(139, 77, 255, 0.8), transparent);
  content: "";
}

.card-kicker {
  display: block;
  margin-bottom: 8px;
  color: #b897ff;
}

.title {
  margin: 0 0 7px;
  font-size: clamp(20px, 2.05vw, 25px);
  line-height: 1.34;
  text-wrap: balance;
}

.section-title {
  margin: 0 0 11px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.muted {
  color: var(--dim);
}

.stats,
.actions,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.stats {
  margin-top: 13px;
}

.pill {
  padding: 6px 10px;
  border: 1px solid rgba(158, 105, 255, 0.2);
  border-radius: 999px;
  background: rgba(139, 77, 255, 0.075);
  font-size: 13px;
}

.actions {
  margin-top: 14px;
}

.ghost {
  min-height: 41px;
  border-style: solid;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.025);
}

.history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.history-empty {
  margin: 4px 0 2px;
  color: var(--dim);
  font-size: 13px;
}

.hitem {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  background: rgba(9, 7, 14, 0.76);
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.hitem img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hitem span {
  display: block;
  overflow: hidden;
  padding: 8px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.footer {
  display: grid;
  gap: 9px;
  margin: 30px 0 12px;
  color: var(--dim);
  text-align: center;
  font-size: 13px;
}

.footer a {
  color: #e1dbea;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
}

.footer-links {
  justify-content: center;
}

.privacy-page {
  max-width: 780px;
}

.privacy-card {
  padding: clamp(23px, 5vw, 46px);
}

.privacy-card h1 {
  margin-top: 0;
}

.privacy-card a {
  color: var(--accent);
}

@keyframes logo-drift {
  to {
    transform: translate3d(var(--travel), 0, 0);
  }
}

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes button-sheen {
  0%,
  54% {
    left: -48%;
  }

  76%,
  100% {
    left: 120%;
  }
}

@keyframes button-drift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes player-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 15px 38px rgba(0, 0, 0, 0.34);
  }

  50% {
    box-shadow: inset 0 0 0 1px rgba(255, 191, 37, 0.12), 0 0 34px rgba(139, 77, 255, 0.22);
  }
}

@keyframes result-in {
  from {
    opacity: 0.42;
    transform: translateY(7px) scale(0.992);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1100px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .search {
    grid-column: 1 / -1;
  }

  .primary {
    width: 100%;
  }
}

@media (max-width: 900px) {

  .content {
    grid-template-columns: 1fr;
  }

  .history {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .logo-tapes {
    inset: -12vh 0;
    grid-template-rows: repeat(8, 62px);
    gap: 34px;
    opacity: 0.075;
  }

  .logo-tape {
    --tile: 230px;
    --travel: -230px;
    width: 180vw;
    min-width: 180vw;
    margin-inline: -40vw;
  }

  .logo-tape:nth-child(even) {
    --travel: 230px;
  }

  .logo-tape:nth-child(3n) {
    --tile: 210px;
    --travel: -210px;
  }

  .logo-tape:nth-child(6n) {
    --travel: 210px;
  }

  .wrap {
    width: min(100% - 24px, 1140px);
    margin-top: 22px;
  }

  .site-header {
    align-items: center;
  }

  .brand img {
    height: 49px;
  }

  .control-panel {
    padding: 14px;
  }

  .control-heading {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .search {
    grid-column: auto;
  }

  select,
  .primary {
    width: 100%;
  }

  .history {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .logo-flow {
    animation: logo-drift 76s linear infinite;
    will-change: transform;
  }

  .logo-tape:nth-child(even) .logo-flow {
    animation-duration: 88s;
  }

  .logo-tape:nth-child(3n) .logo-flow {
    animation-duration: 82s;
  }

  .site-header {
    animation: enter-up 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .control-panel {
    animation: enter-up 620ms 80ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .content {
    animation: enter-up 680ms 150ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .footer {
    animation: enter-up 700ms 210ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .search input,
  select,
  .ghost,
  .hitem {
    transition: border-color 170ms ease, background-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
  }

  .primary:not(:disabled) {
    animation: button-drift 8s ease infinite;
    transition: transform 170ms ease, filter 170ms ease, box-shadow 170ms ease;
  }

  .primary:not(:disabled)::before {
    animation: button-sheen 4.8s ease-in-out infinite;
  }

  .primary:not(:disabled):hover {
    transform: translateY(-2px);
    filter: brightness(1.07) saturate(1.08);
    box-shadow: 0 15px 34px rgba(139, 77, 255, 0.31), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .primary:not(:disabled):active {
    transform: translateY(0) scale(0.985);
  }

  .ghost:not(:disabled):hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.055);
  }

  .hitem:hover {
    z-index: 1;
    border-color: rgba(172, 118, 255, 0.42);
    transform: translateY(-3px) scale(1.015);
    box-shadow: 0 13px 25px rgba(0, 0, 0, 0.3);
  }

  .hitem img {
    transition: transform 350ms ease;
  }

  .hitem:hover img {
    transform: scale(1.04);
  }

  body.is-spinning .player {
    animation: player-pulse 1.35s ease-in-out infinite;
  }

  .result-in .player-panel,
  .result-in .meta .card:first-child {
    animation: result-in 450ms cubic-bezier(0.22, 1, 0.36, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-flow,
  .primary,
  .primary::before,
  .player,
  .site-header,
  .control-panel,
  .content,
  .footer {
    animation: none !important;
  }

  .logo-flow {
    transform: none;
    will-change: auto;
  }

  .primary,
  .ghost,
  .hitem,
  .hitem img,
  .search input,
  select {
    transition: none !important;
  }
}
