/*
Theme Name: GamePortal Dark
Theme URI: https://yoursite.com
Description: HTML5 Oyun Portalı - Her sayfa bir oyun, tam ekran deneyim
Author: GamePortal
Version: 1.0.0
Text Domain: gameportal
*/

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

:root {
  --bg-deep:        #040810;
  --bg-dark:        #070e1a;
  --bg-card:        #0d1627;
  --bg-card-hover:  #111e36;
  --border:         #1a2d50;
  --accent:         #00d4ff;
  --accent-dim:     #0099bb;
  --accent-glow:    rgba(0,212,255,0.12);
  --gold:           #f5a623;
  --hot:            #ff3d6e;
  --new-color:      #00e676;
  --text-primary:   #e8f0fe;
  --text-secondary: #8ba3cc;
  --text-muted:     #4a6080;
  --font-display:   'Orbitron', monospace;
  --font-body:      'Rajdhani', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }
img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
#site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(4,8,16,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 900;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-primary);
}
.site-logo span { color: var(--accent); text-shadow: 0 0 20px var(--accent); }

#primary-nav ul { list-style: none; display: flex; gap: 2rem; align-items: center; }
#primary-nav a {
  font-weight: 600; font-size: 0.88rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-secondary);
  padding: 0.3rem 0; border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
#primary-nav a:hover,
#primary-nav .current-menu-item a { color: var(--accent); border-bottom-color: var(--accent); }

.header-search {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.35rem 0.8rem; transition: border-color 0.2s;
}
.header-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.header-search input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-body);
  font-size: 0.88rem; width: 150px;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search button { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; }
.header-search button:hover { color: var(--accent); }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); padding: 0.4rem 0.6rem; cursor: pointer; font-size: 1.1rem; }

