:root{
  --bg0:#070A10;
  --bg1:#0B1020;
  --line:rgba(255,255,255,.08);
  --line2:rgba(255,255,255,.12);
  --text:#EAF1FF;
  --muted:#A9B8D3;

  --accent:#7C5CFF;
  --accent2:#2EE9A6;
  --danger:#FF4D6D;
  --warn:#FFB020;

  --shadow2: 0 10px 30px rgba(0,0,0,.35);
  --radius:18px;
  --radius2:14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(900px 700px at 80% 20%, rgba(46,233,166,.18), transparent 55%),
    radial-gradient(1000px 900px at 50% 120%, rgba(255,176,32,.10), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  overflow-x:hidden;
}

body:before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  opacity:.07;
  mix-blend-mode:overlay;
}

/* overlay */
.overlay{
  position:fixed; inset:0;
  display:none;
  place-items:center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  z-index:999;
  padding:18px;
}
.overlay.show{ display:grid; }
.overlayCard{
  width:min(760px, 100%);
  border-radius: 22px;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: 0 25px 90px rgba(0,0,0,.65);
  padding:18px;
  position:relative;
  overflow:hidden;
}
.overlayCard:before{
  content:"";
  position:absolute; inset:-1px;
  background:
    radial-gradient(700px 220px at 15% 0%, rgba(124,92,255,.40), transparent 60%),
    radial-gradient(700px 220px at 85% 0%, rgba(46,233,166,.25), transparent 60%);
  opacity:.5;
  pointer-events:none;
}
.overlayCard > *{ position:relative; z-index:1; }

.overlayHeader h1{ margin:6px 0 0; font-size:28px; line-height:1.1; }
.overlayHeader h1 span{
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  font-size:12px;
  color: var(--muted);
  width:max-content;
}

.modeGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:14px;
}
@media (max-width: 720px){
  .modeGrid{ grid-template-columns: 1fr; }
}
.modeBtn{
  text-align:left;
  width:100%;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:14px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.modeBtn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
}
.modeBtn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,.26), rgba(46,233,166,.12));
  border-color: rgba(124,92,255,.25);
}
.modeTitle{ font-weight:850; font-size:16px; margin-bottom:6px; }
.modeDesc{ color:var(--muted); font-size:13px; line-height:1.35; }
.overlayFoot{ margin-top:12px; }

.wrap{
  max-width:1180px;
  margin:0 auto;
  padding:26px 18px 40px;
}

.top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin: 8px 0 18px;
}
.topActions{ display:flex; gap:10px; }
h1{
  margin:0;
  font-size:30px;
  letter-spacing:.2px;
  line-height:1.1;
}
h1 span{
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.muted{ color:var(--muted); margin:8px 0 0; }
.small{ font-size:12px; opacity:.95; }
h2{ margin:0; font-size:16px; letter-spacing:.2px; }
h3.sub{ margin:0 0 10px; font-size:13px; color:var(--muted); font-weight:700; letter-spacing:.25px; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1.18fr;
  gap:16px;
  margin-top:16px;
}
@media (max-width: 940px){
  .grid{ grid-template-columns:1fr; }
}

.card{
  position:relative;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
  overflow:hidden;
}
.card:before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: var(--radius);
  padding:1px;
  background:
    radial-gradient(700px 200px at 20% 0%, rgba(124,92,255,.35), transparent 60%),
    radial-gradient(700px 200px at 80% 0%, rgba(46,233,166,.22), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events:none;
  opacity:.45;
}
.card > *{ position:relative; z-index:1; }

.cardHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.kbdHint{ text-align:right; opacity:.9; }

.hr{
  height:1px;
  background: linear-gradient(90deg, transparent, var(--line2), transparent);
  margin:16px 0;
}

.row{
  display:grid;
  grid-template-columns: 170px 1fr auto;
  gap:10px;
  align-items:center;
  margin-top:10px;
}
@media (max-width: 560px){
  .row{ grid-template-columns: 1fr; }
}
.lbl{ color:var(--muted); font-size:12px; letter-spacing:.2px; }

input{
  width:100%;
  padding:11px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(7,10,16,.55);
  color:var(--text);
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
input:focus{
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.15);
}
input:hover{ transform: translateY(-.5px); }

/* range input nicer */
input[type="range"]{
  padding: 0;
  height: 28px;
  background: transparent;
  border: none;
  box-shadow: none;
}
input[type="range"]::-webkit-slider-runnable-track{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124,92,255,.95), rgba(46,233,166,.85));
  border: 1px solid rgba(255,255,255,.18);
  margin-top: -4px;
  box-shadow: 0 0 18px rgba(124,92,255,.25);
}

