:root {
  --bg: #0b0c0f;
  --panel: #14161b;
  --panel2: #1b1e25;
  --panel3: #232731;
  --line: #262a33;
  --text: #eef0f4;
  --muted: #8b919e;
  --red: #e2342d;
  --red2: #ff5a4f;
  --gold: #e7b35a;
  --green: #3ccf6e;
  --t1: #c98a2c;
  --t2: #6c5ce7;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: var(--text); background: var(--panel3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
[hidden] { display: none !important; }

/* header */
.top { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: linear-gradient(180deg, #121419, #0d0f13); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .12em; }
.brand svg { width: 44px; height: 28px; }
.brand small { display: block; font-size: 10px; letter-spacing: .3em; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { padding: 9px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs a:hover { color: var(--text); background: var(--panel2); }
.tabs a.on { color: var(--gold); background: var(--panel3); }
.me { display: flex; align-items: center; gap: 10px; }
.me img { width: 34px; height: 34px; border-radius: 50%; }
.me .name { font-weight: 600; }
.me .out { color: var(--muted); font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; background: var(--panel3); font-weight: 600; border: 1px solid transparent; transition: .15s; }
.btn:hover { background: #2c313d; }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover { background: var(--red2); }
.btn.gold { background: var(--gold); color: #1a1407; }
.btn.gold:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: #3a1416; color: #ff7a72; }
.btn.danger:hover { background: #4a181b; }
.btn.white { background: #fff; color: #111; }
.btn.steam { background: #171a21; border-color: #2a475e; }
.btn.steam:hover { background: #1b2838; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

main { max-width: 1440px; margin: 0 auto; padding: 20px 24px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; }

/* lista */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 18px; }
.hero .card { padding: 22px; }
.hero h1 { font-size: 28px; letter-spacing: -.01em; }
.hero p { margin: 6px 0 18px; color: var(--muted); }
.srv { display: flex; flex-direction: column; gap: 10px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.wait { background: var(--gold); }
.addr { font-family: ui-monospace, monospace; background: var(--panel3); padding: 6px 10px; border-radius: 8px; display: inline-block; }
.lobbies { display: flex; flex-direction: column; gap: 8px; }
.lrow { display: grid; grid-template-columns: 44px 1fr 150px 130px 110px 110px; align-items: center; gap: 14px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.lrow:hover { border-color: #3a3f4b; }
.lrow img, .ava { width: 40px; height: 40px; border-radius: 50%; background: var(--panel3); object-fit: cover; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel3); font-size: 13px; font-weight: 600; }
.chip.live { background: #3a1416; color: #ff7a72; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* lobby */
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.bar .grow { flex: 1; }
.link { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); padding: 9px 14px; border-radius: 10px; color: var(--gold); font-family: ui-monospace, monospace; font-size: 13px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid3 { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 18px; align-items: start; }
.team { display: flex; flex-direction: column; gap: 8px; }
.thead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: linear-gradient(90deg, rgba(201,138,44,.28), rgba(201,138,44,.04) 70%), var(--panel); border: 1px solid var(--line); }
.team.t2 .thead { background: linear-gradient(90deg, rgba(108,92,231,.3), rgba(108,92,231,.04) 70%), var(--panel); }
.thead .tname { font-weight: 700; font-size: 17px; flex: 1; display: flex; gap: 8px; align-items: center; min-width: 0; }
.thead .tname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thead .tname button { color: var(--muted); }
.size { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.size button { width: 28px; height: 28px; border-radius: 8px; font-size: 18px; }
.size button:hover { background: var(--panel3); color: var(--text); }
.slot { display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 60px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); position: relative; }
.slot.free { color: var(--muted); cursor: pointer; }
.slot.free:hover { border-color: #3a3f4b; color: var(--text); }
.slot.free .plus { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--panel3); font-size: 20px; }
.slot.me { border-color: rgba(231,179,90,.55); }
.slot.drag-over { border-color: var(--gold); background: var(--panel2); }
.slot .pname { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .tag { font-size: 11px; color: var(--gold); font-weight: 700; letter-spacing: .05em; }
.slot .off { opacity: .45; }
.slot .acts { display: none; gap: 4px; }
.slot:hover .acts { display: flex; }
.slot .acts button { padding: 4px 8px; border-radius: 6px; font-size: 12px; color: var(--muted); background: var(--panel3); }
.slot .acts button:hover { color: var(--text); }
.slot[draggable="true"] { cursor: grab; }
.online { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: absolute; left: 44px; top: 40px; border: 2px solid var(--panel); }

.center { display: flex; flex-direction: column; gap: 10px; }
.mapcard { position: relative; height: 220px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.mapcard::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.15), rgba(0,0,0,.7)); }
.mapcard > * { position: relative; z-index: 1; }
.mapcard .mapchip { position: absolute; top: 12px; left: 12px; z-index: 2; }
.mapcard .score { font-size: 56px; font-weight: 800; letter-spacing: .04em; text-shadow: 0 4px 20px rgba(0,0,0,.6); }
.mapcard .state { background: rgba(0,0,0,.55); padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.mapbg { position: absolute; inset: 0; z-index: 0 !important; }
.mapbg .big { position: absolute; right: -10px; bottom: -28px; font-size: 92px; font-weight: 800; color: rgba(255,255,255,.07); letter-spacing: -.02em; text-transform: uppercase; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; height: 54px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.opt .lbl { flex: 1; font-weight: 600; }
.opt .val { font-weight: 600; color: var(--muted); }
.bench { margin-top: 18px; }
.bench h3 { font-size: 14px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.bench .people { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.pill img { width: 26px; height: 26px; border-radius: 50%; }

/* switch */
.sw { width: 46px; height: 26px; border-radius: 999px; background: var(--panel3); position: relative; flex: none; transition: .15s; }
.sw::after { content: "✕"; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #5b616d; color: #1b1e25; font-size: 11px; font-weight: 800; display: grid; place-items: center; transition: .15s; }
.sw.on { background: #4a3d22; }
.sw.on::after { content: "✓"; left: 23px; background: var(--gold); }
.sw:disabled { opacity: .5; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { padding: 6px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--panel3); color: var(--gold); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 50; display: grid; place-items: center; padding: 20px; }
.mbox { width: min(960px, 100%); max-height: 90vh; display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.mbox.small { width: min(480px, 100%); grid-template-columns: 1fr; }
.mhead { grid-column: 1 / -1; display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mhead h2 { flex: 1; font-size: 22px; }
.mside { padding: 14px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); }
.mside button { text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.mside button.on, .mside button:hover { background: var(--panel3); color: var(--text); }
.mbody { overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.mbox.small .mbody { padding: 20px; }
.sect { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sect h3 { font-size: 18px; margin-bottom: 4px; }
.srow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--panel3); }
.srow .lbl { flex: 1; font-weight: 600; }
.srow .lbl small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.mode { padding: 16px 12px; border-radius: 12px; background: var(--panel3); border: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.mode .ic { font-size: 28px; }
.mode b { font-size: 15px; }
.mode small { color: var(--muted); font-size: 12px; }
.mode.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(231,179,90,.12), transparent), var(--panel3); }
.mode.on b { color: var(--gold); }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mapt { position: relative; height: 90px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; display: flex; align-items: flex-end; padding: 8px 10px; font-weight: 700; }
.mapt.on { border-color: var(--gold); }
.mapt span { position: relative; z-index: 1; text-shadow: 0 2px 8px #000; }

/* istoric */
.hist { display: flex; flex-direction: column; gap: 10px; }
.hrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding: 14px 18px; }
.hrow .side { display: flex; flex-direction: column; gap: 6px; }
.hrow .side.r { align-items: flex-end; text-align: right; }
.hrow .hs { text-align: center; }
.hrow .hs b { font-size: 30px; }
.hrow .avs { display: flex; gap: 4px; }
.hrow .avs img { width: 26px; height: 26px; border-radius: 50%; }
.win { color: var(--green); }

/* comenzi */
.help { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.help .card { padding: 18px; }
.help h3 { margin-bottom: 10px; }
.help table { width: 100%; border-collapse: collapse; font-size: 14px; }
.help td { padding: 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.help td:first-child { font-family: ui-monospace, monospace; color: var(--gold); white-space: nowrap; padding-right: 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel3); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 90vw; }
.toast.err { border-color: #6b2023; color: #ffb0aa; }

/* login cerut */
.gate { max-width: 520px; margin: 60px auto; padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }

@media (max-width: 1100px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .center { grid-column: 1 / -1; order: -1; }
  .hero { grid-template-columns: 1fr; }
  .lrow { grid-template-columns: 40px 1fr auto; }
  .lrow .hide-s { display: none; }
}
@media (max-width: 700px) {
  main { padding: 14px 16px 40px; }
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .grid3 { grid-template-columns: 1fr; }
  .mbox { grid-template-columns: 1fr; }
  .mside { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .hrow { grid-template-columns: 1fr; text-align: center; }
  .hrow .side, .hrow .side.r { align-items: center; text-align: center; }
  .mapcard .score { font-size: 44px; }
}
