/* ═══════════════════════════════════════════════════════════════
   MINEMEV — main_new.css
   Editorial-Gamer Dark Theme
   Fonts: Bebas Neue (display) · DM Sans (body) · JetBrains Mono (code/tags)
═══════════════════════════════════════════════════════════════ */

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --bg-base:       #0a0b0d;
  --bg-raised:     #111316;
  --bg-elevated:   #181a1f;
  --bg-hover:      #1e2028;
  --bg-input:      #13151a;

  --border:        rgba(255,255,255,.07);
  --border-accent: rgba(255,194,0,.35);

  --gold:          #ffc200;
  --gold-dim:      rgba(255,194,0,.12);
  --gold-glow:     rgba(255,194,0,.25);

  --text-primary:  #f0f1f3;
  --text-secondary:#8a8f9c;
  --text-muted:    #4e5260;

  --live-red:      #e53935;
  --live-pulse:    rgba(229,57,53,.45);

  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;

  --transition:    .2s cubic-bezier(.4,0,.2,1);

  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
}

/* ── Base resets ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

a { color: inherit; text-decoration: none; }

/* ── Utility: hidden ───────────────────────────────────────── */
.hidden { display: none !important; }


/* ═══════════════════════════════════════════════════════════
   LIVE STREAM SECTION
═══════════════════════════════════════════════════════════ */
.stream-wrapper {
  width: 100%;
  max-width: 75%;          /* ← constrains the width */
  margin-left: auto;       /* ← centers it */
  margin-right: auto;      /* ← centers it */
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  padding: 28px 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

/* Subtle noise texture overlay */
.stream-wrapper::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.stream-wrapper > * { position: relative; z-index: 1; }

/* Eyebrow bar */
.stream-wrapper__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.live-pip {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--live-red);
  box-shadow: 0 0 0 0 var(--live-pulse);
  animation: pulse-live 1.6s ease infinite;
  flex-shrink: 0;
}

@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0 var(--live-pulse); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.eyebrow-label { color: var(--live-red); font-weight: 600; }
.eyebrow-divider { color: var(--text-muted); }

/* Grid */
.stream-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: stretch;
}

/* Profile card */
.stream-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stream-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.6), 0 0 0 1px var(--border-accent);
}

.stream-card__avatar-wrap {
  position: relative;
}

.stream-card__avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  display: block;
  transition: transform var(--transition);
}

.stream-card__avatar:hover { transform: scale(1.06); }

.stream-card__badge {
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%);
  background: var(--live-red);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 2px 8px;
  border-radius: 20px;
  border: 2px solid var(--bg-elevated);
}

.stream-card__body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.stream-card__name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: .06em;
  color: var(--gold);
  line-height: 1;
}

.stream-card__status {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  background: rgba(255,255,255,.04);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  width: 100%;
}

.stream-card__viewers {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: var(--gold);
  font-weight: 600;
}

.stream-card__game {
  font-size: .78rem;
  font-style: italic;
  color: var(--text-muted);
}

.stream-card__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.ctrl-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.ctrl-btn svg { width: 14px; height: 14px; }

.ctrl-btn:hover {
  background: var(--gold-dim);
  border-color: var(--border-accent);
  color: var(--gold);
}

.ctrl-dots { display: flex; gap: 5px; }

.ctrl-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition), transform var(--transition);
}

.ctrl-dot--active {
  background: var(--gold);
  transform: scale(1.35);
}

/* Embed area */
.stream-embed {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

#twitch-embed,
#twitch-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
}

#youtube-embed {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#youtube-iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}


/* ═══════════════════════════════════════════════════════════
   EXPLORE PAGE
═══════════════════════════════════════════════════════════ */
.explore {
  background: var(--bg-base);
  min-height: 100vh;
}

/* Header */
.explore__header {
  padding: 40px 36px 0;
}

.explore__header-inner {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 18px;
}

.explore__eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.explore__eyebrow span { color: var(--gold); }

.explore__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  letter-spacing: .04em;
  color: var(--text-primary);
  line-height: 1;
}