code{
  background: rgba(7,10,16,.55);
  border: 1px solid var(--line);
  padding:3px 8px;
  border-radius: 999px;
  font-size: 12px;
}

/* buttons */
.btn{
  padding:10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
  user-select:none;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.btn:active{ transform: translateY(0px) scale(.99); }

.btn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,.85), rgba(46,233,166,.65));
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 14px 40px rgba(124,92,255,.18);
}
.btn.warn{
  background: linear-gradient(135deg, rgba(255,176,32,.22), rgba(255,176,32,.10));
  border-color: rgba(255,176,32,.25);
}
.btn.danger{
  background: linear-gradient(135deg, rgba(255,77,109,.22), rgba(255,77,109,.10));
  border-color: rgba(255,77,109,.28);
}

/* ACTIVE */
.btn.active{
  border-color: rgba(124,92,255,.55);
  background: linear-gradient(135deg, rgba(124,92,255,.30), rgba(46,233,166,.12));
  box-shadow: 0 0 0 4px rgba(124,92,255,.12), 0 18px 60px rgba(124,92,255,.10);
}
.btn.active:before{
  content:"";
  display:inline-block;
  width:8px;height:8px;border-radius:999px;
  margin-right:8px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(124,92,255,.35);
  vertical-align:middle;
}

/* chips */
.chip{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.chip:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.06); }
.chip.danger{ border-color: rgba(255,77,109,.25); background: rgba(255,77,109,.10); }

/* toggles */
.toggles{ display:flex; gap:10px; align-items:center; }
.switch{ display:flex; align-items:center; gap:8px; user-select:none; }
.switch input{ display:none; }
.slider{
  width:44px; height:26px; border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  position:relative;
  transition: background .15s ease, border-color .15s ease;
}
.slider:after{
  content:"";
  width:18px;height:18px;border-radius:999px;
  position:absolute; top:50%; left:4px; transform: translateY(-50%);
  background: rgba(255,255,255,.80);
  transition: left .15s ease, background .15s ease;
}
.switch input:checked + .slider{
  background: linear-gradient(135deg, rgba(124,92,255,.30), rgba(46,233,166,.18));
  border-color: rgba(124,92,255,.35);
}
.switch input:checked + .slider:after{
  left:20px;
  background: rgba(46,233,166,.95);
}
.switchLabel{ font-size:12px; color: var(--muted); }

/* grids */
.btnGrid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap:10px;
}
@media (max-width: 420px){
  .btnGrid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.btnGrid .btn{
  width:100%;
  padding:12px 10px;
  border-radius: 14px;
  font-weight:750;
  letter-spacing:.2px;
}

/* stats */
.stats{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}
.stat{
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(7,10,16,.48);
  padding:12px;
}
.stat .k{ color: var(--muted); font-size: 12px; }
.stat .v{
  margin-top:4px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing:.3px;
}

/* live banner */
.liveBanner{
  border:1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,92,255,.12), rgba(46,233,166,.06));
  padding:12px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
  overflow:hidden;
  position:relative;
}
.liveBanner:before{
  content:"";
  position:absolute; inset:-2px;
  background: radial-gradient(500px 120px at 20% 0%, rgba(124,92,255,.25), transparent 60%),
              radial-gradient(500px 120px at 80% 0%, rgba(46,233,166,.16), transparent 60%);
  opacity:.7;
  pointer-events:none;
}
.liveBanner > *{ position:relative; z-index:1; }
.liveDot{
  width:10px;height:10px;border-radius:999px;
  background: rgba(255,255,255,.35);
  box-shadow: 0 0 0 6px rgba(255,255,255,.06);
}
.liveBanner.pulse .liveDot{
  background: rgba(46,233,166,.95);
  box-shadow: 0 0 0 6px rgba(46,233,166,.12), 0 0 18px rgba(46,233,166,.30);
  animation: pulse 700ms ease-out;
}
@keyframes pulse{
  0%{ transform: scale(1); }
  40%{ transform: scale(1.4); }
  100%{ transform: scale(1); }
}
.liveText{ display:flex; flex-direction:column; gap:2px; }
.liveTitle{ font-size:12px; color: var(--muted); }
.liveValue{ font-size:20px; font-weight:950; letter-spacing:.2px; }
.liveMeta{ display:flex; align-items:center; gap:10px; }
.liveSmall{ font-size:12px; color: var(--muted); white-space:nowrap; }

