/* winTok — ortak tasarım sistemi (landing, giriş, panel, yönetici) */
:root {
  --bg: #08090e;
  --bg2: #0d0e15;
  --surface: #12131c;
  --surface2: #181a26;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .14);
  --text: #f4f5fb;
  --muted: #9aa0b6;
  --dim: #6c7289;
  --red: #fe2c55;
  --purple: #a855f7;
  --cyan: #25f4ee;
  --gold: #ffc83d;
  --green: #34d399;
  --warn: #fbbf24;
  --brand: linear-gradient(120deg, #fe2c55 0%, #a855f7 55%, #25f4ee 110%);
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(168, 85, 247, .45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2c3b; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.grad-text { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--surface2); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: transform .15s, border-color .15s, background .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { border: 0; color: #fff; background: var(--brand); box-shadow: 0 8px 28px rgba(254, 44, 85, .28); }
.btn-primary:hover { box-shadow: 0 10px 34px rgba(168, 85, 247, .4); }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(254, 44, 85, .12); border-color: rgba(254, 44, 85, .4); color: #ff7b93; }
.btn-danger:hover { background: rgba(254, 44, 85, .2); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 14px 28px; font-size: 15.5px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.input, select.input, textarea.input {
  width: 100%; background: #0b0c13; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(168, 85, 247, .22); }
.input::placeholder { color: var(--dim); }
.hint { font-size: 12.5px; color: var(--dim); }
.form-error { background: rgba(254, 44, 85, .1); border: 1px solid rgba(254, 44, 85, .35); color: #ff8ea3; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; }
.form-ok { background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .35); color: #6ee7b7; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #2a2c3b; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(20px); }

/* ---------- Kart / rozet ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h2, .card h3 { margin: 0 0 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; background: var(--surface2); border: 1px solid var(--line2); color: var(--muted); }
.badge.green { color: #6ee7b7; background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); }
.badge.red { color: #ff8ea3; background: rgba(254, 44, 85, .1); border-color: rgba(254, 44, 85, .35); }
.badge.gold { color: var(--gold); background: rgba(255, 200, 61, .1); border-color: rgba(255, 200, 61, .35); }
.badge.purple { color: #d2a8ff; background: rgba(168, 85, 247, .12); border-color: rgba(168, 85, 247, .4); }
.badge.cyan { color: var(--cyan); background: rgba(37, 244, 238, .08); border-color: rgba(37, 244, 238, .32); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

/* ---------- Üst çubuk ---------- */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(16px); background: rgba(8, 9, 14, .72); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 22px; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 34px; width: auto; }
.nav { display: flex; gap: 6px; margin-left: 12px; }
.nav a { padding: 8px 14px; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: 14px; transition: .15s; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface2); }
.menu-btn { display: none; }

/* ---------- Ortalanmış sayfalar (giriş / mesaj) ---------- */
.center-page { display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.center-page::before, .glow::before {
  content: ''; position: fixed; inset: -20% -10% auto -10%; height: 70vh; pointer-events: none; z-index: 0;
  background: radial-gradient(40% 60% at 20% 30%, rgba(254, 44, 85, .22), transparent 70%), radial-gradient(40% 60% at 80% 20%, rgba(37, 244, 238, .16), transparent 70%), radial-gradient(50% 60% at 55% 55%, rgba(168, 85, 247, .2), transparent 70%);
  filter: blur(30px);
}
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 440px; background: rgba(18, 19, 28, .86); backdrop-filter: blur(10px); border: 1px solid var(--line2); border-radius: 24px; padding: 34px; box-shadow: var(--shadow); }
.auth-card .logo-big { display: block; margin: 0 auto 22px; height: 48px; }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.auth-foot a { color: var(--text); font-weight: 700; border-bottom: 1px solid var(--line2); }
.msg-card { position: relative; z-index: 1; max-width: 460px; text-align: center; padding: 38px 30px; }
.msg-card .msg-logo { height: 44px; margin: 0 auto 20px; }
.msg-card p { color: var(--muted); }

/* ---------- Panel iskeleti ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; position: relative; z-index: 1; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: 99px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { padding: 9px 20px; border-radius: 99px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font-weight: 700; font-size: 13.5px; }

/* ---------- Oyun kartları ---------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.game-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s; }
.game-card:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: var(--shadow); }
.game-thumb { position: relative; aspect-ratio: 16 / 11; background: #0b0c13 center top / cover no-repeat; border-bottom: 1px solid var(--line); }
.game-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(18, 19, 28, .95)); }
.game-thumb .badge { position: absolute; top: 12px; left: 12px; z-index: 2; backdrop-filter: blur(6px); background: rgba(8, 9, 14, .7); }
.game-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game-body h3 { margin: 0; font-size: 18px; }
.game-body p { margin: 0; color: var(--muted); font-size: 13.5px; flex: 1; }
.game-locked .game-thumb { filter: grayscale(.85) brightness(.7); }
.linkbox { display: flex; gap: 8px; align-items: center; background: #0b0c13; border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; }
.linkbox input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--cyan); font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; }

/* ---------- Adımlar / ipuçları ---------- */
.steps { display: grid; gap: 14px; counter-reset: s; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step::before { counter-increment: s; content: counter(s); flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.step b { display: block; }
.step span { color: var(--muted); font-size: 13.5px; }
.code-input { text-align: center; letter-spacing: .35em; font-size: 22px; font-weight: 800; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; padding: 12px 16px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--line); background: var(--bg2); white-space: nowrap; }
.t td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { cursor: pointer; transition: background .12s; }
.t tbody tr:hover { background: rgba(255, 255, 255, .03); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; text-transform: uppercase; }

/* ---------- İstatistik kartları ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--brand); opacity: .12; filter: blur(8px); }
.stat .n { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 13px; }

/* ---------- Modal / çekmece / toast ---------- */
.overlay-bg { position: fixed; inset: 0; background: rgba(4, 5, 9, .7); backdrop-filter: blur(4px); z-index: 100; display: none; }
.overlay-bg.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg2); border-left: 1px solid var(--line2); z-index: 101; transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer.open { transform: none; }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -48%); opacity: 0; pointer-events: none; width: min(480px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 22px; padding: 26px; z-index: 101; transition: .2s; box-shadow: var(--shadow); }
.modal.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.modal h3 { margin: 0 0 16px; font-size: 20px; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--surface2); border: 1px solid var(--line2); padding: 11px 18px; border-radius: 99px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: tin .25s ease; pointer-events: auto; }
.toast.err { border-color: rgba(254, 44, 85, .5); color: #ff9db0; }
.toast.ok { border-color: rgba(52, 211, 153, .5); color: #7ef0c4; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Yetki ızgarası (yönetici) ---------- */
.ent-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 10px; flex-wrap: wrap; }
.ent-row .name { font-weight: 700; min-width: 130px; }
.ent-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip { cursor: pointer; border: 1px solid var(--line2); background: var(--surface2); color: var(--text); border-radius: 99px; padding: 5px 11px; font-size: 12px; font-weight: 700; }
.chip:hover { border-color: var(--purple); }
.chip.danger:hover { border-color: var(--red); color: #ff8ea3; }
.section-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 800; margin: 24px 0 10px; }

/* ---------- Admin düzeni ---------- */
.admin-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 26px; align-items: start; }
.side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 4px; }
.side button { text-align: left; padding: 11px 16px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.side button:hover { background: var(--surface); color: var(--text); }
.side button.active { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); }

@media (max-width: 860px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg2); padding: 12px; border-bottom: 1px solid var(--line); margin: 0; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .topbar-in { gap: 12px; padding: 10px 16px; }
  .admin-wrap { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; overflow-x: auto; }
  .side button { white-space: nowrap; }
  .page { padding: 20px 16px 60px; }
}
