/* LoDL Studio website: dark, warm, Persian (RTL), mobile first. */

@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn-wght.woff2") format("woff2-variations"), url("/assets/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b0a09;
  --bg-2: #14110e;
  --card: #1a1612;
  --card-2: #221c16;
  --line: #3a3027;
  --text: #f5eee5;
  --muted: #bfb1a1;
  --faint: #8d7f70;
  --gold: #f5a524;
  --gold-2: #ffcf73;
  --gold-ink: #1d1203;
  --blue: #5cb8ff;
  --green: #6fd08c;
  --red: #ff7b6e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --gutter: 16px;
  --max: 1120px;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(245, 165, 36, .10), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  font-feature-settings: "ss01";
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--gold-2); }
h1, h2, h3 { line-height: 1.35; margin: 0; font-weight: 800; }
p { margin: 0; }
[hidden] { display: none !important; }

.i { width: 22px; height: 22px; flex: none; }

.skip {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 50;
  background: var(--gold); color: var(--gold-ink); padding: 8px 14px; border-radius: 10px; font-weight: 700;
}
.skip:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; border-radius: 8px; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(11, 10, 9, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
/* RTL: login on the visual left (inline-end). */
.topbar-login { margin-inline-start: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand-name { font-weight: 800; letter-spacing: .02em; font-size: 17px; white-space: nowrap; }

.account-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 60%;
  min-height: 42px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.account-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn:hover { border-color: var(--gold); }
.account-btn.premium { border-color: rgba(245, 165, 36, .6); }
.account-btn .i { width: 20px; height: 20px; color: var(--gold-2); }

/* ---- layout ---- */
main { outline: none; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: 28px; padding-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 22px; }
.section-head p { color: var(--muted); font-size: 14.5px; }
.muted { color: var(--muted); }

/* ---- landing ---- */
.studio-hero { text-align: center; padding: 18px 0 8px; }
.studio-logo {
  width: min(560px, 100%); margin: 0 auto; aspect-ratio: 1672 / 941; height: auto;
  mix-blend-mode: screen;              /* the logo's black background melts into the page */
  -webkit-mask-image: radial-gradient(ellipse 62% 62% at 50% 50%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 62% at 50% 50%, #000 62%, transparent 100%);
}
.studio-hero h1 { font-size: 26px; margin-top: -6px; }
.studio-hero .tagline { color: var(--gold-2); font-weight: 600; margin-top: 4px; }
.studio-hero .lead { color: var(--muted); max-width: 560px; margin: 12px auto 0; }

.games-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }

.game-card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.game-card:hover { transform: translateY(-3px); border-color: rgba(245, 165, 36, .7); }
.game-card .cover { aspect-ratio: 16 / 9; width: 100%; height: auto; object-fit: cover; object-position: center 45%; }
.game-card .cover-fallback { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #2a2017, #120f0c); }
.game-card .body { display: flex; align-items: center; gap: 14px; padding: 14px 16px 16px; }
.game-card .icon { width: 64px; height: 64px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .12); flex: none; object-fit: cover; background: #000; }
.game-card .names { min-width: 0; flex: 1; }
.game-card h3 { font-size: 21px; }
.game-card .en { color: var(--faint); font-size: 14px; font-weight: 600; }
.game-card .blurb { color: var(--muted); font-size: 14.5px; padding: 0 16px 4px; }
.game-card .cta { margin: 12px 16px 16px; }

.soon-card {
  display: grid; place-items: center; text-align: center; gap: 6px;
  min-height: 180px; padding: 24px; border-radius: var(--radius);
  border: 1px dashed var(--line); color: var(--faint);
}
.soon-card strong { color: var(--muted); font-size: 17px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; width: 100%;
  border-radius: 14px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); box-shadow: 0 6px 18px rgba(245, 165, 36, .25); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-link { background: none; color: var(--gold-2); min-height: 40px; font-weight: 600; }
.btn[disabled] { opacity: .55; cursor: default; box-shadow: none; filter: none; }
.btn .i { width: 20px; height: 20px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card-2); color: var(--text); cursor: pointer;
}

/* ---- game page ---- */
.game-hero { position: relative; isolation: isolate; }
.game-hero .bg {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-position: center 42%;
}
.game-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 10, 9, .25) 0%, rgba(11, 10, 9, .35) 40%, rgba(11, 10, 9, .92) 78%, var(--bg) 100%);
}
.game-hero .inner { padding-top: 12px; padding-bottom: 8px; text-align: center; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 6px 12px 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .12);
}
.back-link .i { width: 18px; height: 18px; }
.hero-top { display: flex; justify-content: flex-start; }
.game-logo {
  /* Over the picture the logo keeps its own dark backdrop, softened into a glow (screen blending washed it out). */
  width: min(520px, 96%); height: auto; aspect-ratio: 1672 / 941; margin: 40px auto 0;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%);
}
.game-hero h1 { font-size: 30px; margin-top: -8px; text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.game-hero h1 .en { display: inline-block; font-size: 16px; color: var(--muted); font-weight: 600; margin: 0 10px; }
.game-hero .tagline { color: #e9ddcf; max-width: 620px; margin: 6px auto 0; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }

/* player strip */
.player-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2);
}
.player-strip .who { flex: 1; min-width: 180px; }
.player-strip .who strong { display: block; font-size: 16px; }
.player-strip .who span { color: var(--muted); font-size: 14px; }
.player-strip .btn { width: auto; min-height: 42px; padding: 6px 16px; font-size: 15px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.chip-premium { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); }
.chip-free { background: #2a241e; color: var(--muted); }
.chip-owned { background: rgba(111, 208, 140, .16); color: var(--green); border: 1px solid rgba(111, 208, 140, .4); }
.chip .i { width: 16px; height: 16px; }

/* premium */
.premium-card {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 22px 18px;
  background:
    radial-gradient(500px 220px at 85% -40px, rgba(245, 165, 36, .28), transparent 70%),
    linear-gradient(160deg, #2a1d0f, #16110c 60%);
  border: 1px solid rgba(245, 165, 36, .45);
  box-shadow: var(--shadow);
}
.premium-head { display: flex; align-items: center; gap: 12px; }
.premium-head .crown { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 4px 10px rgba(245, 165, 36, .4)); }
.premium-head h2 { font-size: 26px; color: var(--gold-2); }
.premium-head p { color: var(--muted); font-size: 14.5px; }
.premium-body { display: grid; gap: 18px; margin-top: 16px; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.perks li { display: flex; gap: 10px; align-items: flex-start; }
.perks .tick {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none; margin-top: 2px;
  border-radius: 50%; background: rgba(245, 165, 36, .18); color: var(--gold-2);
}
.perks .tick .i { width: 16px; height: 16px; }
.perks b { color: var(--text); }
.perks span { color: var(--muted); }
.price-box {
  display: grid; gap: 10px; align-content: start;
  padding: 16px; border-radius: 16px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .08);
}
.price-big { font-size: 32px; font-weight: 900; color: var(--text); line-height: 1.2; }
.price-big small { font-size: 16px; font-weight: 700; color: var(--muted); margin-inline-start: 6px; }
.price-note { color: var(--gold-2); font-weight: 600; font-size: 15px; }
.price-fine { color: var(--faint); font-size: 13.5px; }

/* shop */
.shop-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.item-card {
  display: grid; grid-template-columns: 88px 1fr; gap: 14px;
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
}
.item-pic {
  width: 88px; height: 88px; border-radius: 16px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #3a2c1f, #1a1410 75%); border: 1px solid rgba(255, 255, 255, .06);
}
.item-pic img { width: 100%; height: 100%; object-fit: cover; }
.item-pic svg { width: 58px; height: 58px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.item-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.item-main h3 { font-size: 17.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-main .desc { color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.prices { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.price {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line); font-weight: 800; font-size: 15px; white-space: nowrap;
}
.price .i { width: 18px; height: 18px; }
.price s { color: var(--faint); font-weight: 600; font-size: 13px; text-decoration-thickness: 1.5px; }
.price-or { color: var(--faint); font-size: 13px; }
.item-buy { grid-column: 1 / -1; }
.item-buy .btn { min-height: 44px; }
.badge-off {
  display: inline-block; padding: 0 8px; border-radius: 8px; background: var(--red); color: #2a0703; font-size: 12.5px; font-weight: 800;
}

.note-card {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-top: 18px;
  border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 14.5px;
}
.note-card svg { width: 40px; height: 40px; flex: none; }

/* states */
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--muted); gap: 12px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { padding: 16px; border-radius: var(--radius); border: 1px solid rgba(255, 123, 110, .45); background: rgba(255, 123, 110, .08); color: #ffd2cc; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #1a1612, #241e18, #1a1612); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 150px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- modals ---- */
.modal {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--line); border-radius: 22px;
  background: linear-gradient(180deg, #1e1914, #15110d); color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.modal::backdrop { background: rgba(5, 4, 3, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-close-form { position: absolute; top: 12px; inset-inline-end: 12px; margin: 0; }
.modal-body { padding: 26px 20px 22px; display: grid; gap: 14px; }
.modal-body h2 { font-size: 21px; padding-inline-end: 44px; }
.stack { display: grid; gap: 10px; }
label { font-weight: 700; font-size: 15px; }
input[type="text"] {
  width: 100%; min-height: 52px; padding: 10px 14px;
  border-radius: 14px; border: 1px solid var(--line); background: #0f0d0b; color: var(--text);
  font: inherit; font-size: 19px; letter-spacing: .06em; text-align: center;
}
input[type="text"]:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(245, 165, 36, .25); }
.form-error { color: var(--red); font-size: 14.5px; min-height: 0; }
.form-error:empty { display: none; }
.dev-code { font-size: 13.5px; color: var(--faint); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; text-align: center; }

.buy-head { display: flex; align-items: center; gap: 14px; }
.buy-head .item-pic { width: 72px; height: 72px; border-radius: 14px; }
.buy-head .item-pic svg { width: 46px; height: 46px; }
.buy-head h2 { padding-inline-end: 40px; font-size: 19px; }
.buy-steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.buy-steps li { display: flex; gap: 10px; align-items: flex-start; }
.buy-steps li::before {
  counter-increment: s; content: counter(s, persian);
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--line); color: var(--gold-2); font-weight: 800; font-size: 14px;
}
.buy-steps .basket { display: inline-block; width: 26px; height: 26px; vertical-align: -7px; margin: 0 2px; }
.buy-message { background: rgba(245, 165, 36, .1); border: 1px solid rgba(245, 165, 36, .35); border-radius: 14px; padding: 12px 14px; }
.account-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: #0f0d0b; border: 1px solid var(--line); }
.account-line .label { color: var(--muted); font-size: 14px; }

dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 700; }

/* ---- footer ---- */
.footer {
  margin-top: 40px; padding: 30px var(--gutter) calc(30px + env(safe-area-inset-bottom));
  text-align: center; border-top: 1px solid rgba(255, 255, 255, .06); background: #080706;
}
.footer-logo { margin: 0 auto 8px; border-radius: 12px; }
.footer-title { font-weight: 700; }
.footer-note { color: var(--muted); font-size: 14px; margin-top: 4px; }
.social { list-style: none; padding: 0; margin: 14px 0 6px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.social a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; font-weight: 600;
}
.social a:hover { border-color: var(--gold); color: var(--gold-2); }
.footer-handle { color: var(--gold-2); font-weight: 700; }
.footer-copy { color: var(--faint); font-size: 13px; margin-top: 10px; }

/* ---- wider screens ---- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .studio-hero h1 { font-size: 32px; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .item-card { grid-template-rows: 1fr auto; }
  .item-buy { align-self: end; }
  .game-hero h1 { font-size: 36px; }
  .premium-card { padding: 28px; }
  .modal-body { padding: 30px 26px 26px; }
}
@media (min-width: 960px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .premium-body { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .game-logo { margin-top: 70px; }
  .section { padding-top: 36px; padding-bottom: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
