@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Manrope:wght@400;600;700&display=swap");

:root {
  --bg: #0d1117;
  --panel: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --brand-1: #0ea5e9;
  --brand-2: #22c55e;
  --danger: #f85149;
  --ring: rgba(14, 165, 233, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 14%, rgba(14, 165, 233, 0.08), transparent 40%),
    radial-gradient(circle at 88% 82%, rgba(34, 197, 94, 0.06), transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: linear-gradient(90deg, #08131d, #133548);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.brand h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  font-size: 2rem;
  line-height: 1;
}

.brand p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.85;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
}

.profile-menu {
  position: relative;
}

.profile-button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.profile-button img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 115%;
  width: min(480px, 92vw);
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 14px;
  box-shadow: 0 18px 35px rgba(1, 4, 9, 0.5);
  padding: 0.9rem;
  color: var(--text);
}

.dropdown-label,
.dropdown-sub {
  margin: 0.3rem 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.auth-form {
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 0.7rem;
  background: #0d1117;
}

.auth-form h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

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

input,
textarea,
select {
  width: 100%;
  margin-bottom: 0.55rem;
  border-radius: 10px;
  border: 1px solid #30363d;
  padding: 0.6rem;
  background: #0d1117;
  color: var(--text);
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px var(--ring);
  background: #161b22;
}

button {
  border: 0;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  color: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

code {
  word-break: break-all;
}

.btn-outline {
  background: #21262d;
  color: var(--text);
  border: 1px solid #30363d;
}

.btn-link,
.side-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}

.btn-link {
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  color: white;
}

.full-width-link {
  display: flex;
  width: 100%;
  margin-bottom: 0.8rem;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 78px);
}

.sidebar {
  background: #0f2231;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
  border-radius: 8px;
}

.side-link {
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.tab-btn.active {
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
}

.content-area {
  padding: 1rem;
}

.tab-panel {
  display: none;
  background: var(--panel);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(17, 30, 43, 0.08);
  animation: fadeUp 250ms ease;
}

.tab-panel.active {
  display: block;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.card-list li {
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 0.7rem;
  background: #0d1117;
}

.small-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.info-banner {
  margin-bottom: 0.8rem;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 0.75rem;
  background: #0d1117;
}

.dot-divider {
  padding: 0 0.4rem;
  color: #8b98a5;
}

.now-card {
  margin-bottom: 0.8rem;
  border-radius: 12px;
  padding: 0.8rem;
  border: 1px solid #30363d;
  background: linear-gradient(120deg, rgba(14, 165, 233, 0.08), rgba(34, 197, 94, 0.06));
}

.now-loop-indicator {
  display: inline-flex;
  align-items: center;
  margin: 0.35rem 0 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  font-size: 0.82rem;
  font-weight: 700;
}

.loop-current-btn {
  margin: 0 0 0.7rem;
}

.loop-current-btn.is-active {
  border-color: rgba(34, 197, 94, 0.75);
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
}

.audio-player {
  width: 100%;
  margin-bottom: 0.8rem;
}

.media-player-shell {
  margin-bottom: 0.8rem;
  border: 1px solid #30363d;
  border-radius: 14px;
  background: #08131d;
  overflow: hidden;
}

.media-player-shell iframe {
  display: block;
  width: 100%;
  min-height: 352px;
  border: 0;
}

.live-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(8, 19, 29, 0.92);
}

.obs-live-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #d61f3a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.obs-offline-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
  color: rgba(248, 250, 252, 0.92);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.live-audio-btn {
  margin: 0;
}

.live-status-text {
  margin-left: auto;
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.88rem;
}

.live-video-frame {
  display: block;
  width: 100%;
  min-height: 352px;
  background: #000;
  border: 0;
}

.live-video-offline-state {
  min-height: 352px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 30%, rgba(15, 23, 42, 0.5), rgba(2, 6, 23, 0.95));
  color: rgba(248, 250, 252, 0.92);
}

