/* ============================================================
   DRAGONFILM - Main Stylesheet
   Quiet luxury palette - graphite, ivory, champagne
   ============================================================ */

:root {
  --green: #d8bd7a;
  --green-dim: #a98d55;
  --green-dark: #2b261c;
  --green-glow: rgba(216, 189, 122, 0.28);
  --green-glow-sm: rgba(216, 189, 122, 0.11);
  --accent-sage: #8fa99a;
  --accent-steel: #8aa0b4;
  --accent-ink: #14110a;
  --bg: #090a0c;
  --bg2: #101215;
  --bg3: #171a1e;
  --bg4: #20242a;
  --card-bg: #121519;
  --surface: #191d22;
  --border: rgba(216, 189, 122, 0.18);
  --border-strong: rgba(216, 189, 122, 0.42);
  --text: #f0eee8;
  --text-dim: #b9b3a7;
  --text-muted: #7c766d;
  --white: #fbfaf6;
  --radius: 12px;
  --radius-lg: 18px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-ios: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-ios);
  --font-title: var(--font-ios);
  --font-body: var(--font-ios);
  --header-h: 82px;
}

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

html { scroll-behavior: smooth; width: 100%; max-width: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  width: 100%;
  max-width: 100%;
}

.is-hidden {
  display: none !important;
}

.filtered-view {
  padding-top: 24px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--green-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

/* ---- Page transition ---- */
.page-enter { animation: fadeInUp 0.5s var(--transition) both; }
@keyframes fadeInUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-h);
  background: rgba(9, 10, 12, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 16px;
  min-width: 0;
}

header > * { min-width: 0; }

.logo-wrap { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-wrap img {
  width: 230px;
  height: auto;
  max-width: 240px;
  max-height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--green-glow));
}
.logo-text { font-family: var(--font-display); font-size: 22px; color: var(--green); display: none; }

nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
nav a {
  font-family: var(--font-title); font-weight: 600; font-size: 14px;
  color: var(--text-dim); text-decoration: none;
  padding: 6px 12px; border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
nav a:hover, nav a.active { color: var(--green); background: var(--green-glow-sm); }

.header-search {
  flex: 1 1 auto; min-width: 0; max-width: 360px; margin-left: auto;
  display: flex; align-items: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 24px; padding: 0 14px; gap: 8px;
  transition: var(--transition);
  position: relative;
}
.header-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow-sm); }
.header-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font-body); font-size: 14px;
  padding: 8px 0;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search button { background: none; border: none; cursor: pointer; color: var(--text-dim); display: flex; align-items: center; }
.header-search button:hover { color: var(--green); }

.search-popup {
  position: absolute;
  z-index: 120;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: min(460px, 70vh);
  overflow: auto;
  padding: 8px;
  background: rgba(20, 20, 20, 0.98);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.search-popup[hidden] { display: none; }
.search-popup-wide { border-radius: 10px; }
.search-popup-state {
  padding: 14px 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.search-popup-list {
  display: grid;
  gap: 4px;
}
.search-popup-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}
.search-popup-item:hover,
.search-popup-item:focus-visible {
  background: var(--green-glow-sm);
  outline: none;
}
.search-popup-poster {
  width: 46px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg2);
}
.search-popup-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
}
.search-popup-main {
  min-width: 0;
}
.search-popup-title {
  display: block;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-popup-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-popup-source {
  align-self: start;
  margin-top: 4px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}
.search-popup-more {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--green);
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
}
.search-popup-more:hover { border-color: var(--green); background: var(--green-glow-sm); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; flex-shrink: 0; }
.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 50%; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); font-size: 16px;
  text-decoration: none;
}
.btn-icon:hover { border-color: var(--green); color: var(--green); background: var(--green-glow-sm); }

.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green-dark); border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 700; font-size: 14px;
  color: var(--green); cursor: pointer;
  box-shadow: 0 0 12px var(--green-glow);
}

.menu-toggle {
  display: none; background: none; border: none; color: var(--text); cursor: pointer; font-size: 22px;
}

/* ---- Mobile nav ---- */
.mobile-nav {
  display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
  background: rgba(16, 18, 21, 0.97); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); z-index: 999;
  padding: 12px 16px;
  flex-direction: column; gap: 4px;
}
.mobile-nav.open { display: flex; animation: slideDown 0.25s ease both; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav a {
  font-family: var(--font-title); font-weight: 600; font-size: 16px;
  color: var(--text-dim); text-decoration: none;
  padding: 10px 14px; border-radius: 8px;
  transition: var(--transition);
}
.mobile-nav a:hover, .mobile-nav a.active { color: var(--green); background: var(--green-glow-sm); }

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
main { padding-top: var(--header-h); min-height: 100vh; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero {
  position: relative; height: 520px; overflow: hidden;
  background: var(--bg2);
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.8s ease;
}
.hero-slide.active { opacity: 1; }
.hero-bg {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.45) saturate(1.2);
}
.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(9,10,12,0.95) 0%, rgba(9,10,12,0.58) 52%, transparent 100%),
              linear-gradient(0deg, rgba(9,10,12,1) 0%, transparent 42%);
}
.hero-content {
  position: absolute; bottom: 60px; left: 60px; right: 50%;
  animation: heroFadeIn 0.6s ease both;
}
@keyframes heroFadeIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

.hero-badge {
  display: inline-block;
  font-family: var(--font-title); font-size: 11px; font-weight: 700;
  background: var(--green); color: var(--accent-ink); padding: 3px 10px; border-radius: 4px;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(32px, 5vw, 60px);
  color: var(--white); line-height: 1; margin-bottom: 12px;
  text-shadow: 0 0 30px rgba(0,0,0,0.8);
}
.hero-meta {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  font-family: var(--font-title); font-size: 13px; color: var(--text-dim);
}
.hero-meta .year, .hero-meta .cat {
  background: rgba(255,255,255,0.08); padding: 2px 8px; border-radius: 4px;
}
.hero-rating { color: var(--green); font-weight: 700; }
.hero-desc {
  font-size: 14px; color: var(--text-dim); margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 12px; }

.btn-primary {
  display: flex; align-items: center; gap: 8px;
  background: var(--green); color: var(--accent-ink);
  font-family: var(--font-title); font-weight: 700; font-size: 15px;
  border: none; border-radius: 8px; padding: 10px 22px;
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 0 20px var(--green-glow);
}
.btn-primary:hover { background: #e6ca85; box-shadow: 0 0 32px var(--green-glow); transform: translateY(-2px); }

.btn-secondary {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1); color: var(--white);
  font-family: var(--font-title); font-weight: 600; font-size: 15px;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 10px 22px;
  cursor: pointer; text-decoration: none;
  transition: var(--transition); backdrop-filter: blur(4px);
}
.btn-secondary:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }

.hero-dots {
  position: absolute; bottom: 20px; left: 60px;
  display: flex; gap: 6px;
}
.hero-dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.3);
  cursor: pointer; transition: var(--transition);
}
.hero-dot.active { width: 24px; background: var(--green); }

.hero-arrows {
  position: absolute; right: 20px; bottom: 50%;
  transform: translateY(50%);
  display: flex; flex-direction: column; gap: 8px;
}
.hero-arrow {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: white; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); backdrop-filter: blur(4px);
}
.hero-arrow:hover { background: var(--green); border-color: var(--green); color: var(--accent-ink); }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section { padding: 40px 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.section-title {
  font-family: var(--font-display); font-size: 28px; color: var(--white);
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ''; display: block;
  width: 4px; height: 28px;
  background: var(--green); border-radius: 2px;
  box-shadow: 0 0 8px var(--green-glow);
}
.section-more {
  font-family: var(--font-title); font-size: 13px; font-weight: 600;
  color: var(--green); text-decoration: none;
  display: flex; align-items: center; gap: 4px;
  transition: var(--transition);
}
.section-more:hover { gap: 8px; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; align-items: center;
}
.genre-filter-bar { margin-top: 32px; }
.filter-label { font-family: var(--font-title); font-size: 13px; color: var(--text-muted); font-weight: 600; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--font-title); font-size: 13px; font-weight: 600;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-dim); padding: 5px 14px; border-radius: 20px;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.active { background: var(--green); color: var(--accent-ink); border-color: var(--green); box-shadow: 0 0 10px var(--green-glow); }
.chip-more {
  display: inline-flex; align-items: center; gap: 6px;
  border-color: var(--border-strong);
  color: var(--green);
  background: linear-gradient(135deg, rgba(216,189,122,0.14), rgba(255,255,255,0.03));
}
.chip-more.active .chip-caret { transform: rotate(180deg); }
.chip-caret { display: inline-block; transition: var(--transition); }
.all-genres-panel {
  margin: -14px 0 28px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(25,29,34,0.98), rgba(16,18,21,0.98));
  box-shadow: 0 18px 45px rgba(0,0,0,0.32), 0 0 24px var(--green-glow-sm);
}
.all-genres-panel[hidden] { display: none !important; }
.all-genres-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.all-genres-title {
  font-family: var(--font-title); font-size: 16px; font-weight: 800;
  color: var(--white); letter-spacing: 0.2px;
}
.all-genres-status,
.all-genres-current {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.all-genres-current { color: var(--green); }
.all-genres-close {
  background: var(--bg3); color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-family: var(--font-title); font-weight: 700; transition: var(--transition);
}
.all-genres-close:hover { border-color: var(--green); color: var(--green); }
.all-genres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}
.all-genres-grid .chip {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  border-radius: 12px;
}

