/* ===== VoidHub design system ===== */
:root {
  --bg: #05050a;
  --bg-soft: #0b0a13;
  --panel: rgba(19, 18, 30, 0.72);
  --panel-solid: #12111c;
  --panel-2: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f2f8;
  --muted: #9a9cb0;
  --muted-2: #6f7183;
  --violet: #8b5cf6;
  --violet-soft: rgba(139, 92, 246, 0.18);
  --cyan: #22d3ee;
  --pink: #f472b6;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1000px 620px at 8% -12%, rgba(139, 92, 246, 0.22), transparent 62%),
    radial-gradient(760px 520px at 108% 4%, rgba(34, 211, 238, 0.12), transparent 62%),
    radial-gradient(900px 700px at 46% 122%, rgba(244, 114, 182, 0.1), transparent 62%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
  pointer-events: none;
}

::selection {
  background: rgba(139, 92, 246, 0.45);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

img,
video,
canvas {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 650;
}

p {
  margin: 0;
}

kbd {
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ===== Layout ===== */
.container {
  width: min(1280px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(6, 6, 12, 0.72);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 14px;
  white-space: nowrap;
}

.brand b {
  color: var(--violet);
  font-weight: 800;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: conic-gradient(from 210deg, #8b5cf6, #22d3ee, #f472b6, #8b5cf6);
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.55);
  display: grid;
  place-items: center;
  flex: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 7px;
  background: #08070f;
}

.brand-mark span {
  position: relative;
  z-index: 1;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav a.active {
  color: #fff;
  background: rgba(139, 92, 246, 0.16);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.32);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.user-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: 0.15s;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.page {
  padding: 34px 0 70px;
  animation: pageIn 0.45s ease both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 8px;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.page-head h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
}

.page-head .sub {
  color: var(--muted);
  margin-top: 8px;
  font-size: 14px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 550;
  font-size: 14px;
  white-space: nowrap;
  transition: 0.15s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6d3ff0);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.8);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9b70ff, #7b4bff);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 9px;
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== Inputs ===== */
.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  outline: none;
  transition: 0.15s;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(139, 92, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.textarea {
  resize: vertical;
  min-height: 84px;
}

/* ===== Cards & panels ===== */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(16px);
  padding: 20px;
}

.panel h3 {
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

/* ===== Hub ===== */
.hero {
  padding: 46px 0 34px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.hero h1 span {
  background: linear-gradient(100deg, #c4b5fd 0%, #8b5cf6 35%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  margin-top: 14px;
  max-width: 560px;
  font-size: 15px;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}

.clock {
  font-size: 34px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.hostline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  flex: none;
}

.dot.red {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 10px;
}

.app-card {
  --glow: rgba(139, 92, 246, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 230px;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(10, 9, 18, 0.6);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s;
}

.app-card::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 220px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.4s;
}

.app-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

.app-card:hover::before {
  opacity: 1;
  transform: scale(1.12);
}

.app-card[data-app="remote"] {
  --glow: rgba(34, 211, 238, 0.42);
}

.app-card[data-app="games"] {
  --glow: rgba(251, 191, 36, 0.34);
}

.app-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
}

.app-icon svg {
  width: 27px;
  height: 27px;
}

.app-card h2 {
  font-size: 21px;
}

.app-card p {
  color: var(--muted);
  font-size: 14px;
  max-width: 30ch;
}

.app-card .go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #c4b5fd;
}

.app-card .go svg {
  transition: transform 0.2s;
}

.app-card:hover .go svg {
  transform: translateX(4px);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 42px 0 16px;
}

.section-title h2 {
  font-size: 18px;
}

.section-title a {
  font-size: 13px;
  color: var(--muted);
}

.section-title a:hover {
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.stat {
  padding: 20px 22px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.stat:last-child {
  border-right: 0;
}

.stat .label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 650;
}

.stat .value {
  font-size: 24px;
  font-weight: 650;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat .note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #22d3ee);
}

.recent-list {
  display: grid;
  gap: 8px;
}

.recent {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  transition: 0.15s;
}

.recent:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
}

.recent .thumb {
  width: 62px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #241f3d, #0f2a33);
  flex: none;
}

.recent .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent .meta {
  min-width: 0;
}

.recent .meta b {
  display: block;
  font-weight: 550;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent .meta span {
  font-size: 12px;
  color: var(--muted-2);
}

.recent .kind {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 12px;
  white-space: nowrap;
}

/* ===== Login ===== */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 38px 34px 30px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(170deg, rgba(25, 23, 40, 0.9), rgba(9, 8, 16, 0.92));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  width: 380px;
  height: 300px;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45), transparent 68%);
  pointer-events: none;
}

.login-mark {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
}

.login-card h1 {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.login-card h1 b {
  color: var(--violet);
}

.login-card .lead {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 26px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.login-error {
  display: none;
  margin: 14px 0 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: #fecdd3;
  font-size: 13px;
}

.login-error.show {
  display: block;
}

.login-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-2);
  font-size: 11px;
}

.login-card .btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
}

.shake {
  animation: shake 0.35s;
}

@keyframes shake {
  25% {
    transform: translateX(-7px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-3px);
  }
}

/* ===== Videos ===== */
.library {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 26px;
  align-items: start;
}

.side {
  position: sticky;
  top: 92px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.side-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 700;
  padding: 4px 10px 10px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  transition: 0.14s;
}

.side-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.side-item.active {
  background: rgba(139, 92, 246, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.side-item .ico {
  width: 18px;
  text-align: center;
  opacity: 0.9;
  flex: none;
}

.side-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}

.side-sub {
  margin: 2px 0 2px 16px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 1px;
}

.side-sub button {
  font-size: 13px;
  color: var(--muted-2);
  padding: 6px 9px;
  border-radius: 8px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-sub button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.side-sub button.active {
  color: #ddd6fe;
}

.library-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}

.library-tools .input {
  width: 220px;
}

.library-tools .select {
  width: auto;
  padding-right: 30px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted-2);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.crumbs button {
  color: var(--muted);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 6px;
}

.crumbs button:hover {
  color: var(--text);
}

.crumbs .sep {
  opacity: 0.5;
}

.crumbs b {
  color: var(--text);
  font-weight: 550;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  color: var(--muted);
  transition: 0.14s;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chip.active {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.4);
  color: #ede9fe;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 18px;
}

.media-card {
  text-align: left;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
  transition: 0.2s;
  position: relative;
}

.media-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

.media-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(139, 92, 246, 0.35), transparent 60%),
    linear-gradient(140deg, #1a1730, #0c1a22);
  overflow: hidden;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
}

.media-thumb .fallback svg {
  width: 34px;
  height: 34px;
}

.media-thumb .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s;
  background: rgba(5, 4, 12, 0.35);
}

.media-card:hover .play {
  opacity: 1;
}

.play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: #100c1c;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
}

