/* ═══════════════════════════════════════════
   Magicably Oyun — Ana Stil
   Tema: Koyu uzay, neon aksanlar, geometric
   ═══════════════════════════════════════════ */

:root {
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --bg3:       #18181f;
  --bg4:       #1e1e28;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --text:      #e8e6f0;
  --text2:     #8e8ca0;
  --text3:     #5a5870;
  --accent:    #7c5cfc;
  --accent2:   #a87fff;
  --neon:      #00f5d4;
  --neon2:     #00c9b1;
  --warn:      #f5a623;
  --danger:    #ff4d6d;
  --success:   #22d3a0;
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── HEADER ─────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.logo em { color: var(--accent2); font-style: normal; }
.logo-icon {
  font-size: 1.4rem;
  color: var(--neon);
  line-height: 1;
}
.header-nav { display: flex; gap: 16px; }
.nav-link {
  font-size: 0.875rem;
  color: var(--text2);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

/* ─── HERO ───────────────────────────── */
.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.orb-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: -200px; left: -100px;
}
.orb-2 {
  width: 350px; height: 350px;
  background: var(--neon);
  top: -100px; right: 100px;
  opacity: 0.2;
}
.orb-3 {
  width: 250px; height: 250px;
  background: var(--warn);
  bottom: -80px; left: 40%;
  opacity: 0.15;
}

.hero .container { position: relative; }

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}
.hero-title span {
  -webkit-text-stroke: 2px var(--accent2);
  color: transparent;
}

.hero-sub {
  color: var(--text2);
  font-size: 1.1rem;
  margin-bottom: 32px;
  font-weight: 300;
}

.search-form {
  display: flex;
  max-width: 480px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,252,0.15);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 14px 20px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.search-input::placeholder { color: var(--text3); }

.search-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0 22px;
  font-size: 1.2rem;
  transition: background 0.2s;
}
.search-btn:hover { background: var(--accent2); }

/* ─── KATEGORİLER BAR ────────────────── */
.categories-bar {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.cat-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 50px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text2);
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-pill:hover {
  border-color: var(--border2);
  color: var(--text);
  transform: translateY(-1px);
}
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── MAIN CONTENT ───────────────────── */
.main-content { padding: 48px 0 80px; }

.section { margin-bottom: 56px; }

.section-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title span { font-size: 1.1rem; }

.results-header {
  margin-bottom: 24px;
  color: var(--text2);
  font-size: 0.9rem;
}
.clear-filter {
  margin-left: 12px;
  color: var(--danger);
  opacity: 0.8;
  transition: opacity 0.2s;
}
.clear-filter:hover { opacity: 1; }

/* ─── OYUN KARTLARı ──────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.games-grid--featured {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
  box-shadow: var(--shadow);
}

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

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(124,92,252,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}
.game-card:hover .card-overlay { opacity: 1; }

.play-btn {
  background: #fff;
  color: var(--accent);
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 600;
  font-family: var(--font-head);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.badge-featured {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--warn);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}
.card-desc {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.4;
  flex: 1;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.card-cat {
  font-size: 0.75rem;
  color: var(--text3);
}
.card-plays {
  font-size: 0.75rem;
  color: var(--neon2);
}

.game-card--big .card-title { font-size: 1.05rem; }
.game-card--big .card-body { padding: 16px; }

/* ─── BOŞ DURUM ──────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: var(--text2);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}

/* ─── FOOTER ─────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text2);
}
.footer-text {
  font-size: 0.85rem;
  color: var(--text3);
  flex: 1;
}
.footer-link {
  font-size: 0.85rem;
  color: var(--accent2);
  transition: color 0.2s;
}
.footer-link:hover { color: var(--text); }

/* ─── BUTONLAR ───────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border-color: var(--border2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--bg3); }

.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; border-radius: 6px; }
.btn-edit { background: var(--bg4); color: var(--text2); border-color: var(--border); }
.btn-edit:hover { color: var(--text); border-color: var(--border2); }
.btn-view { background: rgba(0,245,212,0.08); color: var(--neon2); border-color: rgba(0,245,212,0.2); }
.btn-view:hover { background: rgba(0,245,212,0.15); }
.btn-delete { background: rgba(255,77,109,0.08); color: var(--danger); border-color: rgba(255,77,109,0.2); }
.btn-delete:hover { background: rgba(255,77,109,0.15); }
.btn-back {
  background: var(--bg3);
  color: var(--text2);
  border-color: var(--border);
  border-radius: 50px;
  padding: 8px 18px;
}
.btn-back:hover { color: var(--text); }

/* ─── ALERT ──────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.875rem;
}
.alert-error   { background: rgba(255,77,109,0.1); border: 1px solid rgba(255,77,109,0.3); color: #ff8fa3; }
.alert-success { background: rgba(34,211,160,0.1); border: 1px solid rgba(34,211,160,0.3); color: var(--success); }

/* ─── RESPONSIVE ─────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 48px 0 40px; }
  .hero-title { font-size: 3rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .games-grid--featured { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}
