*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  background: #f5f2ec;
}

a { color: #c0392b; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
  background: #1a1a1a;
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.site-title a { color: white; font-size: 1.2rem; font-weight: bold; }
.site-title span { color: #c0392b; }
nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-left: auto; }
nav a { color: #ccc; font-size: 0.9rem; }
nav a:hover { color: white; text-decoration: none; }

/* Main */
main { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  color: #888;
  border-top: 1px solid #ddd;
  margin-top: 3rem;
  background: #1a1a1a;
  color: #aaa;
}
footer a { color: #c0392b; }

/* Home page */
.home h1 { font-size: 2rem; margin-bottom: 0.5rem; color: #1a1a1a; }
.home .tagline { color: #555; margin-bottom: 2rem; }
.home section { margin-top: 2rem; }
.home h2 { font-size: 1.1rem; font-weight: bold; margin-bottom: 0.5rem; color: #3d6b35; text-transform: uppercase; letter-spacing: 0.05em; }

/* Browse grid */
.browse-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.browse-grid a {
  background: #1a1a1a;
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: 3px;
  font-size: 0.9rem;
}
.browse-grid a:hover { background: #c0392b; text-decoration: none; }

/* Entity browser (Music, Film, etc.) */
.browser-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.browser-controls input {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 1rem;
  background: white;
}
.tier-filters { display: flex; gap: 0.4rem; }
.tier-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 20px;
  background: white;
  font-size: 0.85rem;
  cursor: pointer;
}
.tier-btn.active { background: #1a1a1a; color: white; border-color: #1a1a1a; }

/* Results table */
.results-count { font-size: 0.85rem; color: #888; margin-bottom: 0.75rem; }

.entity-list { width: 100%; border-collapse: collapse; }
.entity-list th {
  background: #1a1a1a;
  color: white;
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  font-weight: bold;
}
.entity-list td {
  padding: 0.6rem 0.75rem;
  vertical-align: top;
  font-size: 0.9rem;
  border-bottom: 1px solid #e8e8e4;
}
.entity-list tr:nth-child(even) td { background: #efefed; }
.entity-list tr:hover td { background: #e8e0d8; cursor: pointer; }

/* Watch button */
.watch-btn {
  display: inline-block;
  background: #c0392b;
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}
.tier-discussion { background: #c0392b; color: white; }
.tier-reference { background: #ddd; color: #444; }
.tier-namecheck { background: #f0f0f0; color: #999; font-style: italic; }

/* Inline YouTube embed */
.embed-row td {
  background: #1a1a1a !important;
  padding: 0 !important;
}
.embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.embed-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

@media (max-width: 600px) {
  nav { margin-left: 0; }
  .desktop-tier { display: none; }
  .entity-list th:nth-child(3) { display: none; }
}

@media (min-width: 601px) {
  .mobile-tier { display: none; }
}

/* Sortable headers */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { background: #2d4a6e; }
th.sort-asc::after { content: " ▲"; font-size: 0.75em; }
th.sort-desc::after { content: " ▼"; font-size: 0.75em; }

/* Tier tooltip */
.tier-info { position: relative; display: inline-block; margin-left: 0.5rem; cursor: help; color: #888; font-size: 0.9rem; }
.tier-info .tier-tooltip {
  display: none;
  position: absolute;
  left: 0; top: 2rem;
  background: #1a1a1a;
  color: #eee;
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  width: 280px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.tier-info:hover .tier-tooltip,
.tier-info.open .tier-tooltip { display: block; }

/* Logo */
.site-logo { height: 36px; width: auto; vertical-align: middle; margin-right: 0.5rem; }
 
/* Home hero */
.home-hero { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1rem; }
.home-logo { height: 80px; width: auto; flex-shrink: 0; }
@media (max-width: 600px) {
  .home-hero { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .home-logo { height: 60px; }
}
 
/* Footer links */
.footer-links { margin-bottom: 0.5rem; }
.footer-links a { color: #c0392b; margin: 0 0.25rem; }
.footer-copy { font-size: 0.8rem; color: #666; }


/* Support section */
.support-section { background: #1a1a1a; color: #eee; padding: 1.5rem; border-radius: 6px; margin-top: 2rem; }
.support-section h2 { color: #e8c068 !important; }
.support-intro { margin-bottom: 1rem; color: #ccc; }
.support-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.support-btn {
  background: #c0392b;
  color: white !important;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.95rem;
  text-decoration: none !important;
}
.support-btn:hover { background: #e74c3c; }
.support-fine-print { font-size: 0.8rem; color: #888; font-style: italic; }