.home-search-row { margin-bottom: 28px; }
.home-search {
  max-width: 100%;
  border-radius: 10px;
  padding: 4px 16px;
}
.home-search-input {
  padding: 10px 0;
  font-size: 15px;
}

.result-info {
  font-family: var(--font-title);
  font-size: 13px;
  color: var(--text-muted);
}

.server-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 20px;
  flex-wrap: wrap;
}
.server-label { font-family: var(--font-title); font-weight: 700; font-size: 13px; color: var(--text-muted); }
.server-btn {
  font-family: var(--font-title); font-size: 13px; font-weight: 700;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-dim); padding: 5px 14px; border-radius: 6px;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.server-btn:hover { border-color: var(--green); color: var(--green); }
.server-btn.active { background: var(--green-dark); border-color: var(--green); color: var(--green); }
.server-btn.has-movie { border-color: rgba(216,189,122,0.55); color: var(--green); }
.server-btn.no-movie,
.server-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* ============================================================
   WEEKLY RANKINGS
   ============================================================ */
.weekly-rankings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 8px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18,21,25,0.94), rgba(12,14,17,0.94));
  overflow: hidden;
}

.weekly-rank-panel {
  min-width: 0;
  padding: 12px 14px 10px;
}

.weekly-rank-panel + .weekly-rank-panel {
  border-left: 1px solid rgba(216,189,122,0.12);
}

.weekly-rank-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.weekly-rank-source {
  flex: 0 0 auto;
  border: 1px solid rgba(216,189,122,0.26);
  border-radius: 6px;
  background: rgba(216,189,122,0.11);
  color: var(--green);
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 6px;
}

.weekly-rank-source.anilist {
  color: var(--accent-steel);
  border-color: rgba(138,160,180,0.34);
  background: rgba(138,160,180,0.11);
}

.weekly-rank-source.season {
  color: var(--accent-sage);
  border-color: rgba(143,169,154,0.34);
  background: rgba(143,169,154,0.11);
}

.weekly-rank-source.korea {
  color: #f0c98c;
  border-color: rgba(240,201,140,0.34);
  background: rgba(240,201,140,0.11);
}

.weekly-rank-source.china {
  color: #f28f8f;
  border-color: rgba(242,143,143,0.34);
  background: rgba(242,143,143,0.11);
}

.weekly-rank-head h2 {
  color: var(--white);
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

.weekly-rank-head p {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.2;
  margin-top: 2px;
}

.weekly-rank-list {
  display: grid;
  gap: 4px;
}

.weekly-rank-row {
  display: grid;
  grid-template-columns: 24px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 3px 5px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  transition: var(--transition);
  width: 100%;
}

.weekly-rank-row:hover {
  background: rgba(216,189,122,0.07);
  color: var(--white);
}

.weekly-rank-row:disabled {
  cursor: wait;
  opacity: 0.78;
}

.weekly-rank-no {
  color: var(--text-muted);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.weekly-rank-poster {
  width: 24px;
  height: 32px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg3);
  border: 1px solid rgba(255,255,255,0.06);
}

.weekly-rank-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.weekly-rank-poster-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
}

