/* ==========================================================
   Leonida Deals
   Dark UI, one accent, neutral surfaces. Display face (GTA Art
   Deco) is reserved for the wordmark and page title only.
   ========================================================== */

@font-face { font-family: "GTA Art Deco"; src: url("../assets/fonts/GTAArtDeco-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "GTA Display"; src: url("../assets/fonts/GTAArtDeco-CondensedHeavy.woff") format("woff"); font-weight: 900; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg: #0f0b16;
  --bg-elev: #151020;
  --surface: #191322;
  --surface-2: #211a2e;
  --surface-3: #2a2239;

  /* text */
  --text: #f4f0f8;
  --text-2: #b8afc6;
  --text-3: #7f7590;

  /* lines */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  /* accent (used sparingly) */
  --accent: #ff4f8b;
  --accent-2: #ff7a3d;
  --accent-grad: linear-gradient(90deg, #ff7a3d 0%, #ff4f8b 100%);
  --accent-ink: #ffffff;
  --focus: 0 0 0 3px rgba(255, 79, 139, 0.45);

  /* status */
  --ok: #4ade80;
  --star: #ffb020;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-brand: "GTA Art Deco", var(--font);
  --font-display: "GTA Display", Impact, "Arial Narrow Bold", sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);

  --nav-h: 64px;
  --wrap: 1200px;
  --gutter: 24px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: var(--accent); color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 200; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--line-2); font-weight: 600; transition: top 0.2s; }
.skip:focus { top: 12px; }

/* ---------- Backdrop ---------- */
.backdrop { position: absolute; inset: 0 0 auto 0; height: 720px; z-index: 0; overflow: hidden; pointer-events: none; }
.backdrop__art { width: 100%; height: 100%; object-fit: cover; object-position: 55% 30%; opacity: 0.55; }
.backdrop__fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 11, 22, 0.55) 0%, rgba(15, 11, 22, 0.35) 22%, rgba(15, 11, 22, 0.78) 52%, var(--bg) 100%),
    linear-gradient(90deg, rgba(15, 11, 22, 0.5) 0%, transparent 25%, transparent 75%, rgba(15, 11, 22, 0.5) 100%);
}
.backdrop__figure {
  position: absolute; top: 0; right: 16px; height: 480px; width: auto; max-width: none;
  filter: drop-shadow(-16px 16px 32px rgba(0, 0, 0, 0.55));
  mask-image: linear-gradient(180deg, #000 72%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}
/* between 1500px and phones the right margin is too narrow, so he stands behind the content at low opacity */
@media (max-width: 1499px) { .backdrop__figure { height: 400px; right: -40px; opacity: 0.45; } }
@media (max-width: 640px)  { .backdrop__figure { height: 290px; right: -34px; top: 34px; opacity: 0.95; mask-image: linear-gradient(180deg, #000 55%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: rgba(15, 11, 22, 0); border-bottom: 1px solid transparent;
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s, -webkit-backdrop-filter 0.4s, box-shadow 0.4s;
}
.nav::before {
  /* soft scrim so the bar reads over the art before scrolling */
  content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 11, 22, 0.7) 0%, rgba(15, 11, 22, 0.3) 60%, transparent 100%);
  opacity: 1; transition: opacity 0.4s var(--ease);
}
.nav.is-scrolled { background: rgba(15, 11, 22, 0.82); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-color: var(--line); box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.8); }
.nav.is-scrolled::before { opacity: 0; }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav__actions { position: relative; display: flex; gap: 8px; }
.nav__actions .btn.is-disabled { opacity: 0.55; cursor: not-allowed; filter: none; box-shadow: none; }
.nav__actions .btn.is-disabled:hover { transform: none; }
.navnote {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; max-width: 260px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  font-size: 13px; color: var(--text-2); white-space: nowrap;
  opacity: 0; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s var(--ease);
}
.navnote::before { content: ""; position: absolute; top: -5px; right: 18px; width: 8px; height: 8px; background: var(--surface-2); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); transform: rotate(45deg); }
.navnote.is-on { opacity: 1; transform: none; }
body.is-loading main, body.is-loading .footer { visibility: hidden; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark { width: 28px; height: 28px; }
.brand__name { font-family: var(--font-brand); font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.brand__name span { color: var(--accent-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn--lg { height: 48px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent-grad); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { filter: brightness(1.06); box-shadow: 0 6px 18px -6px rgba(255, 79, 139, 0.6); }
.btn--ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); }

/* ---------- Main / toolbar ---------- */
main { position: relative; z-index: 1; flex: 1 0 auto; }
/* main is also .wrap, whose padding shorthand would zero this out, so target main.wrap */
main.wrap { padding-bottom: 96px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar__left { display: flex; align-items: baseline; gap: 12px; }
.toolbar__right { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; justify-content: flex-end; }
.title { font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; }
.count { font-size: 13px; color: var(--text-3); }

.search {
  position: relative; display: flex; align-items: center; flex: 1 1 200px; max-width: 360px; height: 40px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-3);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--focus); color: var(--text-2); }
.search svg { position: absolute; left: 12px; width: 18px; height: 18px; pointer-events: none; }
.search input { width: 100%; height: 100%; padding: 0 12px 0 38px; background: none; border: 0; outline: 0; color: var(--text); border-radius: 10px; }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.select { position: relative; display: inline-flex; align-items: center; height: 40px; color: var(--text-3); }
.select select {
  appearance: none; -webkit-appearance: none; height: 100%; padding: 0 36px 0 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select select:hover { border-color: rgba(255, 255, 255, 0.22); }
.select select:focus-visible { border-color: var(--accent); box-shadow: var(--focus); }
.select svg { position: absolute; right: 10px; width: 18px; height: 18px; pointer-events: none; }

/* ---------- Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* ---------- Card ---------- */
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-md); }
.card__hit { display: block; width: 100%; text-align: left; color: inherit; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.card__hit:focus-visible { box-shadow: inset var(--focus); }
.card__cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.card:hover .card__img { transform: scale(1.03); }
.card__badge {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-transform: capitalize;
  background: rgba(15, 11, 22, 0.78); color: var(--text); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.card__badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); }
