/* ===================================================
   RentStations — Design System
   Palette: deep navy → PlayStation blue, white type
   Type: Lalezar (display) / Vazirmatn (body)
   Signature: floating PS symbols (△ ○ ✕ □)
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lalezar&family=Vazirmatn:wght@300;400;500;700&display=swap');

:root {
  --bg-deep: #040b26;
  --bg-base: #071238;
  --bg-elevated: #0c1b4d;
  --blue-royal: #15309b;
  --accent: #2e7cf6;
  --accent-soft: #6ea8ff;
  --accent-glow: rgba(46, 124, 246, 0.35);
  --white: #f4f7ff;
  --muted: #93a5d4;
  --surface: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.09);
  --danger: #f0506e;
  --success: #3ddc97;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Lalezar', 'Vazirmatn', sans-serif;
  --font-body: 'Vazirmatn', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: linear-gradient(170deg, var(--bg-base) 0%, var(--bg-deep) 55%, #02071a 100%);
  background-attachment: fixed;
  color: var(--white);
  font-size: 16px;
  line-height: 1.8;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(4, 11, 38, 0.72);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.5px;
}

.brand .logo-img {
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(46, 124, 246, 0.55));
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}

.brand:hover .logo-img {
  transform: rotate(-6deg) scale(1.08);
  filter: drop-shadow(0 0 16px rgba(110, 168, 255, 0.8));
}

.brand .en { color: var(--accent-soft); font-size: 0.8rem; font-family: var(--font-body); font-weight: 500; display: block; line-height: 1; margin-top: 2px; letter-spacing: 2px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.main-nav a:hover { color: var(--white); background: var(--surface); }

.main-nav a.active {
  color: var(--white);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--white);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  min-height: 48px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent) 0%, #1d5fd0 100%);
  color: #fff;
  box-shadow: 0 8px 28px var(--accent-glow);
}

/* shine sweep on hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: inset-inline-start 0.55s var(--ease);
}

.btn-primary:hover::after { inset-inline-start: 130%; }

.btn-primary:hover { box-shadow: 0 10px 36px var(--accent-glow); transform: translateY(-2px); }

.btn-ghost {
  background: var(--surface);
  color: var(--white);
  box-shadow: inset 0 0 0 1px var(--border);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 110px;
  text-align: center;
}

/* ambient glow blobs */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  width: 480px;
  height: 480px;
  top: -180px;
  inset-inline-start: -120px;
  background: radial-gradient(circle, rgba(46, 124, 246, 0.32), transparent 65%);
  animation: blob-a 16s ease-in-out infinite alternate;
}

.hero::after {
  width: 420px;
  height: 420px;
  bottom: -200px;
  inset-inline-end: -100px;
  background: radial-gradient(circle, rgba(21, 48, 155, 0.5), transparent 65%);
  animation: blob-b 20s ease-in-out infinite alternate;
}

@keyframes blob-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(70px, 50px) scale(1.15); }
}

@keyframes blob-b {
  from { transform: translate(0, 0) scale(1.1); }
  to { transform: translate(-60px, -45px) scale(0.95); }
}

.hero-inner { position: relative; z-index: 2; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--accent-soft);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 28px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.35;
  max-width: 18ch;
  margin-inline: auto;
}

.hero h1 .glow {
  color: var(--accent-soft);
  text-shadow: 0 0 32px var(--accent-glow);
}

.hero p.lede {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 52ch;
  margin: 20px auto 40px;
}

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* floating PS symbols field */
.ps-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.ps-field svg {
  position: absolute;
  opacity: 0.14;
  animation: drift 14s var(--ease) infinite alternate;
}

.ps-field svg:nth-child(2n) { animation-duration: 18s; animation-delay: -4s; }
.ps-field svg:nth-child(3n) { animation-duration: 22s; animation-delay: -9s; }

@keyframes drift {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-34px) rotate(14deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ps-field svg { animation: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }

.section-head { text-align: center; margin-bottom: 48px; }

.section-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--accent-soft);
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.section-head p { color: var(--muted); max-width: 58ch; margin: 8px auto 0; }

/* ---------- Cards / steps ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.card:hover { transform: translateY(-4px); border-color: rgba(110, 168, 255, 0.35); }

.card .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(46, 124, 246, 0.14);
  color: var(--accent-soft);
  margin-bottom: 18px;
}

.card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.95rem; }

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

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(110, 168, 255, 0.4);
  box-shadow: 0 16px 40px rgba(2, 7, 26, 0.6);
}

.game-card .thumb {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: cover;
  background: var(--bg-elevated);
}

.game-card .meta { padding: 14px 16px 18px; }

.game-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.5; }

.game-card .tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--accent-soft);
  background: rgba(46, 124, 246, 0.12);
  border-radius: 999px;
  padding: 2px 12px;
}

/* skeleton loading */
.skeleton {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.skeleton .sk-img { aspect-ratio: 3/4; }
.skeleton .sk-line { height: 14px; margin: 16px; border-radius: 6px; }

.sk-img, .sk-line {
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.07) 50%, transparent 70%) var(--bg-elevated);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* empty state */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-state .icon { margin-bottom: 16px; color: var(--accent-soft); opacity: 0.7; }
.empty-state h3 { color: var(--white); font-size: 1.15rem; margin-bottom: 6px; }

/* ---------- Rules ---------- */
.rules-list { display: flex; flex-direction: column; gap: 16px; max-width: 820px; margin-inline: auto; }

.rule {
  display: flex;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.rule .num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent-soft);
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(46, 124, 246, 0.12);
  border-radius: 12px;
  flex-shrink: 0;
}

