/* ===== Emperatoor Store - Main Styles ===== */
@font-face {
  font-family: 'Modam';
  src: url('../fonts/Modam-ExtraLight.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Modam';
  src: url('../fonts/Modam-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Modam';
  src: url('../fonts/Modam-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Modam';
  src: url('../fonts/Modam-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Modam';
  src: url('../fonts/Modam-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Modam';
  src: url('../fonts/Modam-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Modam';
  src: url('../fonts/Modam-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Modam';
  src: url('../fonts/Modam-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
:root{
  --bg: #060911; --bg-elevated: #0d1420; --bg-card: #0f1626;
  --border: #1b2537; --border-soft: #16203590;
  --text: #f5f6fa; --text-muted: #8991a4; --text-faint: #565f74;
  --accent: #2457f5; --accent-bright: #3f6bff; --accent-soft: #2457f522;
  --success: #22c55e; --heart: #ef4444; --radius: 12px; --radius-sm: 11px; --content-gutter: 30px;
}
*{box-sizing:border-box;}
html{overflow-x:hidden; width:100%;}
body{font-family:'Modam', 'Vazirmatn', sans-serif; background:var(--bg); color:var(--text); direction:rtl; margin:0; overflow-x:hidden; width:100%; max-width:100vw;}
a{color:inherit; text-decoration:none;}
button, input, select{font-family:inherit;}

/* ---------- layout shell ---------- */
.layout{display:grid; grid-template-columns:300px 1fr; gap:30px; max-width:1500px; margin:0 auto; padding:calc(10px + env(safe-area-inset-top)) 30px 110px;}
.topbar{grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:2px;}
.logo{display:flex; align-items:center; gap:12px; font-weight:900; font-size:19px;}
.logo img{height:40px; width:auto;}
.search-wrap{flex:1; max-width:900px; position:relative;}
.search-wrap input{width:100%; background:var(--bg-elevated); border:1px solid var(--border); border-radius:999px; padding:11px 24px 11px 48px; color:var(--text); font-size:14px; outline:none; text-align:right;}
.search-icon{position:absolute; left:20px; top:50%; transform:translateY(-50%); color:var(--text-faint); display:flex; align-items:center;}
.topbar-filter-button{display:none;}
.account-btn{background:var(--bg-elevated); border:1px solid var(--border); border-radius:999px; padding:15px 26px; font-size:14px; font-weight:600;}

/* ---------- nav + filters ---------- */
.sidebar{display:flex; flex-direction:column; gap:20px;}
.nav-card{background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:10px; display:flex; flex-direction:column; gap:3px;}
.nav-item{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-radius:var(--radius-sm); font-weight:600; color:var(--text-muted);}
.nav-item.active{background:var(--accent); color:#fff;}
.filters-card{background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:20px; display:flex; flex-direction:column; gap:20px;}
.apply-btn{background:var(--accent); color:#fff; border:none; border-radius:var(--radius-sm); padding:14px; font-weight:700; width:100%; cursor:pointer;}

/* ---------- game cards ---------- */
.games-grid{display:grid; grid-template-columns:repeat(6,1fr); gap:16px;}
.playlist-row{display:flex; gap:12px; overflow-x:auto; padding:14px var(--content-gutter) 18px; margin: -14px calc(var(--content-gutter) * -1) -14px; -webkit-overflow-scrolling:touch; min-width:0; scrollbar-width:none; -webkit-mask-image:linear-gradient(to right, transparent 0, #000 var(--content-gutter), #000 calc(100% - var(--content-gutter)), transparent 100%); mask-image:linear-gradient(to right, transparent 0, #000 var(--content-gutter), #000 calc(100% - var(--content-gutter)), transparent 100%);}
.playlist-row::-webkit-scrollbar{display:none;}
.playlist-card{flex:0 0 calc(31% - 8px); min-width:100px;}
.playlist-card .game-card{aspect-ratio:3/4;}
main.main{min-width:0;}
@media(min-width:1101px){
  .playlist-card{flex:0 0 calc(16% - 14px);}
}
.game-card{position:relative; border-radius:var(--radius); overflow:hidden; aspect-ratio:3/4; cursor:pointer; transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease; border:1px solid var(--border);}
.game-card:hover,
.game-card:focus-within,
.game-card:active{z-index:2; border-color:var(--accent); transform:scale(1.03); box-shadow:0 0 18px rgba(38,126,255,.65), 0 0 4px rgba(92,168,255,.9);}
.game-thumb{position:absolute; inset:0; background-size:cover; background-position:center;}
.card-gradient{position:absolute; left:0; right:0; bottom:0; height:50%; background:linear-gradient(0deg, #000000e6 0%, #00000099 50%, transparent 100%); pointer-events:none;}
.card-size-label{position:absolute; bottom:14px; left:14px; font-weight:300; font-size:13.5px; color:#fff; z-index:2; direction:ltr;}
.card-add-btn{position:absolute; bottom:12px; right:12px; width:35px; height:30px; border-radius:5px; background:var(--accent); border:none; display:flex; align-items:center; justify-content:center; z-index:2; cursor:pointer; transition:.15s;}
.card-add-btn:hover{background:var(--accent-bright);}
.card-add-btn.added{background:var(--success); color:#141B34;}
.btn-default-state{display:flex; align-items:center; justify-content:center; gap:8px;}
.btn-added-state{display:none; align-items:center; justify-content:center; gap:8px;}
.added .btn-default-state{display:none;}
.added .btn-added-state{display:flex;}
.card-add-btn svg{width:17px; height:17px;}
.tag-row{display:flex; gap:6px; flex-wrap:wrap;}
.tag{background:var(--accent-soft); color:var(--accent-bright); font-size:11px; font-weight:600; padding:4px 10px; border-radius:7px;}
.home-quick-filters-wrap{margin:18px 0 20px;}
.home-quick-filters-scroll{display:flex; gap:16px; overflow-x:auto; padding:0 var(--content-gutter) 4px; margin-inline:calc(var(--content-gutter) * -1); -webkit-overflow-scrolling:touch; scrollbar-width:none; -webkit-mask-image:linear-gradient(to right, transparent 0, #000 var(--content-gutter), #000 calc(100% - var(--content-gutter)), transparent 100%); mask-image:linear-gradient(to right, transparent 0, #000 var(--content-gutter), #000 calc(100% - var(--content-gutter)), transparent 100%);}
.home-quick-filters-scroll::-webkit-scrollbar{display:none;}
.home-quick-filter{display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; min-width:180px; min-height:82px; padding:20px 26px; border-radius:24px; background:rgba(20,28,38,.9); border:1px solid rgba(255,255,255,.08); color:#fff; font-size:clamp(1.1rem,2vw,2.15rem); font-weight:700; line-height:1.15; white-space:nowrap; box-shadow:inset 0 1px 0 rgba(255,255,255,.04);}
.home-quick-filter:hover{border-color:rgba(255,255,255,.18); background:rgba(25,34,46,.96);}
.home-genres{margin:8px 0 18px;}
.home-genre-row{display:flex; flex-direction:row; direction:rtl; gap:10px; overflow-x:auto; padding:14px var(--content-gutter) 18px; margin:-14px calc(var(--content-gutter) * -1) -14px; -webkit-overflow-scrolling:touch; scrollbar-width:none; min-width:0; -webkit-mask-image:linear-gradient(to right, transparent 0, #000 var(--content-gutter), #000 calc(100% - var(--content-gutter)), transparent 100%); mask-image:linear-gradient(to right, transparent 0, #000 var(--content-gutter), #000 calc(100% - var(--content-gutter)), transparent 100%);}
.home-genre-row::-webkit-scrollbar{display:none;}
.home-genre-card{display:flex; flex:0 0 auto; align-items:center; justify-content:center; min-height:40px; min-width:70px; padding:5px 13px; border:1px solid rgba(255,255,255,.08); border-radius:50px; background:rgba(20,28,38,.9); color:#fff; font-size:clamp(.9rem,1.35vw,1.25rem); font-weight:300; line-height:1.15; text-align:center; text-decoration:none; white-space:nowrap; box-shadow:inset 0 1px 0 rgba(255,255,255,.04); transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;}
.home-genre-card:hover,
.home-genre-card:focus-visible,
.home-genre-card:active{z-index:2; border-color:var(--accent); background:rgba(25,34,46,.96); transform:scale(1.03); box-shadow:0 0 18px rgba(38,126,255,.65), 0 0 4px rgba(92,168,255,.9);}
.console-selector-wrap{margin:28px 0 22px;}
.console-selector-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.console-selector-card{display:flex;align-items:center;justify-content:center;min-height:92px;padding:18px 20px;border-radius:16px;background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.03));border:1px solid rgba(255,255,255,.08);text-decoration:none;box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 8px 18px rgba(0,0,0,.2);transition:transform .18s ease,border-color .18s ease,background .18s ease;}
.console-selector-card:hover{transform:translateY(-1px);border-color:rgba(255,255,255,.18);background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.04));}
.console-logo{display:flex;align-items:center;justify-content:center;min-width:0;}
.console-logo img{display:block;max-height:42px;max-width:180px;width:auto;filter:none;object-fit:contain;}
.ps4-logo img{max-height:24px;max-width:120px;}
.ps5-logo img{max-height:24px;max-width:120px;}
.xo-logo img{max-height:24px;max-width:100px;}
.xs-logo img{max-height:28px;max-width:150px;}
.all-games-top-filters{margin-bottom:22px;}

/* ---------- FILTERS: open button + bottom sheet modal ---------- */
.filters-open-btn{width:100%; background:var(--accent); color:#fff; border:none; border-radius:var(--radius-sm); padding:16px; font-weight:700; font-size:15px; cursor:pointer; transition:.15s;}
.filters-open-btn:hover{background:var(--accent-bright);}

.filters-overlay{position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:90; opacity:0; pointer-events:none; transition:opacity .25s ease;}
.filters-overlay.show{opacity:1; pointer-events:auto;}

.filters-sheet{position:fixed; left:12px; right:12px; bottom:12px; z-index:91; background:rgba(15,22,38,0.75); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); border:1px solid var(--border); border-radius:22px; padding:14px 22px calc(24px + env(safe-area-inset-bottom)); max-height:85vh; overflow-y:auto; transform:translateY(120%); transition:transform .3s cubic-bezier(.2,.8,.3,1); box-shadow:0 -10px 40px rgba(0,0,0,0.5);}
.filters-sheet.show{transform:translateY(0);}
.filters-sheet-handle{width:44px; height:4px; background:var(--border); border-radius:4px; margin:0 auto 14px;}

.filters-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:20px;}
.filters-head h4{font-size:17px; font-weight:800;}
.filters-clear{color:var(--accent-bright); font-size:13px; cursor:pointer;}

.filter-group{margin-bottom:22px;}
.filter-group .title{display:block; font-size:14px; font-weight:700; margin-bottom:10px; color:var(--text);}

.select-wrap{position:relative;}
.select-wrap select{width:100%; background:var(--bg-elevated); border:1px solid var(--border); color:var(--text); border-radius:var(--radius-sm); padding:14px 16px; font-size:14px; appearance:none; -webkit-appearance:none;}
.select-wrap .select-chevron{position:absolute; left:16px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none;}

.size-range{width:100%; accent-color:var(--accent); margin-bottom:8px;}
.range-labels{display:flex; justify-content:space-between; font-size:12px; color:var(--text-muted);}

.player-mode-row{display:flex; justify-content:space-between; gap:10px;}
.player-mode-btn{flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; background:transparent; border:none; color:var(--text); cursor:pointer; font-size:12.5px; font-weight:600; padding:6px;}
.player-mode-icon{width:56px; height:56px; border-radius:50%; background:var(--bg-elevated); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--text-muted); transition:.15s;}
.player-mode-btn.active .player-mode-icon{background:var(--accent); border-color:var(--accent); color:#fff;}
.player-mode-btn.active{color:var(--text);}

/* Filter-sheet visual redesign: scoped so no other button or page layout changes. */
.filters-sheet .filters-clear,.filters-sheet .filter-option,.filters-sheet .apply-btn{font-family:inherit;}
.filters-overlay{background:rgba(1,5,13,.78);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);}
.filters-sheet{right:50%;left:auto;bottom:0;width:min(430px,calc(100% - 32px));max-height:calc(100dvh - 70px);padding:19px 20px calc(24px + env(safe-area-inset-bottom));background:linear-gradient(145deg,rgba(25,30,42,.88),rgba(5,10,19,.95));border:1px solid rgba(255,255,255,.18);border-bottom:0;border-radius:28px 28px 0 0;box-shadow:0 -18px 65px rgba(0,0,0,.62),inset 0 1px 0 rgba(255,255,255,.1);backdrop-filter:blur(28px) saturate(130%);-webkit-backdrop-filter:blur(28px) saturate(130%);transform:translate(50%,120%);}
.filters-sheet.show{transform:translate(50%,0);}.filters-sheet-handle{width:64px;margin-bottom:15px;background:rgba(255,255,255,.38);}.filters-head{margin-bottom:17px;}.filters-head h2{margin:0;font-size:22px;font-weight:800;}.filters-clear{padding:4px 0!important;border:0!important;background:transparent!important;color:#aeb8cc!important;font:inherit;font-size:13px;cursor:pointer;}
.filters-sheet .filter-group{margin:0 0 18px;padding-bottom:18px;border-bottom:1px solid rgba(255,255,255,.14);}.filters-sheet .filter-size-group{padding-bottom:0;border-bottom:0;}.filters-sheet .title{margin:0 0 11px;font-size:14px;}.filters-sheet .select-wrap select{height:48px;padding:0 16px;background:rgba(0,0,0,.34);border:1px solid rgba(255,255,255,.12);border-radius:99px;outline:none;}.filters-sheet .select-chevron{width:18px;height:18px;filter:brightness(0) invert(1);}
.filter-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}.filters-sheet .filter-option{min-width:0;padding:0!important;border:0!important;background:transparent!important;color:#f8f9fd!important;font:inherit;font-size:12px;font-weight:700;line-height:1.5;cursor:pointer;box-shadow:none!important;}.filter-option-icon{width:64px;height:64px;margin:0 auto 7px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.14);border-radius:50%;background:rgba(1,7,17,.46);transition:background .18s,border-color .18s,box-shadow .18s;}.filter-option-icon img{width:30px;height:30px;object-fit:contain;filter:brightness(0) invert(1);}.platform-option .filter-option-icon img{width:36px;height:36px;}.filter-option.active .filter-option-icon{background:#1761e9;border-color:#1761e9;box-shadow:0 5px 20px rgba(23,97,233,.36);}
.filters-sheet .size-range{height:18px;margin:0;direction:rtl;appearance:none;-webkit-appearance:none;background:transparent;cursor:pointer;}.filters-sheet .size-range::-webkit-slider-runnable-track{height:8px;border-radius:99px;background:#1c63f0;}.filters-sheet .size-range::-moz-range-track{height:8px;border-radius:99px;background:#1c63f0;}.filters-sheet .size-range::-webkit-slider-thumb{width:18px;height:18px;margin-top:-5px;appearance:none;-webkit-appearance:none;border:0;border-radius:50%;background:#f7f9ff;box-shadow:0 1px 7px rgba(0,0,0,.45);}.filters-sheet .size-range::-moz-range-thumb{width:18px;height:18px;border:0;border-radius:50%;background:#f7f9ff;}.filters-sheet .range-labels{direction:rtl;color:#f3f5fb;font-size:10px;font-weight:600;}.filters-sheet .apply-btn{height:48px;margin-top:3px;border-radius:99px;font-size:16px;}
@media(min-width:1101px){.all-games-top-filters{display:none;}}
@media(max-width:390px){.filters-sheet{width:calc(100% - 20px);padding-right:14px;padding-left:14px;}.filter-option-icon{width:58px;height:58px;}.filters-sheet .filter-option{font-size:11px;}}
.games-pagination{display:flex; justify-content:center; gap:10px; margin-top:24px;}
.games-pagination .page-numbers{background:var(--bg-card); border:1px solid var(--border); color:var(--text); padding:9px 15px; border-radius:9px; font-size:13px;}
.games-pagination .page-numbers.current{background:var(--accent); border-color:var(--accent); color:#fff;}
.infinite-loader{display:none; justify-content:center; padding:26px 0;}
.spinner{width:30px; height:30px; border-radius:50%; border:3px solid var(--border); border-top-color:var(--accent); animation:emperatoorSpin .7s linear infinite;}
@keyframes emperatoorSpin{to{transform:rotate(360deg);}}

#pullToRefreshIndicator{
  position:fixed; top:0; left:0; right:0; height:0; z-index:200;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
  background:var(--bg); transition:height .15s ease;
}
#pullToRefreshIndicator .ptr-spinner{
  width:26px; height:26px; border-radius:50%;
  border:3px solid var(--border); border-top-color:var(--accent);
}
#pullToRefreshIndicator.ready .ptr-spinner{border-top-color:var(--success);}
#pullToRefreshIndicator.refreshing .ptr-spinner{animation:emperatoorSpin .6s linear infinite;}
.fav-btn{width:36px; height:36px; border-radius:10px; background:var(--bg-elevated); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--text-muted); cursor:pointer;}
.fav-btn.on{color:var(--heart); border-color:var(--heart);}
.add-btn{background:var(--accent); color:#fff; border:none; border-radius:10px; font-size:17px; font-weight:700; cursor:pointer;}
.add-btn.added{background:var(--success); color:#141B34;}

/* ---------- mini cart bar (above bottom nav, mobile) ---------- */
.mini-cart-bar{display:none !important; position:fixed; bottom:65px; left:50%; transform:translateX(-50%); z-index:55; background:rgba(20, 20, 20, 0.55); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); color:#fff; padding:14px 26px; align-items:center; justify-content:space-between; gap:22px; font-size:15px; font-weight:300; border-radius:999px; width:calc(100% - 32px); max-width:420px; box-shadow:0 8px 24px #0006; pointer-events:none;}
.mini-cart-bar .mini-cart-size{display:flex; align-items:center; gap:6px; direction:ltr; font-weight:300;}
.mini-cart-bar .mini-cart-count{font-weight:300;}

/* Installed PWA only: keep the mini cart above the bottom navigation and device safe area. */
.ios-pwa-prompt{position:fixed; inset:0; display:none; z-index:9999; align-items:center; justify-content:center; padding:20px; background:rgba(2,8,18,.72);}
.ios-pwa-prompt.is-visible{display:flex;}
.ios-pwa-prompt-backdrop{position:absolute; inset:0; background:rgba(2,8,18,.65);}
.ios-pwa-prompt-card{position:relative; z-index:1; width:min(100%, 480px); background:rgba(15,21,31,.9); border:1px solid rgba(255,255,255,.13); border-radius:24px; padding:26px 20px 20px; box-shadow:0 26px 64px rgba(0,0,0,.38);}
.ios-pwa-brand-row{display:flex; align-items:center; justify-content:center; gap:12px; margin:10px 0 26px;}
.ios-pwa-brand-mark{width:42px; height:42px; border-radius:12px; background:linear-gradient(135deg,#1d6dff,#143ec6); display:flex; align-items:center; justify-content:center; box-shadow:0 0 18px rgba(33,104,255,.7);}
.ios-pwa-brand-mark img{width:22px; height:22px; object-fit:contain; filter:brightness(0) invert(1);}
.ios-pwa-brand-name{display:flex; align-items:center; justify-content:center; min-height:42px; font-weight:900; line-height:1; letter-spacing:.02em; color:#fff;}
.ios-pwa-brand-name img{max-height:32px; width:auto; display:block; filter:brightness(0) invert(1);}
.ios-pwa-brand-name span{font-size:30px; letter-spacing:.02em;}
.ios-pwa-copy{color:#fff; text-align:center; line-height:1.8;}
.ios-pwa-copy h2{margin:0 0 10px; font-size:18px; font-weight:800; color:#fff;}
.ios-pwa-copy p{margin:0; font-size:18px; font-weight:500; color:#f3f5fb; line-height:1.9;}
.ios-pwa-copy strong{font-weight:800;}
.ios-pwa-action-row{display:flex; align-items:center; justify-content:center; gap:10px; margin:18px auto 12px; color:#eff5ff; font-size:16px; font-weight:700;}
.ios-pwa-inline-cta{font-size:20px; letter-spacing:.02em;}
.ios-pwa-plus-icon{display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:8px; background:rgba(255,255,255,.08);}
.ios-pwa-plus-icon img{width:16px; height:16px; display:block; filter:brightness(0) invert(1);}
.inline-icon{display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; vertical-align:middle;}
.inline-icon img{width:18px; height:18px; display:block; filter:brightness(0) invert(1);}
.ios-pwa-hint{font-size:14px; color:#d9e1ef; margin-top:10px;}
.ios-pwa-dismiss{display:block; width:100%; margin-top:20px; border:0; border-radius:18px; padding:16px 20px; background:linear-gradient(180deg,#1d6dff,#0f5be6); color:#fff; font-weight:800; font-size:18px; cursor:pointer; box-shadow:0 14px 28px rgba(27,109,255,.34);}

@media (display-mode: standalone) and (max-width:1100px){
  .mini-cart-bar{bottom:calc(88px + env(safe-area-inset-bottom));}
}

@media (display-mode: standalone){
  .ios-pwa-prompt{display:none !important;}
}

@media (max-width: 767px){
  .ios-pwa-prompt{padding:12px;}
  .ios-pwa-prompt-card{padding:20px 18px 18px; border-radius:20px;}
  .ios-pwa-brand-name span{font-size:24px;}
  .ios-pwa-copy h2{font-size:16px;}
  .ios-pwa-copy p{font-size:15px; line-height:1.75;}
  .ios-pwa-inline-cta{font-size:18px;}
  .ios-pwa-dismiss{font-size:16px; padding:14px 18px;}
}

/* ---------- bottom app nav (mobile) ---------- */
.bottom-nav{display:none; position:fixed; bottom:0; right:0; left:0; z-index:70; background:var(--bg-elevated); border-top:1px solid var(--border); padding:8px 6px calc(8px + env(safe-area-inset-bottom)); align-items:center; justify-content:space-around;}
.bottom-nav a{display:flex; flex-direction:column; align-items:center; gap:5px; font-size:10.5px; font-weight:600; color:var(--text-faint); position:relative;}
.bottom-nav a.active{color:var(--accent-bright);}
.bottom-nav a .ic{display:flex; align-items:center; justify-content:center;}
.bottom-nav a .ic svg{width:20px; height:20px;}
.bottom-nav .badge{position:absolute; top:-6px; left:-10px; background:var(--accent); color:#fff; font-size:9px; border-radius:999px; padding:1px 6px;}
.mobile-search{display:none;}
.mobile-search-open{overflow:hidden;}
.orientation-lock{display:none;}
@media (max-width:1100px) and (orientation:landscape){
  .orientation-lock{position:fixed;inset:0;z-index:2000;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:28px;text-align:center;direction:rtl;background:var(--bg);color:var(--text);}
  .orientation-lock-icon{font-size:46px;line-height:1;color:var(--accent-bright);transform:rotate(-45deg);}
  .orientation-lock strong{font-size:20px;font-weight:800;}
  .orientation-lock span{max-width:320px;color:var(--text-muted);font-size:13px;line-height:1.8;}
}

/* ---------- install cart page ---------- */
.cart-page{max-width:700px; margin:0 auto; padding:24px 18px 100px;}
.cart-page-head{display:flex; align-items:center; gap:12px; margin-bottom:6px;}
.cart-badge{width:30px;height:30px;border-radius:50%; background:var(--accent); color:#fff; display:flex;align-items:center;justify-content:center; font-weight:800;}
.cart-item-row{display:flex; align-items:center; gap:14px; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:14px; margin-bottom:12px;}
.cart-item-thumb{width:70px; height:70px; border-radius:10px; background-size:cover; background-position:center;}
.cart-item-remove{color:var(--text-faint); cursor:pointer; font-size:18px;}
.hero-home{border-radius:var(--radius); min-height:340px; padding:36px; margin-bottom:28px; display:flex; align-items:flex-end; width:100%; max-width:100%; min-width:0; box-sizing:border-box;}
.hero-home h1{font-size:34px; font-weight:900; color:#fff; margin-bottom:12px; line-height:1.25;}
.hero-home p{color:#e6e8f2; font-size:14px; line-height:1.8; margin-bottom:18px;}
.hero-home-cta{display:inline-block; background:var(--accent); color:#fff; font-weight:700; padding:13px 24px; border-radius:11px; font-size:14px;}

/* ---------- HERO CAROUSEL ---------- */
.hero-carousel{position:relative; border-radius:var(--radius); min-height:340px; margin-bottom:28px; overflow:hidden; width:100%; max-width:100%; min-width:0; box-sizing:border-box;}
.hero-slide{position:absolute; inset:0; opacity:0; visibility:hidden; transition:opacity .5s ease; display:flex; align-items:flex-end; padding:36px; box-sizing:border-box; width:100%; max-width:100%; background-size:cover; background-position:center; background-repeat:no-repeat;}
.hero-slide::after{content:''; position:absolute; inset:0; background:linear-gradient(0deg, #000000cc 0%, #00000066 35%, transparent 65%); pointer-events:none; z-index:1;}
.hero-slide.active{opacity:1; visibility:visible;}
.hero-slide-content{max-width:520px; width:100%; position:relative; z-index:2; word-break:break-word; overflow-wrap:break-word; box-sizing:border-box;}
.hero-slide-content h1{font-size:34px; font-weight:900; color:#fff; margin-bottom:12px; line-height:1.25; text-shadow:0 2px 10px rgba(0,0,0,0.6);}
.hero-slide-content p{color:#e6e8f2; font-size:14px; line-height:1.8; margin-bottom:18px; display:inline-block; background:rgba(0,0,0,0.5); padding:10px 14px; border-radius:12px;}
.hero-dots{position:absolute; bottom:16px; left:50%; transform:translateX(-50%); display:flex; gap:6px; z-index:3;}
.hero-dot{width:8px; height:8px; border-radius:50%; background:#ffffff55; cursor:pointer; transition:.2s;}
.hero-dot.active{background:#fff; width:22px; border-radius:5px;}
.section-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;}
.section-head h2{font-size:17px; font-weight:800;}
.section-head-first{margin-top:0;}

.storage-card{background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:18px; margin:18px 0;}
.info-chip{background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; text-align:center; padding:16px 6px;}
.storage-bar{height:8px; border-radius:6px; background:var(--border); overflow:hidden; margin:10px 0;}
.storage-bar-fill{height:100%; background:var(--accent); transition:width .3s ease, background-color .3s ease;}
.storage-bar-fill.bar-yellow{background:#eab308;}
.storage-bar-fill.bar-red{background:#ef4444;}
.storage-warning{background:#5a3c0d; color:#ffd580; border-radius:10px; padding:12px 14px; font-size:12.5px; margin-top:12px;}
.order-form input, .order-form select{width:100%; background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-sm); padding:13px 16px; color:var(--text); margin-bottom:12px;}
.submit-btn{width:100%; background:var(--accent); color:#fff; border:none; padding:16px; border-radius:var(--radius-sm); font-weight:700; font-size:15px; cursor:pointer;}
.empty-state{text-align:center; padding:60px 20px; color:var(--text-faint);}

/* ---------- SINGLE GAME PAGE (no site header, custom hero) ---------- */
.single-game-shell{max-width:900px; margin:0 auto;}
.sg-hero{position:relative; width:100%; min-height:340px; background-size:cover; background-position:center;}
.sg-hero-gradient{position:absolute; inset:0; background:linear-gradient(0deg, var(--bg) 0%, var(--bg) 30%, transparent 100%); pointer-events:none;}
.sg-hero-top{position:fixed; top:0; left:0; right:0; display:flex; align-items:center; justify-content:space-between; padding:calc(16px + env(safe-area-inset-top)) 16px 16px; z-index:50;}
.sg-icon-btn{width:38px; height:38px; border-radius:50%; background:#00000066; backdrop-filter:blur(6px); border:1px solid #ffffff22; display:flex; align-items:center; justify-content:center; color:#fff; cursor:pointer;}
.sg-icon-btn.is-fav{color:var(--heart); border-color:var(--heart);}
.sg-back-btn{color:#fff;}
.sg-hero-overlay{position:absolute; bottom:0; left:0; right:0; padding:0px 18px 0px; z-index:2; direction:ltr; text-align:left;}
.sg-body{padding:0 18px 20px;}
.sg-title{font-size:26px; font-weight:300; color:#fff; margin:0 0 8px; text-shadow:0 3px 12px rgba(0,0,0,0.85);}
.sg-platform-row{display:flex; gap:10px; margin-bottom:8px; justify-content:flex-start;}
.sg-platform-badge{background:#000000aa; border-radius:10px; padding:8px 14px; display:flex; align-items:center; justify-content:center;}
.sg-platform-badge img{height:20px; width:auto; display:block;}
.sg-add-btn{width:100%; display:flex; align-items:center; justify-content:center; gap:10px; padding:12px; font-size:15px; margin-bottom:0;}
.info-chip-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:15px; margin-top:15px;}
.info-chip-icon{width:24px;height:24px;object-fit:contain;filter:brightness(0) invert(1);opacity:.9;}
.section-head a{color:var(--text-muted);font-size:12.5px;white-space:nowrap;}
.search-results-page{padding:4px 0 30px;}.search-results-head{margin:0 0 18px;}.search-results-head h1{margin:0;font-size:20px;font-weight:800;}
.sg-gallery{display:flex;gap:10px;overflow-x:auto;margin:0 calc(var(--content-gutter) * -1) 5px;padding:0 var(--content-gutter) 6px;-webkit-overflow-scrolling:touch;scrollbar-width:none;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 var(--content-gutter),#000 calc(100% - var(--content-gutter)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,#000 var(--content-gutter),#000 calc(100% - var(--content-gutter)),transparent 100%);}
.sg-gallery::-webkit-scrollbar{display:none;}
.sg-gallery-item{flex:0 0 auto;width:330px;height:180px;padding:0;border:0;border-radius:12px;overflow:hidden;background:transparent;cursor:zoom-in;}.sg-gallery-item img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .2s ease;}.sg-gallery-item:hover img{transform:scale(1.03);}
.sg-gallery-viewer{position:fixed;inset:0;z-index:500;display:none;align-items:center;justify-content:center;overflow:hidden;background:rgba(0,4,12,.76);}.sg-gallery-viewer.is-open{display:flex;}.sg-gallery-viewer-blur{position:absolute;inset:-35px;background-position:center;background-size:cover;filter:blur(28px);opacity:.42;transform:scale(1.12);}.sg-gallery-viewer::after{content:'';position:absolute;inset:0;background:rgba(0,5,15,.46);}
.sg-gallery-figure{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:12px;width:min(94vw,1120px);margin:0;}.sg-gallery-figure img{display:block;max-width:100%;max-height:78dvh;border-radius:14px;box-shadow:0 18px 55px rgba(0,0,0,.65);object-fit:contain;}.sg-gallery-figure figcaption{color:#fff;font-size:13px;direction:ltr;}.sg-gallery-close,.sg-gallery-nav{position:absolute;z-index:2;display:grid;place-items:center;width:44px;height:44px;border:1px solid rgba(255,255,255,.25);border-radius:50%;background:rgba(4,10,21,.58);color:#fff;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);cursor:pointer;}.sg-gallery-close{top:calc(18px + env(safe-area-inset-top));right:18px;font-size:30px;font-weight:300;line-height:1;}.sg-gallery-nav{top:50%;transform:translateY(-50%);font-size:38px;font-weight:300;line-height:1;}.sg-gallery-next{right:18px;}.sg-gallery-prev{left:18px;}

/* Swap the gallery arrows: next is on the left and previous on the right. */
.sg-gallery-next{left:18px;right:auto;}.sg-gallery-prev{right:18px;left:auto;}
@media(max-width:640px){.sg-gallery-item{width:350px;height:200px;}.sg-gallery-nav{width:38px;height:38px;font-size:32px;}.sg-gallery-next{right:9px;}.sg-gallery-prev{left:9px;}.sg-gallery-figure{width:calc(100vw - 74px);}.sg-gallery-figure img{max-height:70dvh;}.sg-gallery-close{top:calc(12px + env(safe-area-inset-top));right:12px;}}

@media(max-width:1100px){
  :root{--content-gutter:30px;}
  .layout{grid-template-columns:1fr;}
  .games-grid{grid-template-columns:repeat(3,1fr); gap:10px;}
  .sidebar{display:none;} /* هم منو هم فیلترها فقط رو دسکتاپ بمونن */
  .bottom-nav{display:flex;}
  .mini-cart-bar{display:flex;}
  .layout{padding-bottom:130px;}

  .topbar{flex-wrap:wrap; row-gap:4px;}
  .logo{order:1; flex:1 1 100%; justify-content:center;}
  .account-btn{display:none;}
  .search-wrap{order:3; flex:1 1 100%; max-width:none;}
  .search-wrap input{cursor:text;}
  .mobile-search{position:fixed;inset:0;z-index:150;background:var(--bg);display:none;flex-direction:column;padding:calc(14px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));overflow-y:auto;}
  .mobile-search.is-open{display:flex;}
  .mobile-search-head{display:flex;align-items:center;gap:10px;}
  .mobile-search-form{display:flex;align-items:center;flex:1;min-width:0;height:58px;padding:0 10px 0 14px;border:1px solid rgba(255,255,255,.1);border-radius:999px;background:var(--bg-elevated);box-shadow:0 8px 22px rgba(0,0,0,.24);direction:ltr;}
  .mobile-search-form input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--text);font-size:18px;text-align:left;direction:ltr;}
  .mobile-search-form input::placeholder{color:var(--text-muted);opacity:1;}
  .mobile-search-form button,.mobile-search-close{display:grid;place-items:center;border:0;cursor:pointer;}
  .mobile-search-form button{order:2;flex:0 0 32px;width:32px;height:32px;padding:0;border-radius:50%;background:var(--accent);}
  .mobile-search-form button img{display:block;width:18px;height:18px;filter:brightness(0) invert(1);}
  .mobile-search-close{flex:0 0 58px;width:58px;height:58px;padding:0;border-radius:50%;background:var(--bg-elevated);box-shadow:0 8px 22px rgba(0,0,0,.24);}
  .mobile-search-close img{display:block;width:30px;height:30px;filter:brightness(0) invert(1);}
  .mobile-search-results{flex:1;min-height:0;padding-top:22px;overflow-y:auto;-webkit-overflow-scrolling:touch;}
  .mobile-search-placeholder,.mobile-search-loading{margin:0;text-align:center;color:var(--text-muted);font-size:15px;}
  .mobile-search-results .games-grid{grid-template-columns:repeat(3,1fr);gap:10px;}
  .mobile-search-results .search-results-head{display:none;}
}
@media(max-width:640px){
  .games-grid{grid-template-columns:repeat(3,1fr); gap:8px;}
  .info-chip{min-height:90px; padding:12px 6px;}
  .info-chip b{font-size:13px; line-height:1.3;}
  .hero-home{min-height:160px; padding:18px; margin-bottom:20px;}
  .hero-home h1{font-size:20px; margin-bottom:6px;}
  .hero-home p{font-size:11.5px; line-height:1.5; margin-bottom:12px;}
  .hero-home-cta{padding:9px 18px; font-size:12.5px;}
  .hero-carousel{min-height:200px; margin-bottom:20px;}
  .hero-slide{padding:18px;}
  .hero-slide-content h1{font-size:17px; margin-bottom:6px;}
  .hero-slide-content p{font-size:11.5px; line-height:1.5; margin-bottom:8px;}
  .section-head{margin-bottom:10px;}
  .section-head h2{font-size:14px; font-weight:700;}
}

@media(max-width:640px){.sg-gallery-next{left:9px;right:auto;}.sg-gallery-prev{right:9px;left:auto;}}

/* Installed PWA: compact iOS-style tab bar using the existing icons and labels. */
@media (display-mode: standalone) and (max-width:1100px){
  body {
    min-height: 100vh;
  }
  .layout{display:block;padding:calc(132px + env(safe-area-inset-top)) 18px 156px;}
  .topbar{position:fixed;z-index:69;top:0;right:0;left:0;display:flex;margin:0;padding:calc(18px + env(safe-area-inset-top)) 18px 14px;row-gap:24px;background:linear-gradient(180deg,rgba(6,9,17,.98) 0%,rgba(6,9,17,.92) 50%,rgba(6,9,17,0) 100%);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);}
  .topbar .logo{order:1;}.topbar .search-wrap{order:2;flex:1 1 auto;min-width:1;}.topbar .account-btn{display:none;}.topbar-filter-button{display:flex;order:3;flex:0 0 48px;width:48px;height:48px;margin-right:0px;padding:0;border:1px solid rgba(255,255,255,.24);border-radius:50%;background:#090e18;color:var(--text);align-items:center;justify-content:center;cursor:pointer;}.topbar-filter-button img{display:block;width:25px;height:25px;}
  .bottom-nav{right:12px;left:12px;bottom:calc(10px + env(safe-area-inset-bottom));min-height:68px;padding:7px;background:rgba(13,20,32,.88);border:1px solid rgba(255,255,255,.10);border-radius:26px;box-shadow:0 12px 34px rgba(0,0,0,.38);backdrop-filter:blur(22px) saturate(140%);-webkit-backdrop-filter:blur(22px) saturate(140%);justify-content:space-between;overflow:hidden;}
  .bottom-nav-indicator{position:absolute;z-index:0;top:7px;bottom:7px;border-radius:20px;background:linear-gradient(135deg,rgba(52,102,255,.34),rgba(37,87,245,.15));box-shadow:inset 0 1px 0 rgba(255,255,255,.09),0 5px 16px rgba(27,83,255,.16);transition:transform .34s cubic-bezier(.2,.9,.2,1),width .34s cubic-bezier(.2,.9,.2,1);pointer-events:none;}
  .bottom-nav a{z-index:1;flex:1 1 20%;min-width:0;min-height:53px;padding:6px 3px;border-radius:20px;gap:3px;color:#7c879b;font-size:10px;line-height:1.15;transition:color .2s ease,transform .25s ease;}
  .bottom-nav a .ic{width:25px;height:25px;}.bottom-nav a .ic svg{width:22px;height:22px;}
  .bottom-nav a.active{color:var(--accent-bright);background:transparent;transform:translateY(-1px);}
  .bottom-nav .badge{top:2px;left:calc(50% - 18px);border:2px solid rgba(13,20,32,.88);}
  .mini-cart-bar{bottom:calc(96px + env(safe-area-inset-bottom));}
  html{scroll-behavior:smooth;}html.pwa-page-leaving body{opacity:.2;transform:translateX(-12px);transition:opacity .14s ease,transform .14s ease;}body{transition:opacity .16s ease,transform .16s ease;}
  input,select,textarea{font-size:16px!important;}
  .cart-page{padding-top:8px;}
  .layout .cart-page{margin-top:-28px;}
}
@media (display-mode: standalone) and (max-width:1100px) and (prefers-reduced-motion: reduce){.bottom-nav-indicator,.bottom-nav a,body{transition:none!important;}}

/* ---------- PWA polish: persistent chrome, launch screen and game detail ---------- */
.pwa-splash{display:none;}
.sg-section-title{margin:0 0 12px;font-size:20px;font-weight:300;}
.sg-media{margin:4px 0 24px;}.sg-media-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:0 0 14px;padding:4px;border:1px solid var(--border);border-radius:999px;background:var(--bg-elevated);direction:rtl;}.sg-media-tabs button{min-height:48px;border:0;border-radius:999px;background:transparent;color:var(--text-muted);font-size:17px;font-weight:400;cursor:pointer;transition:background .3s cubic-bezier(.2,.9,.2,1),color .25s ease,transform .25s ease;}.sg-media-tabs button.is-active{background:linear-gradient(135deg,var(--accent),#193eb8);color:#fff;box-shadow:0 4px 14px rgba(36,87,245,.32);}.sg-media-tabs button:active{transform:scale(.97);}.sg-video-wrap{overflow:hidden;border-radius:14px;aspect-ratio:16/9;background:#040711;}.sg-video-wrap iframe,.sg-video-wrap video{display:block;width:100%;height:100%;border:0;object-fit:cover;}
.sg-about{margin:0 0 0px;}.sg-about-head{display:flex;align-items:center;justify-content:space-between;gap:12px;}.sg-about-toggle{position:absolute;left:50%;bottom:0px;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;width:26px;height:10px;border:0;background:transparent;color:var(--accent-bright);cursor:pointer;z-index:2;padding:0;}.sg-about-toggle img{display:block;width:25px;height:25px;opacity:.92;transition:transform .25s ease;}.sg-about-content{position:relative;max-height:5.7em;overflow:hidden;color:var(--text-muted);font-size:13.5px;font-weight:400;line-height:1.9;transition:max-height .35s ease;cursor:pointer;padding-bottom:0px;}.sg-about-content::after{content:'';position:absolute;right:0;bottom:0;left:0;height:2.8em;background:linear-gradient(transparent,var(--bg));pointer-events:none;}.sg-about-content.is-expanded{max-height:1000vh;padding-bottom:0px;}.sg-about-content.is-expanded::after{display:none;}.sg-about-content.is-expanded .sg-about-toggle img{transform:rotate(180deg);} 
.sg-related{margin:0 0 118px;}.sg-related-row{display:flex;gap:12px;overflow-x:auto;padding:12px 0 16px;margin-block:-12px;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;}.sg-related-row::-webkit-scrollbar{display:none;}.sg-related-card{position:relative;flex:0 0 calc(31% - 8px);min-width:100px;min-height:0;aspect-ratio:3/4;padding:7px;border:1px solid var(--border);border-radius:13px;background:linear-gradient(150deg,#10192a,#0a101b);overflow:hidden;scroll-snap-align:start;}.sg-related-image{display:block;height:62%;border-radius:9px;background:center/cover no-repeat;}.sg-related-card h3{margin:7px 0 3px;direction:ltr;text-align:left;font-size:12px;font-weight:600;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.sg-related-card p{margin:0;color:#c8d0df;direction:ltr;text-align:left;font-size:10px;}.sg-related-card .card-add-btn{position:absolute;right:7px;bottom:7px;width:28px;height:26px;border-radius:7px;font-size:20px;line-height:1;}.sg-related-card .btn-added-state{font-size:14px;}

@media (display-mode: standalone) and (max-width:1100px){
  :root{--content-gutter:18px;}
  .pwa-splash{position:fixed;z-index:1000;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;background:radial-gradient(circle at 50% 42%,#122346 0%,#080e1a 44%,#060911 82%);opacity:1;visibility:visible;transition:opacity .35s ease,visibility .35s ease;}.pwa-splash.is-hidden{opacity:0;visibility:hidden;}.pwa-splash-brand{display:flex;align-items:center;justify-content:center;min-height:56px;color:#fff;font-weight:800;font-size:24px;}.pwa-splash-brand img{display:block;max-width:190px;max-height:62px;width:auto;height:auto;}.pwa-splash-loader{width:29px;height:29px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--accent-bright);border-radius:50%;animation:emperatoorSpin .75s linear infinite;}
  .topbar{background:linear-gradient(180deg,#060911 0%,rgba(6,9,17,.94) 70%,rgba(6,9,17,0) 100%);backdrop-filter:none;-webkit-backdrop-filter:none;}
  .bottom-nav{background:linear-gradient(0deg,#060911 0%,rgba(6,9,17,.97) 72%,rgba(6,9,17,.89) 100%);border-color:rgba(139,160,205,.16);backdrop-filter:none;-webkit-backdrop-filter:none;}
  html.pwa-page-leaving body{opacity:1;transform:none;}html.pwa-page-leaving .layout .main{opacity:.2;transform:translateX(-12px);}.layout .main{transition:opacity .14s ease,transform .14s ease;}
  .bottom-nav-indicator{left:0;right:auto;background:linear-gradient(145deg,rgba(71,109,236,.52),rgba(41,73,176,.25));box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 6px 18px rgba(18,56,174,.3);transition:transform .48s cubic-bezier(.34,1.56,.64,1),width .48s cubic-bezier(.34,1.56,.64,1),opacity .18s ease;}.bottom-nav-indicator.is-moving{animation:navIndicatorPulse .48s ease;}.bottom-nav a.active .ic{animation:navIconPop .42s cubic-bezier(.34,1.56,.64,1);}
  .sg-media-tabs button{min-height:45px;font-size:18px;}
}
@keyframes navIndicatorPulse{50%{filter:brightness(1.32);}}@keyframes navIconPop{45%{transform:translateY(-3px) scale(1.16);}}