.live-video-offline-state strong {
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

.live-video-offline-state span {
  max-width: 28rem;
  color: rgba(248, 250, 252, 0.74);
}

.small-link {
  color: var(--brand-1);
  text-decoration: none;
  font-size: 0.92rem;
}

.small-link:hover {
  text-decoration: underline;
}

.stack-form {
  max-width: 560px;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.inline-grid select,
.inline-grid button {
  grid-column: span 2;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #30363d;
  text-align: left;
  padding: 0.5rem;
  vertical-align: middle;
}

.viewer-profile {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.viewer-profile img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #21262d;
}

.admin-actions {
  display: flex;
  gap: 0.35rem;
}

.spread-row {
  justify-content: space-between;
}

.admin-actions .danger {
  background: var(--danger);
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.centered-shell {
  min-height: calc(100vh - 78px);
  align-items: center;
}

.card-section {
  background: var(--panel);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(1, 4, 9, 0.3);
  border: 1px solid #30363d;
}

.narrow-card {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.profile-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
}

.settings-form {
  margin-top: 1rem;
}

.check-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.check-row input {
  width: auto;
  margin: 0;
}

.code-panel {
  display: grid;
  gap: 0.8rem;
  border-radius: 12px;
  border: 1px solid #d7e0e8;
  background: #0f2231;
  color: #f8fafc;
  padding: 0.9rem;
}

.obs-recommend-card {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.85rem;
}

.obs-recommend-grid {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 1.2fr);
  gap: 0.35rem 0.9rem;
  margin-top: 0.55rem;
}

.obs-recommend-grid span:nth-child(odd) {
  color: rgba(248, 250, 252, 0.72);
}

.obs-recommend-grid span:nth-child(even) {
  font-weight: 700;
}

.obs-recommend-note {
  margin: 0.7rem 0 0;
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.92rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #08212f;
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(7, 24, 37, 0.3);
}

.hidden {
  display: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
  }

  .tab-btn {
    white-space: nowrap;
    min-width: fit-content;
  }

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

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

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

  .inline-grid select,
  .inline-grid button {
    grid-column: span 1;
  }
}

/* Advanced UI pass */
:root {
  --bg: #0d1117;
  --panel: rgba(22, 27, 34, 0.97);
  --panel-solid: #21262d;
  --text: #e6edf3;
  --muted: #8b949e;
  --brand-1: #0ea5e9;
  --brand-2: #14b8a6;
  --brand-3: #f59e0b;
  --line: #30363d;
  --shadow-lg: 0 20px 55px rgba(1, 4, 9, 0.5);
}

body.page-body {
  background:
    radial-gradient(circle at 10% 5%, rgba(14, 165, 233, 0.08), transparent 24%),
    radial-gradient(circle at 88% 11%, rgba(245, 158, 11, 0.06), transparent 24%),
    linear-gradient(180deg, #0d1117, #0a0f17);
}

.topbar {
  padding: 1rem 1.25rem;
  background: linear-gradient(110deg, #07111a 0%, #0b2033 52%, #134367 100%);
}

.topbar-meta,
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-pill {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.84rem;
}

.page-frame,
.page-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1rem;
}

.page-shell-wide {
  max-width: 1440px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  gap: 1rem;
  padding: 1.1rem;
  border-radius: 24px;
  background: linear-gradient(130deg, rgba(8, 19, 29, 0.97), rgba(14, 57, 87, 0.92));
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1rem;
}

.hero-copy h2 {
  margin: 0.45rem 0 0.8rem;
  font-size: clamp(1.7rem, 2.6vw, 2.65rem);
  line-height: 1.1;
}

.hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-card {
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stat-card span,
.eyebrow,
.playlist-order {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.7rem;
}

.accent-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(14, 165, 233, 0.18));
}

.dashboard-layout {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
}

.sidebar {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(10, 27, 43, 0.97), rgba(15, 48, 68, 0.95));
  box-shadow: var(--shadow-lg);
}

.sidebar-footnote {
  margin-top: auto;
  padding: 0.75rem;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.tab-panel,
.card-section,
.player-sidecar,
.player-stage {
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 1.2rem;
}

.section-head {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.section-copy {
  max-width: 42ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.notice-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.9), rgba(13, 17, 23, 0.6));
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  color: var(--muted);
}

.playlist-grid,
.queue-grid,
.feature-grid,
.player-grid,
.login-grid,
.admin-grid {
  display: grid;
  gap: 0.85rem;
}

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

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

.admin-span-full {
  grid-column: 1 / -1;
}

.playlist-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.playlist-grid.playlist-scroll-limited {
  max-height: calc((7.4rem * 3) + (0.85rem * 2));
  overflow-y: auto;
  padding-right: 0.35rem;
  align-content: start;
}

.playlist-grid.playlist-scroll-limited .playlist-card {
  min-height: 7.4rem;
}

.playlist-grid.playlist-scroll-limited::-webkit-scrollbar {
  width: 10px;
}

.playlist-grid.playlist-scroll-limited::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0ea5e9, #14b8a6);
  border-radius: 999px;
}

