:root {
  --bg: #0e1116;
  --bg2: #151a22;
  --panel: #1a2029;
  --panel2: #212936;
  --line: #2b3441;
  --text: #e6ebf2;
  --muted: #8b97a8;
  --accent: #f0a93b;
  --accent2: #ffcb6b;
  --t: #d8a54a;
  --ct: #5b9bd5;
  --good: #4cc38a;
  --bad: #e5484d;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
h1, h2, h3 { font-family: Rajdhani, sans-serif; letter-spacing: .5px; margin: 0 0 10px; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 17px; }

/* --- üst çubuk --- */
/* blur kaldırıldı: her kaydırmada yeniden çizim yaptırıp sayfayı yavaşlatıyordu */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: #0e1116; border-bottom: 1px solid var(--line); }
.brand { font-family: Rajdhani; font-size: 22px; white-space: nowrap; }
.brand .logo { color: var(--accent); }
.brand b { color: var(--accent); }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap; }
nav a:hover { color: var(--text); background: var(--panel); }
nav a.on { color: #111; background: var(--accent); }
.me { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.balance { font-family: Rajdhani; font-size: 18px; font-weight: 700; color: var(--good); background: var(--panel); padding: 4px 10px; border-radius: 8px; }

main { max-width: 1400px; margin: 0 auto; padding: 22px 20px 60px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

/* --- genel --- */
.btn { border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 8px; font-weight: 600; transition: .12s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.btn.primary:hover { background: var(--accent2); }
.btn.good { background: var(--good); border-color: var(--good); color: #0b1a12; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel2); }
.st { color: #cf6a32; font-weight: 700; }
.section { margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.section h3 { margin: 0; color: var(--muted); text-transform: uppercase; font-size: 14px; letter-spacing: 1.5px; }
.empty { color: var(--muted); padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* --- bağlanma ekranı --- */
.pair { max-width: 520px; margin: 60px auto; text-align: center; }
.pair .code { font-family: Rajdhani; font-size: 34px; letter-spacing: 12px; text-align: center; width: 260px; }
.pair ol { text-align: left; color: var(--muted); line-height: 1.9; }
.pair kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--accent); font-weight: 700; }

/* --- slotlar / takım --- */
.slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot { position: relative; min-width: 130px; padding: 10px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-align: left; color: var(--text); }
.slot.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.slot .n { font-family: Rajdhani; font-size: 16px; font-weight: 700; }
.slot .a { font-size: 11px; color: var(--good); font-weight: 700; }
.teams { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.teams button { border: 0; background: transparent; color: var(--muted); padding: 7px 18px; border-radius: 8px; font-weight: 700; font-family: Rajdhani; font-size: 16px; }
.teams button.on.t { background: var(--t); color: #111; }
.teams button.on.ct { background: var(--ct); color: #0b1522; }

/* --- kart ızgarası --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.card { position: relative; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; overflow: hidden; transition: border-color .12s; content-visibility: auto; contain-intrinsic-size: 170px 190px; }
.card:hover { border-color: var(--accent); }
.card .tools { position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; gap: 4px; }
.tbtn { border: 1px solid var(--line); background: rgba(14,17,22,.85); color: var(--text); border-radius: 6px; padding: 2px 7px; font-size: 13px; }
.tbtn:hover { border-color: var(--accent); }
.card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rc, #4b69ff); }
.card img { width: 100%; height: 100px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.card .t1 { font-size: 12px; color: var(--muted); }
.card .t2 { font-weight: 600; font-size: 13px; line-height: 1.3; min-height: 34px; }
.card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-top: 4px; color: var(--muted); }
.card .price { color: var(--good); font-weight: 700; font-family: Rajdhani; font-size: 15px; }
.card.none img { opacity: .25; }
.card.sel { outline: 2px solid var(--accent); }
.card .badge { position: absolute; top: 8px; left: 8px; }
.card .x { position: absolute; top: 6px; right: 8px; color: var(--muted); font-size: 12px; }

/* --- modal --- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5,7,10,.72); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal.hidden { display: none; }
.dialog { width: min(1100px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.dialog.narrow { width: min(560px, 100%); }
.dialog .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dialog .head h2 { margin: 0; flex: 1; }
.close { background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; }
.picker-list { max-height: 60vh; overflow-y: auto; padding: 2px; }

/* --- düzenleyici (float/seed/StatTrak) --- */
.editor { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.editor img { width: 100%; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 1px; }
input[type=range] { width: 100%; padding: 0; accent-color: var(--accent); }
.floatbar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #2e8b57 0 7%, #7ccf5b 7% 15%, #d6c24a 15% 38%, #e08a3a 38% 45%, #c2452d 45% 100%); position: relative; margin: 6px 0; }
.floatbar .mk { position: absolute; top: -4px; width: 3px; height: 16px; background: #fff; border-radius: 2px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* --- kasa açma --- */
.reel-wrap { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); height: 170px; margin: 16px 0; }
.reel-wrap::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--accent); z-index: 2; box-shadow: 0 0 12px var(--accent); }
.reel { position: absolute; top: 10px; left: 0; display: flex; gap: 8px; will-change: transform; }
.reel .it { width: 150px; height: 148px; flex: none; background: var(--panel); border-radius: 8px; border-bottom: 4px solid var(--rc); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; font-size: 11px; text-align: center; }
.reel .it img { width: 120px; height: 90px; object-fit: contain; }
.reel .it.rare { background: radial-gradient(circle, #3a2d10, var(--panel)); }
/* --- hediye kasası --- */
.gift { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 5px 12px; font: 600 13px Inter, sans-serif; cursor: pointer; white-space: nowrap; }
.gift.ready { color: #1a1204; background: linear-gradient(135deg, var(--accent2), var(--accent)); border-color: transparent; animation: giftPulse 1.6s ease-in-out infinite; }
.gift.big { padding: 9px 18px; font-size: 15px; }
.gift-banner { display: flex; align-items: center; gap: 14px; margin-top: 14px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.gift-banner img { height: 58px; }
@keyframes giftPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); } }

/* --- dolap: normal / paralı mod sekmeleri --- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); cursor: pointer; text-align: left; font: inherit; }
.mode b { color: var(--text); font-size: 15px; }
.mode span { font-size: 12px; }
.mode.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.mode.eco.on { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--panel)); }

/* --- admin: araç aç/kapat --- */
.vehicles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.veh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: var(--radius); background: var(--panel2); }
.veh.off { border-left-color: var(--bad); opacity: .75; }
.veh.all { border-left-color: var(--line); justify-content: center; }

/* --- CS2 tarzı kasa açma ekranı --- */
.unbox { position: fixed; inset: 0; z-index: 70; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 24px;
  background: radial-gradient(ellipse at 50% 40%, #1d2533 0%, #0a0d12 70%); animation: ubIn .25s ease; }
.ub-x, .ub-mute { position: absolute; top: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 20px; cursor: pointer; }
.ub-x { right: 16px; font-size: 26px; line-height: 1; }
.ub-mute { right: 64px; font-size: 16px; }
.ub-head { text-align: center; margin-bottom: 22px; }
.ub-head img { height: 96px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
.ub-head h2 { margin: 6px 0 2px; font-family: Rajdhani, sans-serif; font-size: 26px; letter-spacing: .5px; }
.ub-head.shake img { animation: ubShake .12s linear infinite; }
.ub-reel { --w: 176px; position: relative; width: 100%; max-width: 1100px; height: 196px; overflow: hidden; background: linear-gradient(#0b0e13, #11151c 50%, #0b0e13);
  border-top: 1px solid #2c3544; border-bottom: 1px solid #2c3544;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ub-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #f5c542; z-index: 3; box-shadow: 0 0 14px 2px rgba(245,197,66,.7); }
.ub-line::before, .ub-line::after { content: ''; position: absolute; left: 50%; margin-left: -9px; border: 9px solid transparent; }
.ub-line::before { top: 0; border-top-color: #f5c542; }
.ub-line::after { bottom: 0; border-bottom-color: #f5c542; }
.ub-strip { position: absolute; top: 12px; left: 0; display: flex; will-change: transform; }
.ub-it { width: var(--w); height: 172px; flex: none; padding: 0 3px; }
.ub-it > div { height: 100%; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; overflow: hidden;
  background: linear-gradient(180deg, #3b414b 0%, #272c34 58%, color-mix(in srgb, var(--rc) 45%, #272c34) 100%); border-bottom: 5px solid var(--rc); transition: transform .3s, box-shadow .3s; }
.ub-it img { width: 88%; height: 100px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); }
.ub-it span { font-size: 11px; text-align: center; line-height: 1.2; color: #cfd6e0; max-height: 2.4em; overflow: hidden; }
.ub-it .star { font-size: 64px; line-height: 100px; height: 100px; color: #ffd24a; text-shadow: 0 0 18px rgba(255,210,74,.8); }
.ub-it.rare > div { background: linear-gradient(180deg, #6b5214 0%, #3a2d0c 60%, #8a6a18 100%); }
.ub-it.win > div { transform: scale(1.07); box-shadow: 0 0 0 2px var(--rc), 0 0 36px var(--rc); }
.ub-hint { margin-top: 12px; font-size: 12px; }
.ub-reveal { text-align: center; max-width: 720px; animation: ubPop .55s cubic-bezier(.2,1.4,.4,1); }
.ub-reveal .glow { position: relative; isolation: isolate; width: min(520px, 88vw); aspect-ratio: 4 / 3; margin: 0 auto; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 50%, transparent) 0%, transparent 62%); }
.ub-reveal .glow::before { content: ''; position: absolute; inset: -8%; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(color-mix(in srgb, var(--rc) 30%, transparent) 0 7deg, transparent 7deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 68%); mask-image: radial-gradient(circle, #000 15%, transparent 68%); animation: ubSpin 24s linear infinite; }
.ub-reveal .glow img { width: 86%; filter: drop-shadow(0 18px 28px rgba(0,0,0,.7)); animation: ubFloat 3.2s ease-in-out infinite; }
.ub-reveal .rar { color: var(--rc); font-family: Rajdhani, sans-serif; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; font-size: 15px; }
.ub-reveal h1 { margin: 4px 0; font-family: Rajdhani, sans-serif; font-size: clamp(24px, 4vw, 34px); border-bottom: 4px solid var(--rc); display: inline-block; padding: 0 10px 4px; }
.ub-reveal .price { font-size: 26px; font-weight: 700; color: var(--good); margin: 4px 0 16px; }
.ub-reveal.gold .glow::before { animation-duration: 10s; }
@keyframes ubIn { from { opacity: 0; } }
@keyframes ubPop { from { opacity: 0; transform: scale(.7); } }
@keyframes ubShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-3deg) translateY(-2px); } 75% { transform: rotate(3deg) translateY(2px); } }
@keyframes ubSpin { to { transform: rotate(360deg); } }
@keyframes ubFloat { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .ub-reveal .glow::before, .ub-reveal .glow img { animation: none; } }

.drop { text-align: center; }
.drop img { max-width: 360px; width: 100%; filter: drop-shadow(0 14px 24px rgba(0,0,0,.6)); }
.odds { display: grid; gap: 14px; }
.odds .tier { border-left: 4px solid var(--rc); padding-left: 10px; }

/* --- canlı akış --- */
.layout2 { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.feed { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; }
.feed .f { display: flex; gap: 8px; align-items: center; padding: 7px; border-radius: 8px; background: var(--panel); margin-bottom: 6px; border-left: 3px solid var(--rc); font-size: 12px; }
.feed .f img { width: 54px; height: 40px; object-fit: contain; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.srv { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel); padding: 5px 10px; border-radius: 8px; }
.srv.on { color: var(--good); }
.uname { color: var(--text); font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.uname:hover, .uname.on { border-color: var(--accent); color: var(--accent); }
.profile-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.profile-head .big { font-family: Rajdhani; font-size: 34px; font-weight: 700; color: var(--good); }
.subpicker { margin-top: 4px; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--accent); font-weight: 700; font-size: 12px; }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--good); padding: 10px 14px; border-radius: 8px; max-width: 380px; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.toast.err { border-left-color: var(--bad); }

@media (max-width: 860px) {
  .layout2 { grid-template-columns: 1fr; }
  .feed { position: static; max-height: none; }
  .editor { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; }
  nav { order: 3; width: 100%; }
}
