/* Portal Sub-Pages — BG3 Dark Fantasy Theme
   Fix 1: New Rocker (headers/UI) + Grenze Gotisch (body text)
   Fix 2: All headers uppercase
   Fix 3: Font sizes bumped +2px across the board */

@import url('https://fonts.googleapis.com/css2?family=New+Rocker&family=Grenze+Gotisch:wght@300;400;600&display=swap');

:root {
  color-scheme: dark;
  --bg-0: #0d101a;
  --bg-1: #120a19;
  --text: #e6daf5;
  --muted: rgba(230, 218, 245, 0.72);
  --accent: #bd8eff;
  --danger: #ff8da1;
  --gold: #c9a84c;
  --gold-glow: rgba(201, 168, 76, 0.18);
  --gold-dim: rgba(201, 168, 76, 0.32);
  --border: rgba(189, 142, 255, 0.2);
  --border-gold: rgba(201, 168, 76, 0.28);
  --panel-bg: rgba(12, 8, 20, 0.72);
  --stone-bg: rgba(18, 12, 28, 0.65);
  --font-header: 'New Rocker', cursive;
  --font-body: 'Grenze Gotisch', cursive;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%,  rgba(90, 30, 180, 0.32), transparent 65%),
    radial-gradient(ellipse 60% 70% at  5% 85%,  rgba(30, 15, 70,  0.40), transparent 70%),
    radial-gradient(ellipse 50% 60% at 95% 80%,  rgba(60, 10, 100, 0.20), transparent 70%),
    linear-gradient(180deg, #0e0b17 0%, #07050f 55%, #050309 100%);
  background-attachment: fixed;
}

/* Fix 2: All headings uppercase + New Rocker */
h1, h2, h3, h4,
.nav-title, .section-heading, .page-title,
.card-title, .game-name, .track-title, .q-title,
.player-title, .article-headline, .featured-headline,
.upload-text, .empty-title {
  font-family: var(--font-header);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 12px 32px;
  gap: 20px;
  background: rgba(6, 3, 14, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-gold);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-header);
  font-size: 13px; /* was 11px */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.82;
  transition: opacity 0.18s;
  white-space: nowrap;
}
.back-btn::before { content: "⟵"; font-size: 17px; line-height: 1; } /* was 15px */
.back-btn:hover { opacity: 1; }

.nav-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-header);
  font-size: clamp(18px, 3vw, 26px); /* was 16px/24px */
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 18px rgba(189, 142, 255, 0.55);
}

.nav-spacer { width: 80px; }

/* ── Content wrapper ─────────────────────────────────────────────────────── */
.portal-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 24px 72px;
}

/* ── Decorative divider ──────────────────────────────────────────────────── */
.rune-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0;
  font-family: var(--font-header);
  font-size: 15px; /* was 13px */
  letter-spacing: 0.18em;
  color: var(--gold-dim);
  text-transform: uppercase;
}
.rune-divider::before,
.rune-divider::after {
  content: "";
  flex: 1;
  height: 1px;
}
.rune-divider::before { background: linear-gradient(90deg,  transparent, var(--gold-dim)); }
.rune-divider::after  { background: linear-gradient(270deg, transparent, var(--gold-dim)); }

/* ── Stone panel ─────────────────────────────────────────────────────────── */
.stone-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 28px 32px;
  box-shadow:
    0 0 50px rgba(60, 15, 120, 0.12),
    inset 0 0 80px rgba(0, 0, 0, 0.35);
}

.stone-panel.gold {
  border-color: var(--border-gold);
  box-shadow:
    0 0 40px var(--gold-glow),
    inset 0 0 60px rgba(0, 0, 0, 0.4);
}

/* ── Grid helpers ────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.portal-card {
  background: var(--stone-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.portal-card:hover {
  border-color: rgba(189, 142, 255, 0.5);
  box-shadow: 0 0 24px rgba(140, 70, 240, 0.2);
  transform: translateY(-2px);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a0f2e, #0f0a1e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: rgba(189, 142, 255, 0.3);
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 14px 16px;
}

.card-title {
  font-family: var(--font-header);
  font-size: 15px; /* was 13px */
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 4px;
}

