/* ═══════════════════════════════════════════════════════════
   VAULTFLIX — Netflix-style Gaming Portal
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Variables ──────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:          #141414;
  --card-bg:     #181818;
  --accent:      #8B5CF6;
  --accent-dark: #7136f0;
  --border:      #2F2F2F;
  --text:        #FFFFFF;
  --text-muted:  #AAAAAA;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --nav-height:   68px;
  --shelf-gap:    14px;
  --card-width:   180px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(20, 20, 20, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  z-index: 1000;
  transition: background .3s;
}

.navbar--scrolled {
  background: rgba(10, 10, 10, .98);
}

.navbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 4%;
  gap: 28px;
}

.navbar__brand {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
  letter-spacing: 3px;
  flex-shrink: 0;
}

.navbar__links {
  display: flex;
  gap: 22px;
}

.navbar__link {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s;
}

.navbar__link:hover,
.navbar__link--active {
  color: var(--text);
}

/* ── Search bar (elegant) ───────────────────────────────── */
.navbar__search {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
}

.navbar__search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color .25s;
  z-index: 2;
}

.navbar__search-input {
  width: 220px;
  padding: 10px 16px 10px 40px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: .84rem;
  font-weight: 400;
  outline: none;
  transition: all .35s cubic-bezier(.4,0,.2,1);
}

.navbar__search-input::placeholder {
  color: rgba(255,255,255,.35);
  font-weight: 400;
}

.navbar__search-input:focus {
  width: 320px;
  background: rgba(255,255,255,.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229,9,20,.15);
}

.navbar__search-input:focus ~ .navbar__search-icon,
.navbar__search:hover .navbar__search-icon {
  color: var(--text);
}

/* ── Catalog Shelves ────────────────────────────────────── */
.catalog {
  padding: calc(var(--nav-height) + 32px) 4% 80px;
}

.catalog__empty {
  text-align: center;
  padding: 120px 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.shelf {
  margin-bottom: 48px;
}

.shelf__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.shelf__heading {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 1px;
  color: var(--text);
}

.shelf__heading span {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 10px;
  letter-spacing: 0;
}

/* Arrow navigation */
.shelf__arrows {
  display: flex;
  gap: 6px;
}

.shelf__arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}

.shelf__arrow:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.08);
}

.shelf__arrow:disabled {
  opacity: .25;
  cursor: default;
}

.shelf__arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Slider track */
.shelf__track-wrap {
  position: relative;
  overflow: hidden;
}

.shelf__row {
  display: flex;
  gap: var(--shelf-gap);
  transition: transform .45s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

/* ── Game Card ──────────────────────────────────────────── */
.game-card {
  flex: 0 0 var(--card-width);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
  cursor: pointer;
  transition: transform .28s ease, box-shadow .28s ease;
  position: relative;
}

.game-card:hover {
  transform: scale(1.08);
  z-index: 2;
  box-shadow: 0 10px 40px rgba(0,0,0,.7);
}

.game-card__poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #222;
}

.game-card__info {
  padding: 10px 12px 14px;
}

.game-card__title {
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card__resource {
  font-size: .72rem;
  color: var(--accent);
  margin-top: 3px;
  font-weight: 500;
}

/* ── Modal Overlay ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  background: #1a1a1a;
  border-radius: 12px;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(0,0,0,.8);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(0,0,0,.5);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .2s;
}

.modal__close:hover {
  background: var(--accent);
}

.modal__hero {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.modal__hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #1a1a1a 0%, transparent 60%);
}

.modal__step {
  padding: 24px 28px 32px;
}

.modal__step.hidden {
  display: none;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.modal__subtitle {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 20px;
}

/* ── Shared Button ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 4px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .2s, transform .15s;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
  transform: scale(1.03);
}

.btn--full {
  width: 100%;
  margin-top: 12px;
}

/* ── Form Controls ──────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}

.form-input:focus {
  border-color: var(--accent);
}

/* Platform pills */
.platform-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-pill {
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}

.platform-pill:hover {
  border-color: var(--text);
  color: var(--text);
}

.platform-pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Slider */
.form-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

.form-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform .15s;
}

.form-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* ── Console ────────────────────────────────────────────── */
.console {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  font-family: 'Courier New', monospace;
  font-size: .82rem;
  color: #00ff66;
  height: 180px;
  overflow-y: auto;
  margin-bottom: 16px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.console::-webkit-scrollbar {
  width: 6px;
}

.console::-webkit-scrollbar-track {
  background: transparent;
}

.console::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15);
  border-radius: 3px;
}

.console::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.28);
}

.console .log-line {
  opacity: 0;
  animation: fadeIn .35s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ── Progress Bar ───────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .6s ease;
}