.play-btn svg {
  width: 17px;
  height: 17px;
  margin-left: 2px;
}

.media-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(5, 4, 12, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 650;
  color: #d8d9e6;
}

.media-badge.audio {
  color: #a5f3fc;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #22d3ee);
}

.media-body {
  padding: 12px 13px 14px;
}

.media-body b {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-body span {
  display: block;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 60px 24px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
}

.empty h3 {
  color: var(--text);
  font-size: 17px;
  margin-bottom: 8px;
}

.empty p {
  font-size: 13px;
  max-width: 460px;
  margin: 0 auto;
}

.empty code {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: #c4b5fd;
  word-break: break-all;
}

/* ===== Player modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 3, 8, 0.82);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.18s ease both;
}

.modal-backdrop[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.player {
  width: min(1050px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b0a14;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.player-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.player-head h3 {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-head p {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-head .close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex: none;
}

.player-head .close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.player-stage {
  background: #000;
  display: grid;
  place-items: center;
  min-height: 260px;
}

.player-stage video {
  width: 100%;
  max-height: 62vh;
  background: #000;
  display: block;
}

.audio-stage {
  width: 100%;
  padding: 46px 24px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  background:
    radial-gradient(500px 260px at 50% 0%, rgba(139, 92, 246, 0.28), transparent 70%),
    #08070f;
}

.vinyl {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 35% 30%, #3b3357, #12101d 62%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  animation: spin 9s linear infinite;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.vinyl::after {
  content: "";
  position: absolute;
  inset: 43%;
  border-radius: 50%;
  background: linear-gradient(140deg, #8b5cf6, #22d3ee);
}

.vinyl.paused {
  animation-play-state: paused;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.audio-stage audio {
  width: min(560px, 100%);
}

.player-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.player-foot .note {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted-2);
}

.transcode-box {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  max-width: 540px;
}

.transcode-box h4 {
  color: var(--text);
  font-size: 16px;
  margin-bottom: 8px;
}

.transcode-box p {
  font-size: 13px;
  margin-bottom: 18px;
}

/* ===== Remote ===== */
.remote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.remote-main {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.remote-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.remote-toolbar .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.remote-toolbar .spacer {
  flex: 1;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--muted);
}

.toggle.on {
  color: #e9d5ff;
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.16);
}

.toggle .led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}

.toggle.on .led {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.screen {
  position: relative;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(139, 92, 246, 0.09), transparent 70%), #000;
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
  outline: none;
  touch-action: none;
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 250px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  cursor: crosshair;
}

.screen.control-off img {
  cursor: default;
}

.screen-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
  background: rgba(5, 5, 11, 0.88);
  color: var(--muted);
  z-index: 2;
}

.screen-overlay[hidden] {
  display: none;
}

