:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --bg: #070b14;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.78);
  --line: rgba(148, 163, 184, 0.2);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 10% 10%, #1e1b4b 0, transparent 40%),
    radial-gradient(circle at 85% 20%, #0f766e 0, transparent 35%),
    linear-gradient(160deg, #030712, #0b1120 55%, #020617);
}

.background-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 80% 75%, rgba(124, 58, 237, 0.18), transparent 40%);
  z-index: 0;
}

.header,
.container {
  position: relative;
  z-index: 1;
}

.header {
  text-align: center;
  padding: 2.2rem 1rem 1.2rem;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-size: 0.78rem;
}

.header h1 {
  margin: 0.45rem 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.admin-link {
  display: inline-block;
  margin-top: 0.9rem;
  text-decoration: none;
  color: #bfdbfe;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  transition: 0.2s;
}

.admin-link:hover {
  border-color: var(--accent-2);
  color: #fff;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.container.narrow {
  max-width: 700px;
}

.panel {
  backdrop-filter: blur(8px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  padding: 1rem;
}

.status-panel {
  display: none;
  border-left: 4px solid var(--accent-2);
}

.status-panel.visible {
  display: block;
}

.status-panel.error {
  border-left-color: var(--danger);
  background: rgba(127, 29, 29, 0.35);
}

.admin-header,
.film-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.auth-status,
#pageInfo {
  font-size: 0.92rem;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

input {
  background: #0b1224;
  color: var(--text);
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

input:focus-visible,
button:focus-visible,
.admin-link:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 0.68rem 1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), #4f46e5);
  color: #fff;
}

button.secondary {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid var(--line);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

.films-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1rem;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b1224;
  position: relative;
  transform: translateY(0);
  transition: transform 0.2s ease, border-color 0.2s ease;

  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.55);
}

.rank {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  font-size: 0.78rem;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #a5f3fc;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.card img {
  width: 100%;
  height: 265px;
  object-fit: cover;
  background: #1e293b;
}

.card-body {
  padding: 0.78rem;

  display: flex;
  flex-direction: column;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
}

