/* SNIPER FC dashboard — dark + pink, sporty, mobile-first. */
:root {
  --bg: #0a0d12;
  --bg2: #0d1118;
  --panel: #121823;
  --panel2: #161d29;
  --card: #161d29;
  --line: #232c3b;
  --text: #eef2f7;
  --muted: #8a97a7;
  --pink: #ff1f6b;
  --pink-dim: #b3164c;
  --green: #25d07d;
  --green-soft: #7be3a8;
  --red: #ef4565;
  --amber: #f6b740;
  --blue: #43a6ff;
  --grey: #6b7888;
  --r: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  color: var(--text);
  font-family: "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.err { color: var(--red); }
h1, h2, .brand-name, .wr-title, .num, .funnel .n, .member3 .n, .stat .v, .btn-run, .nav-num {
  font-family: "Rajdhani", "Noto Sans Thai", sans-serif;
}

main { padding: 12px; max-width: 760px; margin: 0 auto; display: grid; gap: 12px; padding-bottom: 84px; }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, #0a0d12 70%, #0a0d1200);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 0 10px #ff1f6b55); }
.brand-name { font-size: 26px; font-weight: 700; letter-spacing: 1px; line-height: 1; }
.brand-name span { color: var(--pink); }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.bell { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  position: relative; cursor: pointer; }
.bell::before { content: "🔔"; font-size: 17px; }
.bell::after { content: ""; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }

/* mode chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px; }
.modechip { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 7px 11px;
  font-size: 11px; font-weight: 600; letter-spacing: .5px; color: var(--muted); }
.modechip b { color: var(--text); margin-left: 5px; }
.modechip.on b { color: var(--green); } .modechip.off b { color: var(--muted); } .modechip.warn b { color: var(--pink); }

/* panel */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ph { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.panel-head .ph { margin: 0; }
.ph-ic { color: var(--pink); display: inline-flex; }
.ph-ic svg { width: 18px; height: 18px; }
.count { color: var(--pink); font-weight: 700; font-size: 13px; }

/* war room */
.warroom { position: relative; padding: 0; overflow: hidden; min-height: 250px; }
.warroom { background-image: url("/assets/warroom.png"); background-size: cover; background-position: center; }
.wr-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, #0b0f17cc 0%, #0b0f17e6 60%, #0b0f17f5 100%); }
.wr-body { position: relative; padding: 16px; }
.wr-title { font-size: 22px; font-weight: 700; color: var(--pink); letter-spacing: 1px; }
.wr-sub { font-size: 13px; color: var(--text); margin-bottom: 12px; }
.wr-status { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
.st { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grey); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.off { background: var(--red); }
.st .k { color: var(--muted); } .st .v { color: var(--text); font-weight: 600; }

/* funnel */
.funnel { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 4px; margin-bottom: 6px; }
.funnel-note { text-align: center; margin: 0 0 12px; opacity: .8; }
.fstep { text-align: center; }
.fstep .ic { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center;
  border: 1.5px solid var(--line); background: #0d121b; color: var(--muted); }
.fstep.active .ic { border-color: var(--pink); color: var(--pink); box-shadow: 0 0 14px #ff1f6b40; }
.fstep .ic svg { width: 24px; height: 24px; }
.fstep .n { font-size: 24px; font-weight: 700; line-height: 1; }
.fstep .l { font-size: 10px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.fstep .l2 { font-size: 11px; color: var(--muted); }

.btn-run { width: 100%; min-height: 50px; border: none; border-radius: 13px; cursor: pointer;
  background: linear-gradient(90deg, #ff1f6b, #ff5c8a); color: #fff; font-size: 18px; font-weight: 700;
  letter-spacing: .5px; box-shadow: 0 6px 20px #ff1f6b44; }
.btn-run:active { transform: translateY(1px); }
.btn-run:disabled { opacity: .6; }

/* AI staff */
.staff-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.staff-label { color: var(--pink); font-weight: 700; font-family: "Rajdhani"; letter-spacing: 1px; font-size: 16px; }
.staff-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; overflow-x: auto; }
.staff { text-align: center; }
.staff .av { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 5px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #1b2433, #0d121b); border: 1px solid var(--line); color: var(--pink); position: relative; }
.staff .av svg { width: 24px; height: 24px; }
.staff .av::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); border: 2px solid #0d121b; }
.staff .nm { font-size: 10.5px; font-weight: 600; }
.staff .rl { font-size: 9.5px; color: var(--muted); }
.staff.active .av { border-color: var(--pink); color: var(--pink); box-shadow: 0 0 0 2px #ff1f6b55, 0 0 14px #ff1f6b88; animation: pulse 1.1s ease-in-out infinite; }
.staff.active .nm { color: var(--pink); }
.staff.active .av::after { background: var(--pink); border-color: #0d121b; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* member block */
.member3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.member3 .cell { text-align: center; padding: 8px 4px; border-right: 1px solid var(--line); }
.member3 .cell:last-child { border-right: none; }
.member3 .l { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.member3 .n { font-size: 40px; font-weight: 700; line-height: 1; }
.member3 .n.pos { color: var(--green); } .member3 .n.neg { color: var(--red); } .member3 .n.pink { color: var(--pink); }

/* owner block */
.owner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: #0e131c; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.stat .l { font-size: 10.5px; color: var(--muted); }
.stat .v { font-size: 16px; font-weight: 700; }
.v.pos { color: var(--green); } .v.neg { color: var(--red); } .v.warn { color: var(--amber); }
.record { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.rec { background: #0e131c; border: 1px solid var(--line); border-radius: 10px; padding: 8px 2px; text-align: center; }
.rec .ic { font-size: 13px; } .rec .n { font-size: 17px; font-weight: 700; } .rec .p { font-size: 10px; color: var(--muted); }
.note { margin-top: 8px; font-size: 11px; color: var(--amber); }

/* tip cards */
.cards { display: grid; gap: 10px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; gap: 11px; position: relative; }
.crest { width: 50px; height: 50px; border-radius: 11px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: #0e131c; border: 1px solid var(--line); font-weight: 700; font-family: "Rajdhani"; font-size: 17px; color: var(--text); }
.crest img { width: 100%; height: 100%; object-fit: contain; }
/* O/U lead badge (no team logo) */
.crest.ou { flex-direction: column; gap: 1px; font-family: "Rajdhani"; line-height: 1; }
.crest.ou .ou-ar { font-size: 18px; font-weight: 800; }
.crest.ou .ou-l { font-size: 9px; font-weight: 700; white-space: nowrap; }
.crest.ou-over { color: var(--green); border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.crest.ou-under { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.de-badge { display: inline-block; margin: 2px 0; font-size: 11px; }
.tbody { flex: 1; min-width: 0; }
.trow1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.league { font-size: 11px; color: var(--muted); }
.teams { font-size: 16px; font-weight: 700; margin: 2px 0 6px; }
.teams .vs { color: var(--pink); font-weight: 700; }
.pickline { display: inline-block; background: #2a1020; border: 1px solid #4a1e36; color: #ff7aa6;
  border-radius: 8px; padding: 3px 9px; font-size: 13px; font-weight: 700; }
.tmeta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; }
.tmeta .k { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; display: block; }
.tmeta .v { font-weight: 700; }
.tmeta .v.pos { color: var(--green); } .tmeta .v.amber { color: var(--amber); }
.tfoot { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.result { display: flex; align-items: center; gap: 8px; }
.score { font-weight: 700; font-family: "Rajdhani"; font-size: 16px; }
.owner-only { background: #0e131c; border: 1px dashed var(--line); border-radius: 9px; padding: 6px 9px; margin-top: 9px; display: flex; gap: 14px; font-size: 11px; }
.owner-only .k { color: var(--muted); display: block; font-size: 9.5px; }
.tag { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.tag.green { background: #11371f; color: var(--green); }
.tag.greensoft { background: #173b2a; color: var(--green-soft); }
.tag.red { background: #3a1620; color: var(--red); }
.tag.grey { background: #202834; color: var(--muted); }
.tag.amber { background: #3a2c12; color: var(--amber); }
.tag.blue { background: #112d47; color: var(--blue); }

/* no-bet card */
.nobet { text-align: center; padding: 22px 14px; }
.nobet .ic { color: var(--pink); opacity: .5; }
.nobet .ic svg { width: 44px; height: 44px; }
.nobet .t { font-size: 17px; font-weight: 700; margin: 8px 0 4px; font-family: "Rajdhani"; }

/* ledger */
.ledger { display: grid; gap: 8px; }
.lrow { display: grid; grid-template-columns: 1fr auto; gap: 6px; background: #0e131c; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.lrow .m { font-size: 13px; font-weight: 600; }
.lrow .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.lrow .right { text-align: right; display: grid; gap: 4px; justify-items: end; }
.lrow .clv { font-size: 12px; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 18px; }

/* bottom nav */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  background: #0b0f17ee; backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0)); }
.navitem { background: none; border: none; color: var(--muted); display: grid; justify-items: center; gap: 3px; font-size: 10px; cursor: pointer; padding: 4px 8px; min-width: 48px; }
.navitem svg { width: 22px; height: 22px; }
.navitem.active { color: var(--pink); }

/* login */
.login { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); padding: 20px; z-index: 50; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 22px; width: 100%; max-width: 360px; text-align: center; }
.login-logo { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 0 12px #ff1f6b66); }
.login-card h1 { margin: 8px 0 2px; font-size: 28px; letter-spacing: 1px; } .login-card h1 span { color: var(--pink); }
.login-card input { width: 100%; min-height: 46px; margin: 10px 0 0; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--line); background: #0e131c; color: var(--text); font-size: 16px; }
.btn { min-height: 46px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-primary { width: 100%; margin-top: 14px; background: linear-gradient(90deg, #ff1f6b, #ff5c8a); color: #fff; border: none; }

@media (min-width: 600px) {
  .owner-grid { grid-template-columns: repeat(6, 1fr); }
}