.playlist-grid.playlist-scroll-limited::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
}

.playlist-order {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, rgba(14, 165, 233, 0.16), rgba(20, 184, 166, 0.18));
  color: #7dd3fc;
}

.playlist-launch-btn {
  min-width: 100px;
}

.playlist-action-stack {
  display: grid;
  gap: 0.45rem;
}

.playlist-request-btn {
  min-width: 100px;
}

.media-player-shell {
  border-radius: 18px;
  border: 1px solid var(--line);
}

.media-frame-wrap {
  position: relative;
}

.player-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(8, 19, 29, 0.54);
  color: #fff;
  text-align: center;
  padding: 1rem;
}

.player-lock span {
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.35rem;
  max-width: 320px;
}

.moderation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(7, 17, 26, 0.72);
  backdrop-filter: blur(5px);
}

.moderation-overlay.hidden {
  display: none;
}

.moderation-card {
  width: min(560px, 96vw);
  border-radius: 20px;
  background: #161b22;
  border: 1px solid #30363d;
  box-shadow: 0 24px 60px rgba(1, 4, 9, 0.5);
  padding: 1.2rem 1.25rem;
}

.moderation-card h2 {
  margin: 0 0 0.5rem;
  color: #f85149;
}

.is-moderated main,
.is-moderated header,
.is-moderated .toast {
  filter: blur(2px);
  pointer-events: none;
}

.audio-player {
  border-radius: 14px;
}

