/* =============================================
   main.css — MiniOyun Ana Stil Dosyası
   Tema: Koyu, neon aksan, arcade estetiği
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;500;600&display=swap');

/* ── CSS Değişkenleri ── */
:root {
  --bg:        #0a0a14;
  --bg2:       #10101e;
  --bg3:       #16162a;
  --card:      #13132030;
  --border:    #2a2a45;
  --neon:      #00f0ff;
  --neon2:     #ff00aa;
  --neon3:     #aaff00;
  --text:      #e8e8ff;
  --muted:     #6a6a9a;
  --radius:    12px;
  --radius-sm: 6px;
  --trans:     .2s ease;
  --font-head: 'Orbitron', monospace;
  --font-body: 'Rajdhani', sans-serif;
  --shadow:    0 8px 32px rgba(0,240,255,.08);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(0,240,255,.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(255,0,170,.05) 0%, transparent 60%);
}

a { color: var(--neon); text-decoration: none; transition: color var(--trans); }
a:hover { color: #fff; }

img { display: block; max-width: 100%; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,20,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  height: 60px;
}
.logo {
  display: flex; align-items: center; gap: .5rem;
  color: var(--text); font-family: var(--font-head);
  font-size: 1.2rem; font-weight: 700; white-space: nowrap;
}
.logo-icon { font-size: 1.5rem; }
.logo-text { color: var(--neon); text-shadow: 0 0 12px var(--neon); }

.search-form {
  display: flex; flex: 1; max-width: 380px;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--bg2);
  margin-left: auto;
}
.search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font-body);
  font-size: .95rem; padding: .5rem .8rem;
}
.search-input::placeholder { color: var(--muted); }
.search-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: .5rem .8rem;
  font-size: 1rem; transition: color var(--trans);
}
.search-btn:hover { color: var(--neon); }

/* ── Kategori bandı ── */
.cat-bar {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; gap: .4rem; padding: .6rem 1.5rem;
}
.cat-pill {
  padding: .3rem .9rem; border-radius: 20px;
  font-size: .8rem; font-family: var(--font-head);
  font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); color: var(--muted);
  transition: all var(--trans);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--neon); color: #000;
  border-color: var(--neon); text-shadow: none;
}

/* ── Layout ── */
.main-layout {
  max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem;
  display: grid; grid-template-columns: 1fr 240px; gap: 2rem;
}
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}

/* ── Section Titles ── */
.section-title {
  font-family: var(--font-head); font-size: 1rem;
  color: var(--neon); margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: .6rem;
}
.result-count {
  font-size: .75rem; color: var(--muted);
  font-family: var(--font-body); font-weight: 500;
}

/* ── Game Grid ── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
}

.game-card {
  display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  color: var(--text); transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
  cursor: pointer;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,240,255,.15);
  border-color: rgba(0,240,255,.35);
  color: var(--text);
}

.card-thumb {
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  background: var(--bg3);
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.game-card:hover .card-thumb img { transform: scale(1.06); }

.card-category {
  position: absolute; top: .5rem; right: .5rem;
  background: rgba(0,0,0,.7); border: 1px solid var(--border);
  color: var(--neon); font-size: .65rem; font-family: var(--font-head);
  padding: .15rem .5rem; border-radius: 4px;
}

.card-info { padding: .75rem; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.card-title { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.card-desc { font-size: .78rem; color: var(--muted); flex: 1; line-height: 1.4; }
.card-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .4rem;
}
.card-plays { font-size: .72rem; color: var(--muted); }
.play-btn {
  background: var(--neon); color: #000;
  font-family: var(--font-head); font-size: .68rem;
  padding: .2rem .6rem; border-radius: 4px;
  font-weight: 700; letter-spacing: .05em;
  transition: background var(--trans);
}
.game-card:hover .play-btn { background: #fff; }

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--muted);
}
.empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* ── Sidebar ── */
.sidebar-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.sidebar-title {
  font-family: var(--font-head); font-size: .8rem;
  color: var(--neon); margin-bottom: 1rem;
}
.popular-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.popular-item {
  display: flex; align-items: center; gap: .6rem;
  font-size: .82rem;
}
.pop-rank {
  min-width: 20px; text-align: center;
  font-family: var(--font-head); font-size: .7rem;
  color: var(--neon); font-weight: 700;
}
.popular-item img { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; }
.popular-item a { flex: 1; color: var(--text); font-size: .8rem; }
.popular-item a:hover { color: var(--neon); }
.pop-count { font-size: .7rem; color: var(--muted); }

