/* ==========================================================================
   DEAD WORLD RADIO — base2.css
   Clean, readable style for the community/streaming pages.
   Mobile-first, responsive.
   ========================================================================== */

/* ---------- Reset & Root ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0f11;
  --bg-raised: #13171a;
  --bg-card:   #181d21;
  --bg-input:  #1a1f24;

  --border:    rgba(255,255,255,.09);
  --border-md: rgba(255,255,255,.14);
  --border-hi: rgba(255,255,255,.22);

  --accent:    #4fa8c5;
  --accent-hi: #7ecfe8;
  --accent-dim:rgba(79,168,197,.18);

  --text:      #dde4e8;
  --text-muted:#8a9aa6;
  --text-dim:  #5a6a74;
  --link:      #7ecfe8;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size: 15px;
  --line: 1.55;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.6);
}

/* ---------- Base ---------- */
html { font-size: var(--font-size); -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: var(--line);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img, iframe { max-width: 100%; display: block; }
pre, code {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Code", "Fira Code", ui-monospace, monospace;
  font-size: .9em;
}

/* ---------- Disable CRT chrome from styles.css ---------- */
.overlay.tv-static,
.scanlines,
.pixel-grid,
.grid-overlay {
  display: none !important;
}

/* ---------- Container ---------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 12px 40px;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  overflow: visible;
}
@media (min-width: 480px) {
  .container { padding: 0 16px 40px; }
}

/* ---------- Nav ---------- */
nav {
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: 200;
  margin-left: -12px;
  margin-right: -12px;
  padding: 8px 12px;
  overflow: visible !important;
}

@media (min-width: 480px) {
  nav {
    margin-left: -16px;
    margin-right: -16px;
    padding: 8px 16px;
  }
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  width: 100%;
  overflow: visible !important;
}

nav ul li { display: block; }

nav .nav-spacer {
  display: none;
  flex: 1 1 auto;
}

nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  border: none;
  background: transparent;
  white-space: nowrap;
  transition: color .12s ease, background .12s ease;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
  max-width: 100%;
}

@media (min-width: 640px) {
  nav .nav-spacer { display: block; }

  nav ul {
    flex-wrap: nowrap;
    gap: 2px;
  }

  nav a {
    min-height: 44px;
    padding: 0 12px;
    font-size: .92rem;
  }
}

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

nav a.active,
nav a[aria-current="page"] {
  color: var(--accent-hi);
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "main"
    "left"
    "right";
  gap: 12px;
  align-items: start;
}

@media (min-width: 700px) {
  .layout {
    grid-template-columns: 200px minmax(0,1fr);
    grid-template-areas:
      "left main"
      "left right";
    gap: 14px;
  }

  .right-rail { grid-column: 2; }
}

@media (min-width: 1000px) {
  .layout {
    grid-template-columns: 220px minmax(0,1fr) 240px;
    grid-template-areas: "left main right";
    gap: 16px;
  }

  .right-rail { grid-column: auto; }
}

.layout--wide {
  grid-template-columns: 1fr !important;
  grid-template-areas: "main" !important;
}

.layout--wide .sidebar { display: none !important; }

.left-rail    { grid-area: left; }
.right-rail   { grid-area: right; }
.main-content { grid-area: main; min-width: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Cards / Sections / Widgets ---------- */
.card,
.section,
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 12px;
}

@media (min-width: 480px) {
  .card,
  .section,
  .widget {
    padding: 16px;
    margin-bottom: 14px;
  }
}

.section h2,
.widget h3,
.widget h4 {
  color: var(--text);
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  text-shadow: none;
}

.section h2 { font-size: 1.05rem; }
.widget h3  { font-size: .98rem; }
.widget h4  { font-size: .92rem; }

/* ---------- Buttons ---------- */
.button,
button.button,
a.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-md);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}

.button:hover {
  background: rgba(255,255,255,.10);
  border-color: var(--border-hi);
  text-decoration: none;
}

.button:active { transform: translateY(1px); }
.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.button--sm { padding: 6px 11px; font-size: .82rem; border-radius: var(--radius-sm); min-height: 32px; }
.button--lg { padding: 12px 22px; font-size: 1rem; }

