:root{
  --bg:#f3f6fb;
  --card:#fff;
  --text:#0f1f33;
  --muted:#64748b;
  --border:#d9e3ef;
  --blue:#1f5fbf;
  --allin:#DC2626;
  --raise:#FACC15;
  --call:#22C55E;
  --fold:#9CA3AF;
  --shadow:0 10px 30px rgba(15,23,42,.075);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",Arial,sans-serif;
  background:#f4f7fb;
  color:var(--text);
}
.app{max-width:1680px;margin:0 auto;padding:24px 28px 34px}
.header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:18px}
.title h1{margin:0;font-size:30px;font-weight:850}
.title p{margin:8px 0 0;color:var(--muted);font-size:15px}
.statusPills{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.statusPills span{
  border:1px solid var(--border);background:#fff;border-radius:999px;padding:8px 12px;
  color:#334155;font-size:12px;font-weight:900;letter-spacing:.02em;text-transform:uppercase
}
.logoutBtn{
  border:1px solid var(--border);background:#fff;border-radius:999px;padding:8px 12px;
  color:#334155;font-size:12px;font-weight:900;letter-spacing:.02em;cursor:pointer
}
.logoutBtn:hover{border-color:#93c5fd;background:#eff6ff;color:#1d4ed8}
#userPill{text-transform:none}
.statusLink{
  border:1px solid var(--border);background:#fff;border-radius:999px;padding:8px 12px;
  color:#334155;font-size:12px;font-weight:900;letter-spacing:.02em;text-decoration:none
}
.statusLink:hover{border-color:#93c5fd;background:#eff6ff;color:#1d4ed8}
.controlCard{
  background:rgba(255,255,255,.98);border:1px solid var(--border);border-radius:8px;
  box-shadow:0 4px 14px rgba(15,23,42,.07);padding:16px 18px;
  display:grid;grid-template-columns:160px 190px 190px minmax(0,1fr);gap:18px;align-items:end;margin-bottom:16px
}
.field label,.segLabel{display:block;font-size:14px;font-weight:800;color:#223044;margin-bottom:8px}
.field select{
  width:100%;height:40px;border:1px solid var(--border);border-radius:10px;background:#fff;
  color:var(--text);padding:0 11px;font-size:15px;outline:none
}
.segment{
  min-width:0;display:flex;flex-wrap:nowrap;gap:8px;align-items:center;overflow-x:auto;overflow-y:hidden;
  padding-bottom:2px;scrollbar-width:thin
}
.btn{
  border:1px solid var(--border);background:#fff;color:#172033;height:40px;min-width:58px;
  padding:0 12px;border-radius:10px;cursor:pointer;font-size:15px;font-weight:750;transition:all .15s ease;user-select:none;
  flex:0 0 auto
}
.btn:hover{border-color:#93c5fd;background:#eff6ff}
.btn.active{
  background:#1f5fbf;color:#fff;border-color:#1f5fbf;
  box-shadow:0 7px 16px rgba(37,99,235,.24)
}
.stackBtn{min-width:74px}
.tabs{
  background:rgba(255,255,255,.98);border:1px solid var(--border);border-radius:8px;
  box-shadow:0 4px 14px rgba(15,23,42,.07);display:grid;grid-template-columns:repeat(4,1fr);
  overflow:hidden;height:52px;margin-bottom:16px
}
.tab{border:0;border-right:1px solid var(--border);background:#fff;font-size:17px;font-weight:800;cursor:pointer;color:#1e293b}
.tab:last-child{border-right:0}
.tab.active{background:#1f5fbf;color:#fff}
.tab.disabled{color:#94a3b8;background:#f8fafc;cursor:not-allowed}
.layout{display:grid;grid-template-columns:minmax(900px,1fr) 390px;gap:22px}
.matrixCard,.sideCard{background:rgba(255,255,255,.98);border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow)}
.matrixCard{padding:18px 20px 22px}
.sourceRow{
  border:1px solid var(--border);background:#fbfdff;border-radius:8px;padding:12px 14px;
  margin-bottom:16px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px
}
.sourceTitle{font-size:16px;font-weight:900;white-space:nowrap}
.villainStackBlock{
  grid-column:1 / -1;display:grid;grid-template-columns:auto minmax(0,1fr);
  align-items:center;gap:10px;padding-top:10px;border-top:1px dashed #d9e3ef
}
.sourceHelp{color:var(--muted);font-size:13px;margin-left:auto}
.matrixHead{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.matrixTitle{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:900;flex-wrap:wrap}
.badge{background:#e8f0ff;color:#1d4ed8;border:1px solid #bfdbfe;padding:5px 10px;border-radius:999px;font-size:13px;font-weight:850}
.badgeNeutral{background:#f8fafc;color:#475569;border-color:#e2e8f0}
.modelBadge{background:#ecfdf5;color:#047857;border-color:#bbf7d0}
.dataKey{font-size:12px;color:var(--muted);font-weight:600}
.handLookup{
  display:grid;grid-template-columns:auto 150px minmax(0,1fr);gap:10px;align-items:center;
  border:1px solid var(--border);background:#fbfdff;border-radius:8px;padding:10px 12px;margin:0 0 12px
}
.handLookupLabel{font-size:14px;font-weight:900;color:#223044;white-space:nowrap}
.handLookupInput{
  height:36px;border:1px solid var(--border);border-radius:8px;background:#fff;color:#0f172a;
  padding:0 10px;font-size:15px;font-weight:900;text-transform:uppercase;outline:none
}
.handLookupInput:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(59,130,246,.12)}
.handLookupResult{font-size:13px;color:var(--muted);font-weight:750;min-width:0}
.handLookupResult strong{color:#0f172a}
.handLookupResult.invalid{color:#dc2626}
.missingRange{
  border:1px solid #fecaca;background:#fff1f2;color:#991b1b;border-radius:8px;
  padding:12px 14px;margin:0 0 12px;font-size:14px;font-weight:800
}
.matrixWrap{overflow:auto;padding-bottom:4px}
.grid{display:grid;grid-template-columns:44px repeat(13,minmax(62px,1fr));gap:4px;min-width:980px}
.corner,.rankHead,.rankSide{height:34px;display:grid;place-items:center;color:#111827;font-weight:900;font-size:15px}
.rankSide{height:61px}
.cell{
  height:61px;border-radius:6px;overflow:hidden;position:relative;border:1px solid rgba(255,255,255,.9);
  display:flex;align-items:center;justify-content:center;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.18);text-align:center
}
.cell:hover{outline:2px solid #1f5fbf;outline-offset:1px;z-index:1}
.cell.selectedCell{outline:3px solid #111827;outline-offset:2px;z-index:2;box-shadow:0 0 0 4px rgba(255,255,255,.9)}
.cell.darkText{color:#111827;text-shadow:none}
.hand{font-size:17px;font-weight:950;letter-spacing:.2px}
.mix{margin-top:4px;font-size:11px;font-weight:850;white-space:nowrap}
.side{display:flex;flex-direction:column;gap:14px}
.sideCard{padding:18px}
.compactCard{padding:14px 16px}
.sideTitle{display:flex;align-items:center;gap:9px;margin:0 0 14px;font-size:18px;font-weight:900}
.compactCard .sideTitle{margin-bottom:10px;font-size:16px}
.mark{width:23px;height:23px;background:var(--blue);color:#fff;border-radius:7px;display:grid;place-items:center;font-size:13px;font-weight:950}
.sceneGrid{display:grid;grid-template-columns:1fr;gap:9px;font-size:15px}
.sceneItem{display:flex;justify-content:space-between;gap:12px;border-bottom:1px dashed #e2e8f0;padding-bottom:8px}
.sceneItem span{color:var(--muted);font-weight:800}
.legend{display:grid;grid-template-columns:1fr;gap:13px}
.legendItem{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:15px;font-weight:850;border:1px solid var(--border);border-radius:8px;padding:12px;background:#fbfdff}
.legendLeft{display:flex;align-items:center;gap:10px}
.compactLegend{grid-template-columns:1fr 1fr;gap:8px}
.compactLegend .legendItem{padding:8px 10px;font-size:13px}
.swatch{width:20px;height:20px;border-radius:6px;display:inline-block}
.compactLegend .swatch{width:14px;height:14px;border-radius:4px}
.stats{display:grid;gap:12px}
.statRow{display:grid;grid-template-columns:78px 1fr 52px;gap:10px;align-items:center;font-size:14px;font-weight:850}
.statName{color:#334155}
.statTrack{height:10px;background:#e2e8f0;border-radius:999px;overflow:hidden}
.statFill{height:100%;width:0;border-radius:999px;transition:width .18s ease}
.statValue{text-align:right;color:#0f172a;font-variant-numeric:tabular-nums}
.statHint{
  border-top:1px dashed #e2e8f0;margin-top:4px;padding-top:10px;
  color:var(--muted);font-size:13px;line-height:1.55
}
.profileGrid{display:grid;gap:8px}
.profileRow{
  display:grid;grid-template-columns:54px 1fr;gap:10px;align-items:center;
  border:1px solid var(--border);background:#fbfdff;border-radius:8px;padding:8px
}
.profileRow.activeSource{border-color:#93c5fd;background:#eff6ff}
.profilePos{font-weight:950;color:#0f172a}
.profileSelect{
  width:100%;height:34px;border:1px solid var(--border);border-radius:8px;background:#fff;
  color:#172033;font-size:14px;font-weight:800;padding:0 8px
}
.heroBadge{
  height:34px;border-radius:8px;background:#e8f0ff;color:#1d4ed8;
  display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:950
}
.note{color:#475569;line-height:1.75;font-size:14px}
.note strong{color:#0f172a}
.hidden{display:none!important}
.authPage{
  min-height:100vh;display:grid;place-items:center;padding:28px;
  background:linear-gradient(135deg,#eef4fb 0%,#f8fbff 55%,#eef4fb 100%)
}
.authPanel{
  width:min(980px,100%);display:grid;grid-template-columns:minmax(0,1fr) 380px;
  gap:26px;align-items:center
}
.authIntro h1{margin:10px 0 12px;font-size:34px;line-height:1.15;font-weight:900;color:#0f1f33}
.authIntro p{margin:0;color:#64748b;font-size:16px;line-height:1.8;max-width:560px}
.authKicker{
  display:inline-flex;border:1px solid var(--border);background:#fff;border-radius:999px;
  padding:7px 11px;color:#1f5fbf;font-size:12px;font-weight:950;letter-spacing:.02em
}
.authCard{
  background:#fff;border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow);
  padding:20px;display:grid;gap:15px
}
.authTabs{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--border);border-radius:8px;overflow:hidden}
.authTab{
  height:42px;border:0;background:#fff;color:#334155;font-size:15px;font-weight:900;cursor:pointer
}
.authTab:first-child{border-right:1px solid var(--border)}
.authTab.active{background:#1f5fbf;color:#fff}
.authField{display:grid;gap:7px;color:#223044;font-size:14px;font-weight:850}
.authField input{
  width:100%;height:42px;border:1px solid var(--border);border-radius:8px;background:#fff;
  color:var(--text);font-size:15px;padding:0 11px;outline:none
}
.authField input:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(59,130,246,.12)}
.authAgree{
  display:grid;grid-template-columns:18px 1fr;gap:9px;align-items:start;
  color:#475569;font-size:13px;line-height:1.55;font-weight:750
}
.authAgree input{margin-top:3px}
.authAgree a,.authLegalLink{color:#1d4ed8;font-weight:900;text-decoration:none}
.authAgree a:hover,.authLegalLink:hover{text-decoration:underline}
.authSubmit{
  height:44px;border:0;border-radius:8px;background:#1f5fbf;color:#fff;
  font-size:15px;font-weight:950;cursor:pointer;box-shadow:0 8px 18px rgba(37,99,235,.22)
}
.authSubmit:disabled{opacity:.65;cursor:not-allowed;box-shadow:none}
.secondaryAuthBtn{
  height:42px;border:1px solid var(--border);border-radius:8px;background:#fff;color:#1f2d42;
  font-size:14px;font-weight:900;cursor:pointer
}
.secondaryAuthBtn:disabled{opacity:.65;cursor:not-allowed}
.devCodeBox{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  border:1px solid #bfdbfe;background:#eff6ff;border-radius:8px;padding:11px 12px;
  color:#1e40af;font-size:13px;font-weight:850
}
.devCodeBox strong{font-size:22px;letter-spacing:3px;color:#0f172a}
.authInlineLinks{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap}
.authInlineLinks a{font-size:13px;color:#1d4ed8;font-weight:900;text-decoration:none}
.authInlineLinks a:hover{text-decoration:underline}
.authMessage{min-height:20px;color:#dc2626;font-size:13px;font-weight:800}
.authMessage.successMessage{color:#16a34a}
.authLegalLink{font-size:13px;justify-self:center}
.legalPage{min-height:100vh;background:#f4f7fb;padding:28px}
.legalCard{
  max-width:920px;margin:0 auto;background:#fff;border:1px solid var(--border);border-radius:8px;
  box-shadow:var(--shadow);padding:28px
}
.legalTop{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}
.legalBack{
  color:#1d4ed8;text-decoration:none;font-size:14px;font-weight:900;
  border:1px solid var(--border);border-radius:999px;padding:8px 12px;background:#fff
}
.legalBack:hover{background:#eff6ff;border-color:#93c5fd}
.legalCard h1{margin:0 0 10px;font-size:30px;line-height:1.2}
.legalLead{margin:0 0 22px;color:#64748b;font-size:16px;line-height:1.7}
.legalCard section{border-top:1px solid #e2e8f0;padding-top:18px;margin-top:18px}
.legalCard h2{margin:0 0 8px;font-size:18px}
.legalCard p{margin:0;color:#334155;font-size:15px;line-height:1.8}
.accountPage{min-height:100vh;background:#f4f7fb;padding:28px}
.accountShell{max-width:1160px;margin:0 auto}
.accountHeader{
  display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px
}
.accountHeader h1{margin:10px 0 8px;font-size:30px;line-height:1.2}
.accountHeader p{margin:0;color:#64748b;font-size:15px}
.accountActions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.accountGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.accountCard{
  background:#fff;border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow);padding:18px
}
.accountCard h2{margin:0 0 14px;font-size:18px}
.accountRows{display:grid;gap:10px}
.accountRow{
  display:flex;justify-content:space-between;gap:12px;border-bottom:1px dashed #e2e8f0;padding-bottom:9px;
  font-size:14px
}
.accountRow span{color:#64748b;font-weight:850}
.accountRow strong{text-align:right;color:#0f172a}
.featureList{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.featureList span{
  border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:999px;
  padding:6px 10px;font-size:12px;font-weight:900
}
@media(max-width:1480px){
  .controlCard{grid-template-columns:140px 170px 170px minmax(0,1fr);gap:14px}
  .btn{min-width:52px;padding:0 10px;font-size:14px}
  .stackBtn{min-width:68px}
  .segment{gap:6px}
}
@media(max-width:1280px){
  .controlCard{grid-template-columns:1fr 1fr;gap:18px}
  .layout{grid-template-columns:1fr}
  .sourceRow{grid-template-columns:auto minmax(0,1fr)}
  .sourceHelp{grid-column:1 / -1;margin-left:0}
}
@media(max-width:760px){
  .app{padding:16px}
  .header{display:block}
  .statusPills{justify-content:flex-start;margin-top:12px}
  .authPage{padding:18px}
  .authPanel{grid-template-columns:1fr;gap:18px}
  .authIntro h1{font-size:27px}
  .authCard{padding:16px}
  .legalPage{padding:16px}
  .legalCard{padding:18px}
  .legalTop{align-items:flex-start;flex-direction:column-reverse}
  .accountPage{padding:16px}
  .accountHeader{display:block}
  .accountActions{justify-content:flex-start;margin-top:14px}
  .accountGrid{grid-template-columns:1fr}
  .controlCard{grid-template-columns:1fr}
  .tabs{grid-template-columns:1fr 1fr;height:auto}
  .tab{height:48px;border-bottom:1px solid var(--border)}
  .sourceRow{grid-template-columns:1fr}
  .handLookup{grid-template-columns:1fr}
  .villainStackBlock{display:grid;grid-template-columns:1fr}
  .sourceHelp{margin-left:0}
  .layout{gap:16px}
}
