* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

button, input {
  font-family: inherit;
  color: inherit;
}

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

img {
  max-width: 100%;
  display: block;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Typography helpers */
.font-display {
  font-family: var(--font-display);
}
.font-mono {
  font-family: var(--font-mono);
}

/* Glassmorphism primitives */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.glass-hover:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.glass-active {
  background: var(--surface-active);
  border-color: var(--border-strong);
}

/* Card */
.card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: white;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.45);
}
.btn-primary:active {
  transform: scale(0.97);
}
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  color: var(--text-secondary);
}
.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Inputs */
.input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}
.input::placeholder {
  color: var(--text-muted);
}
.input:focus {
  border-color: rgba(236, 72, 153, 0.5);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.1);
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

/* Utility */
.line-clamp-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hidden YouTube player */
#player-container {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Layout visibility toggles */
.layout-desktop {
  display: none;
}
.layout-mobile {
  display: flex;
}

@media (min-width: 1024px) {
  .layout-desktop {
    display: grid;
  }
  .layout-mobile {
    display: none;
  }
}
