/* Lanetli Kasaba — shared design system of the account pages and the admin panel.
   One set of components, two themes: body.admin (the panel: calm, rounded, dense) and body.site-page (the player site:
   the game's cinematic look). Shells live in admin.css and site.css; shop / stash / ranking pieces in site-economy.css. */

:root {
  color-scheme: dark;
  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: Impact, "Arial Narrow", "Bahnschrift Condensed", sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;

  --bg: #090b0e;
  --surface: #111419;
  --surface-2: #161a20;
  --surface-3: #1d222a;
  --line: #242a33;
  --line-soft: #1b2028;
  --ink: #e8eaed;
  --ink-strong: #ffffff;
  --muted: #9ba3ae;
  --dim: #6c7480;

  --accent: #e5484d;
  --accent-strong: #f2555a;
  --accent-soft: rgba(229, 72, 77, .14);
  --green: #3ecf8e;
  --green-soft: rgba(62, 207, 142, .13);
  --amber: #f0b03c;
  --amber-soft: rgba(240, 176, 60, .14);
  --blue: #5aa9ff;
  --blue-soft: rgba(90, 169, 255, .13);
  --gold: #e8b84a;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -12px rgba(0, 0, 0, .6);
  --focus: 0 0 0 3px rgba(229, 72, 77, .35);

  /* Legacy names used by older rules and site-economy.css. */
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --red: var(--accent);
  --red-hot: var(--accent-strong);
  --heading: var(--font-display);
  --body: var(--font-ui);
}

/* ------------------------------------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 14.5px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-xs); }
::selection { background: var(--accent); color: #fff; }
h1, h2, h3 { color: var(--ink-strong); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
td.mono { white-space: nowrap; color: var(--muted); }
dd.mono { overflow-wrap: anywhere; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.block { display: block; }
.pad { padding: 16px 20px; }
.amount.pos, .eco-plus { color: var(--green); }
.amount.neg, .eco-minus { color: var(--accent-strong); }
.eco-gold { color: var(--gold); }
td.warn { color: var(--amber); }

/* ------------------------------------------------------------------------------------------------ page */
.panel-main { width: min(100% - 32px, 1320px); margin: 0 auto; padding: 32px 0 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head > div { min-width: 0; }
.page-head h1 { margin: 0; overflow-wrap: anywhere; }
.kicker { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--dim); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: color .15s; }
.text-link:hover { color: var(--ink-strong); }
.back { margin-bottom: 8px; }
.inline-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.inline-link:hover { color: var(--ink-strong); }

/* ------------------------------------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card + .card, .card + .grid-2, .grid-2 + .card, .stats + .card, .card + .stats, .filters-card + .card, .filters-card + .grid-2 { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; min-height: 54px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--ink); }
.card-head h2 .dot { margin-right: 2px; }
.card-hint, .card-head > .muted { font-size: 12.5px; color: var(--dim); }
.card-sub { border-top: 1px solid var(--line); background: var(--surface-2); }
.card-head + .card-sub, .card > .card-sub:first-child { border-top: 0; }
.note { margin: 0; padding: 12px 20px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.card > .note:last-child { border-bottom: 0; }
.empty { margin: 0; padding: 44px 20px; text-align: center; color: var(--dim); font-size: 13.5px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; }
.grid-2 > * { min-width: 0; }
.grid-2 > .card + .card { margin-top: 0; }
.grid-flat { gap: 0; }
.grid-flat > div { border-bottom: 1px solid var(--line); }
.card[id] { scroll-margin-top: 96px; }

/* ------------------------------------------------------------------------------------------------ stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 108px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, background .15s;
}
a.stat:hover { border-color: #323a46; background: var(--surface-2); }
.stat > span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.stat strong { margin-top: auto; font-size: clamp(24px, 2.2vw, 30px); font-weight: 650; line-height: 1.05; color: var(--ink-strong); font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat small { font-size: 12px; line-height: 1.35; color: var(--dim); overflow-wrap: anywhere; }
.stat-online strong { color: var(--green); }
.stat-warn strong { color: var(--amber); }
.stat-danger strong { color: var(--accent-strong); }
.stat-danger { border-color: rgba(229, 72, 77, .35); }
.stats-money { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.stats-money .stat strong.stat-word { font-size: 22px; }

/* ------------------------------------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { background: var(--surface-2); }
th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--dim); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
tbody tr:last-child td { border-bottom: 0; }
td.wrap { min-width: 180px; }
tr.eco-me td { background: rgba(232, 184, 74, .07); }
tr.eco-total td { font-weight: 650; border-top: 1px solid var(--line); background: var(--surface-2); }
.member-link { font-weight: 600; color: var(--ink-strong); }
.member-link:hover { color: var(--accent-strong); }
.member-link.left { color: var(--muted); text-decoration: line-through; }
.member-cell { min-width: 190px; }
.member-cell small { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
td .member-link + .member-link { margin-left: 10px; }

/* ------------------------------------------------------------------------------------------------ badges & tags */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); background: rgba(255, 255, 255, .05);
}
.badge.online { color: var(--green); background: var(--green-soft); }
.badge.locked { color: var(--amber); background: var(--amber-soft); }
.badge.banned { color: var(--accent-strong); background: var(--accent-soft); }
.badge.big { padding: 6px 12px; font-size: 12px; }
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(62, 207, 142, .2); }
.dot.locked { background: var(--amber); }
.dot.banned { background: var(--accent-strong); }
.tag {
  display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 7px; border-radius: var(--radius-xs); vertical-align: middle;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--accent-strong); background: var(--accent-soft); white-space: nowrap;
}
.tag-ok { color: var(--green); background: var(--green-soft); }
.tag-quiet { color: var(--muted); background: rgba(255, 255, 255, .06); }
.tag-big { margin-left: 10px; padding: 4px 9px; font-size: 11px; font-family: var(--font-ui); }

