:root { --gap:14px; --radius:16px; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin:0;
  font:16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:#0e0f12;
  color:#e7e9ee;
}

.container { max-width: 720px; margin: 40px auto; padding: 0 16px; }

.lang-dropdown {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2000;
}

.lang-dropdown-btn {
  background: #1e2127;
  border: 1px solid #2b2f36;
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 6px;
  background: #1e2127;
  border: 1px solid #2b2f36;
  border-radius: 12px;
  min-width: 120px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lang-dropdown-menu.open {
  display: block;
}

.lang-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.lang-dropdown-menu button:hover {
  background: #262a32;
}


/* Buttons, inputs, chips */
button, .btn {
  cursor:pointer; border:1px solid #2b2f36; background:#1e2127; color:#fff;
  padding:10px 14px; border-radius:12px; transition: background .12s ease;
}
button:hover, .btn:hover { background:#262a32; }
.btn.primary { background:#2a4bff; border-color:#2a4bff; }
.btn.secondary { background:#1e2127; border:1px solid #2b2f36; }
.btn.secondary.danger { border-color:#5a1e23; background:#2a0f12; }
.btn.small { padding:6px 10px; border-radius:10px }

label { display:block; margin-bottom: 8px; }
input {
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid #2b2f36;
  background:#0f1115; color:#fff;
}

.row { display:flex; gap: var(--gap); align-items:center; }
.space-between { justify-content: space-between; }
.muted { color:#9aa3af; margin-top: 2px; }
.small-link{color:#cfd6e1;text-decoration:none;font-size:14px;opacity:.9}
.small-link:hover { text-decoration: underline; }

.fixed-top-right{
    position: fixed;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 1000;
  }
  .btn.tiny{
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
  }

  .lang-switch .active{
    background: #2a4bff;
    border-color: #2a4bff;
    color: #fff;
  }

.card {
  background:#16181d; border:1px solid #282a2f; border-radius: var(--radius);
  padding: 20px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
h1,h2{ margin:0 0 12px 0; }

.error { color:#ff6b6b; margin-top:10px; min-height:1.2em; }

/* Grids */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}

/* Swipe deck */
.swipe-wrap { position: relative; overflow: hidden; margin-top:16px; }
.deck {
  position: relative;
  width: 100%;
  height: 68vh;
  min-height: 420px;
}
.deck-loader { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#9aa3af; }
.card-item {
  position: absolute;
  inset: 0;
  border: 1px solid #282a2f;
  background: #14171c;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  padding: 0;
  overflow: hidden;
  touch-action: none;

  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease;
}

.card-item:hover { box-shadow:0 16px 36px rgba(0,0,0,.45); }
.card-item.animate-out { transition: transform .28s ease, opacity .24s linear; }
.card-item.resetting { transition: transform .18s ease; }
.card-item.dragging { cursor:grabbing; }

.card-poster {
  width: 100%;
  flex: 0 1 50%;
  min-height: 140px;
  max-height: 60%;
  object-fit: contain;
  background: #0f1115;
}

.card-body {
  padding: 16px 16px 10px 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.card-title { margin:0 0 6px 0; font-size:20px; }
.card-meta { color:#9aa3af; font-size:14px; }
.card-tags { margin-top:10px; display:flex; flex-wrap:wrap; gap:6px; }
.tag { font-size:12px; padding:4px 8px; border-radius:999px; border:1px solid #2b2f36; background:#101319; color:#cfd6e1; }
.card-footer {
  padding: 12px 16px 16px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #20242b;
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
}

.card--deck.swipe-wrap{
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.swipe-rating-indicator {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
}
.swipe-rating-indicator.visible {
  opacity: 1;
  transform: translate(0, -50%);
}
.swipe-rating-column {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 14px;
  border: 1px solid #2b2f36;
  background: #101319;
  box-shadow: 0 10px 24px rgba(0,0,0,.5);
}
.swipe-star {
  font-size: 28px;
  line-height: 1;
  opacity: .18;
  color: #c6ccd8;
  transition: opacity .12s ease, transform .12s ease, color .12s ease;
  text-shadow: 0 0 0 transparent;
}
.swipe-star.active {
  opacity: 1;
  color: #ffd54a;
  transform: translateY(-1px);
  text-shadow: 0 0 8px rgba(255,213,74,.7);
}

.swipe-side-indicator {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #2b2f36;
  background: #101319;
  color: #e7e9ee;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.swipe-side-indicator.visible {
  opacity: 1;
  transform: translate(-4px, -50%);
}

.swipe-bottom-indicator {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translate(-50%, 0);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #2b2f36;
  background: #101319;
  color: #e7e9ee;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.swipe-bottom-indicator.visible {
  opacity: 1;
  transform: translate(-50%, -4px);
}

/* Hints */
.hint { position:absolute; z-index:2; pointer-events:none; bottom:18px; font-size:13px; opacity:.0; transition:opacity .2s ease; background:#11141a; border:1px solid #242a33; padding:6px 10px; border-radius:999px; color:#9aa3af; }
.hint-right { right:16px; } .hint-left { left:16px; } .hint-up { left:50%; transform:translateX(-50%); bottom:auto; top:8px; }
.deck.has-card .hint { opacity:.6; } .deck.empty .hint { opacity:0 !important; }

/* Onboarding tiles (lists page too) */
.tile{
  padding:12px;border:1px solid #222b3a;background:#151a27;border-radius:12px;
  display:grid;grid-template-columns:64px 1fr;gap:10px;align-items:center
}
.tile .poster{width:64px;height:96px;object-fit:cover;background:#0f1115;border-radius:8px}
.tile h4{margin:0 0 4px 0;font-size:16px}
.tile .meta{color:#9aa3af;font-size:13px}
.rowline{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}

/* Overlay badge while dragging */
.overlay-badge {
  position:absolute; top:16px; padding:8px 12px; border-radius:999px; font-weight:700;
  backdrop-filter: blur(6px); opacity:0; transform:scale(.96);
  transition: opacity .08s linear, transform .08s linear; pointer-events:none;
  border:1px solid #2b2f36; background: rgba(20,23,28,.7); color:#e7e9ee;
}
.badge-right { right:16px; } .badge-left { left:16px; }
.badge-up { left:50%; transform:translateX(-50%) scale(.96); }

/* --- Tabs --- */
.tabs { gap:8px; margin-bottom: 12px; }
.tab-btn { border-radius: 999px; padding:8px 14px; }
.tab-btn.active { background:#2a4bff; border-color:#2a4bff; }

.stars { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px }
.star-btn {
  padding:6px 10px; border-radius:10px; border:1px solid #2b2f36; background:#1e2127;
}
.star-btn.active { background:#2a4bff; border-color:#2a4bff; }
.tile-actions { margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }

.stars.rating-bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.rating-segment {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--muted, #aaa);
  transition: transform 0.1s ease, color 0.1s ease;
}

.rating-segment.active {
  color: var(--accent, #ffb400);
}

.rating-segment:hover {
  transform: scale(1.1);
}

.rating-label {
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted, #888);
  min-width: 28px;
  text-align: right;
}

/* ===== Modal dialog (admin) ===== */

.admin-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(15,23,42,.9), rgba(3,7,18,.96));
  backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity .18s ease;
}

.admin-dialog-backdrop.open {
  display: flex;
  opacity: 1;
}

.admin-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100% - 80px);
  background: radial-gradient(circle at top left, #1f2937 0, #020617 70%);
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,.4);
  box-shadow: 0 24px 70px rgba(0,0,0,.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(.97);
  transition: transform .18s ease;
}

.admin-dialog-backdrop.open .admin-dialog {
  transform: translateY(0) scale(1);
}

.admin-dialog__header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(31,41,55,.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-dialog__header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .02em;
}

.admin-dialog__body {
  padding: 12px 16px 8px;
  overflow-y: auto;
}

.admin-dialog__footer {
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(31,41,55,.9);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}


.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-form__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-form__row label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
}

.admin-form__row input,
.admin-form__row textarea {
  border-radius: 10px;
  border: 1px solid rgba(55,65,81,.9);
  background: rgba(15,23,42,.9);
  color: #e5e7eb;
  padding: 6px 8px;
  font-size: 13px;
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.admin-form__row input:focus,
.admin-form__row textarea:focus {
  border-color: rgba(129,140,248,1);
  box-shadow: 0 0 0 1px rgba(129,140,248,.7);
  background: rgba(15,23,42,1);
}

.admin-form__row textarea {
  resize: vertical;
  min-height: 60px;
}

@media (max-width: 640px) {
  .admin-dialog {
    width: calc(100% - 20px);
    max-height: calc(100% - 40px);
    border-radius: 16px;
  }
}