.weekly-rank-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.weekly-rank-copy strong {
  color: currentColor;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-rank-copy em {
  color: var(--text-muted);
  font-size: 9px;
  font-style: normal;
}

.weekly-rank-score {
  border-radius: 999px;
  background: rgba(216,189,122,0.1);
  border: 1px solid rgba(216,189,122,0.22);
  color: var(--green);
  font-family: var(--font-title);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 6px;
}

.weekly-rank-empty,
.weekly-rank-loading {
  color: var(--text-muted);
  font-size: 12px;
  padding: 12px 6px;
}

.weekly-rank-more {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  padding: 7px 8px;
  transition: var(--transition);
}

.weekly-rank-more:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-glow-sm);
}

body.modal-open {
  overflow: hidden;
}

.ranking-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2200;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0,0,0,0.76);
  backdrop-filter: blur(10px);
}

.ranking-modal-overlay[hidden] {
  display: none !important;
}

.ranking-modal-overlay.open {
  display: flex;
  animation: fadeIn 0.18s ease both;
}

.ranking-modal {
  width: min(720px, 100%);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18,21,25,0.98), rgba(11,13,16,0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 34px 90px rgba(0,0,0,0.76), 0 0 44px var(--green-glow-sm);
  animation: modalIn 0.22s ease both;
}

.ranking-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.ranking-modal-title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.ranking-modal-source {
  flex: 0 0 auto;
}

.ranking-modal h2 {
  color: var(--white);
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}

.ranking-modal p {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.ranking-modal-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg3);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: var(--transition);
}

.ranking-modal-close:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-glow-sm);
}

.ranking-modal-list {
  display: grid;
  gap: 7px;
  overflow-y: auto;
  padding: 12px;
}

.ranking-modal-list .weekly-rank-row {
  grid-template-columns: 34px 44px minmax(0, 1fr) auto;
  min-height: 58px;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(216,189,122,0.08);
  background: rgba(255,255,255,0.025);
}

.ranking-modal-list .weekly-rank-row:hover {
  border-color: rgba(216,189,122,0.28);
}

.ranking-modal-list .weekly-rank-no {
  font-size: 14px;
}

.ranking-modal-list .weekly-rank-poster {
  width: 40px;
  height: 54px;
  border-radius: 6px;
}

.ranking-modal-list .weekly-rank-copy strong {
  font-size: 14px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ranking-modal-list .weekly-rank-copy em {
  font-size: 11px;
}

.ranking-modal-list .weekly-rank-score {
  font-size: 10px;
  padding: 5px 7px;
}

/* ============================================================
   MOVIE GRID & CARDS
   ============================================================ */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}

.movie-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--card-bg); border: 1px solid var(--border);
  cursor: pointer; text-decoration: none; display: block;
  transition: var(--transition);
  transform: translateZ(0);
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}
.movie-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--green);
  box-shadow: 0 16px 40px rgba(0,0,0,0.6), 0 0 20px var(--green-glow-sm);
}

.movie-poster {
  position: relative; aspect-ratio: 2/3; overflow: hidden;
}
.movie-poster img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
  backface-visibility: hidden;
}
.movie-card:hover .movie-poster img { transform: scale(1.08); }

.movie-poster-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-muted); font-size: 32px;
}
.movie-poster-placeholder span { font-family: var(--font-title); font-size: 11px; text-align: center; padding: 0 8px; }

.movie-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(9,10,12,0.9) 0%, transparent 54%);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition);
}
.movie-card:hover .movie-overlay { opacity: 1; }

.play-btn-overlay {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green); color: var(--accent-ink); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px var(--green-glow);
  transform: scale(0.8); transition: transform 0.3s ease;
}
.movie-card:hover .play-btn-overlay { transform: scale(1); }

.movie-badge {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--font-title); font-size: 10px; font-weight: 700;
  background: var(--green); color: var(--accent-ink); padding: 2px 8px; border-radius: 4px;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.movie-badge.ep { background: var(--accent-sage); color: #07100c; }
.movie-badge.movie { background: var(--accent-steel); color: #071018; }

.movie-quality {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--font-title); font-size: 10px; font-weight: 700;
  background: rgba(0,0,0,0.7); color: var(--green);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--green-dim);
}

.movie-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: flex;
  gap: 5px;
  opacity: 0;
  transform: translateY(4px);
  transition: var(--transition);
}

.movie-card:hover .movie-actions {
  opacity: 1;
  transform: translateY(0);
}

.movie-action-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  background: rgba(0,0,0,0.58);
  color: var(--white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  transition: var(--transition);
}

