/* Gamewell tasarım sistemi — sade, ortalı, simetrik.
   Tek vurgu rengi, 8px ritim, eşit sütunlu grid, açık/koyu tema. */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --soft: #F1F5F9;
  --text: #0F172A;
  --muted: #475569;
  --line: #E2E8F0;
  --accent: #6D28D9;        /* düğme zemini (beyaz yazıyla 7:1) */
  --accent-hover: #5B21B6;
  --link: #6D28D9;
  --on-accent: #FFFFFF;
  --accent-soft: #EDE9FE;
  --ok: #047857;
  --ok-soft: #D1FAE5;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --max: 1080px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0D12;
    --surface: #14171F;
    --soft: #1B1F2A;
    --text: #F1F5F9;
    --muted: #A3AEC2;
    --line: #262B38;
    --accent: #7C3AED;
    --accent-hover: #8B5CF6;
    --link: #A78BFA;
    --accent-soft: #2A2150;
    --ok: #6EE7B7;
    --ok-soft: #12382A;
    --danger: #FCA5A5;
    --danger-soft: #3B1818;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 40px 24px 56px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: clamp(28px, 4.2vw, 40px); font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0; }
img { max-width: 100%; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Üst bar: logo ortada, menü altında ortada ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: var(--max); margin: 0 auto; padding: 18px 24px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.logo-mark svg { width: 20px; height: 20px; }
.site-header nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.site-header nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 15px; font-weight: 550; min-height: 40px; display: inline-flex; align-items: center; }
.site-header nav a:hover { color: var(--text); background: var(--soft); text-decoration: none; }
.site-header nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (prefers-color-scheme: dark) { .site-header nav a[aria-current="page"] { color: var(--link); } }

.site-footer { border-top: 1px solid var(--line); padding: 20px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); }

/* ---------- Sayfa başlığı (ortalı) ---------- */
.page-head { text-align: center; max-width: 620px; margin: 0 auto 32px; display: grid; gap: 10px; }
.lead { color: var(--muted); font-size: 17px; }
.center { text-align: center; }
.note { color: var(--muted); font-size: 14px; }
.ok { color: var(--ok); } .err { color: var(--danger); } .okmsg { color: var(--ok); }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 28px; }

/* ---------- Form kontrolleri ---------- */
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
label .note { font-weight: 400; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 25%, transparent); }
input[type=file] { padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--soft); width: 100%; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 44px; cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; font-size: 14px; font-weight: 600; margin-bottom: 8px; }

