:root {
  --bg: #0f0f0f;
  --bg2: #1a1a1a;
  --fg: #ffffff;
  --muted: #9aa0a6;
  --accent: #ff2d6f;
  --accent2: #ffd400;
  --accent3: #00e5ff;
  --ok: #2ee59d;
  --warn: #ff9f43;
  --danger: #ff3030;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; overscroll-behavior: none; }
body { min-height: 100vh; min-height: 100dvh; }
a { color: var(--accent); text-decoration: none; }
h1, h2 { margin: 0 0 10px; font-weight: 900; letter-spacing: -0.02em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.small { font-size: 13px; }

/* SPLASH */
.splash {
  position: fixed; inset: 0;
  background: radial-gradient(1200px 900px at 50% 10%, #2a0f1e 0%, #0f0f0f 55%);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  transition: opacity .6s ease, transform .6s ease;
  overflow: hidden;
}
.splash.gone { opacity: 0; transform: scale(1.05); pointer-events: none; }
.splash-inner { text-align: center; padding: 30px; position: relative; z-index: 2; }
.splash-title { font-size: 56px; line-height: 1.05; font-weight: 900; margin: 0 0 8px; }
.splash-title .grad { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-sub { color: var(--muted); margin: 0 0 30px; font-size: 18px; }
.balloon { position: absolute; font-size: 50px; animation: float 6s ease-in-out infinite; }
.balloon.b1 { left: 8%; top: 12%; animation-delay: 0s; }
.balloon.b2 { right: 10%; top: 20%; animation-delay: 1.4s; }
.balloon.b3 { left: 18%; bottom: 12%; animation-delay: 2.2s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-20px) rotate(6deg); } }

/* HOME */
.home-main { padding: 20px 16px 110px; max-width: 520px; margin: 0 auto; }
.hero h1 { font-size: 32px; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin-top: 4px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.card { background: linear-gradient(160deg, #1c1c1c, #121212); border: 1px solid #242424; border-radius: 20px; padding: 18px; color: var(--fg); display: flex; flex-direction: column; gap: 4px; transition: transform .15s ease; }
.card:active { transform: scale(.97); }
.card .ico { font-size: 42px; line-height: 1; }
.card h2 { font-size: 18px; margin-top: 8px; }
.card p { color: var(--muted); font-size: 12px; margin: 0; }
.card.killer { border-color: #5a0f26; }
.card.shooter { border-color: #4a3a00; }
.card.tlv { border-color: #0c4a4a; }
.card.logs { border-color: #333; }
.logout { text-align: center; margin-top: 24px; font-size: 13px; color: var(--muted); }

/* BOTTOM NAV */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(16,16,16,.95); backdrop-filter: blur(14px); border-top: 1px solid #222; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 4px env(safe-area-inset-bottom); z-index: 50; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; color: var(--muted); font-size: 10px; font-weight: 600; }
.bottom-nav a span { font-size: 22px; }
.bottom-nav a em { font-style: normal; margin-top: 2px; }
.bottom-nav a.on { color: var(--accent); }
body.with-nav { padding-bottom: 84px; }

/* BUTTONS */
.btn-big { display: block; width: 100%; padding: 18px 20px; background: linear-gradient(135deg, var(--accent), #c41a52); color: #fff; border: none; border-radius: 16px; font-size: 18px; font-weight: 900; letter-spacing: .04em; cursor: pointer; box-shadow: 0 10px 30px rgba(255,45,111,.3); text-transform: uppercase; }
.btn-big:active { transform: scale(.98); }
.btn-big.primary { background: linear-gradient(135deg, var(--accent3), #009ec3); box-shadow: 0 10px 30px rgba(0,229,255,.25); }
.btn-big.warn { background: linear-gradient(135deg, #555, #333); box-shadow: none; }
.btn-kill { display: block; width: 100%; margin-top: 24px; padding: 22px 16px; background: linear-gradient(135deg, #ff1b4a, #a6001c); color: #fff; border: none; border-radius: 18px; font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; box-shadow: 0 12px 35px rgba(255,27,74,.4); cursor: pointer; }
.btn-kill:active { transform: scale(.97); }
.btn-kill:disabled { opacity: .5; }
.row { display: flex; gap: 10px; }
.row .btn-big { flex: 1; }

/* HEADERS */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px; }
.topbar h1 { font-size: 22px; }
.topbar .who { color: var(--muted); font-size: 13px; }
.pad { padding: 12px 16px 40px; max-width: 560px; margin: 0 auto; }

/* STATE CARD */
.state-card { background: linear-gradient(160deg, #191919, #101010); border: 1px solid #262626; border-radius: 20px; padding: 20px; margin-bottom: 18px; }
.state-card .label { color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; margin: 4px 0; }
.state-card .target { font-size: 48px; font-weight: 900; margin: 6px 0 18px; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mission-box { background: #0a0a0a; border: 1px dashed #333; border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.mission-box .mission { font-size: 18px; margin: 4px 0 0; line-height: 1.35; }

.dead-title, .win-title { font-size: 48px; text-align: center; margin: 10px 0; line-height: 1.1; }
.dead-title { color: var(--danger); animation: shake .6s ease; }
.win-title { background: linear-gradient(90deg, var(--accent2), #ffae00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.state-card.dead { border-color: #5a0f0f; }
.state-card.winner { border-color: #4a3a00; }
.emoji-rain { font-size: 28px; text-align: center; letter-spacing: 6px; margin-top: 10px; animation: bounce 2s ease infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

.kill-flash { position: fixed; inset: 0; background: #a6001c; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: 900; text-align: center; z-index: 200; animation: flash .2s ease 6; }
@keyframes flash { 50% { background: #000; } }

/* LOGIN */
body.centered { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { width: 100%; max-width: 380px; background: #161616; border: 1px solid #262626; border-radius: 22px; padding: 28px; text-align: center; }
.login-box h1 { font-size: 34px; margin-bottom: 10px; }
.login-box input { width: 100%; padding: 14px 16px; background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 12px; color: #fff; font-size: 16px; margin-bottom: 10px; }
.login-box .btn-big { margin-top: 10px; }
.err { background: #4a0f1c; border: 1px solid #7a1a2c; color: #ffb3bd; padding: 10px; border-radius: 10px; margin-bottom: 10px; font-size: 14px; }

/* ADMIN */
.admin table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.admin th, .admin td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #222; vertical-align: top; }
.admin th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.admin tr.row-dead { opacity: .45; }
.status-idle { color: var(--muted); }
.status-running { color: var(--ok); }
.status-finished { color: var(--accent2); }
.logline { padding: 6px 0; border-bottom: 1px dashed #222; font-size: 13px; }
.logline .time { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.day-filter { margin: 6px 0 14px; }
.day-filter select { background: #0a0a0a; border: 1px solid #2a2a2a; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 14px; }

/* SHOOTER */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 8px 14px; border-radius: 999px; background: #1d1d1d; border: 1px solid #2a2a2a; font-weight: 600; font-size: 13px; color: #777; }
.chip input:checked + span { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #000; border-color: transparent; }
.slot { background: #0a0a0a; border: 2px solid var(--accent3); border-radius: 16px; padding: 28px 10px; text-align: center; margin-bottom: 18px; overflow: hidden; box-shadow: inset 0 0 30px rgba(0,229,255,.2); }
.slot-win { font-size: 42px; font-weight: 900; letter-spacing: -.02em; transition: transform .08s ease; background: linear-gradient(90deg, var(--accent3), #fff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.slot-win.pulse { transform: scale(1.05); }
.slot-win.final { font-size: 54px; animation: winPop .6s ease; }
@keyframes winPop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.result { font-size: 28px; text-align: center; font-weight: 900; margin-top: 18px; line-height: 1.3; }
.result b { color: var(--accent2); font-size: 40px; }

/* TLV */
body.tlv { overflow: hidden; touch-action: none; }
.tlv-wrap { position: fixed; inset: 0; background: radial-gradient(circle at 50% 50%, #1b1b1b 0%, #0a0a0a 100%); overflow: hidden; }
.tlv-info { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 28px; font-weight: 900; color: #fff; padding: 20px; }
.tlv-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 180px; font-weight: 900; color: #fff; z-index: 4; pointer-events: none; }
.tlv-count.go { animation: countPop .8s ease; }
@keyframes countPop { 0% { transform: scale(.4); opacity: 0; } 40% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(.95); opacity: .6; } }
.tlv-winner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: 900; z-index: 5; pointer-events: none; animation: winPop .6s ease; }
.tlv-home { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.1); color: #fff; border-radius: 50%; font-size: 20px; z-index: 10; }
.finger-dot { position: absolute; width: 120px; height: 120px; border-radius: 50%; margin-left: -60px; margin-top: -60px; opacity: .55; box-shadow: 0 0 40px currentColor; transition: opacity .3s ease; pointer-events: none; }
.finger-dot.fade { opacity: .15; }
.finger-halo { position: absolute; width: 240px; height: 240px; border-radius: 50%; margin-left: -120px; margin-top: -120px; opacity: .9; box-shadow: 0 0 80px currentColor; animation: haloPulse 1s ease infinite; pointer-events: none; }
@keyframes haloPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* LOGOUT BUTTON */
.btn-logout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #2a0f0f, #1a0505);
  border: 1px solid #4a1515; color: #ff8a8a;
  font-size: 20px; text-decoration: none; flex-shrink: 0;
  transition: transform .12s ease, background .2s ease;
}
.btn-logout:active { transform: scale(.92); background: linear-gradient(135deg, #4a1515, #2a0f0f); }
.btn-logout.floating {
  position: fixed; top: calc(env(safe-area-inset-top, 0) + 12px); right: 12px;
  z-index: 120; background: rgba(42,15,15,.9); backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}

/* SECRET REVEAL */
.secret-wrap {
  position: relative; min-height: 220px; padding: 0;
  border-radius: 18px; overflow: hidden;
  background: #0a0a0a; border: 1px dashed #333;
  margin-bottom: 14px; cursor: pointer; user-select: none;
}
.secret-data { padding: 20px; transition: filter .35s ease, opacity .25s ease; }
.secret-wrap[data-hidden="1"] .secret-data { filter: blur(16px) saturate(.4); opacity: .4; pointer-events: none; }
.secret-wrap[data-hidden="1"] .mission-box { border-color: transparent; }
.secret-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(10,10,10,.55); backdrop-filter: blur(2px);
  text-align: center; padding: 20px;
  transition: opacity .25s ease; pointer-events: none;
}
.secret-wrap[data-hidden="0"] .secret-cover { opacity: 0; }
.secret-cover .eye { font-size: 48px; margin-bottom: 8px; animation: eyeBlink 2.4s ease infinite; }
.secret-cover .cover-title { font-size: 20px; font-weight: 900; letter-spacing: .06em; color: var(--accent2); }
.secret-cover .cover-sub { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.4; }
@keyframes eyeBlink { 0%,94%,100% { transform: scale(1); } 96% { transform: scale(1,.1); } }
.secret-timer {
  position: absolute; top: 10px; right: 12px;
  background: rgba(255,45,111,.85); color: #fff;
  font-weight: 900; font-size: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 14px rgba(255,45,111,.4);
  animation: timerPulse 1s ease infinite;
}
@keyframes timerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* SMS / ZAK */
.btn-zak { display:block; text-align:center; margin-top:14px; padding:14px; background:#1b1b1b; border:1px solid #3a2a00; color:var(--accent2); border-radius:14px; font-weight:800; font-size:15px; letter-spacing:.05em; }
.btn-zak:active { transform:scale(.98); }

/* KPI */
.kpi-row { display:grid; grid-template-columns: repeat(3,1fr); gap:10px; margin-bottom:14px; }
.kpi { background:#0a0a0a; border:1px solid #242424; border-radius:14px; padding:14px 8px; text-align:center; }
.kpi b { display:block; font-size:28px; font-weight:900; line-height:1; }
.kpi em { display:block; color:var(--muted); font-style:normal; font-size:11px; margin-top:6px; text-transform:uppercase; letter-spacing:.1em; }
.kpi b.accent { color: var(--accent); }
.row .danger { background: linear-gradient(135deg,#4a0f0f,#240707); color:#ff8a8a; box-shadow:none; }

/* Live dot */
.live-dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--ok); box-shadow:0 0 8px var(--ok); margin-left:8px; animation:blink 1.4s ease-in-out infinite; vertical-align:middle; }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.3; } }

/* Missions CRUD */
.mission-add { display:flex; gap:8px; margin:8px 0 14px; }
.mission-add input { flex:1; padding:10px 12px; background:#0a0a0a; border:1px solid #2a2a2a; color:#fff; border-radius:10px; font-size:14px; }
.mission-add button { padding:0 16px; background:var(--accent); border:none; border-radius:10px; color:#fff; font-size:18px; font-weight:900; cursor:pointer; }
.mission-list { list-style:none; padding:0; margin:0; }
.mission-list li { display:flex; gap:8px; align-items:flex-start; padding:10px 0; border-bottom:1px dashed #222; font-size:14px; }
.mission-list .m-text { flex:1; }
.mission-list .m-actions { display:flex; gap:4px; flex-shrink:0; }
.mission-list button { background:transparent; border:none; cursor:pointer; padding:4px 8px; font-size:16px; border-radius:8px; }
.mission-list button:hover { background:#1a1a1a; }

/* Log filters */
.log-filters { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.log-filters select, .log-filters button { background:#0a0a0a; border:1px solid #2a2a2a; color:#fff; padding:8px 12px; border-radius:8px; font-size:13px; }
.log-filters button { background:var(--accent); border:none; font-weight:700; cursor:pointer; }

.logline.kill { background: linear-gradient(90deg, rgba(255,27,74,.18), transparent); border-left:3px solid var(--accent); padding-left:10px; border-radius:8px; }
.logline.warn { border-left:3px solid var(--warn); padding-left:10px; }

/* TIMELINE */
.timeline { display:flex; flex-direction:column; gap:8px; }
.tl-item { display:flex; gap:12px; align-items:center; padding:12px 14px; background:#141414; border:1px solid #222; border-radius:14px; }
.tl-item.kill { background: linear-gradient(90deg, rgba(255,45,111,.22), rgba(255,45,111,.05)); border-color:#6a1532; }
.tl-item.kill .tl-main { font-weight:800; color:#ffb8c8; text-transform:uppercase; letter-spacing:.03em; }
.tl-item.warn { border-color:#5a3e0a; }
.tl-ico { font-size:22px; width:36px; height:36px; display:flex; align-items:center; justify-content:center; background:#0a0a0a; border-radius:10px; flex-shrink:0; }
.tl-body { flex:1; min-width:0; }
.tl-main { font-size:14px; line-height:1.3; }
.tl-time { color:var(--muted); font-size:11px; margin-top:2px; font-variant-numeric: tabular-nums; }

/* ADMIN ATTEMPTS / SUSPICION */
.danger-card { background: linear-gradient(160deg, #2a0808, #140404); border-color: #6a1515 !important; box-shadow: 0 0 20px rgba(255,30,30,.15); }
.danger-card h2 { color: #ff6b6b; letter-spacing: .02em; }
.alert-chip { background: linear-gradient(90deg, rgba(255,30,30,.25), rgba(255,30,30,.05)); border: 1px solid #6a1515; color: #ffb3b3; padding: 10px 14px; border-radius: 12px; margin: 8px 0 0; font-size: 13px; }
.susp-card { background: rgba(10,10,10,.6); border: 1px solid #451515; border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.susp-head { display: flex; justify-content: space-between; gap: 8px; color: #ffb3b3; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.susp-head .susp-time { font-variant-numeric: tabular-nums; }
.susp-reason { color: #ffd6a8; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.susp-clues { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.4; }
.susp-clues li { background: #0a0a0a; padding: 8px 10px; border-radius: 10px; border-left: 3px solid #ff6b6b; }
.susp-clues li.muted { color: var(--muted); border-left-color: #444; }
.tl-item.admin { background: linear-gradient(90deg, rgba(255,30,30,.25), rgba(255,30,30,.05)); border-color: #6a1515; }
.tl-item.admin .tl-main { font-weight: 800; color: #ffb3b3; }

/* CONFETTI */
.confetti-piece { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 999; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }
