/* Design tokens, reset, and shared primitives. */

:root {
  --bg: #0b0b0e;
  --panel: #15151b;
  --panel2: #1d1d25;
  --text: #fff;
  --muted: #a7a7b3;
  --accent: #ff3f6c;
  --accent2: #7c5cff;
  --line: rgba(255, 255, 255, .10);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* The storefront scrolls inside .main; the player owns its own viewport. */
body { overscroll-behavior-y: none; }

/* The storefront steps aside while the full-screen player is open.
   Note this hides the *contents*, not .app itself — #playerPage lives inside
   .app, so hiding the shell would hide the player too. */
.app.hidden { display: none; }
#view.hidden { display: none; }
.topbar.hidden { display: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

h1, h2, h3 { margin: 0; line-height: 1.15; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- utils */

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

.spinner {
  width: 28px; height: 28px;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel2) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  top: calc(16px + var(--safe-top));
  transform: translateX(-50%) translateY(-12px);
  background: rgba(20, 20, 24, .96);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  max-width: min(90vw, 460px);
  text-align: center;
  font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- buttons */

.btn {
  border: 1px solid var(--line);
  background: #25252d;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #2f2f38; }
.btn.primary { border: 0; background: var(--accent); }
.btn.primary:hover { background: #ff5c83; }
.btn.ghost { background: transparent; }

.round {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .42);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.round:hover { background: rgba(0, 0, 0, .68); }

/* ---------------------------------------------------------------- empty */

.empty {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
}
.empty h3 { font-size: 18px; color: #fff; margin-bottom: 8px; }