/* ---------- Forms ---------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
textarea,
select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: var(--line);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  min-height: 44px;
}

@media (min-width: 480px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  input[type="number"],
  textarea,
  select {
    font-size: .95rem;
    min-height: auto;
  }
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,168,197,.18);
}

textarea { resize: vertical; min-height: 80px; }

label {
  display: block;
  margin-bottom: 5px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group { margin-bottom: 14px; }
.form-hint  { margin-top: 4px; font-size: .82rem; color: var(--text-dim); }

/* ---------- Flash messages ---------- */
.flash,
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border-md);
  font-size: .92rem;
}

.flash-error,
.alert-error {
  background: rgba(220,60,60,.12);
  border-color: rgba(220,60,60,.35);
  color: #f9a0a0;
}

.flash-success,
.alert-success {
  background: rgba(60,180,100,.10);
  border-color: rgba(60,180,100,.30);
  color: #7fe8a8;
}

.flash-info,
.alert-info {
  background: rgba(79,168,197,.10);
  border-color: rgba(79,168,197,.28);
  color: var(--accent-hi);
}

.flash-warning,
.alert-warning {
  background: rgba(220,160,40,.10);
  border-color: rgba(220,160,40,.28);
  color: #f0c97a;
}

/* ---------- Typography ---------- */
h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 12px; color: var(--text); }
h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
h4 { font-size: .92rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }

@media (min-width: 480px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.05rem; }
  h4 { font-size: .95rem; }
}

p { margin-bottom: 10px; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--text-muted); font-size: .9em; }
.dim   { color: var(--text-dim); }
.dot   { opacity: .5; margin: 0 2px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-md);
  background: rgba(255,255,255,.05);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill--tiny { padding: 2px 6px; font-size: .75rem; }

/* ---------- Tables — horizontal scroll on mobile ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

thead th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-md);
  font-weight: 600;
  color: var(--text-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.03); }

@media (min-width: 480px) {
  thead th { padding: 9px 12px; }
  tbody td { padding: 9px 12px; }
}

/* ---------- Global player ---------- */
#global-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  flex-wrap: wrap;
}

#gp-vol  { max-width: 120px; }
#gp-seek { width: 100%; accent-color: var(--accent); }
#gp-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#global-player .button { padding: 8px 12px; }

@media (max-width: 480px) {
  #global-player { gap: 6px 8px; }
  #gp-vol { flex: 1 1 100%; max-width: none; }
  #gp-title { font-size: .88rem; }
}

/* ---------- Alerts bell ---------- */
.alerts-bell {
  position: fixed;
  top: 8px;
  right: 10px;
  z-index: 9999;
  display: none;
}

@media (min-width: 480px) {
  .alerts-bell { top: 12px; right: 14px; }
}

.alerts-bell button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-md);
  background: var(--bg-raised);
  color: var(--text-muted);
  padding: 7px 11px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-size: .85rem;
  min-height: 36px;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.alerts-bell button:hover {
  border-color: var(--border-hi);
  color: var(--text);
  background: rgba(255,255,255,.06);
}

.alerts-bell button.has-alerts {
  border-color: var(--accent);
  color: var(--accent-hi);
}

.alerts-dot {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: var(--accent);
  color: #fff;
}

.alerts-panel {
  position: fixed;
  top: 52px;
  right: 10px;
  width: calc(100vw - 20px);
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 9998;
}

@media (min-width: 480px) {
  .alerts-panel {
    position: absolute;
    top: 44px;
    right: 0;
    width: min(400px, calc(100vw - 24px));
  }
}

.alerts-panel.open { display: block; }

.alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.alerts-head .title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.alerts-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.alerts-actions a,
.alerts-actions button {
  border: 1px solid var(--border-md);
  background: transparent;
  color: var(--text-muted);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: .82rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.alerts-actions a:hover,
.alerts-actions button:hover {
  color: var(--text);
  border-color: var(--border-hi);
  text-decoration: none;
}

.alerts-list {
  max-height: min(60vh, 480px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.alerts-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alerts-item:last-child { border-bottom: none; }
.alerts-item.unread { background: rgba(79,168,197,.07); }
.alerts-item a { color: var(--text); text-decoration: none; }
.alerts-item a:hover { text-decoration: underline; }
.alerts-meta { color: var(--text-dim); font-size: .8rem; margin-top: 2px; }
.alerts-body { color: var(--text-muted); font-size: .88rem; margin-top: 4px; overflow-wrap: anywhere; }
.alerts-empty { padding: 14px; color: var(--text-muted); font-size: .9rem; }

/* ---------- Nav search ---------- */
.nav-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 4px;
}

.nav-search-input {
  display: inline-flex !important;
  width: 180px !important;
  min-width: 0 !important;
  min-height: 32px !important;
  padding: 6px 32px 6px 12px !important;
  font-size: .82rem !important;
  background: rgba(0,0,0,.35) !important;
  border: 1px solid rgba(127,255,255,.16) !important;
  border-radius: 10px !important;
  color: rgba(234,234,234,.92) !important;
  outline: none !important;
  transition: width .22s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease !important;
  -webkit-appearance: none;
}

.nav-search-input:focus,
.nav-search-wrap.is-focused .nav-search-input {
  width: 240px !important;
  border-color: rgba(127,255,255,.48) !important;
  background: rgba(0,0,0,.50) !important;
  box-shadow: 0 0 0 2px rgba(127,255,255,.10) !important;
}

.nav-search-input::placeholder { color: rgba(180,220,220,.38); }
.nav-search-input::-webkit-search-cancel-button { display: none; }

.nav-search-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(127,255,255,.40);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color .12s ease;
  min-height: auto !important;
}

.nav-search-btn:hover { color: rgba(127,255,255,.80); }

.nav-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max(300px, 100%);
  background: rgba(10,12,14,.97);
  border: 1px solid rgba(127,255,255,.22);
  border-radius: 14px;
  box-shadow:
    0 16px 48px rgba(0,0,0,.65),
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 0 24px rgba(127,255,255,.08);
  overflow: hidden;
  z-index: 99999;
  backdrop-filter: blur(8px);
  max-height: 420px;
  overflow-y: auto;
}

.nav-search-dropdown.is-open { display: block; }

.nsd-group-label {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(127,255,255,.45);
  border-top: 1px solid rgba(255,255,255,.05);
}

.nsd-group-label:first-child { border-top: none; }

.nsd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  text-decoration: none;
  color: rgba(234,234,234,.88);
  transition: background .1s ease;
  cursor: pointer;
}

.nsd-item:hover,
.nsd-item.is-active {
  background: rgba(127,255,255,.08);
  color: rgba(234,234,234,1);
}

.nsd-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(200,240,240,.7);
}

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

.nsd-avatar--text {
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
}

.nsd-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nsd-item-label {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(234,234,234,.95);
}

.nsd-item-sub {
  font-size: 11px;
  color: rgba(180,220,220,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nsd-type {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(127,255,255,.38);
  padding: 2px 6px;
  border: 1px solid rgba(127,255,255,.16);
  border-radius: 6px;
  white-space: nowrap;
}

.nsd-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: rgba(180,220,220,.45);
  text-align: center;
}

.nav-search-dropdown::-webkit-scrollbar { width: 4px; }
.nav-search-dropdown::-webkit-scrollbar-thumb { background: rgba(127,255,255,.18); border-radius: 999px; }

@media (max-width: 640px) {
  .nav-search-input { width: 120px !important; }

  .nav-search-input:focus,
  .nav-search-wrap.is-focused .nav-search-input {
    width: 170px !important;
  }

  .nav-search-dropdown {
    width: min(300px, calc(100vw - 16px));
    right: 0;
  }
}

@media (max-width: 400px) {
  .nav-search-wrap { display: none; }
}

/* ---------- Footer ---------- */
footer {
  width: 100%;
  margin: 32px 0 0;
  padding: 18px 0 10px;
  border-top: 1px solid var(--border);
  position: static;
  display: block;
  text-align: center;
  font-size: .82rem;
  color: var(--text-dim);
  clear: both;
}

footer a {
  display: inline-block;
  color: var(--text-dim);
}

footer a:hover { color: var(--text-muted); }

footer .dot {
  display: inline-block;
  margin: 0 8px;
  vertical-align: middle;
}

@media (max-width: 720px) {
  footer {
    margin-top: 24px;
    padding: 16px 0 8px;
    text-align: center;
  }
}

/* ---------- Scrollbar (webkit) ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.20); }

/* ---------- Utilities ---------- */
.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; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.mt-8  { margin-top: 8px; }
.mb-8  { margin-bottom: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