.code-panel {
  border-radius: 16px;
  background: linear-gradient(180deg, #08131d, #10283d);
}

.login-hero-panel {
  min-height: 100%;
}

.login-card {
  background: rgba(22, 27, 34, 0.97);
}

/* Tablet devices (640px - 1024px) */
@media (max-width: 1000px) {
  .hero-panel,
  .dashboard-layout,
  .playlist-grid,
  .queue-grid,
  .feature-grid,
  .player-grid,
  .login-grid,
  .admin-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .section-head,
  .playlist-card {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-meta,
  .header-actions {
    flex-wrap: wrap;
  }

  .playlist-grid.playlist-scroll-limited {
    max-height: calc((7.4rem * 6) + (0.85rem * 5));
  }

  .page-frame,
  .page-shell {
    padding: 0.75rem;
  }

  .topbar {
    padding: 0.75rem 1rem;
  }

  .brand h1 {
    font-size: 1.5rem;
  }

  .brand p {
    font-size: 0.75rem;
  }

  .live-pill {
    display: none;
  }
}

/* Mobile phones (< 640px) */
@media (max-width: 640px) {
  :root {
    font-size: 15px;
  }

  * {
    -webkit-tap-highlight-color: transparent;
  }

  body {
    background: linear-gradient(180deg, #0d1117, #0a0f17);
  }

  .topbar {
    padding: 0.6rem 0.75rem;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
  }

  .brand {
    gap: 0.5rem;
  }

  .brand h1 {
    font-size: 1.2rem;
    letter-spacing: 0.5px;
  }

  .brand p,
  .topbar-meta .live-pill {
    display: none;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .profile-button {
    padding: 0.3rem 0.5rem;
    gap: 0.3rem;
  }

  .profile-button img {
    width: 28px;
    height: 28px;
  }

  .profile-button span {
    display: none;
  }

  .dropdown {
    width: min(90vw, 400px);
    right: -10px;
    padding: 0.75rem;
  }

  .auth-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .auth-form {
    padding: 0.6rem;
  }

  .auth-form h3 {
    font-size: 0.9rem;
  }

  .auth-form input,
  .auth-form button {
    margin-bottom: 0.45rem;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 16px;
  }

  .page-frame,
  .page-shell {
    padding: 0.5rem;
    margin-top: 70px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 16px;
    margin-bottom: 0.75rem;
  }

  .hero-copy h2 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    margin: 0.3rem 0 0.6rem;
  }

  .hero-copy p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .stat-card {
    padding: 0.75rem;
    border-radius: 12px;
  }

  .stat-card strong {
    font-size: 1.4rem;
    margin-top: 0.25rem;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.4rem;
    padding: 0.6rem;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  .tab-btn {
    white-space: nowrap;
    min-width: fit-content;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }

  .side-link {
    white-space: nowrap;
    min-width: fit-content;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }

  .sidebar-footnote {
    display: none;
  }

  .content-area {
    padding: 0.75rem;
  }

  .tab-panel,
  .card-section,
  .card-list li {
    border-radius: 12px;
    padding: 0.75rem;
  }

  .tab-panel {
    box-shadow: 0 4px 12px rgba(17, 30, 43, 0.08);
  }

  .playlist-grid,
  .queue-grid,
  .feature-grid,
  .player-grid,
  .login-grid,
  .admin-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .playlist-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding: 0.65rem;
  }

  .playlist-order {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .playlist-action-stack {
    gap: 0.3rem;
  }

  .playlist-launch-btn,
  .playlist-request-btn {
    padding: 0.5rem;
    font-size: 0.85rem;
    min-width: 70px;
  }

  input,
  textarea,
  select {
    padding: 0.5rem;
    margin-bottom: 0.45rem;
    border-radius: 8px;
    font-size: 16px;
  }

  button {
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    font-size: 0.95rem;
  }

  .btn-outline,
  .btn-link {
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
  }

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

  .inline-grid select,
  .inline-grid button {
    grid-column: span 1;
  }

  .media-player-shell iframe {
    min-height: 240px;
  }

  .section-head {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .section-copy {
    font-size: 0.9rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.4rem 0.35rem;
    font-size: 0.85rem;
  }

  .viewer-profile img {
    width: 28px;
    height: 28px;
  }

  .admin-actions {
    gap: 0.25rem;
  }

  .admin-actions button {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  .profile-chip {
    padding: 0.3rem 0.5rem;
  }

  .profile-chip img {
    width: 28px;
    height: 28px;
  }

  .check-row {
    gap: 0.4rem;
    margin-bottom: 0.6rem;
  }

  .moderation-card {
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 1rem;
  }

  .code-panel {
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  .toast {
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }

  .playlist-grid.playlist-scroll-limited {
    max-height: calc((6.5rem * 4) + (0.65rem * 3));
  }

  .media-player-shell {
    border-radius: 12px;
  }

  .card-list li {
    padding: 0.65rem;
  }

  .now-card {
    padding: 0.7rem;
    border-radius: 12px;
  }

  input:focus,
  textarea:focus,
  select:focus {
    box-shadow: 0 0 0 2px var(--ring);
  }
}

/* Extra small phones (< 480px) */
@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }

  .brand h1 {
    font-size: 1rem;
  }

  .hero-panel {
    padding: 0.7rem;
  }

  .hero-copy h2 {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .stat-card strong {
    font-size: 1.2rem;
  }

  .topbar {
    padding: 0.5rem 0.6rem;
  }

  .playlist-card {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .playlist-order {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .media-player-shell iframe {
    min-height: 200px;
  }

  .moderation-card {
    width: 96vw;
    padding: 0.85rem;
  }

  .playlist-grid.playlist-scroll-limited {
    max-height: calc((6rem * 3) + (0.65rem * 2));
  }

  .page-frame,
  .page-shell {
    padding: 0.4rem;
    margin-top: 65px;
  }

  .topbar {
    margin-top: 0;
  }

  .dropdown {
    width: 92vw;
  }

  .auth-form input,
  .auth-form button,
  input,
  textarea,
  select,
  button {
    font-size: 16px;
  }
}

/* Large screens (> 1200px) */
@media (min-width: 1200px) {
  .page-frame,
  .page-shell {
    max-width: 1400px;
  }

  .dashboard-layout {
    gap: 1.5rem;
  }

  .sidebar {
    padding: 1rem;
  }

  .hero-panel {
    gap: 1.5rem;
  }

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

/* ── Settings Page ──────────────────────────────────────────── */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.compact-hero {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
}

.settings-current-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.settings-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--brand-1);
  background: #21262d;
  object-fit: cover;
}

.settings-username-display {
  display: block;
  font-size: 1.1rem;
  color: var(--text);
}

.settings-email-display {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.settings-role-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.field-hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}

.settings-msg {
  display: none;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.settings-msg-ok {
  display: block;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.settings-msg-error {
  display: block;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: #f87171;
}

.settings-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.settings-divider::before,
.settings-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.file-input {
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  background: #0d1117;
  color: var(--text);
  border: 1px dashed #30363d;
  border-radius: 10px;
}

.file-input:hover {
  border-color: var(--brand-1);
}

.file-input::-webkit-file-upload-button {
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

/* ── Forgot Password ─────────────────────────────────────────── */

.forgot-password-wrap {
  margin-top: 0.6rem;
  text-align: right;
}

.link-btn {
  background: none;
  border: 0;
  color: var(--brand-1);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--brand-2);
}

.forgot-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

select option {
  background: #161b22;
  color: var(--text);
}