/* ── Footer ── */
.site-footer {
  text-align: center; padding: 1.5rem;
  color: var(--muted); font-size: .8rem;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--neon); }

/* ══════════════════════════════════════════════
   OYUN SAYFASI
   ══════════════════════════════════════════════ */
.oyun-sayfasi { display: flex; flex-direction: column; }

.game-header {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.2rem;
  background: rgba(10,10,20,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.back-btn {
  color: var(--muted); font-size: .85rem; white-space: nowrap;
  padding: .3rem .6rem; border: 1px solid var(--border);
  border-radius: 6px; transition: all var(--trans);
}
.back-btn:hover { color: var(--neon); border-color: var(--neon); }
.game-page-title {
  font-family: var(--font-head); font-size: .95rem; font-weight: 700; flex: 1;
}
.game-page-cat {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--neon); font-size: .7rem; font-family: var(--font-head);
  padding: .2rem .6rem; border-radius: 20px;
}

/* ── Oyun Alanı ── */
.game-stage {
  background: #000; position: relative;
}
.iframe-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: calc(100vh - 60px);
  position: relative; overflow: hidden;
}
.iframe-wrap iframe {
  width: 100%; height: 100%; border: none;
  display: block;
}
.game-controls-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 1rem; background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.ctrl-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; padding: .3rem .8rem;
  border-radius: 6px; font-family: var(--font-body);
  font-size: .8rem; transition: all var(--trans);
}
.ctrl-btn:hover { border-color: var(--neon); color: var(--neon); }
.ctrl-info { font-size: .8rem; color: var(--muted); }

/* ── Oyun Bilgisi ── */
.game-info-block {
  max-width: 900px; margin: 2rem auto; padding: 0 1.2rem;
  display: flex; gap: 1.5rem; align-items: flex-start;
}
.game-info-cover {
  width: 120px; height: 80px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  flex-shrink: 0;
}
.game-info-text h2 { font-family: var(--font-head); font-size: 1rem; margin-bottom: .4rem; }
.game-desc { color: var(--muted); font-size: .88rem; }
.game-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.tag {
  font-size: .72rem; padding: .2rem .6rem;
  border: 1px solid var(--border); border-radius: 20px;
  color: var(--muted); font-family: var(--font-head);
}

/* ── Benzer oyunlar ── */
.similar-section { max-width: 900px; margin: 0 auto 2rem; padding: 0 1.2rem; }
.similar-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .8rem;
}
.similar-card {
  display: flex; flex-direction: column; gap: .4rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; color: var(--text); font-size: .78rem; text-align: center;
  transition: border-color var(--trans);
}
.similar-card:hover { border-color: var(--neon); color: var(--neon); }
.similar-card img { aspect-ratio: 16/10; object-fit: cover; }
.similar-card span { padding: .3rem .5rem; }

/* ══════════════════════════════════════════════
   BUTTONS (Global)
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--radius-sm);
  font-family: var(--font-head); font-size: .78rem;
  font-weight: 600; cursor: pointer; border: none;
  transition: all var(--trans); text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--neon); color: #000; }
.btn-primary:hover { background: #fff; color: #000; }
.btn-secondary { background: var(--bg3); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--neon); color: var(--neon); }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-danger { background: rgba(255,60,60,.15); border: 1px solid rgba(255,60,60,.3); color: #ff5555; }
.btn-danger:hover { background: rgba(255,60,60,.3); }
.btn-sm { padding: .3rem .6rem; font-size: .7rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ── */
.alert {
  padding: .8rem 1rem; border-radius: var(--radius-sm);
  font-size: .88rem; margin-bottom: 1rem;
}
.alert-success { background: rgba(0,255,0,.08); border: 1px solid rgba(0,255,0,.3); color: #88ff88; }
.alert-error   { background: rgba(255,0,0,.08); border: 1px solid rgba(255,0,0,.3); color: #ff8888; }

/* ══════════════════════════════════════════════
   TELEGRAM MINI APP — Ek uyum
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .header-inner { padding: 0; }
  .logo-text { display: none; }
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .main-layout { padding: 1rem .8rem; }
  .cat-inner { padding: .5rem .8rem; }
  .iframe-wrap { aspect-ratio: unset; height: 55vw; min-height: 200px; }
  .game-info-block { flex-direction: column; }
  .game-info-cover { width: 100%; height: 160px; }
}
