/* metin2private — site stilleri
   Bölümler: 1 Değişkenler · 2 Temel · 3 Yerleşim · 4 Header · 5 Butonlar · 6 Filtre
             7 Sunucu satırı · 8 Detay · 9 İçerik (prose) · 10 Uyarılar/boş durum · 11 Footer · 12 Duyarlı · 13 Hareket */

/* 1 — Tasarım değişkenleri */
:root {
  --bg: #0E1116;
  --surface: #151A22;
  --surface-2: #1A202A;
  --surface-3: #202734;
  --border: #2A313D;
  --border-strong: #363F4E;
  --text: #F3F4F7;
  --text-muted: #989FAE;
  --accent: #EE9347;
  --accent-hover: #F7A562;
  --accent-ink: #1A1206;
  --banner-bg: #0B0E12;
  --success: #6CC08B;
  --warning: #E8C26A;
  --danger: #EF7B7B;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.125rem;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --container: 1160px;
  --btn-h: 44px;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

/* 2 — Temel */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4, h5, h6 { color: var(--text); line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-ink); padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--sp-3); }
.muted { color: var(--text-muted); }
.num, .vote-count { font-variant-numeric: tabular-nums; }

/* 3 — Yerleşim */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-5); }
.container-narrow { max-width: 820px; }
.site-main { flex: 1 0 auto; padding-bottom: var(--sp-12); }
.site-main:focus { outline: none; }
.page-head { padding: var(--sp-8) 0 var(--sp-5); }
.page-head h1 { font-size: var(--fs-2xl); }
.page-lead { margin-top: var(--sp-2); color: var(--text-muted); font-size: var(--fs-md); }

/* 4 — Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: relative; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.brand-mark { flex: none; display: block; }
.brand-accent { color: var(--accent); }
.site-nav ul { display: flex; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--sp-3);
  border-radius: var(--radius); color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.9375rem;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-toggle {
  display: none; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-3);
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; font-weight: 600; font-size: var(--fs-sm); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

/* 5 — Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--btn-h); padding: 0 var(--sp-5);
  border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 0.9375rem; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.btn-vote { background: transparent; color: var(--accent); border-color: var(--accent); min-width: 96px; }
.btn-vote:hover { background: var(--accent); color: var(--accent-ink); }
.btn-vote[disabled], .btn-vote.is-done { border-color: var(--border-strong); color: var(--text-muted); background: transparent; cursor: default; }
.btn-block { width: 100%; }
.btn-inline { margin-top: var(--sp-3); }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

/* 6 — Level filtresi */
.level-filter { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.filter-label { color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.level-filter ul { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-muted); font-weight: 600; font-size: 0.9375rem; text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.is-selected { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.list-region.is-loading .server-list { opacity: .55; transition: opacity .15s ease; }

/* 7 — Sunucu satırı */
.server-section + .server-section { margin-top: var(--sp-10); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.section-head h2 { font-size: var(--fs-lg); }
.section-sub { color: var(--text-muted); font-size: var(--fs-sm); }
.server-list { display: flex; flex-direction: column; gap: var(--sp-4); }

.server-row {
  display: grid;
  grid-template-columns: minmax(0, 68fr) minmax(0, 32fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-margin-top: var(--sp-6);
}
.server-row:target { border-color: var(--accent); }
.server-banner { position: relative; display: block; background: var(--banner-bg); min-width: 0; }
.banner-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 6; overflow: hidden;
  background: var(--banner-bg);
  display: flex; align-items: center; justify-content: center;
}
.server-row .banner-frame { height: 100%; min-height: 100%; }
/* scale-down: büyük afiş kırpılmadan sığdırılır (contain), küçük afiş büyütülüp bulanıklaştırılmaz. */
.banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: scale-down; display: block; }
.banner-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1);
  padding: var(--sp-4); text-align: center;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--banner-bg) 100%);
}
.ph-name { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 800; color: var(--text); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ph-note { color: var(--text-muted); font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; }
.banner-frame.is-broken .banner-img { display: none; }
.rank-badge {
  position: absolute; top: var(--sp-3); left: var(--sp-3);
  min-width: 30px; height: 30px; padding: 0 var(--sp-2);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(14, 17, 22, .86); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text); font-weight: 800; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
}