.movie-action-btn:hover,
.movie-action-btn.active {
  border-color: var(--green);
  background: var(--green);
  color: var(--accent-ink);
}

.movie-info { padding: 10px 10px 12px; }
.movie-title {
  font-family: var(--font-title); font-weight: 700; font-size: 14px;
  color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 4px;
}
.movie-card:hover .movie-title { color: var(--green); }
.movie-rank-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}
.rank-chip,
.rating-chip {
  border-radius: 4px;
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 6px;
}
.rank-chip {
  background: var(--green);
  color: var(--accent-ink);
}
.rating-chip {
  background: rgba(216,189,122,0.1);
  border: 1px solid rgba(216,189,122,0.28);
  color: var(--green);
}
.movie-sub {
  font-size: 11px; color: var(--text-muted);
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.movie-sub .dot { color: var(--text-muted); }
.movie-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}
.source-chip {
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--green);
  background: rgba(216,189,122,0.08);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 5px;
}

/* ============================================================
   LOADING & EMPTY
   ============================================================ */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.skeleton-card { border-radius: var(--radius); overflow: hidden; }
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-poster { aspect-ratio: 2/3; }
.skeleton-line { height: 12px; border-radius: 4px; margin: 8px 10px; }
.skeleton-line.short { width: 60%; }

.empty-state {
  text-align: center; padding: 80px 20px; color: var(--text-muted);
}
.empty-state .icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-title); font-size: 20px; margin-bottom: 8px; color: var(--text-dim); }
.empty-state p { font-size: 14px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 40px; flex-wrap: wrap;
}
.page-btn {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer;
  font-family: var(--font-title); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn.active { background: var(--green); border-color: var(--green); color: var(--accent-ink); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-gap {
  color: var(--text-muted);
  padding: 0 4px;
}

/* ============================================================
   MODAL (Login / Register)
   ============================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
  align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: calc(var(--header-h) + 18px) 20px 24px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8), 0 0 40px var(--green-glow-sm);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modalIn { from { transform: scale(0.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.modal-title { font-family: var(--font-display); font-size: 30px; color: var(--white); }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 22px; }
.modal-close:hover { color: var(--text); }

.modal-tabs { display: flex; gap: 0; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.modal-tab {
  flex: 1; background: none; border: none;
  font-family: var(--font-title); font-weight: 700; font-size: 16px;
  color: var(--text-muted); padding: 10px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: var(--transition);
}
.modal-tab.active { color: var(--green); border-bottom-color: var(--green); }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-family: var(--font-title); font-weight: 600; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.form-input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 14px;
  color: var(--text); font-family: var(--font-body); font-size: 14px;
  outline: none; transition: var(--transition);
}
.form-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow-sm); }

.form-submit {
  width: 100%; background: var(--green); color: var(--accent-ink);
  font-family: var(--font-title); font-weight: 700; font-size: 16px;
  border: none; border-radius: 8px; padding: 12px;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 0 20px var(--green-glow);
}
.form-submit:hover { background: #e6ca85; box-shadow: 0 0 32px var(--green-glow); }

.form-error { color: #ff4444; font-size: 13px; margin-top: 4px; display: none; }
.form-error.show { display: block; }

/* ============================================================
   GUEST NOTICE POPUP
   ============================================================ */
.guest-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: calc(var(--header-h) + 18px) 18px 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}
.guest-notice-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease both;
}
.guest-notice {
  position: relative;
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(25,29,34,0.98), rgba(12,14,17,0.98));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 30px 28px 26px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.72), 0 0 42px var(--green-glow-sm);
  animation: modalIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.guest-notice-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.guest-notice-close:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.guest-notice-kicker {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.guest-notice h2 {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.12;
  color: var(--white);
  margin-bottom: 12px;
}
.guest-notice p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 22px;
}
.guest-notice-action {
  width: 100%;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: var(--accent-ink);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 800;
  padding: 12px 16px;
  transition: var(--transition);
}
.guest-notice-action:hover {
  background: #e6ca85;
  box-shadow: 0 0 26px var(--green-glow);
}

/* ============================================================
   USER DROPDOWN
   ============================================================ */
.user-menu { position: relative; }
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 230px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  overflow: hidden; z-index: 100;
}
.user-menu.open .user-dropdown { display: block; animation: slideDown 0.2s ease both; }