.release-date,
.countdown,
.empty-state {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

.release-date,
.empty-state {
  color: var(--muted);
}

.countdown {
  font-weight: 700;
  color: #a5b4fc;
}


.platform-text {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.platform-text strong {
  color: var(--text);
  font-weight: 700;
}

.pagination {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .card img {
    height: 230px;
  }
}

/* ── Site Navigation ── */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  transition: 0.2s;
  letter-spacing: 0.02em;
}

.nav-link:hover {
  border-color: var(--accent-2);
  color: #fff;
}

.nav-link.active {
  background: linear-gradient(120deg, var(--accent), #4f46e5);
  border-color: transparent;
  color: #fff;
}

/* ── Theme: Game (green accent) ── */
body.theme-game {
  background: radial-gradient(circle at 10% 10%, #14291b 0, transparent 40%),
    radial-gradient(circle at 85% 20%, #065f46 0, transparent 35%),
    linear-gradient(160deg, #030712, #071210 55%, #020617);
}

body.theme-game .nav-link.active {
  background: linear-gradient(120deg, #059669, #047857);
}

body.theme-game .countdown {
  color: #6ee7b7;
}

body.theme-game .rank {
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

body.theme-game .card:hover {
  border-color: rgba(52, 211, 153, 0.55);
}

/* ── Theme: Album (pink accent) ── */
body.theme-album {
  background: radial-gradient(circle at 10% 10%, #2d1b2e 0, transparent 40%),
    radial-gradient(circle at 85% 20%, #7c1d6f 0, transparent 35%),
    linear-gradient(160deg, #030712, #130a17 55%, #020617);
}

body.theme-album .nav-link.active {
  background: linear-gradient(120deg, #db2777, #9d174d);
}

body.theme-album .countdown {
  color: #f9a8d4;
}

body.theme-album .rank {
  border-color: rgba(244, 114, 182, 0.4);
  color: #f9a8d4;
}

body.theme-album .card:hover {
  border-color: rgba(244, 114, 182, 0.55);
}

body.theme-album .card img.album-cover {
  height: 185px;
  object-fit: cover;
  border-radius: 4px 4px 0 0;
}

.artist-name {
  font-weight: 600;
  color: var(--text) !important;
  font-size: 0.88rem !important;
}

/* ── Admin Tabs ── */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: 0.2s;
}

.tab-btn.active {
  background: linear-gradient(120deg, var(--accent), #4f46e5);
  border-color: transparent;
  color: #fff;
}

.form-title {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

/* ── Ad Card ── */
.ad-card {
  border: 1px dashed rgba(148, 163, 184, 0.3) !important;
  background: rgba(15, 23, 42, 0.5) !important;
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.ad-card:hover {
  border-color: rgba(148, 163, 184, 0.5) !important;
  transform: none !important;
}

.ad-label {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  font-size: 0.68rem;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 2;
}

.ad-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.ad-placeholder {
  text-align: center;
}

.ad-placeholder-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.6rem;
  opacity: 0.5;
}

.ad-placeholder-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
}

.ad-placeholder-sub {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.55);
}

/* ── Theme: All Categories (orange accent) ── */
body.theme-all {
  background: radial-gradient(circle at 10% 10%, #1a1200 0, transparent 40%),
    radial-gradient(circle at 85% 20%, #7c2d12 0, transparent 35%),
    linear-gradient(160deg, #030712, #120a01 55%, #020617);
}

body.theme-all .nav-link.active {
  background: linear-gradient(120deg, #ea580c, #c2410c);
}

body.theme-all .countdown { color: #fed7aa; }
body.theme-all .rank { border-color: rgba(251,146,60,0.4); color: #fed7aa; }
body.theme-all .card:hover { border-color: rgba(251,146,60,0.55); }

/* ── Category Badge (all.html) ── */
.cat-badge {
  position: absolute;
  top: 0.55rem; right: 0.55rem;
  z-index: 2;
  font-size: 0.68rem; font-weight: 700;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}

.cat-film  { background: rgba(124,58,237,0.85); color: #ddd6fe; }
.cat-game  { background: rgba(5,150,105,0.85);  color: #a7f3d0; }
.cat-album { background: rgba(219,39,119,0.85); color: #fce7f3; }

/* ── Real Ad Card (with image from Firestore) ── */
.ad-real {
  text-decoration: none;
  color: var(--text);
  display: block;
  cursor: pointer;
}

.ad-real:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(251, 191, 36, 0.6) !important;
}

.ad-banner-img {
  width: 100%;
  height: 245px;
  object-fit: cover;
  background: #1e293b;
  display: block;
}

.ad-copy-text {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Live Ad Card (dari Firestore) ── */
.ad-card--live {
  text-decoration: none;
  color: inherit;
  display: block;
}
.ad-card--live:hover { transform: translateY(-4px); border-color: rgba(34,211,238,0.55) !important; }
.ad-banner-img {
  width: 100%; height: 265px; object-fit: cover; background: #1e293b;
}
.ad-title {
  margin: 0; font-size: 1rem; font-weight: 700;
}
.ad-copy {
  margin: 0.4rem 0 0; font-size: 0.82rem; color: var(--muted);
}

/* ── Card Accordion ── */
.card {
  cursor: pointer;
}
.card-details {
  display: none;
  border-top: 1px solid rgba(148,163,184,.15);
  margin-top: .75rem;
  padding-top: .75rem;
}
.card.expanded .card-details {
  display: block;
}
.card-detail-row {
  display: flex;
  gap: .5rem;
  margin-bottom: .45rem;
  font-size: .82rem;
  line-height: 1.4;
}
.card-detail-label {
  color: var(--muted);
  min-width: 80px;
  flex-shrink: 0;
  font-weight: 600;
}
.card-detail-value {
  color: var(--text);
}
.card-trailer-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .5rem;
  padding: .4rem .85rem;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.35);
  border-radius: 999px;
  color: #f87171;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.card-trailer-btn:hover {
  background: rgba(239,68,68,.25);
}
.card-expand-hint {
  font-size: .72rem;
  color: var(--muted);
  margin-top: .5rem;
  opacity: .7;
}
.card.expanded .card-expand-hint {
  display: none;
}

/* ── Modal Detail ── */
.kr-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.kr-modal-overlay.open {
  display: flex;
}
.kr-modal {
  background: #0f1829;
  border: 1px solid rgba(124,58,237,.35);
  border-radius: 20px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.kr-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 50%;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  flex-shrink: 0;
}
.kr-modal-close:hover { background: rgba(255,255,255,.15); color: #e2e8f0; }
.kr-modal-top {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 1.25rem;
  padding: 1.5rem;
}
.kr-modal-poster {
  width: 140px;
  height: 196px;
  object-fit: cover;
  border-radius: 12px;
  background: #1e293b;
}
.kr-modal-info {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.kr-modal-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: rgba(124,58,237,.2);
  color: #a78bfa;
  width: fit-content;
}
.kr-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #e2e8f0;
  margin: 0;
  line-height: 1.3;
}
.kr-modal-artist {
  font-size: .9rem;
  color: #94a3b8;
}
.kr-modal-release {
  font-size: .85rem;
  color: #06b6d4;
  font-weight: 600;
}
.kr-modal-platform {
  font-size: .82rem;
  color: #64748b;
}
.kr-modal-countdown {
  font-size: .82rem;
  color: #a78bfa;
  margin-top: .25rem;
}
.kr-modal-video {
  background: #070b14;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(239,68,68,.2);
}
.kr-modal-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.kr-modal-no-trailer {
  color: #475569;
  font-size: .82rem;
  text-align: center;
}
.kr-modal-details {
  border-top: 1px solid rgba(148,163,184,.1);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem .5rem;
}
.kr-modal-row {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.kr-modal-row.full {
  grid-column: 1 / -1;
}
.kr-modal-lbl {
  font-size: .72rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.kr-modal-val {
  font-size: .88rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 640px) {
  .kr-modal-top {
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    padding: 1.25rem 1rem;
  }
  .kr-modal-poster {
    width: 100px;
    height: 140px;
  }
  .kr-modal-video {
    grid-column: 1 / -1;
    margin-top: .5rem;
  }
  .kr-modal-details {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .kr-modal-row.full { grid-column: 1; }
  .kr-modal-title { font-size: 1rem; }
}

/* Remove old accordion styles interference */
.card { cursor: pointer; }
.card-details { display: none !important; }
.card-hint-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: auto;
  padding: .65rem .75rem .75rem;
  width: 100%;
  box-sizing: border-box;
}
.card-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: .45rem .5rem;
  border-radius: 8px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .2s;
  white-space: nowrap;
}
.card-btn-trailer {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.28);
  color: #f87171;
}
.card-btn-trailer:hover {
  background: rgba(239,68,68,.22);
}
.card-btn-detail {
  background: rgba(124,58,237,.1);
  border: 1px solid rgba(124,58,237,.25);
  color: #a78bfa;
}
.card-btn-detail:hover {
  background: rgba(124,58,237,.2);
}


/* ── Badges ── */

/* ── Poster wrap for badge overlay ── */
.poster-wrap {
  position: relative;
  overflow: hidden;
}
.poster-wrap img {
  display: block;
  width: 100%;
}
/* ── Badge Strip Overlay Bottom of Poster ── */
.card-badge-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
}
.badge-hype {
  background: linear-gradient(0deg, rgba(249,115,22,.85), rgba(249,115,22,.4));
  color: #fff7ed;
}
.badge-editor {
  background: linear-gradient(0deg, rgba(124,58,237,.85), rgba(124,58,237,.4));
  color: #ede9fe;
}
.badge-icon-hype {
  font-size: 11px;
  display: inline-block;
  animation: krFlicker 1.5s infinite;
  transform-origin: bottom center;
}
@keyframes krFlicker {
  0%   { transform: rotate(-3deg) scale(1); }
  20%  { transform: rotate(2deg) scale(1.05); }
  40%  { transform: rotate(-2deg) scale(.97); }
  60%  { transform: rotate(3deg) scale(1.03); }
  80%  { transform: rotate(-1deg) scale(1); }
  100% { transform: rotate(-3deg) scale(1); }
}
.badge-icon-editor {
  font-size: 11px;
  display: inline-block;
  animation: krStarPulse 2s infinite;
}
@keyframes krStarPulse {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 3px #7c3aed); }
  50% { opacity: .5; filter: none; }
}

/* ── Rating Grid (modal) ── */
.kr-ratings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.kr-rating-item {
  background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.15);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 70px;
  text-decoration: none;
  transition: background .2s;
  cursor: default;
}
a.kr-rating-item {
  cursor: pointer;
}
a.kr-rating-item:hover {
  background: rgba(124,58,237,.18);
}
.kr-rating-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kr-rating-source {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 700;
}
.kr-rating-arrow {
  color: #7c3aed;
  font-size: 11px;
}
.kr-rating-score {
  font-size: 20px;
  font-weight: 800;
  color: #e2e8f0;
  margin-top: 4px;
}
.kr-rating-score.large {
  font-size: 24px;
}
.kr-rating-quote {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  font-style: italic;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .kr-ratings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
