:root {
  --bg: #0a0c13;
  --bg-2: #0f1320;
  --panel: #151a2a;
  --panel-2: #1b2133;
  --line: #262e45;
  --line-soft: #1e2437;
  --tx: #e9edf7;
  --tx-dim: #97a1ba;
  --tx-faint: #6a7490;
  --accent: #7c5cff;
  --accent-2: #a78bfa;
  --free: #22d18b;
  --hot: #ff4d6d;
  --gold: #ffb020;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

/* display:flex/grid tanımlı öğelerde hidden özniteliği ezilmesin */
[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(124, 92, 255, .16), transparent 60%),
    radial-gradient(900px 500px at 88% 0%, rgba(34, 209, 139, .10), transparent 55%),
    var(--bg);
  color: var(--tx);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent-2); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ---------------- Üst bar ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 12, 19, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-icon {
  font-size: 26px; width: 46px; height: 46px; flex: none;
  display: grid; place-items: center; border-radius: 13px;
  background: linear-gradient(140deg, rgba(124, 92, 255, .30), rgba(34, 209, 139, .20));
  border: 1px solid var(--line);
}
.brand h1 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.brand-sub { margin: 1px 0 0; font-size: 12.5px; color: var(--tx-faint); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.updated { font-size: 12.5px; color: var(--tx-faint); white-space: nowrap; }
.btn-refresh {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); color: var(--tx);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 15px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-refresh:hover { background: var(--panel-2); border-color: var(--accent); }
.btn-refresh.busy { opacity: .6; pointer-events: none; }
.btn-refresh.busy .rf-icon { display: inline-block; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- İstatistikler ---------------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0 20px; }
.stat {
  background: linear-gradient(160deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px;
}
.stat-v { font-size: 27px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.stat-l { font-size: 12.5px; color: var(--tx-faint); margin-top: 5px; }
.stat.green .stat-v { color: var(--free); }
.stat.gold  .stat-v { color: var(--gold); }
.stat.violet .stat-v { color: var(--accent-2); }

.banner {
  background: rgba(255, 77, 109, .10); border: 1px solid rgba(255, 77, 109, .35);
  color: #ffc2cc; border-radius: 11px; padding: 11px 15px; font-size: 13.5px; margin-bottom: 18px;
}

/* ---------------- Sekmeler ---------------- */

.tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line-soft); padding-bottom: 0; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--tx-dim); font: inherit; font-weight: 600; font-size: 14.5px;
  padding: 11px 15px; cursor: pointer; border-radius: 9px 9px 0 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--tx); background: rgba(255, 255, 255, .03); }
.tab.is-on { color: var(--tx); border-bottom-color: var(--accent); }
.tab-n {
  font-size: 11.5px; font-weight: 700; background: var(--panel-2);
  color: var(--tx-dim); border-radius: 20px; padding: 2px 8px; min-width: 22px; text-align: center;
}
.tab.is-on .tab-n { background: var(--accent); color: #fff; }

/* ---------------- Kontroller ---------------- */

.controls { margin: 18px 0 20px; }
.ctrl-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.search { position: relative; flex: 1 1 260px; min-width: 200px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .55; }
#q {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--tx);
  border-radius: 10px; padding: 10px 13px 10px 36px; font: inherit; font-size: 14px;
}
#q:focus { outline: none; border-color: var(--accent); }
#q::placeholder { color: var(--tx-faint); }

.sel { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx-faint); }
.sel select {
  background: var(--panel); border: 1px solid var(--line); color: var(--tx);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.sel select:focus { outline: none; border-color: var(--accent); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.track {
  width: 40px; height: 23px; border-radius: 20px; background: var(--panel-2);
  border: 1px solid var(--line); position: relative; transition: background .18s, border-color .18s; flex: none;
}
.knob {
  position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--tx-faint); transition: transform .18s, background .18s;
}
.switch input:checked + .track { background: rgba(124, 92, 255, .32); border-color: var(--accent); }
.switch input:checked + .track .knob { transform: translateX(17px); background: var(--accent-2); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-lbl { font-size: 13.5px; color: var(--tx-dim); font-weight: 500; }
.switch input:checked ~ .switch-lbl { color: var(--tx); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--tx-dim);
  border-radius: 20px; padding: 6px 13px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.chip:hover { color: var(--tx); border-color: var(--accent); }
.chip.is-on { background: rgba(124, 92, 255, .18); border-color: var(--accent); color: #fff; }
.chip-n { opacity: .6; margin-left: 5px; font-weight: 500; }

/* ---------------- Kartlar ---------------- */

.grid {
  display: grid; gap: 18px; margin-bottom: 40px;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}

.card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }

.thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1d2440, #131829); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 12, 19, .92) 0%, rgba(10, 12, 19, .12) 45%, transparent 70%);
}
.thumb-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; opacity: .25; }