/* progress bars */
.progressWrap{ margin-top:10px; }
.progressRow{ display:flex; justify-content:space-between; align-items:center; }
.mt8{ margin-top:8px; }
.bar{
  margin-top:6px;
  height:10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
}
.barFill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(124,92,255,.95), rgba(46,233,166,.85));
  border-radius:999px;
  transition: width .25s ease;
}
.barFill2{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(255,176,32,.85), rgba(124,92,255,.65));
  border-radius:999px;
  transition: width .25s ease;
}

/* pills */
.pillRow{ display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; }
.pill{
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(7,10,16,.48);
  font-size:12px;
  display:inline-flex;
  gap:8px;
  align-items:center;
}
.pill:before{
  content:"";
  width:8px; height:8px; border-radius:999px;
  background: rgba(255,255,255,.25);
}
.pill.good{ border-color: rgba(46,233,166,.28); }
.pill.good:before{ background: rgba(46,233,166,.95); box-shadow:0 0 18px rgba(46,233,166,.35); }
.pill.warn{ border-color: rgba(255,176,32,.28); }
.pill.warn:before{ background: rgba(255,176,32,.95); box-shadow:0 0 18px rgba(255,176,32,.30); }
.pill.bad{ border-color: rgba(255,77,109,.28); }
.pill.bad:before{ background: rgba(255,77,109,.95); box-shadow:0 0 18px rgba(255,77,109,.35); }
.pill.ghost{ opacity:.9; }

.throwRow{
  display:grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap:10px;
  align-items:center;
  margin-top:10px;
}
@media (max-width: 560px){
  .throwRow{ grid-template-columns: 1fr 1fr 1fr; }
  .throwRow .btn{ grid-column:1 / -1; }
}
.dartInput{ max-width: 140px; }

/* history */
.history{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:340px;
  overflow:auto;
  padding-right:4px;
}
.history::-webkit-scrollbar{ width:10px; }
.history::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.08);
  border-radius:999px;
  border:1px solid rgba(255,255,255,.06);
}

.item{
  position:relative;
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(7,10,16,.45);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.item:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.14);
  background: rgba(7,10,16,.55);
}
.item .left{ display:flex; flex-direction:column; gap:4px; }
.item .right{
  font-weight:950;
  font-size: 18px;
  letter-spacing:.2px;
  align-self:flex-start;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.item.bust{
  border-color: rgba(255,77,109,.35);
  box-shadow: 0 0 0 4px rgba(255,77,109,.10);
}
.item.finish{
  border-color: rgba(46,233,166,.35);
  box-shadow: 0 0 0 4px rgba(46,233,166,.10);
}
.item.last:after{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: var(--radius2);
  pointer-events:none;
  background: radial-gradient(500px 120px at 30% 0%, rgba(124,92,255,.22), transparent 60%),
              radial-gradient(500px 120px at 70% 0%, rgba(46,233,166,.16), transparent 60%);
  opacity:.8;
}

/* toasts */
.toasts{
  position:fixed;
  top:14px;
  right:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index:1000;
}
.toast{
  width:min(340px, calc(100vw - 28px));
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(10,14,22,.70);
  backdrop-filter: blur(10px);
  padding:12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  animation: toastIn .18s ease-out;
}
@keyframes toastIn{
  from{ transform: translateY(-6px); opacity:0; }
  to{ transform: translateY(0); opacity:1; }
}
.toastTitle{ font-weight:900; margin-bottom:4px; }
.toastMsg{ color:var(--muted); font-size:13px; line-height:1.35; }
.toast.good{ border-color: rgba(46,233,166,.25); }
.toast.warn{ border-color: rgba(255,176,32,.25); }
.toast.bad{ border-color: rgba(255,77,109,.25); }

/* confetti */
.confetti{
  position:fixed; inset:0;
  pointer-events:none;
  z-index:999;
}
.confettiPiece{
  position:absolute;
  width:10px; height:16px;
  border-radius:4px;
  opacity:.9;
  animation: fall 900ms ease-in forwards;
}
@keyframes fall{
  0%{ transform: translateY(-20px) rotate(0deg); opacity:1; }
  100%{ transform: translateY(105vh) rotate(320deg); opacity:0; }
}

.foot{ margin-top:16px; color: var(--muted); font-size:12px; }
.mt{ margin-top:10px; }
.hidden{ display:none !important; }
