/* Oyun Köşesi — tüm sayfalarda ortak stiller */

:root {
  color-scheme: light;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #eceef6;
  --surface-3: #dfe2ee;
  --text: #1b1e29;
  --muted: #5b6275;
  --border: #dadeea;
  --accent: #5048e5;
  --accent-hover: #4038d0;
  --accent-text: #ffffff;
  --accent-soft: #e9e8fd;
  --coral: #e85d3f;
  --good: #188a4a;
  --bad: #d23c3c;
  --focus: #5048e5;
  --shadow-sm: 0 1px 2px rgb(20 24 40 / 6%);
  --shadow: 0 1px 2px rgb(20 24 40 / 6%), 0 10px 28px rgb(20 24 40 / 9%);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111319;
    --surface: #1a1d27;
    --surface-2: #232736;
    --surface-3: #2e3346;
    --text: #e8eaf2;
    --muted: #9ba2b5;
    --border: #2c3142;
    --accent: #8c86ff;
    --accent-hover: #a29dff;
    --accent-text: #14121f;
    --accent-soft: #2a2850;
    --coral: #ff8a6b;
    --good: #45c07a;
    --bad: #ff6b6b;
    --focus: #8c86ff;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111319;
  --surface: #1a1d27;
  --surface-2: #232736;
  --surface-3: #2e3346;
  --text: #e8eaf2;
  --muted: #9ba2b5;
  --border: #2c3142;
  --accent: #8c86ff;
  --accent-hover: #a29dff;
  --accent-text: #14121f;
  --accent-soft: #2a2850;
  --coral: #ff8a6b;
  --good: #45c07a;
  --bad: #ff6b6b;
  --focus: #8c86ff;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);
}

/* ---------- Temel ---------- */

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}
.container.narrow { max-width: 680px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 32px; height: 32px; }
.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-link {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}
.header-link:hover { color: var(--text); background: var(--surface-2); }

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Düğmeler ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
@media (max-width: 420px) {
  .btn .lbl-sm-hide { display: none; }
}
.btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

/* Seçenek grubu (Kolay / Orta / Zor gibi) */
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 12px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 9px;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 360px) {
  .seg button { padding: 6px 9px; }
  .btn { padding: 0 13px; }
}

/* ---------- Ana sayfa ---------- */

.hero { padding-top: 44px; padding-bottom: 8px; }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 20ch;
}
.hero p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.1rem;
}
.hero .perks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.hero .perks li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  padding: 28px 0 48px;
}
.game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.game-card .art {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  line-height: 1;
}
.game-card .art span { filter: drop-shadow(0 4px 10px rgb(0 0 0 / 18%)); }
.art-2048 { background: linear-gradient(135deg, #ffd38f, #ff7a5c); }
.art-yilan { background: linear-gradient(135deg, #8fe3b0, #2fa36b); }
.art-bloklar { background: linear-gradient(135deg, #8fb4ff, #7c6cf2); }
.art-mayin-tarlasi { background: linear-gradient(135deg, #c9d2e3, #7a879e); }
.art-hafiza { background: linear-gradient(135deg, #ffb3d1, #b06ef3); }
.art-xox { background: linear-gradient(135deg, #9fe8f0, #3b9ed8); }
.game-card .body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}
.game-card h2 { margin: 0; font-size: 1.15rem; }
.game-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.game-card .meta {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.tag {
  background: var(--surface-2);
  color: var(--muted);
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.78rem;
}
.record-badge { font-weight: 650; color: var(--accent); }

@media (max-width: 560px) {
  .hero { padding-top: 28px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 20px; }
  .game-card .art { font-size: 2.6rem; aspect-ratio: 4 / 3; }
  .game-card .body { padding: 10px 12px 12px; }
  .game-card h2 { font-size: 1.02rem; }
  .game-card p { font-size: 0.86rem; line-height: 1.4; }
  .game-card .meta { flex-wrap: wrap; }
}

/* 18+ bölümü */
.adult-section { padding-bottom: 36px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.section-note { margin: 0; color: var(--muted); }
.adult-section .game-grid { padding: 16px 0 0; }
.age-badge {
  display: inline-grid;
  place-items: center;
  min-width: 2.4em;
  padding: 2px 8px;
  border-radius: 8px;
  background: #c9473d;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.5;
  vertical-align: middle;
}
.game-card .art.art-0317 { background: radial-gradient(circle at 50% 62%, #4a3125 0%, #16131a 55%, #0b0b0e 100%); }
.game-card .art.art-0317 span { filter: drop-shadow(0 0 16px rgb(255 170 90 / 55%)); }
.game-card .art .age-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.72rem;
}
.game-card .art { position: relative; }

.info-section {
  padding-top: 8px;
  padding-bottom: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.info-section > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.info-section h2 { margin: 0 0 6px; font-size: 1.05rem; }
.info-section p { margin: 0; color: var(--muted); }

/* ---------- Oyun sayfası ---------- */

.game-main { flex: 1; padding: 20px 0 40px; }

.breadcrumb {
  margin: 0 0 8px;
  font-size: 0.9rem;
}
.breadcrumb a { color: var(--muted); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { color: var(--text); }

@media (max-width: 560px) {
  .game-main { padding-top: 12px; }
  .breadcrumb { display: none; } /* üst barda "Tüm oyunlar" bağlantısı zaten var */
  .game-head { margin-bottom: 10px; }
  .toolbar { margin-bottom: 12px; }
}

.game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.game-head h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
}
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat {
  min-width: 76px;
  padding: 6px 14px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.stat span {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat b {
  display: block;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }

.play-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status-line {
  min-height: 1.6em;
  margin: 12px 0 0;
  text-align: center;
  font-weight: 650;
  color: var(--muted);
}

.howto {
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.howto h2 { margin: 0 0 8px; font-size: 1.1rem; }
.howto ul { margin: 0; padding-left: 20px; color: var(--muted); }
.howto li + li { margin-top: 4px; }

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 650;
  text-align: center;
}

.more-games { margin-top: 28px; }
.more-games h2 { margin: 0 0 12px; font-size: 1.1rem; }
.more-games ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.more-games a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}
.more-games a:hover { background: var(--surface-2); }
.more-games .emoji { font-size: 1.5rem; line-height: 1; }

/* Oyun üzerindeki bilgi katmanı (Oyun bitti, Duraklatıldı vb.) */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  background: rgb(245 246 251 / 82%);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  border-radius: inherit;
  animation: overlay-in 0.2s ease-out;
}
.overlay-box {
  max-width: 320px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.overlay h2 { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -0.01em; }
.overlay p { margin: 0 0 14px; color: var(--muted); }
.overlay .new-record {
  display: inline-block;
  margin: 0 0 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}
.overlay .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Dokunmatik kontrol tuşları — yalnızca dokunmatik cihazlarda görünür */
.touch-controls { display: none; }
@media (hover: none) and (pointer: coarse) {
  .touch-controls { display: flex; }
  .hide-on-touch { display: none; }
}
.pad-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.pad-btn:active { background: var(--surface-2); transform: translateY(1px); }

/* ---------- Metin sayfaları ---------- */

.prose { flex: 1; padding: 32px 0 48px; }
.prose h1 { margin: 0 0 16px; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.02em; }
.prose h2 { margin: 28px 0 8px; font-size: 1.2rem; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }

/* ---------- Alt bilgi ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
}
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; gap: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
