:root{
  --bg:#0b0f14;
  --card:#101826;
  --muted:#93a4b8;
  --text:#e7eef7;
  --accent:#62d6ff;
  --accent2:#b8ff6b;
  --warn:#ffb86b;
  --bad:#ff6b6b;
  --good:#6bffb5;
  --border:rgba(231,238,247,0.12);
  --shadow:0 12px 40px rgba(0,0,0,0.45);
  --r:16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:
             url('bg.svg') 0 0 / 240px 240px repeat,
             radial-gradient(1200px 600px at 20% -10%, rgba(98,214,255,0.20), transparent 60%),
             radial-gradient(900px 500px at 80% 0%, rgba(184,255,107,0.14), transparent 55%),
             var(--bg);
  color:var(--text);
  font-family:var(--sans);
}
.topbar{
  padding:22px 24px;
  border-bottom:1px solid var(--border);
  background:rgba(11,15,20,0.65);
  backdrop-filter: blur(8px);
  position:sticky;
  top:0;
  z-index:10;
}
.topbarRow{display:flex; align-items:flex-start; justify-content:space-between; gap:16px}
.nav{display:flex; gap:10px; align-items:center}
.navLink{
  text-decoration:none;
  color:var(--text);
  font-weight:700;
  font-size:13px;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(0,0,0,0.18);
}
.navLink:hover{border-color:rgba(98,214,255,0.65)}
.brand{font-weight:800; letter-spacing:0.4px; font-size:18px; margin:0}
.sub{color:var(--muted); margin:6px 0 0; font-size:13px}
.muted{color:var(--muted)}
.mono{font-family:var(--mono)}
.grid{
  display:grid;
  grid-template-columns: 360px 1fr;
  grid-template-rows:auto auto;
  gap:18px;
  padding:18px;
  max-width: 1200px;
  margin:0 auto;
}
.container{max-width: 980px; margin:0 auto; padding:18px}
.card{
  background:linear-gradient(180deg, rgba(16,24,38,0.92), rgba(16,24,38,0.70));
  border:1px solid var(--border);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:16px 16px 14px;
  transition: transform 120ms ease, border-color 120ms ease;
}
.card:hover{border-color:rgba(98,214,255,0.22); transform: translateY(-1px)}
.card h2{margin:0 0 12px; font-size:15px; letter-spacing:0.2px}
.row{display:flex; align-items:center; gap:10px; margin:10px 0}
label{width:120px; color:var(--muted); font-size:13px}
input,select{
  flex:1;
  background:rgba(0,0,0,0.25);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 10px;
  outline:none;
}
input[type="range"]{
  padding:0;
  border:none;
  background:transparent;
}
input:focus,select:focus{border-color:rgba(98,214,255,0.55)}
.actions{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}
button{
  background:linear-gradient(180deg, rgba(98,214,255,0.22), rgba(98,214,255,0.10));
  border:1px solid rgba(98,214,255,0.40);
  color:var(--text);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:650;
}
button:hover{border-color:rgba(98,214,255,0.75)}
button:focus-visible,
input:focus-visible,
select:focus-visible{
  outline:2px solid rgba(98,214,255,0.65);
  outline-offset:2px;
}
button.ghost{
  background:rgba(0,0,0,0.18);
  border:1px solid var(--border);
  color:var(--text);
}
.status{font-family:var(--mono); font-size:12px; color:var(--muted); padding:10px 10px; border:1px dashed var(--border); border-radius:12px}
.status.done{border-style:solid; border-color:rgba(107,255,181,0.45); color:rgba(231,238,247,0.92)}
.status.error{border-style:solid; border-color:rgba(255,107,107,0.55); color:rgba(255,107,107,0.95)}
.hint{margin-top:12px; color:var(--muted); font-size:12px; line-height:1.4}
.guide{margin-top:12px; padding:12px 12px; border-radius:14px; border:1px solid var(--border); background:rgba(0,0,0,0.18)}
.guide .title{font-weight:800; margin-bottom:6px}
.guide ul{margin:8px 0 0 18px; padding:0}
.guide li{margin:4px 0}
.sliderRow{display:flex; align-items:center; gap:10px; margin:10px 0}
.sliderRow .lbl{width:20px; text-align:right}
.legend{display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:10px}
.legend .badge{margin-right:2px}
.legend .muted{margin-right:10px}
.matrixWrap{margin-top:12px}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--border);
}
.table th,.table td{
  padding:10px;
  border-bottom:1px solid var(--border);
  border-right:1px solid var(--border);
  text-align:center;
  font-size:13px;
}
.table th{color:var(--muted); font-weight:700; background:rgba(0,0,0,0.22)}
.table tr:last-child td{border-bottom:none}
.table td:last-child, .table th:last-child{border-right:none}
.table td.cellBrYou{box-shadow:inset 0 0 0 2px rgba(184,255,107,0.55); background:rgba(184,255,107,0.06)}
.table td.cellBrBot{box-shadow:inset 0 0 0 2px rgba(98,214,255,0.45); background:rgba(98,214,255,0.04)}
.table td.cellNash{box-shadow:inset 0 0 0 2px rgba(98,214,255,0.70); background:rgba(98,214,255,0.08)}
.table td.cellPlayed{outline:2px solid rgba(255,184,107,0.70); outline-offset:-2px}
.pay{font-family:var(--mono)}
.badge{display:inline-block; padding:2px 8px; border-radius:999px; border:1px solid var(--border); color:var(--muted); font-size:11px}
.badge.good{border-color:rgba(107,255,181,0.55); color:rgba(107,255,181,0.95)}
.badge.bad{border-color:rgba(255,107,107,0.55); color:rgba(255,107,107,0.95)}
.badge.accent{border-color:rgba(98,214,255,0.60); color:rgba(98,214,255,0.95)}
.tags{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; justify-content:center}
.score{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:12px}
.score .k{color:var(--muted); font-size:12px}
.score .v{font-family:var(--mono); font-size:18px; font-weight:800}
.log{margin-top:12px; max-height:260px; overflow:auto; border:1px solid var(--border); border-radius:14px; padding:10px; background:rgba(0,0,0,0.18)}
.logLine{display:block; padding:6px 8px; border-bottom:1px solid rgba(231,238,247,0.08); font-family:var(--mono); font-size:12px; border-left:3px solid transparent}
.logLine.good{border-left-color:rgba(107,255,181,0.75); background:rgba(107,255,181,0.05)}
.logLine.bad{border-left-color:rgba(255,107,107,0.75); background:rgba(255,107,107,0.04)}
.logLine:last-child{border-bottom:none}
.pillRow{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px}
.pill{padding:6px 10px; border-radius:999px; border:1px solid var(--border); background:rgba(0,0,0,0.18); color:var(--muted); font-size:12px; cursor:pointer}
.pill.active{border-color:rgba(98,214,255,0.65); color:var(--text)}
#analysis{color:var(--text); font-size:13px; line-height:1.5}
.big{font-size:13px; margin-bottom:10px}
.section{margin-top:10px; padding-top:10px; border-top:1px solid rgba(231,238,247,0.08)}
.h{font-weight:800; letter-spacing:0.2px; margin-bottom:6px}
.coach{margin:10px 0 12px; padding:12px 12px; border-radius:14px; border:1px solid var(--border); background:rgba(0,0,0,0.18)}
.coach .title{font-weight:800; margin-bottom:6px}
.coach .row{margin:8px 0}
.coach .grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.metric{padding:10px; border-radius:12px; border:1px solid rgba(231,238,247,0.10); background:rgba(0,0,0,0.18)}
.metric .k{color:var(--muted); font-size:12px}
.metric .v{font-family:var(--mono); font-size:13px; margin-top:4px}
.progress{width:100%; height:8px; border-radius:999px; overflow:hidden; margin-top:6px}
.progress::-webkit-progress-bar{background:rgba(231,238,247,0.10); border-radius:999px}
.progress::-webkit-progress-value{background:rgba(98,214,255,0.65); border-radius:999px}
.progress::-moz-progress-bar{background:rgba(98,214,255,0.65); border-radius:999px}
.mt8{margin-top:8px}
.mt10{margin-top:10px}
hr{border:none; border-top:1px solid var(--border); margin:12px 0}
.code{font-family:var(--mono); font-size:12px; padding:8px 10px; border-radius:12px; border:1px solid var(--border); background:rgba(0,0,0,0.18); overflow:auto}
.footer{padding:16px 18px; color:var(--muted); font-size:12px; border-top:1px solid var(--border)}
.footerGrid{display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap}
.lbSummary{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px}
.table tr.lbRow.win td{background:rgba(107,255,181,0.04)}
.table tr.lbRow.loss td{background:rgba(255,107,107,0.03)}
.table tr.lbRow.tie td{background:rgba(231,238,247,0.02)}
.table tr.lbRow.win td:first-child{box-shadow:inset 3px 0 0 rgba(107,255,181,0.70)}
.table tr.lbRow.loss td:first-child{box-shadow:inset 3px 0 0 rgba(255,107,107,0.70)}
.table tr.lbRow.tie td:first-child{box-shadow:inset 3px 0 0 rgba(231,238,247,0.25)}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr;}
  label{width:120px}
  .lbSummary{grid-template-columns:1fr;}
}
