:root {
  --bg: #17121f;
  --bg-deep: #120e19;
  --panel: #201929;
  --raise: #2a2236;
  --raise-2: #332a42;
  --line: #3b3149;
  --line-soft: #2c2438;
  --text: #f2edf8;
  --muted: #a99cbb;
  --faint: #776b8b;
  --gold: #f5b83d;
  --gold-hi: #ffd27a;
  --gold-ink: #2b1d02;
  --gold-soft: rgba(245, 184, 61, .13);
  --live: #ff4d6d;
  --ok: #4fd1a1;
  --err: #ff6b6b;
  --err-soft: rgba(255, 107, 107, .1);
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 20px;
  --font: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: dark;
}

* { 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: 400 16px/1.55 var(--font); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: .86em; color: var(--muted); background: var(--raise); padding: 2px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.12; }
h1 { font-size: clamp(30px, 4vw, 40px); font-weight: 750; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

/* ---------- üst çubuk ve alt bilgi ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1180px; width: 100%; margin: 0 auto; padding: 18px 24px;
}
.top.admin { max-width: none; background: var(--panel); border-bottom: 1px solid var(--line-soft); padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 19px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand img, .brand svg { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.brand svg { color: var(--gold); }
.brand small { font-weight: 500; color: var(--faint); font-size: 14px; }
.top nav { display: flex; align-items: center; gap: 6px; }

.foot {
  max-width: 1180px; width: 100%; margin: auto auto 0; padding: 28px 24px 36px;
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  color: var(--faint); font-size: 14px; border-top: 1px solid var(--line-soft);
}
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

.wrap { max-width: 1180px; width: 100%; margin: 0 auto; padding: 16px 24px 64px; }
.wrap.admin { padding-top: 28px; }

/* ---------- düğmeler ve alanlar ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--raise); color: var(--text); font: inherit; font-weight: 650; font-size: 15px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--raise-2); color: var(--text); }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-hi); border-color: var(--gold-hi); color: var(--gold-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--raise); color: var(--text); }
.btn.danger { background: var(--err-soft); border-color: rgba(255, 107, 107, .4); color: #ffb3b3; }
.btn.danger-text { color: var(--err); }
.btn.small { height: 34px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.btn.big { height: 52px; padding: 0 24px; font-size: 16.5px; border-radius: 14px; }

.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius);
  background: var(--bg-deep); border: 1px solid var(--line); color: var(--text); font: inherit;
}
.input:focus { border-color: var(--gold); outline: none; }
select.input { padding-right: 8px; }
.mono-input { font-family: var(--mono); letter-spacing: .05em; text-transform: uppercase; }
label { display: grid; gap: 7px; font-size: 14px; color: var(--muted); font-weight: 500; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }

.alert { padding: 12px 16px; border-radius: var(--radius); background: rgba(79, 209, 161, .1); color: #a6f0d2; border: 1px solid rgba(79, 209, 161, .3); margin-bottom: 18px; }
.alert.err { background: var(--err-soft); color: #ffb8b8; border-color: rgba(255, 107, 107, .35); }
.warn { padding: 12px 16px; border-radius: var(--radius); background: var(--gold-soft); color: var(--gold-hi); }

/* ---------- ana sayfa ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center;
  padding: 40px 0 72px;
}
.hero h1 { font-size: clamp(40px, 6.2vw, 76px); font-weight: 800; letter-spacing: -.035em; line-height: .98; max-width: 11ch; }
.hero .lead { margin: 24px 0 30px; font-size: 18.5px; line-height: 1.55; color: var(--muted); max-width: 52ch; }
.hero .lead b { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--faint); }

/* Canlı demo: hediye gelir, eylem zinciri belirir. Sayfanın tek hareketli öğesi. */
.demo {
  position: relative; border-radius: 26px; padding: 22px;
  background: linear-gradient(170deg, #241c31 0%, #1a1424 100%);
  border: 1px solid var(--line-soft);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.demo-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; color: var(--text); }
.live::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(255, 77, 109, .2); }
.demo-stage { min-height: 300px; display: grid; align-content: start; gap: 14px; }
.demo-gift { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--raise); }
.demo-token { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: radial-gradient(circle at 35% 30%, #3a2f4c, #241c31); border: 2px solid var(--gold); box-shadow: 0 0 0 5px var(--gold-soft); }
.demo-who { font-weight: 650; }
.demo-what { font-size: 14.5px; color: var(--muted); }
.demo-coins { text-align: right; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.demo-coins small { display: block; color: var(--faint); font-weight: 400; font-size: 12px; }
.demo-chain { display: grid; gap: 8px; padding-left: 28px; position: relative; }
.demo-chain::before { content: ''; position: absolute; left: 28px; top: -14px; bottom: 18px; width: 2px; background: linear-gradient(var(--gold), rgba(245, 184, 61, .15)); transform: translateX(-14px); }
.demo-step { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: #2f2640; border: 1px solid var(--line-soft); font-size: 15px; position: relative; }
.demo-step svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.demo-step::before { content: ''; position: absolute; left: -15px; top: 50%; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); transform: translate(-50%, -50%); }
.demo-result { margin-top: 4px; font-size: 14.5px; color: var(--ok); display: flex; gap: 8px; align-items: center; }
.demo-result::before { content: '✓'; font-weight: 700; }
.demo-dots { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.demo-dots button { width: 8px; height: 8px; padding: 0; border-radius: 99px; border: 0; background: var(--line); cursor: pointer; transition: width .25s, background .25s; }
.demo-dots button[aria-current=true] { width: 22px; background: var(--gold); }
.demo .enter { animation: demo-in .45s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes demo-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.section { padding: 56px 0; border-top: 1px solid var(--line-soft); }
.section-head { display: grid; gap: 10px; margin-bottom: 30px; max-width: 640px; }
.section-head p { color: var(--muted); font-size: 17px; }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.feature { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--muted); font-size: 15px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; }
.steps li::before {
  content: counter(step); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--gold); color: var(--gold); font-weight: 750; font-size: 17px; margin-bottom: 6px;
}
.steps p { color: var(--muted); font-size: 15px; }

.works-with { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; color: var(--muted); font-size: 15px; }
.works-with b { color: var(--text); font-weight: 600; }

/* ---------- giriş / kayıt ---------- */

.auth { width: 100%; max-width: 440px; margin: 32px auto 0; }
.auth-card { padding: 30px; border-radius: var(--radius-l); background: var(--panel); border: 1px solid var(--line-soft); }
.auth h1 { font-size: 30px; margin-bottom: 8px; }
.auth .intro { color: var(--muted); margin-bottom: 24px; }
.auth .switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: 14.5px; }

/* ---------- hesap sayfası ---------- */

.account-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 12px 0 26px; }
.account-head p { color: var(--muted); margin-top: 6px; }
.panel-sec { padding: 28px 0; border-top: 1px solid var(--line-soft); }
.panel-sec > h2 { margin-bottom: 8px; }
.panel-sec > p { max-width: 720px; color: var(--muted); margin-bottom: 16px; }

.license-card { display: flex; flex-wrap: wrap; gap: 14px 40px; align-items: center; padding: 18px 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-soft); }
.license-card dl { margin: 0; display: contents; }
.license-card div { display: grid; gap: 2px; }
.license-card dt { font-size: 13px; color: var(--faint); }
.license-card dd { margin: 0; font-weight: 600; }
.link-form { display: flex; flex-wrap: wrap; gap: 10px; max-width: 580px; }
.link-form .input { flex: 1 1 280px; }

