* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #0f1018; color: #e7e9ff; }
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: #16182a; border-bottom: 2px solid #2a2d4a;
}
h1 { font-size: 20px; margin: 0; }
.hidden { display: none !important; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: #b9a8ff; margin: 0 0 12px; }
.stats { font-size: 14px; color: #9aa0c8; }
header { flex-wrap: wrap; gap: 10px 16px; }
.stream-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stream-ctl button#stream-end { margin: 0; background: #b3324a; padding: 8px 14px; font-size: 13px; }
.stream-ctl input[type="datetime-local"] { padding: 6px 8px; font-size: 12px; }
.stream-since { flex-basis: 100%; font-size: 12px; color: #7c82a8; }
.chat-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  background: #1d2038; border: 1px solid #2a2d4a; border-radius: 999px; padding: 5px 11px; color: #9aa0c8; }
.chat-pill.ok { color: #8fdcab; border-color: rgba(99,229,142,.35); }
.chat-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #63e58e; box-shadow: 0 0 8px rgba(99,229,142,.7); }
.chat-pill .dot.off { background: #6c7299; box-shadow: none; }
.chat-ctl button { padding: 6px 12px; font-size: 12px; }
.badge.cap-badge { background: #2a2d4a; color: #8fdcab; }
main { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; padding: 24px; }
.col { background: #16182a; border: 1px solid #2a2d4a; border-radius: 12px; padding: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

button {
  background: #5b4bff; color: #fff; border: 0; border-radius: 8px;
  padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
button:hover { background: #6d5dff; }
button.danger { background: #b3324a; margin-top: 18px; }
button.small { padding: 5px 9px; font-size: 12px; }
button.gold { background: #c79a2b; }

.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 11px; background: #1d2038; border-radius: 8px; margin-bottom: 7px; font-size: 14px;
}
.list li.current { border: 1px solid gold; }
.list li { flex-wrap: wrap; }
.q-items { list-style: none; margin: 8px 0 2px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px;
  background: rgba(255,207,74,.06); border: 1px solid rgba(255,207,74,.25); border-radius: 8px; }
.q-items li { display: flex; gap: 8px; font-size: 14px; color: #ffe9a8; padding: 0; background: none; margin: 0; }
.q-items li b { color: #fff; min-width: 30px; }
.q-items li.q-total { margin-top: 4px; padding-top: 6px; border-top: 1px dashed rgba(255,207,74,.3); color: #cdb8ff; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.q-brief { font-size: 12px; color: #a49dce; white-space: normal; margin-top: 3px; }

input, select {
  width: 100%; padding: 9px 11px; margin-bottom: 8px; border-radius: 8px;
  border: 1px solid #2a2d4a; background: #0f1018; color: #fff; font-size: 14px;
}
.reveal-form { display: flex; flex-direction: column; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 60; margin-top: -4px;
  background: #1b1e33; border: 1px solid #2f3358; border-radius: 10px;
  max-height: 360px; overflow-y: auto; box-shadow: 0 14px 34px rgba(0,0,0,.55); }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; cursor: pointer; }
.ac-item + .ac-item { border-top: 1px solid #23263f; }
.ac-item:hover, .ac-item.active { background: #2a2f52; }
.ac-item img, .ac-item .ac-noimg { width: 34px; height: 47px; object-fit: cover; border-radius: 4px; background: #10121f; flex: none; }
.ac-info { flex: 1; min-width: 0; }
.ac-name { font-size: 14px; font-weight: 700; color: #eceafe; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-meta { font-size: 11px; color: #9aa0c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-val { flex: none; font-size: 14px; font-weight: 800; color: #63e58e; }
.ac-val.muted { color: #6c7299; }
.ac-note { padding: 10px 12px; color: #9aa0c8; font-size: 13px; }
.reveal-form .row { display: flex; gap: 8px; align-items: stretch; }
.reveal-form .row input { flex: 1; }
.reveal-form .row button { white-space: nowrap; margin-bottom: 8px; }

.battle-card { background: #1d2038; border-radius: 10px; padding: 14px; margin-bottom: 14px; border: 1px solid #3a2030; }
.battle-card h3 { margin: 0 0 8px; font-size: 15px; }
.battle-card .leader { color: gold; font-size: 13px; margin-bottom: 8px; }
.spot { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.spot .nm { flex: 1; font-size: 13px; }
.spot input { width: 70px; margin: 0; }
.badge { font-size: 11px; background: #2a2d4a; padding: 2px 7px; border-radius: 20px; color: #b9a8ff; }
.pool-badge { background: #1b3a26; color: #7dff9b; }
.live-badge { background: #7a1420; color: #ff8a9c; }
button.small.startbtn { background: #1f8a4c; }
button.small.stopbtn { background: #b3324a; }
.opener { background: #241a12; border: 1px solid #6b4a1f; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.opener-h { font-size: 14px; margin-bottom: 8px; color: #ffe9a8; }
.opener-h b { color: #fff; }
.opener-prog { color: #b98; font-size: 12px; }
.opener-row { display: flex; gap: 6px; align-items: center; }
.opener-row input[type=text] { flex: 1; margin: 0; }
.opener-row input[type=number] { width: 64px; margin: 0; }
.opener-row .hitbtn { background: #c79a2b; }

.battle-add { background: #12142a; border: 1px solid #2a2d4a; border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.battle-add .row { display: flex; gap: 8px; }
.battle-add .row input { flex: 1; margin-bottom: 0; }
.battle-add input { margin-bottom: 8px; }
.battle-add .hint { font-size: 12px; color: #7c82a8; margin-top: 8px; }
.battle-add .bulk { margin-top: 8px; }
.battle-add .bulk summary { font-size: 13px; color: #b9a8ff; cursor: pointer; padding: 4px 0; }
.battle-add textarea { width: 100%; margin: 8px 0; padding: 9px 11px; border-radius: 8px; border: 1px solid #2a2d4a; background: #0f1018; color: #fff; font-size: 13px; font-family: inherit; resize: vertical; }
button.small.del { background: #b3324a; }

/* Zbalený zoznam hráčov v battle karte */
.battle-card .players { margin: 8px 0 4px; border-top: 1px solid #2a2d4a; padding-top: 8px; }
.battle-card .players > summary { cursor: pointer; font-size: 12px; color: #9aa0c8; padding: 4px 0; list-style: none; }
.battle-card .players > summary::before { content: '▸ '; color: #7c82a8; }
.battle-card .players[open] > summary::before { content: '▾ '; }
.battle-card .players > summary:hover { color: #b9a8ff; }
.battle-card .players .spot:first-of-type { margin-top: 8px; }

/* ===== Čistý battle fokus ===== */
#battle-focus { max-width: 900px; margin: 0 auto; padding: 20px 24px; }
.bf-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(90deg,#3a2560,#7a3a6e); border-radius: 12px; padding: 12px 16px; }
.bf-head .pb { width: 22px; height: 22px; border-radius: 50%; position: relative; flex: none;
  background: linear-gradient(#ee1c26 0 50%, #f4f4f4 50% 100%); border: 2px solid #141414; }
.bf-head .pb::after { content: ''; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; border-radius: 50%; background: #f4f4f4; border: 2px solid #141414; }
.bf-name { font-size: 20px; font-weight: 900; }
.bf-loot { font-size: 14px; color: #cdb8ff; }
.bf-loot b { color: #63e58e; font-size: 18px; }
.bf-head .stopbtn { margin-left: auto; }
.bf-leader { margin: 12px 0; font-size: 15px; color: #ffe9a8; }
.bf-leader b { color: #fff; }

.bf-mid { background: #16182a; border: 1px solid #2a2d4a; border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.bf-mid.win { border-color: #6b4a1f; background: #241a12; }
.bf-cur { font-size: 22px; font-weight: 900; margin-bottom: 12px; }
.bf-cur b { color: #ffcf4a; }
.bf-win { font-size: 22px; font-weight: 900; color: #ffe9a8; margin-bottom: 12px; }
.bf-reveal { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.bf-reveal #bf_card { flex: 1; margin: 0; }
.bf-reveal #bf_val { width: 90px; margin: 0; }
.big-btn { font-size: 16px; font-weight: 800; padding: 10px 20px; border: none; border-radius: 10px; color: #fff; background: #6b4bd6; cursor: pointer; }
.big-btn.reveal { background: linear-gradient(90deg,#c79a2b,#e0b83c); color: #201800; white-space: nowrap; }
.big-btn:hover { filter: brightness(1.08); }
.bf-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bf-nav .hitbtn { background: #1f8a4c; }
.bf-navhint { font-size: 12px; color: #7c82a8; }
.bf-hint { font-size: 12px; color: #7c82a8; margin-top: 8px; }

.bf-listhd { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9aa0c8; margin: 4px 2px 8px; }
.bf-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.bf-list::-webkit-scrollbar { width: 8px; }
.bf-list::-webkit-scrollbar-thumb { background: #2a2d4a; border-radius: 8px; }
.bf-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px;
  background: rgba(255,255,255,.03); border: 1px solid #23263f; flex-wrap: wrap; }
.bf-row.cur { border-color: rgba(255,207,74,.55); background: rgba(255,207,74,.08); }
.bf-row.has .hit { color: #63e58e; font-weight: 700; }
.bf-row .p { color: #9b7fe0; font-weight: 800; min-width: 26px; }
.bf-row .nm { font-weight: 700; min-width: 120px; }
.bf-row .hit { color: #8a90b8; flex: 1; }
.bf-row .mini { background: #2a2d4a; padding: 4px 8px; }
.bf-edit { flex-basis: 100%; display: flex; gap: 6px; align-items: center; margin-top: 6px; padding-left: 36px; }
.bf-edit input { margin: 0; }
.bf-edit #ec_, .bf-edit input[id^="ec_"] { flex: 1; }
.bf-edit input[type="number"] { width: 80px; }

/* ===== Sken karty z kamery ===== */
.scan-row { display: flex; gap: 8px; margin-top: 10px; }
.scan-row #scan-btn { flex: 1; }
.scan-settings { margin-top: 8px; background: #12142a; border: 1px solid #2a2d4a; border-radius: 10px; padding: 10px; }
.scan-settings .hint { font-size: 11.5px; color: #7c82a8; line-height: 1.5; }
.scan-status { min-height: 4px; }
.scan-toast { position: fixed; right: 18px; bottom: 18px; z-index: 200; max-width: 420px;
  background: #1b1e33; border: 1px solid rgba(160,120,255,.45); border-radius: 12px;
  padding: 12px 16px; font-size: 14px; line-height: 1.5; box-shadow: 0 14px 40px rgba(0,0,0,.6); }
.scan-toast b { color: #ffcf4a; }
.scan-cands { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.scan-cands button { text-align: left; }