/* ===== HERO ===== */
.hero {
  position: relative; padding: 5rem 2rem 4rem; text-align: center; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0,212,255,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(255,61,110,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900; letter-spacing: 3px; text-transform: uppercase;
  line-height: 1.1; margin-bottom: 1rem; position: relative;
}
.hero-title .highlight { color: var(--accent); text-shadow: 0 0 40px rgba(0,212,255,0.5); }
.hero-subtitle { color: var(--text-secondary); font-size: 1.1rem; max-width: 480px; margin: 0 auto 2.5rem; }
.hero-cats { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.cat-btn {
  font-family: var(--font-body); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 0.45rem 1.2rem; border-radius: 4px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.cat-btn:hover, .cat-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* ===== CONTAINER / SECTION ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.games-section { padding: 3rem 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.section-title {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text-primary);
  display: flex; align-items: center; gap: 0.6rem;
}
.section-title::before { content: ''; display: block; width: 4px; height: 18px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 10px var(--accent); }
.section-more { font-size: 0.78rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.section-more:hover { color: var(--accent); }

/* ===== OYUN KARTLARI ===== */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
.games-grid.featured { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.game-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  transition: all 0.3s cubic-bezier(0.23,1,0.32,1);
  cursor: pointer; position: relative;
}
.game-card:hover {
  border-color: var(--accent); transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--accent), 0 0 30px var(--accent-glow);
}
.game-thumb { position: relative; aspect-ratio: 16/10; background: var(--bg-deep); overflow: hidden; }
.game-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.game-card:hover .game-thumb img { transform: scale(1.05); }
.game-thumb-overlay {
  position: absolute; inset: 0; background: rgba(4,8,16,0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s;
}
.game-card:hover .game-thumb-overlay { opacity: 1; }
.play-icon {
  width: 52px; height: 52px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px var(--accent);
  transform: scale(0.85); transition: transform 0.25s;
}
.game-card:hover .play-icon { transform: scale(1); }
.play-icon svg { width: 22px; height: 22px; fill: #000; margin-left: 3px; }
.game-badge {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--font-display); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 3px 8px; border-radius: 3px;
}
.badge-new  { background: var(--new-color); color: #000; }
.badge-hot  { background: var(--hot); color: #fff; }
.badge-top  { background: var(--gold); color: #000; }

.game-info { padding: 0.85rem 1rem; }
.game-title { font-family: var(--font-display); font-size: 0.78rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-meta { display: flex; align-items: center; justify-content: space-between; }
.game-category { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.7rem; }
.game-plays { color: var(--text-muted); font-size: 0.72rem; }

/* ===== TEK OYUN SAYFASI ===== */
.game-fullpage { min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.game-topbar {
  background: var(--bg-dark); border-bottom: 1px solid var(--border);
  padding: 0.65rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-shrink: 0;
}
.game-topbar-left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.back-btn { display: flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-weight: 600; font-size: 0.82rem; transition: color 0.2s; }
.back-btn:hover { color: var(--text-primary); }
.back-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.game-page-title { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; letter-spacing: 1px; color: var(--text-primary); }
.game-topbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.action-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-secondary);
  padding: 0.38rem 0.9rem; font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.5px;
  cursor: pointer; display: flex; align-items: center; gap: 0.4rem; transition: all 0.2s;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.fullscreen-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Oyun wrapper */
.game-wrapper { flex: 1; display: flex; min-height: 0; /* flex shrink fix */ }
.game-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* İçerik alanı */
.game-content-area {
  flex: 1;
  background: #000;
  position: relative;
  min-height: 500px;
  /* height 0 trick: flex:1 çocukların %100 yükseklik alması için */
  height: 0;
}
.game-content-area canvas { display: block; width: 100% !important; height: 100% !important; }
.game-content-area iframe { display: block; width: 100% !important; height: 100% !important; border: none; }
.game-content-area .entry-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}
/* Sadece doğrudan çocukları hedefle — iç elementleri bozmaz */
.game-content-area .entry-content > canvas,
.game-content-area .entry-content > iframe,
.game-content-area .entry-content > div:only-child {
  flex: 1;
  width: 100%;
  height: 100% !important;
}
/* WordPress Gutenberg blok wrapper temizle */
.game-content-area .wp-block-html { height: 100%; }
.game-content-area figure,
.game-content-area .wp-block-group { margin: 0; height: 100%; }

/* Oyun altı reklam bandı */
.game-ad-bar {
  background: var(--bg-dark); border-top: 1px solid var(--border);
  padding: 0.5rem 1rem; display: flex; align-items: center; justify-content: center;
  min-height: 100px; flex-shrink: 0;
}

/* Sağ sidebar */
.game-sidebar {
  width: 272px; flex-shrink: 0;
  background: var(--bg-dark); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.game-sidebar-section { padding: 1.2rem 1.1rem; border-bottom: 1px solid var(--border); }
.sidebar-label { font-family: var(--font-display); font-size: 0.62rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.7rem; }
.game-desc-text { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

.controls-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.controls-list li { display: flex; align-items: center; gap: 0.7rem; font-size: 0.84rem; color: var(--text-secondary); }
.key-badge { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; font-family: var(--font-display); font-size: 0.62rem; font-weight: 700; color: var(--accent); white-space: nowrap; }

.game-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.stat-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 0.7rem; text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--accent); display: block; }
.stat-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.related-game-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem; border-radius: 6px; transition: background 0.2s; cursor: pointer; }
.related-game-item:hover { background: var(--bg-card); }
.related-thumb { width: 54px; height: 38px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: var(--bg-card); }
.related-title { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.related-cat { font-size: 0.7rem; color: var(--accent); margin-top: 1px; }

/* Fullscreen */
.game-fullpage.is-fullscreen .game-sidebar { display: none; }
.game-fullpage.is-fullscreen .game-topbar { display: none; }
.game-fullpage.is-fullscreen .game-content-area {
  position: fixed; inset: 0; z-index: 9999;
  height: 100vh !important; /* override flex height:0 trick */
}

/* WordPress admin bar varsa header offset */
.admin-bar #site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar #site-header { top: 46px; }
}

/* ===== FOOTER ===== */
#site-footer { background: var(--bg-dark); border-top: 1px solid var(--border); padding: 2rem 2rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-logo { font-family: var(--font-display); font-size: 0.95rem; font-weight: 900; letter-spacing: 2px; color: var(--text-secondary); }
.footer-logo span { color: var(--accent); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 0.76rem; color: var(--text-muted); }

/* ===== REKLAM ===== */
.ad-banner { background: var(--bg-card); border: 1px dashed var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; overflow: hidden; }
.ad-leaderboard { width: 100%; height: 90px; margin: 1rem 0; }
.ad-rectangle  { width: 100%; height: 250px; margin: 1rem 0; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 0.5rem; justify-content: center; padding: 3rem 0; }
/* paginate_links() list tipi için ul/li sıfırla */
.pagination ul { list-style: none; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.pagination li { display: flex; }
.page-numbers {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--font-display); font-size: 0.78rem;
  font-weight: 700; color: var(--text-secondary); transition: all 0.2s;
}
.page-numbers:hover,
.page-numbers.current { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.page-numbers.dots { border-color: transparent; background: none; cursor: default; }

/* ===== MOBİL ===== */
@media (max-width: 1024px) { .game-sidebar { width: 240px; } }
@media (max-width: 768px) {
  #primary-nav, .header-search { display: none; }
  .menu-toggle { display: flex; }
  .game-wrapper { flex-direction: column; }
  .game-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 280px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .footer-inner { flex-direction: column; text-align: center; }
}