.link-list { display: grid; gap: 10px; }
.link-row {
  display: grid; grid-template-columns: minmax(170px, 240px) minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft);
}
.link-row b { font-weight: 650; }
.link-row .small { margin-top: 2px; color: var(--faint); }
code.link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 12px; border-radius: 9px; background: var(--bg-deep); cursor: copy; color: var(--muted); }

.quota { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; flex-wrap: wrap; }
.quota-bar { flex: 0 1 280px; height: 8px; border-radius: 99px; background: var(--raise); overflow: hidden; }
.quota-bar span { display: block; height: 100%; background: var(--gold); border-radius: 99px; }

/* ---------- tablo, rozet, anahtar (hesap + yönetim) ---------- */

.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 14px; overflow: hidden; font-size: 14.5px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.active { background: rgba(79, 209, 161, .14); color: var(--ok); }
.badge.unused { background: var(--raise-2); color: var(--muted); }
.badge.expired { background: var(--gold-soft); color: var(--gold-hi); }
.badge.revoked { background: var(--err-soft); color: var(--err); }

.key { font-family: var(--mono); font-size: 13.5px; letter-spacing: .04em; padding: 4px 8px; border-radius: 7px; background: var(--raise); cursor: copy; white-space: nowrap; }
.key:hover { background: var(--raise-2); color: var(--gold-hi); }
.key.big { display: inline-block; font-size: 22px; padding: 8px 14px; }

