/* Darts Trainer – Rewrite v1 (iOS-safe clicks) */
:root{
  --bg:#0b0f14;
  --panel:#111824;
  --panel2:#0f1622;
  --text:#e8eef6;
  --muted:#97a7bf;
  --border:rgba(124,58,237,.35);
  --accent:#7c3aed;
  --good:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
  --shadow:0 22px 80px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(124,58,237,.18), transparent 60%),
              radial-gradient(900px 520px at 90% 10%, rgba(34,197,94,.08), transparent 55%),
              var(--bg);
  color:var(--text);
}

#app{min-height:100%; display:flex; flex-direction:column}

.topbar{
  position:sticky; top:0; z-index:30;
  padding:12px 12px calc(10px + env(safe-area-inset-top));
  display:flex; align-items:center; justify-content:space-between;
  background: rgba(11,15,20,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(42,58,82,.65);
}

.brand{font-weight:900; letter-spacing:.9px; font-size:13px}
.top-actions{display:flex; gap:10px}

.main{flex:1; padding:14px 12px 90px; max-width:760px; width:100%; margin:0 auto}

.card{
  background: linear-gradient(180deg, rgba(17,24,36,.96), rgba(11,15,20,.96));
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  box-shadow: var(--shadow);
  margin-bottom:12px;
}

.hrow{display:flex; gap:10px; align-items:flex-end; justify-content:space-between}
.big{font-size:34px; font-weight:900; letter-spacing:.5px}
.small{font-size:12px; color:var(--muted)}
.title{font-weight:800; letter-spacing:.7px; font-size:13px}

.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.spacer{flex:1}

.btn, .iconbtn, .tab{
  appearance:none;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.06);
  color:var(--text);
  border-radius:16px;
  padding:12px 14px;
  font-weight:800;
  letter-spacing:.4px;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* iOS */
}

.btn:active, .iconbtn:active, .tab:active{transform: scale(.98)}
.btn.primary{background: rgba(124,58,237,.28); border-color: rgba(124,58,237,.45)}
.btn.good{background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.35)}
.btn.bad{background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.35)}
.btn.ghost{background: transparent}

.iconbtn{width:44px; height:44px; padding:0; display:grid; place-items:center}

input, textarea, select{
  width:100%;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:12px 12px;
  outline:none;
  font-weight:700;
}
input::placeholder, textarea::placeholder{color:rgba(151,167,191,.75)}
label{display:block; font-size:12px; color:var(--muted); margin:0 0 6px}

.pill{
  display:inline-flex; gap:6px; align-items:center;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.06);
  border-radius:999px;
  padding:8px 10px;
  font-size:12px;
  color:var(--muted);
}
.pill.good{border-color: rgba(34,197,94,.35); color:#c9f7da}
.pill.warn{border-color: rgba(245,158,11,.35); color:#ffe7bd}
.pill.bad{border-color: rgba(239,68,68,.35); color:#ffd1d1}
.pill.accent{border-color: rgba(124,58,237,.45); color:#e7dcff}

.divider{height:1px; background: rgba(148,163,184,.14); margin:12px 0}

.tabs{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  padding:10px 10px calc(10px + env(safe-area-inset-bottom));
  display:flex; gap:10px; justify-content:center;
  background: rgba(11,15,20,.92);
  backdrop-filter: blur(10px);
  border-top:1px solid rgba(42,58,82,.65);
}
.tab{
  flex:1;
  max-width:220px;
  display:flex; gap:8px; align-items:center; justify-content:center;
  padding:12px 10px;
  font-weight:900;
}
.tab span{font-size:12px}
.tab.active{border-color: rgba(124,58,237,.55); background: rgba(124,58,237,.20)}

.modal-backdrop{
  position:fixed; inset:0; z-index:999;
  display:flex; align-items:center; justify-content:center;
  padding:16px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}
.modal{
  width:min(560px, 100%);
  background: linear-gradient(180deg, rgba(17,24,36,.98), rgba(11,15,20,.98));
  border:1px solid rgba(124,58,237,.35);
  border-radius:18px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:12px 12px; border-bottom:1px solid rgba(148,163,184,.14)}
.modal-title{font-weight:900; letter-spacing:.6px; font-size:13px}
.modal-body{padding:12px}
.modal-foot{padding:12px; border-top:1px solid rgba(148,163,184,.14); display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap}

.toast-wrap{
  position:fixed; left:0; right:0; bottom:78px; z-index:9999;
  display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none;
  padding:0 12px;
}
.toast{
  pointer-events:none;
  max-width:760px;
  width:100%;
  background: rgba(17,24,36,.92);
  border:1px solid rgba(148,163,184,.18);
  border-radius:16px;
  padding:10px 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  font-weight:800;
  letter-spacing:.3px;
  font-size:12px;
}
.toast.good{border-color: rgba(34,197,94,.35)}
.toast.warn{border-color: rgba(245,158,11,.35)}
.toast.bad{border-color: rgba(239,68,68,.35)}

pre.log{
  white-space:pre-wrap;
  word-break:break-word;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(148,163,184,.14);
  border-radius:14px;
  padding:10px;
  margin:0;
  color:#cfe0f7;
  font-size:12px;
  line-height:1.35;
}