.card-meta {
  font-family: var(--font-body);
  font-size: 13px; /* was 11px */
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Button ──────────────────────────────────────────────────────────────── */
.rune-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 26px;
  background: rgba(189, 142, 255, 0.08);
  border: 1px solid rgba(189, 142, 255, 0.45);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--font-header);
  font-size: 14px; /* was 12px */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
  text-decoration: none;
}
.rune-btn:hover {
  background: rgba(189, 142, 255, 0.18);
  box-shadow: 0 0 16px rgba(189, 142, 255, 0.25);
}
.rune-btn.gold {
  border-color: var(--border-gold);
  color: var(--gold);
  background: var(--gold-glow);
}
.rune-btn.gold:hover {
  background: rgba(201, 168, 76, 0.22);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.2);
}

/* ── Label / badge ───────────────────────────────────────────────────────── */
.rune-label {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-header);
  font-size: 12px; /* was 10px */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  background: var(--gold-glow);
}

/* ── Section heading ─────────────────────────────────────────────────────── */
.section-heading {
  font-family: var(--font-header);
  font-size: 15px; /* was 13px */
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

/* ── Empty / placeholder state ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 15px; /* was 13px */
  letter-spacing: 0.08em;
}
.empty-state .icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-title {
  font-family: var(--font-header);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 10px;
  display: block;
}

/* ── Upload zone ─────────────────────────────────────────────────────────── */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  border: 2px dashed rgba(189, 142, 255, 0.4);
  border-radius: 6px;
  background: rgba(10, 6, 22, 0.65);
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  margin-bottom: 36px;
}
.upload-zone.dragover,
.upload-zone:hover {
  border-color: rgba(189, 142, 255, 0.75);
  background: rgba(189, 142, 255, 0.05);
}
.upload-zone .upload-icon { font-size: 44px; opacity: 0.5; }
.upload-zone p {
  font-family: var(--font-header);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.upload-zone p.upload-or {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(230, 218, 245, 0.4);
  letter-spacing: 0.06em;
  text-transform: none;
}
.upload-zone input[type="file"] { display: none; }

/* ── Link add row ────────────────────────────────────────────────────────── */
.link-add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  align-items: stretch;
}
.link-add-row input {
  flex: 1;
  background: rgba(10, 6, 22, 0.7);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 16px;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.2s;
}
.link-add-row input::placeholder { color: var(--muted); opacity: 0.6; }
.link-add-row input:focus { border-color: rgba(189, 142, 255, 0.5); }
.link-add-row button {
  font-family: var(--font-header);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 22px;
  background: rgba(189, 142, 255, 0.1);
  border: 1px solid rgba(189, 142, 255, 0.45);
  border-radius: 3px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s;
  white-space: nowrap;
}
.link-add-row button:hover { background: rgba(189, 142, 255, 0.22); }

/* ── Link card ───────────────────────────────────────────────────────────── */
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--stone-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.link-card:hover { border-color: rgba(189, 142, 255, 0.4); }
.link-favicon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 3px;
  background: rgba(189, 142, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  overflow: hidden;
}
.link-favicon img { width: 100%; height: 100%; object-fit: cover; }
.link-info { flex: 1; min-width: 0; }
.link-title {
  font-family: var(--font-header);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.link-url {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.link-open {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.06em;
  opacity: 0.8;
  flex-shrink: 0;
  font-family: var(--font-header);
}
.link-open:hover { opacity: 1; }
.link-delete {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  padding: 0 4px;
  flex-shrink: 0;
  transition: opacity 0.18s;
}
.link-delete:hover { opacity: 1; }

/* ── Upload media grid ───────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.media-card {
  background: var(--stone-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.media-card:hover { border-color: rgba(189, 142, 255, 0.45); box-shadow: 0 0 18px rgba(100, 40, 200, 0.13); }
.media-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.media-thumb.video-thumb {
  background: #0a0616;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  aspect-ratio: 16/9;
}
.media-caption {
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-top: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: var(--danger);
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s;
}
.media-card:hover .media-delete { display: flex; }

/* ── Upload status bar ───────────────────────────────────────────────────── */
.upload-status {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 16px;
  min-height: 20px;
}
.upload-status.error { color: var(--danger); }
.upload-status.success { color: #8dffb2; }
