/* WMW — ortak tema (lobi + oyun). Koyu lacivert zemin, parşömen metin, altın vurgu. */

:root {
  --bg: #0f1626;
  --bg-2: #141d31;
  --panel: #1a2540;
  --panel-2: #22304f;
  --border: #35466c;
  --border-soft: #2a3856;
  --text: #ece3cc;
  --muted: #9aa5bf;
  --accent: #d4a83c;
  --accent-2: #f0c75e;
  --accent-ink: #1a1305;
  --danger: #c0392b;
  --danger-2: #e74c3c;
  --ok: #3f9d5a;
  --ok-2: #57c374;
  --warn: #d98c1f;
  --info: #3f7fbf;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --radius: 6px;
  --radius-lg: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, Consolas, "Cascadia Mono", "Courier New", monospace;
  --fs: 14px;
  --gap: 8px;
}

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs)/1.45 var(--font);
  min-height: 100vh;
}
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; line-height: 1.2; color: var(--accent-2); }
h1 { font-size: 1.6rem; letter-spacing: .02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: 12px 0; }
code, pre, .mono { font-family: var(--mono); font-size: .92em; }
pre { background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 8px 10px; overflow: auto; }
img, svg { max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border-soft); }
th { color: var(--muted); font-weight: 600; font-size: .85em; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(255, 255, 255, .03); }
[hidden] { display: none !important; }

/* --- form --- */
input, select, textarea, button { font: inherit; color: inherit; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  min-height: 34px;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212, 168, 60, .25); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; }
select { appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%239aa5bf' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
select option { background: var(--panel); color: var(--text); }
label { display: block; color: var(--muted); font-size: .9em; margin-bottom: 4px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; }
.field { margin-bottom: 10px; }

/* --- düğmeler --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s, box-shadow .12s;
}
.btn:hover { background: #2b3c62; border-color: #4a5f8c; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent-2); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger-2); color: #fff; }
.btn-danger:hover { background: var(--danger-2); }
.btn-ok { background: var(--ok); border-color: var(--ok-2); color: #fff; }
.btn-ok:hover { background: var(--ok-2); }
.btn-sm { min-height: 26px; padding: 2px 8px; font-size: .88em; }
.btn-lg { min-height: 42px; padding: 8px 22px; font-size: 1.05em; }
.btn-block { display: flex; width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-2); }

/* --- panel --- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); margin: -14px -16px 12px; padding: 10px 16px; border-bottom: 1px solid var(--border-soft); background: linear-gradient(180deg, rgba(255,255,255,.04), transparent); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-sub { background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px 12px; }

/* --- rozet --- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: .8em; font-weight: 600; line-height: 1.6;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  vertical-align: middle; white-space: nowrap;
}
.badge-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-2); }
.badge-ok { background: var(--ok); color: #fff; border-color: var(--ok-2); }
.badge-danger { background: var(--danger); color: #fff; border-color: var(--danger-2); }
.badge-warn { background: var(--warn); color: #1a1305; border-color: #f0a640; }
.badge-muted { color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); vertical-align: middle; margin-right: 4px; }
.dot-online { background: var(--ok-2); box-shadow: 0 0 6px var(--ok-2); }
.dot-offline { background: var(--danger-2); }

/* --- yerleşim yardımcıları --- */
.row { display: flex; flex-direction: row; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.row-nowrap { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; gap: var(--gap); }
.grow { flex: 1 1 auto; min-width: 0; }
.center { display: flex; align-items: center; justify-content: center; }
.between { justify-content: space-between; }
.right { text-align: right; }
.gap-0 { gap: 0; } .gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; }
.p-2 { padding: 8px; } .p-3 { padding: 16px; }
.w-100 { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
.container-narrow { max-width: 520px; margin: 0 auto; padding: 16px; }
.text-ok { color: var(--ok-2); } .text-danger { color: var(--danger-2); } .text-accent { color: var(--accent-2); } .text-warn { color: var(--warn); }
.num { font-variant-numeric: tabular-nums; }

/* --- liste --- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: var(--gap); }
.list > li:last-child { border-bottom: 0; }
.list > li:hover { background: rgba(255, 255, 255, .03); }
.list > li.selected { background: rgba(212, 168, 60, .12); box-shadow: inset 3px 0 0 var(--accent); }

/* --- toast --- */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 9000;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none; max-width: min(380px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--info);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 9px 14px; max-width: 100%;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-left-color: var(--ok-2); }
.toast-danger { border-left-color: var(--danger-2); }
.toast-warn { border-left-color: var(--warn); }

/* --- kaydırma çubuğu --- */
* { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: #4a5f8c; }

/* --- katman / modal --- */
.overlay { position: fixed; inset: 0; background: rgba(5, 8, 16, .7); z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; }

/* --- ilerleme çubuğu --- */
.bar { height: 8px; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }

/* --- yükleniyor --- */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  :root { --fs: 13px; }
  .panel { padding: 10px 12px; }
  .panel-head { margin: -10px -12px 10px; padding: 8px 12px; }
}