.user-info-panel {
  padding: 16px; border-bottom: 1px solid var(--border);
}
.user-info-name { font-family: var(--font-title); font-weight: 700; font-size: 16px; color: var(--white); }
.user-info-sub { font-size: 12px; color: var(--text-muted); }

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; background: transparent; text-align: left;
  padding: 11px 16px; color: var(--text-dim);
  font-family: var(--font-title); font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
}
.dropdown-item:hover { background: var(--green-glow-sm); color: var(--green); }
.dropdown-item.danger:hover { background: rgba(255,68,68,0.1); color: #ff4444; }
.dropdown-separator { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 10px; padding: 12px 18px;
  font-family: var(--font-title); font-weight: 600; font-size: 14px;
  color: var(--text); min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease both;
}
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.error { border-left-color: #ff4444; }
.toast.info { border-left-color: var(--accent-steel); }

/* ============================================================
   HISTORY PAGE
   ============================================================ */
.page-header {
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-title { font-family: var(--font-display); font-size: 40px; color: var(--white); }
.page-header-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.history-note {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 8px;
  max-width: 620px;
}

.history-item {
  display: flex; gap: 14px; align-items: center;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 12px;
  text-decoration: none; transition: var(--transition);
}
.history-item:hover { border-color: var(--green); background: var(--bg3); }
.history-poster { width: 60px; height: 90px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.history-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  opacity: 0.4;
}
.history-info { flex: 1; min-width: 0; text-decoration: none; }
.history-title { font-family: var(--font-title); font-weight: 700; font-size: 16px; color: var(--text); margin-bottom: 4px; }
.history-item:hover .history-title { color: var(--green); }
.history-meta { font-size: 12px; color: var(--text-muted); }
.history-detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.history-detail-row span {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
}
.history-progress { margin-top: 8px; }
.history-progress-caption {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.history-progress-fill { width: 30%; }
.history-play-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}
.history-empty-icon {
  font-size: 48px;
  opacity: 0.3;
}
.history-empty-cta {
  display: inline-block;
  margin-top: 16px;
}
.progress-bar-wrap { background: var(--bg3); border-radius: 4px; height: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.3s ease; }

.clear-btn {
  background: none; border: 1px solid rgba(255,68,68,0.3); color: rgba(255,68,68,0.7);
  font-family: var(--font-title); font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 6px; cursor: pointer;
  transition: var(--transition);
}
.clear-btn:hover { background: rgba(255,68,68,0.1); border-color: #ff4444; color: #ff4444; }

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.history-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -14px 0 22px;
}

.history-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg3);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  transition: var(--transition);
}

.history-tab:hover,
.history-tab.active {
  border-color: var(--green);
  background: var(--green);
  color: var(--accent-ink);
}

.history-action-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  transition: var(--transition);
}

.history-action-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-glow-sm);
}

.history-remove-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255,68,68,0.3);
  border-radius: 999px;
  background: rgba(255,68,68,0.07);
  color: rgba(255,110,110,0.9);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  transition: var(--transition);
}