.rule h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.rule p { color: var(--muted); font-size: 0.95rem; }
.rule a { color: var(--accent-soft); border-bottom: 1px dashed var(--accent-soft); }

.rule.warn { border-color: rgba(240, 80, 110, 0.35); }
.rule.warn .num { color: var(--danger); background: rgba(240, 80, 110, 0.1); }

.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(46, 124, 246, 0.1);
  border: 1px solid rgba(46, 124, 246, 0.3);
  border-radius: var(--radius);
  padding: 18px 22px;
  max-width: 820px;
  margin: 0 auto 36px;
  color: var(--accent-soft);
  font-size: 0.95rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  max-width: 980px;
  margin-inline: auto;
}

.about-copy h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; margin-bottom: 16px; }
.about-copy p { color: var(--muted); margin-bottom: 14px; }
.about-copy strong { color: var(--white); }

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-card a.line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.contact-card a.line:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.contact-card .line .sub { color: var(--muted); font-size: 0.82rem; display: block; direction: ltr; text-align: right; }
.contact-card .line svg { color: var(--accent-soft); flex-shrink: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 64px 24px;
  background:
    radial-gradient(600px 280px at 50% -40%, rgba(46, 124, 246, 0.28), transparent),
    var(--surface);
}

.cta-band h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 12px; }
.cta-band p { color: var(--muted); margin-bottom: 30px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 36px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer nav { display: flex; gap: 18px; }
.site-footer a:hover { color: var(--white); }
.footer-symbols { display: flex; gap: 10px; color: var(--accent-soft); opacity: 0.6; }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 720px; margin-inline: auto; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.panel h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; margin-bottom: 6px; }
.panel .sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 26px; }

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.field label .req { color: var(--danger); }

.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(4, 11, 38, 0.5);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s var(--ease);
}

.field input:focus { outline: none; border-color: var(--accent-soft); box-shadow: 0 0 0 3px rgba(46,124,246,0.18); }

.field .hint { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }
.field .error { color: var(--danger); font-size: 0.85rem; margin-top: 6px; display: none; }
.field.invalid .error { display: block; }
.field.invalid input { border-color: var(--danger); }

/* dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.dropzone:hover, .dropzone.dragover { border-color: var(--accent-soft); background: rgba(46,124,246,0.07); }
.dropzone svg { margin-bottom: 10px; color: var(--accent-soft); }
.dropzone .preview { max-height: 220px; margin: 0 auto 12px; border-radius: var(--radius-sm); object-fit: contain; }
.dropzone input[type="file"] { display: none; }

.form-msg {
  display: none;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.form-msg.show { display: block; }
.form-msg.success { background: rgba(61, 220, 151, 0.12); border: 1px solid rgba(61,220,151,0.4); color: var(--success); }
.form-msg.error { background: rgba(240, 80, 110, 0.1); border: 1px solid rgba(240,80,110,0.4); color: var(--danger); }

/* admin games list */
.admin-games { margin-top: 40px; }
.admin-games h3 { font-size: 1.1rem; margin-bottom: 16px; }

.admin-game-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: rgba(255,255,255,0.03);
}

.admin-game-row img { width: 52px; height: 68px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.admin-game-row .name { flex: 1; font-weight: 500; }

.btn-del {
  background: rgba(240, 80, 110, 0.12);
  color: var(--danger);
  border: 1px solid rgba(240,80,110,0.35);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  min-height: 40px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.2s var(--ease);
}

.btn-del:hover { background: rgba(240, 80, 110, 0.22); }

.admin-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-bar .btn { min-height: 42px; padding: 8px 20px; font-size: 0.9rem; }

/* spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.loading .spinner { display: inline-block; }
.btn.loading .label { opacity: 0.7; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- page enter animation ---------- */
.fade-up { animation: fadeUp 0.7s var(--ease) both; }
.fade-up.d1 { animation-delay: 0.08s; }
.fade-up.d2 { animation-delay: 0.16s; }
.fade-up.d3 { animation-delay: 0.24s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Game preview modal ---------- */
.game-card { cursor: pointer; }

.game-card .thumb { transition: transform 0.45s var(--ease); }
.game-card:hover .thumb { transform: scale(1.05); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 7, 26, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.modal-backdrop.open { opacity: 1; }

/* hidden must beat display:grid, otherwise the invisible backdrop keeps swallowing clicks */
.modal-backdrop[hidden] { display: none; }

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: linear-gradient(170deg, var(--bg-elevated), var(--bg-deep));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px var(--accent-glow);
  transform: translateY(26px) scale(0.94);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.modal-backdrop.open .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal-close {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(4, 11, 38, 0.65);
  backdrop-filter: blur(6px);
  color: var(--white);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.modal-close:hover { background: rgba(240, 80, 110, 0.25); transform: rotate(90deg); }

.modal-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 52dvh;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}

.modal-body { padding: 22px 24px 26px; text-align: center; }

.modal-body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.modal-body .tag {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--accent-soft);
  background: rgba(46, 124, 246, 0.12);
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 18px;
}

.modal-body .modal-cta { width: 100%; }

.modal-body .modal-hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 12px;
}

body.modal-open { overflow: hidden; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .hero::before, .hero::after { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: grid; place-items: center; }

  .main-nav {
    position: absolute;
    top: 68px;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(4, 11, 38, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px;
    display: none;
  }

  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 16px; border-radius: var(--radius-sm); }

  .hero { padding: 64px 0 80px; }
  .section { padding: 52px 0; }
}

@media (max-width: 480px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 22px; }
}
