:root {
  --bg: #131114;
  --bg-raised: #1c191d;
  --text: #ece7e9;
  --text-dim: #9c9498;
  --accent: #b23a5c;
  --accent-soft: #7a2a41;
  --border: #322d31;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

/* ---------- Age gate ---------- */
#age-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.age-gate-box {
  max-width: 460px;
  text-align: center;
}
.age-gate-box h1 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.age-gate-box p {
  color: var(--text-dim);
  font-size: 0.95rem;
}
.age-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0;
}
.age-gate-actions button,
.age-gate-actions a {
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
#age-yes {
  background: var(--accent);
  color: #fff;
}
#age-no {
  background: transparent;
  border: 1px solid var(--border) !important;
  color: var(--text-dim);
}
.age-gate-fine a { color: var(--text-dim); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand {
  font-weight: 600;
  font-size: 1.1rem;
  margin-right: auto;
}
.tabs, .sort-toggle {
  display: flex;
  gap: 8px;
}
.tab, .sort {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}
.tab.active, .sort.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 24px;
}
.card {
  background: var(--bg-raised);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
}
.card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: #000;
}
.card .card-title {
  padding: 10px 12px;
  font-size: 0.9rem;
}
.empty-msg {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 0;
}

/* ---------- Player modal ---------- */
#player-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 24px;
}
.player-box {
  background: var(--bg-raised);
  border-radius: 8px;
  max-width: 900px;
  width: 100%;
  padding: 16px;
  position: relative;
}
#player-mount video, #player-mount iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 6px;
  background: #000;
}
#player-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 12px 4px 4px;
}
#player-close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Admin ---------- */
.admin-box {
  max-width: 480px;
  margin: 60px auto;
  padding: 0 20px;
}
.admin-box h1 { font-size: 1.3rem; }
.admin-box label {
  display: block;
  margin: 14px 0 4px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.admin-box input, .admin-box select {
  width: 100%;
  padding: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
}
.admin-box button {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.admin-error {
  color: #e0899e;
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 1.2em;
}
.admin-list {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.admin-list-item button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  width: auto;
  margin: 0;
}