.history-remove-btn:hover {
  border-color: #ff4444;
  color: #ff4444;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 40px 0 24px; margin-top: 60px;
}
.footer-inner {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px;
  margin-bottom: 32px;
}
.footer-brand .logo-img {
  width: 144px;
  height: auto;
  max-height: 48px;
  margin-bottom: 12px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--green-glow));
}
.footer-brand p { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.footer-col-title { font-family: var(--font-title); font-weight: 700; font-size: 15px; color: var(--white); margin-bottom: 14px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 13px; color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--green); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  text-align: center; font-size: 12px; color: var(--text-muted);
}
.footer-bottom span { color: var(--green); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 66px; }
  header { padding: 0 10px; gap: 8px; }
  nav { display: none; }
  .menu-toggle { display: flex; }
  .header-search { max-width: none; flex: 1; }
  .header-search { padding: 0 10px; gap: 6px; }
  .header-search input { font-size: 13px; }
  .header-actions { margin-left: 0; }
  .btn-icon, .user-avatar { width: 34px; height: 34px; }
  .logo-wrap img { width: 150px; max-width: 156px; max-height: 58px; }
  .logo-text { display: none; }

  .hero { height: 380px; }
  .hero-content { left: 20px; right: 20px; bottom: 40px; }
  .hero-arrows { display: none; }
  .weekly-rankings {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .weekly-rank-panel {
    flex: 0 0 240px;
    scroll-snap-align: start;
  }
  .weekly-rank-panel + .weekly-rank-panel {
    border-left: 1px solid rgba(216,189,122,0.12);
    border-top: none;
  }

  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 12px; }
  .loading-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .movie-card:hover { transform: none; }
  .movie-overlay { display: none; }

  .modal { padding: 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  .hero { height: 320px; }
  .hero-title { font-size: 26px; }
  .hero-desc { display: none; }
  .hero-dots { left: 20px; }
  .btn-primary, .btn-secondary { padding: 8px 16px; font-size: 14px; }
  .section { padding: 28px 0; }
  .movie-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .loading-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .container { padding: 0 12px; }
  .section-header { align-items: flex-start; flex-direction: column; gap: 6px; margin-bottom: 16px; }
  .section-title { font-size: 22px; }
  .section-title::before { height: 22px; }
  .weekly-rankings { margin: 4px 0 20px; }
  .weekly-rank-panel { flex-basis: 214px; }
  .weekly-rank-panel { padding: 8px 6px 7px; }
  .weekly-rank-head { gap: 6px; margin-bottom: 4px; }
  .weekly-rank-source { font-size: 8px; padding: 3px 4px; }
  .weekly-rank-head h2 { font-size: 11px; }
  .weekly-rank-head p { display: none; }
  .weekly-rank-row {
    grid-template-columns: 16px 22px minmax(0, 1fr) auto;
    min-height: 32px;
    gap: 5px;
    padding: 2px 3px;
  }
  .weekly-rank-no { font-size: 10px; }
  .weekly-rank-poster { width: 20px; height: 27px; border-radius: 4px; }
  .weekly-rank-copy strong { font-size: 10px; }
  .weekly-rank-copy em { display: none; }
  .weekly-rank-score { font-size: 8px; padding: 3px 4px; }
  .weekly-rank-more { font-size: 10px; padding: 6px; }
  .ranking-modal-overlay { align-items: stretch; padding: 12px; }
  .ranking-modal { max-height: calc(100vh - 24px); }
  .ranking-modal-head { padding: 14px 12px 11px; }
  .ranking-modal-title-wrap { gap: 8px; }
  .ranking-modal h2 { font-size: 16px; }
  .ranking-modal p { font-size: 11px; }
  .ranking-modal-list {
    gap: 6px;
    padding: 9px;
  }
  .ranking-modal-list .weekly-rank-row {
    grid-template-columns: 22px 34px minmax(0, 1fr) auto;
    min-height: 50px;
    gap: 7px;
    padding: 6px 7px;
  }
  .ranking-modal-list .weekly-rank-poster { width: 32px; height: 44px; }
  .ranking-modal-list .weekly-rank-copy strong { font-size: 12px; }
  .ranking-modal-list .weekly-rank-copy em { display: block; font-size: 10px; }
  .movie-actions { opacity: 1; transform: none; right: 6px; bottom: 6px; }
  .movie-action-btn { width: 24px; height: 24px; font-size: 13px; }
  .filter-bar { align-items: flex-start; gap: 6px; margin-bottom: 16px; }
  .filter-label { width: 100%; }
  .chip { padding: 5px 10px; font-size: 12px; }
  .server-bar { gap: 6px; margin-bottom: 14px; }
  .server-label { width: 100%; }
  .server-btn { padding: 5px 9px; font-size: 11px; }
  .movie-info { padding: 8px 7px 9px; }
  .movie-title { font-size: 12px; line-height: 1.25; }
  .rank-chip, .rating-chip { font-size: 9px; padding: 3px 5px; }
  .movie-sub { font-size: 10px; gap: 4px; }
  .movie-badge, .movie-quality { font-size: 9px; padding: 2px 5px; }
  .source-chip { font-size: 9px; padding: 3px 4px; }
  .footer-inner { gap: 18px; }
  .history-actions { justify-content: flex-start; width: 100%; }
  .history-action-btn, .clear-btn { flex: 1 1 auto; }
}

@media (max-width: 360px) {
  header { padding: 0 8px; gap: 6px; }
  .logo-wrap img { width: 124px; max-width: 124px; max-height: 48px; }
  .btn-icon, .user-avatar { width: 30px; height: 30px; }
  .header-search { padding: 0 8px; }
  .movie-grid, .loading-grid { grid-template-columns: repeat(2, 1fr); }
}