.screen-overlay h3 {
  color: var(--text);
  margin-bottom: 8px;
  font-size: 18px;
}

.screen-overlay p {
  font-size: 13px;
  max-width: 460px;
  margin: 0 auto;
}

.screen-overlay code {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
  font-size: 12px;
  color: #c4b5fd;
}

.remote-hint {
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  line-height: 1.8;
}

.remote-side {
  display: grid;
  gap: 14px;
}

.remote-side .panel {
  padding: 16px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.keypad button {
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keypad button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row span {
  color: var(--muted-2);
}

.info-row b {
  font-weight: 550;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-row b.ok {
  color: var(--green);
}

.info-row b.bad {
  color: var(--red);
}

/* ===== Games ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.game-card {
  --tile: linear-gradient(140deg, #2c2450, #101a24);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: 0.18s;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.game-emoji {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 23px;
  background: var(--tile);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: none;
}

.game-card b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.game-card span {
  display: block;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 2px;
}

.game-card .best {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted-2);
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.stage {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(11, 10, 19, 0.8);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.stage[hidden] {
  display: none;
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.stage-title .game-emoji {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 19px;
}

.stage-title h2 {
  font-size: 16px;
}

.stage-title p {
  font-size: 11.5px;
  color: var(--muted-2);
}

.stage-scores {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.score-box {
  min-width: 76px;
  padding: 6px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  text-align: center;
}

.score-box span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.score-box b {
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.stage-body {
  position: relative;
  display: grid;
  place-items: center;
  padding: 16px;
  min-height: 420px;
  height: min(74vh, 780px);
  background:
    radial-gradient(60% 60% at 50% 40%, rgba(139, 92, 246, 0.08), transparent 70%), #06060c;
  overflow: hidden;
}

.game-canvas {
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  background: #0b0a14;
  touch-action: none;
  outline: none;
  display: block;
}

.stage-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted-2);
  flex-wrap: wrap;
}

.stage-foot .spacer {
  flex: 1;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 4, 9, 0.78);
  backdrop-filter: blur(5px);
  z-index: 3;
  text-align: center;
  padding: 20px;
}

.game-overlay[hidden] {
  display: none;
}

.game-overlay h3 {
  font-size: 27px;
  margin-bottom: 8px;
}

.game-overlay p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.game-overlay .btn {
  margin: 0 4px;
}

/* ===== Toast ===== */
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.toast {
  padding: 11px 15px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 18, 32, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  animation: toastIn 0.25s ease both;
  max-width: 340px;
}

.toast.err {
  border-color: rgba(251, 113, 133, 0.4);
  color: #fecdd3;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ===== Misc ===== */
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.loading {
  display: grid;
  place-items: center;
  padding: 70px;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.skeleton {
  border-radius: 16px;
  aspect-ratio: 16/9;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.03) 20%, rgba(255, 255, 255, 0.07) 40%, rgba(255, 255, 255, 0.03) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 1080px) {
  .app-grid {
    grid-template-columns: 1fr 1fr;
  }
  .remote-layout {
    grid-template-columns: 1fr;
  }
  .remote-side {
    grid-template-columns: 1fr 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  .library {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: none;
  }
  .side::-webkit-scrollbar {
    display: none;
  }
  .side-label,
  .side-sub {
    display: none;
  }
  .side-item {
    width: auto;
    white-space: nowrap;
    flex: none;
  }
  .library-tools {
    margin-left: 0;
    width: 100%;
  }
  .library-tools .input {
    width: 100%;
    flex: 1;
  }
  .hero-meta {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .container {
    width: calc(100% - 28px);
  }
  .app-grid {
    grid-template-columns: 1fr;
  }
  .app-card {
    min-height: 190px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stat:last-child {
    border-bottom: 0;
  }
  .remote-side {
    grid-template-columns: 1fr;
  }
  .topbar-inner {
    gap: 12px;
  }
  .user-chip {
    display: none;
  }
  .nav a {
    padding: 8px 10px;
    font-size: 13px;
  }
  .page-head {
    align-items: flex-start;
  }
  .stage-scores {
    margin-left: 0;
  }
  .stage-body {
    height: auto;
    min-height: 0;
  }
  .hero {
    padding-top: 26px;
  }
  .toast-wrap {
    left: 14px;
    right: 14px;
    justify-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===== Fullscreen remote ===== */
.remote-main:fullscreen {
  border: 0;
  border-radius: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.remote-main:fullscreen .screen {
  flex: 1;
  min-height: 0;
}

.remote-main:fullscreen .screen img {
  max-height: calc(100vh - 118px);
}

/* ===== Remote monitor picker ===== */
.remote-toolbar .select {
  width: auto;
  max-width: 210px;
  padding: 7px 26px 7px 10px;
  font-size: 12px;
  border-radius: 9px;
}