.explore__header-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(255,194,0,.15) 40%, transparent 70%);
}

/* Body grid */
.explore__body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  align-items: start;
  padding: 0 0 60px;
}


/* ═══════════════════════════════════════════════════════════
   SIDEBAR / FILTER FORM
═══════════════════════════════════════════════════════════ */
.sidebar {
  padding: 4px;
  position: sticky;
  top: 60px;
}

#filterForm {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
}

/* Filter group */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Text input */
.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  padding: 9px 12px 9px 34px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.filter-input::placeholder { color: var(--text-muted); }

.filter-input:focus {
  border-color: var(--border-accent);
  background: #0f1115;
}

/* Select */
.select-wrap {
  position: relative;
}

.filter-select {
  width: 100%;
  appearance: none;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  padding: 9px 36px 9px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.filter-select:focus { border-color: var(--border-accent); }

.select-arrow {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Apply button */
.apply-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gold);
  color: #0a0b0d;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 0 0 var(--gold-glow);
}

.apply-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.apply-btn:hover {
  background: #ffce33;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--gold-glow);
}

.apply-btn:active { transform: translateY(0); }


/* ═══════════════════════════════════════════════════════════
   VERSION TREE
═══════════════════════════════════════════════════════════ */
#versionTree {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  max-height: 120px;
  overflow-y: auto;
  color: var(--text-secondary);

  /* Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #2e3038 transparent;
}

#versionTree::-webkit-scrollbar { width: 6px; }
#versionTree::-webkit-scrollbar-track { background: transparent; }
#versionTree::-webkit-scrollbar-thumb { background: #2e3038; border-radius: 3px; }
#versionTree::-webkit-scrollbar-thumb:hover { background: #3e4048; }

#versionTree details { margin-bottom: 2px; }

#versionTree summary,
#versionTree li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-size: .82rem;
  list-style: none;
  user-select: none;
}

#versionTree summary:hover,
#versionTree li:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

#versionTree summary.selected,
#versionTree li.selected {
  color: var(--gold);
}

.v-caret {
  width: 12px; height: 12px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition);
}

#versionTree details[open] > summary .v-caret {
  transform: rotate(90deg);
}

.v-icon { flex-shrink: 0; }

.v-icon--folder { color: var(--gold); width: 15px; height: 15px; }
.v-icon--file   { color: var(--text-muted); width: 14px; height: 14px; }

#versionTree li.selected .v-icon--file { color: var(--gold); }

.v-label { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: .75rem; }

/* Checkbox */
.v-check {
  appearance: none;
  width: 15px; height: 15px;
  margin-left: auto;
  flex-shrink: 0;
  border: 1.5px solid #3e4048;
  border-radius: 3px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.v-check:hover { border-color: var(--text-secondary); }

.v-check:checked {
  background: var(--gold);
  border-color: var(--gold);
}

.v-check:checked::after {
  content: '';
  position: absolute;
  top: 1px; left: 4px;
  width: 4px; height: 7px;
  border: 2px solid #0a0b0d;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

#versionTree ul {
  list-style: none;
  padding-left: 22px;
  margin: 2px 0;
}

/* ── Tag Tree ─────────────────────────────────────────────── */
.tag-tree {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  max-height: 150px;
  overflow-y: auto;
  color: var(--text-secondary);

  scrollbar-width: thin;
  scrollbar-color: #2e3038 transparent;
}

.tag-tree::-webkit-scrollbar { width: 6px; }
.tag-tree::-webkit-scrollbar-track { background: transparent; }
.tag-tree::-webkit-scrollbar-thumb { background: #2e3038; border-radius: 3px; }
.tag-tree::-webkit-scrollbar-thumb:hover { background: #3e4048; }

/* Node wrapper */
.tag-node { margin-bottom: 2px; }

/* Row — shared by both toggle-rows and leaf rows */
.tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition), color var(--transition);
  font-size: .82rem;
  list-style: none;
}

.tag-row:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tag-row.selected {
  color: var(--gold);
}

/* Caret */
.tag-toggle {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.tag-toggle.open { transform: rotate(90deg); }
.tag-toggle.empty { visibility: hidden; }

/* Thumbnail */
.tag-img {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
  color: var(--gold);        /* fallback for icon version */
}

/* Label */
.tag-name {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: inherit;
}

/* Count */
.tag-amount {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Children indent */
.tag-children {
  padding-left: 22px;
  margin: 2px 0;
  display: none;
}

.tag-children.open { display: block; }

/* ── Custom Checkbox ───────────────────────────────────────── */
.tag-checkbox {
  appearance: none;
  width: 15px;
  height: 15px;
  margin-left: auto;
  flex-shrink: 0;
  border: 1.5px solid #3e4048;
  border-radius: 3px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.tag-checkbox:hover { border-color: var(--text-secondary); }

.tag-checkbox:checked {
  background: var(--gold, #7c6fff);
  border-color: var(--gold, #7c6fff);
}

.tag-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 7px;
  border: 2px solid #0a0b0d;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* ── Search ────────────────────────────────────────────────── */
.tag-search-wrap {
  position: relative;
  margin-bottom: 8px;
}

.tag-search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted, #888);
  pointer-events: none;
}

.tag-search-input {
  width: 100%;
  padding: 6px 8px 6px 28px;
  background: var(--bg-input, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-primary, #eee);
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition);
}

.tag-search-input::placeholder { color: var(--text-muted, #888); }
.tag-search-input:focus { border-color: var(--gold, #7c6fff); }

/* ═══════════════════════════════════════════════════════════
   FEED / POST CONTAINER
═══════════════════════════════════════════════════════════ */
.feed {
  padding: 28px 36px 0 24px;
  min-width: 0;
}

#post_container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* ── Pagination ── */
.pagination {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.page-btn {
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.page-btn:hover {
  border-color: var(--border-accent);
  color: var(--gold);
  background: var(--gold-dim);
}

.page-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0b0d;
  font-weight: 700;
}


/* ═══════════════════════════════════════════════════════════
   TAG PILLS  (used inside post cards from posts_new.css)
═══════════════════════════════════════════════════════════ */
.tags-container {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  overflow: hidden;
  max-height: 28px;
  transition: max-height .35s ease;
}

.tags-container:hover { max-height: 160px; }

.tags-container a {
  white-space: nowrap;
  padding: 2px 8px;
  background: rgba(255,194,0,.08);
  border: 1px solid rgba(255,194,0,.2);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .04em;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.tags-container a:hover {
  color: var(--gold);
  background: rgba(255,194,0,.15);
  border-color: var(--border-accent);
}

/* Litematica icon badge */
.litematica-icon::before {
  content: '';
  position: absolute;
  top: 14px; left: 14px;
  width: 32px; height: 32px;
  background-image: url('https://redenmc.com/favicon.ico');
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}


.host-dialog__hero:nth-child(2) {
  display: block;
}
/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .stream-grid {
    grid-template-columns: 220px 1fr;
  }
}

@media (max-width: 900px) {


  .host-dialog__hero:nth-child(2) {
  display: block!important;}
  .host-dialog__hero:nth-child(1) {
  display: none;
  }
  .explore__body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 20px 20px 0;
  }

  .feed {
    padding: 20px 20px 0;
  }

  #filterForm {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .filter-group { flex: 1 1 180px; }

  .apply-btn { flex: 0 0 auto; align-self: flex-end; }
}

@media (max-width: 700px) {
  .stream-wrapper {padding: 20px 16px;max-width: 100%;   /* ← full width on mobile */}
  .stream-grid { grid-template-columns: 1fr; }
  .stream-embed { aspect-ratio: 16/9; }

  .explore__header { padding: 28px 16px 0; }

  .explore__title { font-size: 3rem; }

  .sidebar, .feed { padding-left: 16px; padding-right: 16px; }

  #post_container {
    grid-template-columns: 1fr;
  }

  #filterForm {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .tags-container a { font-size: .62rem; padding: 1px 6px; }
  .explore__title { font-size: 2.4rem; }
}