/* ------------------------------------------------------------------------------------------------ buttons */
.button-primary, .button-ghost, .button-danger, .toolbar button, .panel-main .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 9px 16px;
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; line-height: 1.2; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.button-primary, .toolbar button { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover, .toolbar button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button-ghost { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.button-ghost:hover { background: var(--surface-3); border-color: #36404c; color: var(--ink-strong); }
.button-danger { background: var(--accent-soft); border-color: rgba(229, 72, 77, .4); color: var(--accent-strong); }
.button-danger:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-small { min-height: 30px; padding: 5px 10px; font-size: 11.5px; }
a.button-primary, a.button-ghost, a.button-danger { text-align: center; }
.panel-main button:disabled, .panel-main button[aria-disabled=true] { cursor: not-allowed; opacity: .5; }
.panel-main button.is-busy { opacity: .6; cursor: progress; }

/* ------------------------------------------------------------------------------------------------ forms */
.panel-main input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .panel-main select, .panel-main textarea {
  width: 100%; min-width: 0; min-height: 40px; padding: 9px 12px; background: #0c0f13; border: 1px solid #2a313b; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.panel-main input::placeholder, .panel-main textarea::placeholder { color: var(--dim); }
.panel-main input:hover, .panel-main select:hover, .panel-main textarea:hover { border-color: #36404c; }
.panel-main input:focus, .panel-main select:focus, .panel-main textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.panel-main input[readonly] { color: var(--muted); background: var(--surface-2); }
.panel-main input[type=date] { color-scheme: dark; }
.panel-main textarea { resize: vertical; }
.panel-main input[type=checkbox], .panel-main input[type=radio] { accent-color: var(--accent); }

.stack-form { display: grid; gap: 16px; }
.stack-form.pad { padding: 20px; }
.stack-form label, .action-box label { display: grid; gap: 6px; }
.stack-form label > span, .action-box label > span, .form-grid label > span {
  font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--muted);
}
.stack-form small, .action-box small, .form-grid small { color: var(--dim); font-size: 12px; line-height: 1.45; }
.stack-form .button-primary { margin-top: 4px; min-height: 44px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar input[type=search] { flex: 1 1 260px; }
.toolbar select { width: auto; flex: 0 1 200px; }
.toolbar .date-field { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.toolbar .date-field span { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.toolbar input[type=date] { width: auto; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.filters a {
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line);
  transition: color .15s, background .15s, border-color .15s;
}
.filters a:hover { color: var(--ink-strong); border-color: #36404c; }
.filters a.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.filters-card { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filters-card > span { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 4px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pager > span { margin: 0 auto; }
.pager a { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; color: var(--ink); }
.pager a:hover { border-color: #36404c; background: var(--surface-2); }

.flash {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(62, 207, 142, .3); background: var(--green-soft); color: var(--ink); font-size: 13.5px;
}
.flash::before { content: "✓"; flex: none; font-weight: 800; color: var(--green); }
.flash-error { border-color: rgba(229, 72, 77, .35); background: var(--accent-soft); }
.flash-error::before { content: "!"; width: 1ch; text-align: center; color: var(--accent-strong); }
.error-list { margin: 6px 0 0; padding-left: 18px; }

/* ------------------------------------------------------------------------------------------------ details */
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin: 0; }
.details > div { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
.details dt { margin-bottom: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--dim); }
.details dd { margin: 0; color: var(--ink-strong); overflow-wrap: anywhere; }
.details dd.big-number { font-size: 26px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------------------------------------ actions (member page) */
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; padding: 16px; }
.action-box {
  display: grid; align-content: start; gap: 12px; margin: 0; padding: 16px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.action-box h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ink-strong); }
.action-box p { margin: 0; font-size: 13px; color: var(--muted); }
.action-box form { margin: 0; }
.action-box form .button-ghost { width: 100%; }
.action-box.danger { border-color: rgba(229, 72, 77, .3); background: linear-gradient(180deg, rgba(229, 72, 77, .07), transparent 70%), var(--surface-2); }
.action-box.danger h3 { color: var(--accent-strong); }
.row-form { margin: 0; }
.inline-form { display: grid; gap: 8px; margin: 0; }

/* ------------------------------------------------------------------------------------------------ product form */
.product-form { display: grid; gap: 20px; padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.form-grid label, .item-lines label { display: grid; gap: 6px; align-content: start; }
.form-grid .span-all { grid-column: 1 / -1; }
.item-lines { display: grid; gap: 8px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.item-lines legend { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.item-line { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }
.item-line.locked { display: block; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.form-actions { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------------------------------------------ match detail */
.breakdowns { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.breakdown { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
.breakdown h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; }
.breakdown ul { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); font-variant-numeric: tabular-nums; }
.breakdown li.total { border-bottom: 0; padding-top: 8px; font-weight: 700; color: var(--ink-strong); }
.breakdown li > :last-child { flex: none; white-space: nowrap; }

/* ------------------------------------------------------------------------------------------------ settings */
.settings-form .card + .card { margin-top: 20px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.setting { display: grid; gap: 6px; align-content: start; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
.setting > span { font-size: 13px; font-weight: 600; color: var(--ink-strong); }
.setting small { color: var(--dim); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.setting.changed > span::after { content: " · değiştirildi"; color: var(--amber); font-weight: 500; font-size: 12px; }
.sticky-actions {
  position: sticky; bottom: 12px; z-index: 5; margin-top: 20px; padding: 12px 16px; border-radius: var(--radius);
  background: rgba(17, 20, 25, .92); border: 1px solid var(--line); backdrop-filter: blur(10px); box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .8);
}

/* ------------------------------------------------------------------------------------------------ auth card (setup, access denied) */
.auth-card { width: min(100%, 460px); margin: clamp(8px, 4vh, 48px) auto; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card h1 { margin: 6px 0 10px; }
.auth-card > .muted { margin: 0 0 22px; font-size: 14px; }

/* ------------------------------------------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  .panel-main { width: min(100% - 24px, 1320px); padding-top: 20px; }
  th, td { padding: 10px 12px; }
  th:first-child, td:first-child { padding-left: 14px; }
  th:last-child, td:last-child { padding-right: 14px; }
  .card-head, .toolbar, .filters, .pager, .note { padding-inline: 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { min-height: 96px; padding: 14px; }
  .stat strong { font-size: 22px; }
  .details { grid-template-columns: 1fr 1fr; }
  .details > div { padding: 12px 14px; }
  .actions { grid-template-columns: 1fr; padding: 12px; }
  .auth-card { padding: 24px 20px; }
  .item-line { grid-template-columns: minmax(0, 1fr) 84px; }
  .product-form, .breakdown, .setting { padding: 14px; }
  .toolbar .date-field { flex: 1 1 140px; }
  .toolbar input[type=date] { flex: 1; min-width: 0; }
  .filters-card > span { flex-basis: 100%; }
  .stats-money .stat strong { font-size: 22px; }
}