.server-panel {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-5);
  border-left: 1px solid var(--border);
  min-width: 0;
}
.server-name { font-size: 1.3125rem; overflow-wrap: anywhere; }
.server-name a { color: var(--text); text-decoration: none; }
.server-name a:hover { color: var(--accent-hover); }
.server-meta { margin-top: 2px; color: var(--text-muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

.panel-mid {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.mid-stat { display: flex; flex-direction: column; min-width: 0; }
.mid-label { color: var(--text-muted); font-size: 0.6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.vote-count { font-size: 1.75rem; font-weight: 800; line-height: 1.15; color: var(--text); }
.opening-date { font-size: var(--fs-base); font-weight: 700; color: var(--text); line-height: 1.35; margin-top: 2px; }
.mid-note { color: var(--text-muted); font-size: var(--fs-xs); }
.vote-form { margin: 0; flex: none; }
.vote-feedback { min-height: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.vote-feedback:empty { display: none; }
.vote-feedback.is-success { color: var(--success); }
.vote-feedback.is-warning { color: var(--warning); }
.vote-feedback.is-error { color: var(--danger); }

.panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: auto; }
.panel-actions .btn { padding: 0 var(--sp-3); }

/* 8 — Sunucu detay */
.breadcrumb { padding-top: var(--sp-6); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: var(--sp-2); color: var(--border-strong); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb [aria-current] { color: var(--text); overflow-wrap: anywhere; }

.server-detail { margin-top: var(--sp-4); }
.detail-top {
  display: grid; grid-template-columns: minmax(0, 64fr) minmax(0, 36fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.detail-banner { background: var(--banner-bg); min-width: 0; }
.detail-banner .banner-frame { height: 100%; min-height: 260px; }
.detail-info { padding: var(--sp-6); border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.detail-title { font-size: var(--fs-xl); overflow-wrap: anywhere; }
.detail-lead { color: var(--text-muted); margin-top: calc(var(--sp-2) * -1); }
.info-list { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.info-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.info-list dt { color: var(--text-muted); font-size: var(--fs-sm); }
.info-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.tag { display: inline-block; margin-left: var(--sp-1); padding: 0 var(--sp-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: auto; }
.detail-actions > :only-child { grid-column: 1 / -1; }
.detail-actions .vote-form .btn { width: 100%; }
.detail-content { margin-top: var(--sp-8); }
.detail-content > h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }

/* 9 — İçerik (Markdown/HTML) */
.prose { color: #D9DCE3; font-size: 1.0625rem; line-height: 1.75; max-width: 78ch; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { margin-top: 1.6em; color: var(--text); }
.prose h2 { font-size: 1.375rem; }
.prose h3 { font-size: 1.1875rem; }
.prose h4, .prose h5, .prose h6 { font-size: 1.0625rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li + li { margin-top: .35em; }
.prose li > ul, .prose li > ol { margin-top: .35em; }
.prose strong { color: var(--text); }
.prose blockquote { margin: 1em 0 0; padding: var(--sp-2) var(--sp-4); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-muted); }
.prose img { border-radius: var(--radius); display: block; max-width: 100%; height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: .1em .35em; }
.prose pre { overflow-x: auto; max-width: 100%; padding: var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); line-height: 1.55; }
.prose pre code { background: none; border: 0; padding: 0; font-size: .875rem; }
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.prose th, .prose td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 700; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose .align-center { text-align: center; }
.prose .align-right { text-align: right; }
.seo-text { margin-top: var(--sp-12); padding-top: var(--sp-6); border-top: 1px solid var(--border); font-size: .9375rem; color: var(--text-muted); }
.seo-text h2 { font-size: var(--fs-md); }
.page-prose { padding-bottom: var(--sp-6); }

/* 10 — Uyarılar ve boş durum */
.alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin-bottom: var(--sp-4); font-size: .9375rem; }
.alert-success { border-color: rgba(108, 192, 139, .45); color: var(--success); }
.alert-warning { border-color: rgba(232, 194, 106, .45); color: var(--warning); }
.alert-error { border-color: rgba(239, 123, 123, .45); color: var(--danger); }
.empty-state { padding: var(--sp-8) var(--sp-6); text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); }
.error-page { padding: var(--sp-12) 0; text-align: center; }
.error-code { color: var(--accent); font-weight: 800; font-size: var(--fs-2xl); font-variant-numeric: tabular-nums; }
.error-page h1 { font-size: var(--fs-xl); margin: var(--sp-2) 0 var(--sp-3); }

/* 11 — Footer */
.site-footer { border-top: 1px solid var(--border); background: #0B0E12; padding-top: var(--sp-8); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--sp-8); flex-wrap: wrap; }
.footer-brand { max-width: 440px; }
.brand-small { font-size: 1.0625rem; }
.footer-desc { margin-top: var(--sp-3); color: var(--text-muted); font-size: var(--fs-sm); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-nav a { color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; }
.footer-nav a:hover { color: var(--text); }
.footer-copy { margin-top: var(--sp-8); padding-top: var(--sp-4); padding-bottom: var(--sp-6); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-xs); }

/* 12 — Duyarlı yerleşim */
@media (max-width: 960px) {
  .server-row { grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); }
}
@media (max-width: 760px) {
  .container { padding: 0 var(--sp-4); }
  .page-head { padding: var(--sp-6) 0 var(--sp-4); }
  .page-head h1 { font-size: var(--fs-xl); }
  .page-lead { font-size: var(--fs-base); }

  .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--border); padding: var(--sp-2) var(--sp-4) var(--sp-4); }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: var(--sp-1); }
  .site-nav a { width: 100%; min-height: 44px; }
  .site-nav a.is-active { box-shadow: inset 3px 0 0 var(--accent); }
  html:not(.js) .header-inner { flex-wrap: wrap; padding: var(--sp-2) 0; }
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; }

  .server-row, .detail-top { grid-template-columns: minmax(0, 1fr); }
  .server-row .banner-frame, .detail-banner .banner-frame { aspect-ratio: 16 / 7; height: auto; min-height: 0; }
  .server-panel, .detail-info { border-left: 0; border-top: 1px solid var(--border); padding: var(--sp-4); }
  .vote-count { font-size: 1.5rem; }
  .info-list > div { grid-template-columns: 110px minmax(0, 1fr); }
  .footer-inner { flex-direction: column; gap: var(--sp-5); }
}
@media (max-width: 360px) {
  .panel-actions, .detail-actions { gap: var(--sp-2); }
  .btn { font-size: .875rem; }
  .chip { padding: 0 var(--sp-3); }
}

/* 13 — Hareket azaltma */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