.card__badge[data-kind="hot"]::before { background: var(--accent-2); }
.card__badge[data-kind="trending"]::before { background: var(--accent); }
.card__badge[data-kind="new"]::before { background: var(--ok); }
.card__badge[data-kind="popular"]::before { background: var(--star); }
.card__body { display: block; padding: 12px 14px 4px; }
.card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; font-size: 15px; line-height: 1.35; min-height: calc(2 * 1.35em); }
.card__meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text-2); min-width: 0; }
.card__icon { width: 20px; height: 20px; border-radius: 6px; object-fit: cover; flex: none; }
.card__brand { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__rating { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex: none; color: var(--text-2); }
.card__rating svg { width: 13px; height: 13px; fill: var(--star); }
.card__rating b { font-weight: 600; color: var(--text); }
.card__rating i { font-style: normal; color: var(--text-3); }
.card__foot { display: block; padding: 10px 14px 14px; margin-top: auto; }

/* ---------- Empty state ---------- */
[hidden] { display: none !important; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 64px 0; color: var(--text-2); text-align: center; }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: var(--bg-elev); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 40px 0 32px; }
.footer__brand p { margin-top: 14px; max-width: 34ch; font-size: 13.5px; color: var(--text-2); }
.footer__cols { display: contents; }
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.footer__col h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.footer__col a { font-size: 14px; color: var(--text-2); width: fit-content; }
.footer__col a:hover { color: var(--text); }
.footer__bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 0 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }

/* ---------- Loading wheel ---------- */
.wheel { width: 56px; height: 56px; color: var(--accent); filter: drop-shadow(0 0 10px rgba(255, 79, 139, 0.55)); animation: spin 1.6s linear infinite, glow 1.5s ease-in-out infinite; }
.wheel--lg { width: 72px; height: 72px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 79, 139, 0.45)); } 50% { filter: drop-shadow(0 0 18px rgba(255, 79, 139, 0.9)); } }
.overlay { position: fixed; inset: 0; z-index: 290; display: grid; place-items: center; background: rgba(8, 5, 12, 0.88); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; }
.overlay.is-on { opacity: 1; visibility: visible; }