.empty { padding: 36px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 14px; }

/* ---------- yönetim paneli ---------- */

.narrow { max-width: 420px; margin: 40px auto; }
.narrow h1 { margin-bottom: 8px; }
.narrow .stack { margin-top: 22px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line-soft); border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.stats a { display: grid; gap: 2px; padding: 14px 18px; background: var(--panel); text-decoration: none; color: var(--muted); }
.stats a:hover { background: var(--raise); color: var(--muted); }
.stats a.on { background: var(--raise); box-shadow: inset 0 -2px 0 var(--gold); }
.stats b { font-size: 26px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats span { font-size: 13px; }

.create { margin-bottom: 18px; }
.create summary { list-style: none; }
.create summary::-webkit-details-marker { display: none; }
.create[open] summary { margin-bottom: 12px; }
.create-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft); }
.create-form label { flex: 0 0 150px; }
.create-form label.grow { flex: 1 1 200px; }
.create-form label[hidden] { display: none; }

.new-keys { padding: 18px; border-radius: 14px; background: var(--gold-soft); border: 1px solid rgba(245, 184, 61, .3); margin-bottom: 20px; }
.key-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }

.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1 1 260px; }
.filters select { width: auto; }

.pager { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.pager a { padding: 4px 10px; border-radius: 7px; background: var(--panel); color: var(--muted); text-decoration: none; }
.pager a.on { background: var(--gold); color: var(--gold-ink); }

.back { color: var(--muted); text-decoration: none; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 8px 0 18px; }
.detail-head p { margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border-radius: 14px; overflow: hidden; margin: 0 0 18px; }
.facts div { background: var(--panel); padding: 12px 16px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft); }
.relay-setup { margin-bottom: 16px; }
.relay-setup summary { cursor: pointer; color: var(--text); font-weight: 600; margin-bottom: 8px; }
.wrap.admin h2 { margin: 32px 0 12px; }

/* ---------- bildirim ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; z-index: 10;
  padding: 9px 18px; border-radius: 10px; background: var(--raise-2); border: 1px solid var(--line);
  transition: opacity .15s, transform .15s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- dar ekranlar ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 16px; }
  .features { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .table { display: block; overflow-x: auto; }
  .create-form label { flex: 1 1 140px; }
}
@media (max-width: 640px) {
  .top { padding: 14px 16px; }
  .top nav .btn.ghost.hide-sm { display: none; }
  .wrap { padding: 8px 16px 48px; }
  .foot { padding: 24px 16px 32px; }
  .link-row { grid-template-columns: 1fr; gap: 10px; }
  .auth-card { padding: 22px; }
  .demo { padding: 16px; border-radius: 20px; }
  .demo-stage { min-height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo .enter { animation: none; }
  .toast, .demo-dots button { transition: none; }
}

/* ---------- medya yükleme (Hesabım) ---------- */
.dropzone {
  display: grid; justify-items: center; gap: 4px; text-align: center; cursor: pointer;
  padding: 28px 20px; margin-bottom: 14px; border-radius: 16px; border: 1.5px dashed var(--line);
  background: var(--bg-deep); color: var(--muted); font-size: 15px;
}
.dropzone b { color: var(--text); font-weight: 650; }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.uploads { display: grid; gap: 6px; margin-bottom: 14px; }
.uploads:empty { display: none; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 150px; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--panel); font-size: 14px; }
.upload-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row progress { width: 100%; height: 6px; accent-color: var(--gold); }
.ok-text { color: var(--ok); }
.err-text { color: var(--err); }
@media (max-width: 640px) { .upload-row { grid-template-columns: 1fr; gap: 4px; } }