.badges { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; justify-content: space-between; gap: 8px; }
.badge {
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 7px;
  backdrop-filter: blur(8px); white-space: nowrap; letter-spacing: .2px;
}
.badge.tier-hot { background: rgba(255, 77, 109, .88); color: #fff; }
.badge.tier-good { background: rgba(255, 176, 32, .88); color: #211703; }
.badge.tier-ok { background: rgba(20, 24, 38, .8); color: var(--tx-dim); }
.badge.store { background: rgba(20, 24, 38, .82); color: var(--tx); border: 1px solid rgba(255, 255, 255, .12); }

.timer {
  position: absolute; left: 12px; bottom: 11px; z-index: 2;
  font-size: 12px; font-weight: 700; color: var(--free);
  display: inline-flex; align-items: center; gap: 6px;
}
.timer.urgent { color: #ff8a9c; }
.timer.soon { color: var(--gold); }
.timer .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.price {
  position: absolute; right: 12px; bottom: 11px; z-index: 2;
  font-size: 12.5px; font-weight: 700; color: var(--tx-dim);
}
.price s { opacity: .75; font-weight: 600; }
.price b { color: var(--free); margin-left: 6px; }

.body { padding: 14px 16px 0; flex: 1; }
.title { margin: 0 0 6px; font-size: 15.5px; font-weight: 700; line-height: 1.32; letter-spacing: -.2px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--tx-faint); margin-bottom: 9px; }
.desc {
  margin: 0; font-size: 13px; color: var(--tx-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.act { padding: 13px 16px 15px; display: flex; align-items: center; gap: 10px; }
.btn-get {
  flex: 1; text-align: center; text-decoration: none;
  background: linear-gradient(135deg, var(--accent), #6244e0);
  color: #fff; font-weight: 700; font-size: 13.5px;
  border-radius: 10px; padding: 10px 14px; transition: filter .15s;
}
.btn-get:hover { filter: brightness(1.15); }
.card.f2p .btn-get { background: linear-gradient(135deg, #15a06a, var(--free)); color: #04180f; }
.score { font-size: 11.5px; font-weight: 700; color: var(--tx-faint); white-space: nowrap; }

/* ---------------- Durumlar ---------------- */

.empty { text-align: center; padding: 70px 20px; color: var(--tx-faint); }
.empty-icon { font-size: 44px; display: block; margin-bottom: 12px; opacity: .5; }

.skeleton { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); height: 300px; overflow: hidden; position: relative; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
  animation: sweep 1.3s infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }

.foot { padding: 26px 20px 44px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--tx-faint); }
.foot p { margin: 0 0 6px; }
.foot-dim { opacity: .75; }

/* ---------------- Online sayacı ---------------- */

.online {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(34, 209, 139, .10); border: 1px solid rgba(34, 209, 139, .32);
  color: var(--free); border-radius: 20px; padding: 6px 13px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--free); animation: pulse 1.8s ease-in-out infinite; }
.online-lbl { color: var(--tx-dim); font-weight: 500; }
.online-embed { display: inline-flex; align-items: center; }

/* ---------------- Reklam alanları ---------------- */
/* Hepsi kendi yerini önceden ayırır; reklam geç yüklense bile sayfa zıplamaz. */

.ad { margin: 0 0 20px; display: flex; justify-content: center; }
.ad-top { min-height: 90px; }

/* Reklam kodu yokken: doğrudan reklam satışı için davet kutusu */
.ad-empty {
  width: 100%; min-height: inherit;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: rgba(255, 255, 255, .015);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 12px; text-align: center;
  transition: border-color .15s, background .15s;
}
.ad-empty:hover { border-color: var(--accent); background: rgba(124, 92, 255, .05); }
.ad-empty-icon { font-size: 17px; line-height: 1; opacity: .85; }
.ad-empty-t { font-size: 13px; font-weight: 700; color: var(--tx-dim); }
.ad-empty-s { font-size: 11px; color: var(--tx-faint); letter-spacing: .3px; }
.ad-mail { font-size: 12px; font-weight: 600; color: var(--accent-2); text-decoration: none; margin-top: 2px; }
.ad-mail:hover { text-decoration: underline; }

/* Alt şerit dar olduğu için orada yan yana dizilir */
.ad-bottom .ad-empty { flex-direction: row; gap: 10px; padding: 8px 12px; }

/* Akış-içi reklam: oyun kartıyla aynı ölçüde, sadece etiketi farklı */
.card-ad { justify-content: center; }
.card-ad .ad-tag {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--tx-faint); padding: 8px 14px 0; font-weight: 700;
}
.card-ad .ad-body { flex: 1; display: grid; place-items: center; padding: 10px 14px 14px; min-height: 220px; }
.card-ad .ad-empty { min-height: 200px; }

/* Alta yapışan şerit */
.ad-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(10, 12, 19, .93); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
  padding: 8px 44px 8px 16px; min-height: 66px;
  display: flex; align-items: center; justify-content: center;
}
.ad-bottom-in { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 970px; }
.ad-bottom .ad-empty { min-height: 50px; }
.ad-x {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--tx-dim);
  font-size: 16px; line-height: 1; display: grid; place-items: center;
}
.ad-x:hover { color: var(--tx); border-color: var(--accent); }

/* Şerit açıkken sayfa sonu içerik altında kalmasın */
body.has-bottom-ad .foot { padding-bottom: 96px; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar-in { flex-wrap: wrap; }
  .brand h1 { font-size: 17px; }
  .ad-top { min-height: 100px; }
  .online-lbl { display: none; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .updated { display: none; }
}

/* Footer'daki reklam & iletişim satırı */
.foot-contact {
  margin-top: 12px !important; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--tx-dim); font-size: 13px;
}
.foot-contact strong { color: var(--tx); font-weight: 600; }
.foot-contact a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.foot-contact a:hover { text-decoration: underline; }