/* ---------- Dialog ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; visibility: hidden; opacity: 0; transition: opacity 0.2s, visibility 0.2s; }
.modal.is-open { visibility: visible; opacity: 1; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(6, 4, 10, 0.8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal__panel {
  position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.985); transition: transform 0.25s var(--ease);
}
.modal.is-open .modal__panel { transform: none; }
.modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(15, 11, 22, 0.6); border: 1px solid var(--line-2); color: var(--text);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background 0.15s;
}
.modal__close:hover { background: var(--surface-3); }
.modal__close svg { width: 18px; height: 18px; }

/* header: text sits on the cover image and stays for every step */
.modal__hero { position: relative; aspect-ratio: 16 / 8; background: #000; overflow: hidden; }
/* blurred and scaled up slightly so the soft blur edge stays outside the frame */
.modal__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(5px) saturate(115%); transform: scale(1.08); }
.modal__hero::after {
  content: ""; position: absolute; inset: 0;
  /* black vignette fading in from every edge, plus the bottom fade for the title */
  box-shadow: inset 0 0 60px 18px rgba(0, 0, 0, 0.85);
  background:
    radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.6) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(15, 11, 22, 0.55) 55%, rgba(15, 11, 22, 0.95) 100%);
}
.modal__hero-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 16px 20px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.modal__brand { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.modal__brand img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.25); }
.modal__title { font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); padding-right: 40px; }
.modal__verified { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: var(--accent-grad); }
.modal__verified svg { width: 13px; height: 13px; }

.modal__body { padding: 20px 22px 22px; }
.step--center { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 0 6px; }
.modal__rating { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); }
.modal__rating b { font-size: 17px; font-weight: 700; color: var(--accent-2); }
.modal__rating span { font-size: 12.5px; color: var(--text-3); }
.modal__label { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.modal__list { margin: 0 0 20px; padding: 14px 16px 14px 34px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); display: flex; flex-direction: column; gap: 5px; }
.modal__list li::marker { color: var(--accent); }

.modal__status { margin-top: 16px; font-size: 15px; font-weight: 600; color: var(--accent-2); min-height: 1.5em; transition: opacity 0.25s; }
.progress { width: 75%; height: 6px; margin-top: 16px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--accent-grad); }

.modal__ready { font-family: var(--font-display); font-size: 30px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1; color: var(--accent-2); }
.modal__sub { margin: 8px 0 18px; font-size: 14px; color: var(--text-2); }
.rate { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; }
.rate__label { font-size: 13px; color: var(--text-3); }
.rate__btns { display: flex; gap: 12px; }
.rate__btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--accent); transition: background 0.15s, color 0.15s, transform 0.15s var(--ease); }
.rate__btn svg { width: 20px; height: 20px; }
.rate__btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.rate__btn.is-active { background: var(--accent); border-color: transparent; color: #fff; }
.rate__thanks { font-size: 12.5px; color: var(--ok); }
body.modal-open { overflow: hidden; }

.toast {
  position: fixed; left: 20px; bottom: 20px; z-index: 250;
  display: flex; align-items: center; gap: 12px; width: min(360px, calc(100vw - 40px)); padding: 10px 10px 10px 10px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  transform: translateY(16px); opacity: 0; visibility: hidden;
  transition: transform 0.35s var(--ease), opacity 0.3s, visibility 0.3s;
}
.toast.is-on { transform: none; opacity: 1; visibility: visible; }
.toast__icon { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; background: var(--surface-2); }
.toast__text { min-width: 0; flex: 1; }
.toast__text b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast__text span { display: block; font-size: 12.5px; color: var(--text-3); }
.toast__close { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); flex: none; }
.toast__close:hover { background: var(--surface-3); color: var(--text); }
.toast__close svg { width: 16px; height: 16px; }

body.modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .backdrop { height: 600px; }
}
@media (max-width: 800px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  main.wrap { padding-bottom: 64px; }
  :root { --nav-h: 56px; --gutter: 16px; }
  .nav__actions .btn--ghost { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .toolbar__left { min-height: 118px; align-items: flex-end; padding-bottom: 4px; }
  .toolbar__right { flex-basis: auto; }
  .search { max-width: none; }
  .title { font-size: 26px; }
  .card__body { padding: 10px 12px 2px; }
  .card__foot { padding: 8px 12px 12px; }
  .card__title { font-size: 14px; }
  .modal { padding: 0; align-items: end; }
  .modal__panel { width: 100%; max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal__hero { aspect-ratio: 16 / 9; }
  .modal__title { font-size: 19px; }
  .footer__bar { flex-direction: column; gap: 6px; }
  .toast { left: 12px; bottom: 12px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