/* ── Locker ─────────────────────────────────────────────── */
.locker-banner {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  padding: 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.locker-banner__icon {
  font-size: 1.3rem;
}

.locker-hint {
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

/* Offer cards */
.offers-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.offer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  transition: border-color .2s;
}

.offer-card:hover {
  border-color: var(--accent);
}

.offer-card__thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
}

.offer-card__body {
  flex: 1;
  min-width: 0;
}

.offer-card__name {
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-card__desc {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.offer-card__action {
  flex-shrink: 0;
  padding: 8px 18px;
  background: var(--accent);
  border-radius: 4px;
  font-weight: 600;
  font-size: .78rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .5px;
  transition: background .2s;
}

.offer-card__action:hover {
  background: var(--accent-dark);
}

/* Polling indicator */
.poll-status {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.poll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .2; }
}

/* Debug test button */
.btn--debug {
  display: block;
  margin: 16px auto 0;
  padding: 8px 20px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .3px;
  color: #f0c040;
  background: rgba(240,192,64,.08);
  border: 1px dashed rgba(240,192,64,.35);
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.btn--debug:hover {
  background: rgba(240,192,64,.16);
  border-color: rgba(240,192,64,.6);
}

.btn--debug:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ── Success / Unlock ───────────────────────────────────── */
.success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #1db954;
  color: #fff;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn .4s cubic-bezier(.18,.89,.32,1.28) forwards;
}

@keyframes popIn {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}

.code-box {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  font-family: 'Courier New', monospace;
  font-size: .88rem;
  color: #00ff66;
  white-space: pre-wrap;
  line-height: 1.7;
  margin-top: 16px;
  text-align: left;
}

#step-4 .modal__title,
#step-4 .modal__subtitle {
  text-align: center;
}

/* ── Toast Notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 16px);
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  padding: 16px 18px;
  border-radius: 10px;
  background: #1e1e1e;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  animation: toastIn .4s cubic-bezier(.22,1,.36,1) forwards;
  position: relative;
  overflow: hidden;
}

.toast--removing {
  animation: toastOut .3s ease forwards;
}

.toast--error   { border-left: 3px solid var(--accent); }
.toast--info    { border-left: 3px solid #3b82f6; }
.toast--success { border-left: 3px solid #1db954; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(40px) scale(.92); }
}

.toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  margin-top: 1px;
}

.toast--error   .toast__icon { background: var(--accent); color: #fff; }
.toast--info    .toast__icon { background: #3b82f6; color: #fff; }
.toast--success .toast__icon { background: #1db954; color: #fff; }

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}

.toast--error   .toast__title { color: var(--accent); }
.toast--info    .toast__title { color: #3b82f6; }
.toast--success .toast__title { color: #1db954; }

.toast__message {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,.3);
  font-size: 1.1rem;
  padding: 0 0 0 8px;
  cursor: pointer;
  transition: color .2s;
  line-height: 1;
}

.toast__close:hover {
  color: var(--text);
}

.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 0 10px;
  animation: toastProgress linear forwards;
}

.toast--error   .toast__progress { background: var(--accent); }
.toast--info    .toast__progress { background: #3b82f6; }
.toast--success .toast__progress { background: #1db954; }

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── Utility ────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --card-width: 140px;
  }

  .navbar__links {
    display: none;
  }

  .navbar__search-input {
    width: 160px;
  }
  .navbar__search-input:focus {
    width: 200px;
  }

  .modal {
    max-width: 100%;
    border-radius: 8px;
  }

  .shelf__arrow {
    width: 30px;
    height: 30px;
  }
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 4% 48px;
  margin-top: 20px;
}

.footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  letter-spacing: 2px;
}

.footer__links {
  margin: 14px 0 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.footer__link {
  font-size: .82rem;
  color: var(--text-muted);
  transition: color .2s;
  cursor: pointer;
}

.footer__link:hover {
  color: var(--accent);
}

.footer__sep {
  color: var(--border);
  font-size: .8rem;
}

.footer__copy {
  font-size: .75rem;
  color: rgba(255,255,255,.25);
}

/* ── Legal Modals (Privacy / Terms) ─────────────────────── */
.legal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.legal-overlay.active {
  display: flex;
}

.legal-modal {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(0,0,0,.8);
  padding: 40px 36px 36px;
}

.legal-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background .2s;
}

.legal-modal__close:hover {
  background: var(--accent);
}

.legal-modal__title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 1px;
  margin-bottom: 24px;
  color: var(--accent);
}

.legal-modal__body {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-modal__body h3 {
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
  margin: 22px 0 8px;
}

.legal-modal__body p {
  margin-bottom: 10px;
}

.legal-modal__body ul {
  margin: 6px 0 14px 20px;
}

.legal-modal__body li {
  margin-bottom: 5px;
}

.legal-modal__body strong {
  color: var(--text);
}