/* ---------- Düğmeler ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
button:hover, .btn:hover { background: var(--accent-hover); text-decoration: none; }
button:active { transform: translateY(1px); }
button.ghost, .btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
button.ghost:hover, .btn.ghost:hover { background: var(--soft); border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
button.link { background: none; border: 0; color: var(--link); padding: 0 8px; min-height: 36px; font-weight: 550; }
button.link:hover { background: none; text-decoration: underline; }
button.block, .btn.block { width: 100%; }
button[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Ortalı panel (giriş, tercihler, form) ---------- */
.panel { width: 100%; max-width: 520px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.panel.wide { max-width: 640px; }
.panel form, .panel .form { display: grid; gap: 16px; }
form { display: grid; gap: 16px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--soft); border-radius: 12px; margin-bottom: 20px; }
.seg button { background: transparent; color: var(--muted); border-radius: 9px; }
.seg button:hover { background: transparent; color: var(--text); }
.seg button[aria-pressed="true"], .seg button:not(.ghost) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.seg button.ghost { background: transparent; color: var(--muted); border-color: transparent; box-shadow: none; }
.seg button.ghost:hover { background: transparent; color: var(--text); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.center { justify-content: center; }

/* ---------- Seçim çipleri ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.center { justify-content: center; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 550; cursor: pointer; user-select: none; transition: background-color .15s, border-color .15s; }
.chip:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip[aria-pressed="true"], .chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
/* <button class="chip"> durumları: genel button/ghost hover kuralını ezer */
button.chip { background: var(--surface); color: var(--text); border-color: var(--line); font-weight: 550; padding: 0 16px; }
button.chip:hover { background: var(--soft); }
button.chip.on, button.chip.on:hover, button.chip[aria-pressed="true"], button.chip[aria-pressed="true"]:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Oyun kartları: eşit boy, eşit sütun ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: border-color .15s, box-shadow .15s; }
a.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); text-decoration: none; }
.card .img { aspect-ratio: 16 / 10; background: var(--soft); display: grid; place-items: center; color: color-mix(in srgb, var(--muted) 55%, transparent); overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .img svg { width: 44px; height: 44px; }
.card .b { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card p { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.tags.center { justify-content: center; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.tag.free { background: var(--ok-soft); color: var(--ok); }
.tag.accent { background: var(--accent-soft); color: var(--link); }

/* ---------- Keşfet sayfası araçları ---------- */
.search { max-width: 640px; margin: 0 auto 16px; }
.search input { min-height: 52px; font-size: 17px; padding-left: 48px; border-radius: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 16px center; }
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 640px; margin: 0 auto 16px; }
.toggles { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.count { text-align: center; color: var(--muted); font-size: 14px; margin: 20px 0 20px; min-height: 22px; }

/* ---------- Oyun sayfası ---------- */
.game { max-width: 760px; margin: 0 auto; display: grid; gap: 24px; }
.game .hero-img { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; color: color-mix(in srgb, var(--muted) 55%, transparent); }
.game .hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game .hero-img svg { width: 64px; height: 64px; }
.game h1 { text-align: center; }
.game .desc { color: var(--text); font-size: 17px; text-align: center; white-space: pre-line; }
.actions { display: grid; gap: 12px; }
.actions .primary-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.actions a.btn { width: 100%; }
.actions .secondary-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.report-box { max-width: 460px; margin: 0 auto; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
.section-title { text-align: center; margin: 48px 0 20px; }

/* ---------- Geliştirici paneli ---------- */
.banner { text-align: center; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--soft); color: var(--text); font-weight: 550; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.stat b { display: block; font-size: 26px; line-height: 1.2; font-weight: 700; }
.stat span { color: var(--muted); font-size: 13px; }
.preview { width: 100%; max-width: 360px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; margin: 0 auto; }
.link-row { display: grid; grid-template-columns: 150px 1fr 44px; gap: 8px; margin-bottom: 8px; }
.link-row button { padding: 0; }
details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 4px 16px; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; font-size: 15px; }
details[open] { padding-bottom: 16px; }
.account { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ---------- Boş durum ---------- */
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 16px; display: grid; gap: 14px; justify-items: center; }
.empty svg { width: 40px; height: 40px; opacity: .6; }
.empty .btn { width: auto; }

/* ---------- Küçük ekran ---------- */
@media (max-width: 640px) {
  main { padding: 28px 16px 44px; }
  /* Menü 3 + 3 eşit sütun: dar ekranda da simetrik */
  .site-header nav { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 420px; }
  .site-header nav a { justify-content: center; padding: 8px 6px; font-size: 14px; }
  .filters { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .link-row { grid-template-columns: 1fr 44px; }
  .link-row select { grid-column: 1 / -1; }
  .panel { padding: 20px; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* details içindeki form */
details form { margin-top: 8px; }


/* ---------- Geliştirici analitiği ---------- */
.analytics { max-width: 900px; margin: 0 auto; display: grid; gap: 24px; }
.an-head { display: grid; gap: 10px; justify-items: center; text-align: center; }
.an-head .seg { margin: 0; width: 100%; max-width: 420px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; align-content: start; }
.kpi-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kpi-label { font-size: 13px; font-weight: 650; color: var(--muted); }
.kpi-num { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.kpi-help { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.spark { width: 100%; height: 36px; margin-top: 8px; color: var(--accent); fill: currentColor; display: block; }
.delta { font-size: 12px; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); } .delta.flat { color: var(--muted); font-weight: 600; }

.funnel { display: grid; gap: 4px; }
.f-row { display: grid; grid-template-columns: 150px 1fr 72px; gap: 12px; align-items: center; }
.f-label { font-size: 14px; font-weight: 600; }
.f-track { height: 14px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.f-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.f-row b { text-align: right; font-size: 15px; }
.f-step { margin-left: 162px; font-size: 12px; color: var(--muted); padding: 2px 0 6px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.two-col .panel { max-width: none; box-shadow: none; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1fr) 1.4fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar-num { text-align: right; min-width: 64px; }
.bar-num span { display: block; font-size: 11px; color: var(--muted); }

@media (max-width: 820px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .f-row { grid-template-columns: 1fr 64px; }
  .f-label { grid-column: 1 / -1; }
  .f-step { margin-left: 0; }
  .kpi-num { font-size: 26px; }
}

@media (max-width: 520px) {
  .bar-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .bar-label { grid-column: 1 / -1; white-space: normal; }
}
