/* =========================================
   AutoDarts Statistik – Neon/Gaming UI
   ========================================= */

:root{
  --bg0:#070712;
  --bg1:#0b1020;
  --card:#0f1428;
  --card2:#0c1122;
  --text:#f5f7ff;
  --muted:#a7b0d6;

  --accent:#00e5ff;      /* cyan */
  --accent2:#ff2bd6;     /* magenta */
  --accent3:#7c3aed;     /* purple */

  --border:rgba(255,255,255,.08);
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --glow: 0 0 18px rgba(0,229,255,.35);
  --glow2: 0 0 22px rgba(255,43,214,.18);
  --radius: 18px;
}

/* Optional Light Mode (Theme Toggle bleibt funktionsfähig) */
body.light{
  --bg0:#f3f6ff;
  --bg1:#e9efff;
  --card:#ffffff;
  --card2:#ffffff;
  --text:#0b1020;
  --muted:#4b5476;

  --border:rgba(0,0,0,.10);
  --shadow: 0 18px 60px rgba(0,0,0,.12);
  --glow: 0 0 0 rgba(0,0,0,0);
  --glow2: 0 0 0 rgba(0,0,0,0);
}

*{ box-sizing: border-box; }

html, body{
  margin:0;
  padding:0;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(0,229,255,.12), transparent 60%),
    radial-gradient(850px 650px at 85% 25%, rgba(255,43,214,.10), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(124,58,237,.12), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  min-height: 100%;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

/* Header */
.page{
  margin: 14px 0 14px;
  padding: 2px 4px;
}
.page h1{
  margin:0 0 8px;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: .2px;
}
.muted{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

/* Cards */
.card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)) ,
    radial-gradient(1200px 500px at 10% 0%, rgba(0,229,255,.06), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(255,43,214,.05), transparent 55%),
    var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px;
}

h2{
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: .2px;
}

/* Layout helpers */
.row{
  display:flex;
  gap:12px;
  align-items:center;
}
.wrap{ flex-wrap: wrap; }
.grow{ flex: 1; min-width: 260px; }

.settings{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 10px;
}
@media(min-width: 900px){
  .settings{ grid-template-columns: 1fr 1fr; }
}
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media(min-width: 900px){
  .grid{ grid-template-columns: 1fr 1fr; }
}

/* Buttons */
button, .btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  backdrop-filter: blur(6px);
}
body.light button, body.light .btn{
  border-color: rgba(0,0,0,.12);
  background: rgba(0,0,0,.04);
  color: var(--text);
}
button:hover, .btn:hover{
  transform: translateY(-1px);
  border-color: rgba(0,229,255,.35);
  box-shadow: var(--glow), var(--glow2);
  background: rgba(255,255,255,.09);
}
button:active, .btn:active{
  transform: translateY(0px) scale(.99);
}

.btn.small{
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.actions{
  display:flex;
  justify-content:flex-end;
  margin-top:-6px;
  margin-bottom: 8px;
}

/* Inputs */
input, select{
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color: var(--text);
  min-width: 260px;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
body.light input, body.light select{
  background: rgba(255,255,255,.85);
  border-color: rgba(0,0,0,.12);
  color: var(--text);
}
input::placeholder{ color: rgba(167,176,214,.75); }
input.small{
  min-width: 140px;
  width: 140px;
}
input:focus, select:focus{
  border-color: rgba(0,229,255,.45);
  box-shadow: 0 0 0 4px rgba(0,229,255,.10), var(--glow);
  background: rgba(0,0,0,.28);
}

select{
  min-width: 180px;
}

/* Pills / Badges */
.pill{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
}
body.light .pill{
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.10);
}

.ok{ color:#36f7a5; font-weight: 800; }
.bad{ color:#ff5c5c; font-weight: 800; }

/* Tables */
table{ border-collapse: collapse; width: 100%; }
td, th{
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 10px 8px;
  text-align: left;
  font-size: 14px;
}
body.light td, body.light th{
  border-bottom-color: rgba(0,0,0,.10);
}
th{ color: var(--muted); font-weight: 700; }

/* Code */
code{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text);
}
body.light code{
  background: rgba(0,0,0,.05);
  border-color: rgba(0,0,0,.10);
}

/* Heatmap */
.heat-controls input[type="range"]{
  width: 220px;
  padding: 0;
  border: none;
  min-width: unset;
  background: transparent;
}
.heat-wrap{
  display:flex;
  justify-content:center;
  margin-top: 10px;
}

.board{
  width: 520px;
  height: 520px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  position: relative;

  box-shadow: 0 20px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(0,229,255,.08) inset;
  background-image: url("../img/dartboard.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#heatCanvas{
  position:absolute;
  inset:0;
}

/* Info button */
.info-btn{
  position: fixed;
  top: 14px;
  right: 14px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(0,229,255,.35);
  background:
    radial-gradient(circle at 30% 30%, rgba(0,229,255,.85), rgba(0,229,255,.10) 55%, rgba(0,0,0,.15)),
    linear-gradient(135deg, rgba(0,229,255,.25), rgba(255,43,214,.12));
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: var(--glow), 0 16px 50px rgba(0,0,0,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.info-btn:hover{
  transform: scale(1.08);
  box-shadow: 0 0 22px rgba(0,229,255,.55), 0 0 22px rgba(255,43,214,.20), 0 20px 70px rgba(0,0,0,.55);
}
.info-btn:active{ transform: scale(0.98); }

/* Theme button */
.theme-btn{
  position: fixed;
  top: 14px;
  right: 72px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-size: 18px;
  display: grid;
  place-items: center;
  z-index: 9999;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.theme-btn:hover{
  background: rgba(255,255,255,.12);
  transform: scale(1.08);
  border-color: rgba(255,43,214,.35);
  box-shadow: var(--glow2);
}

/* Modal */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.68);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.modal-backdrop[hidden]{ display: none !important; }

.modal{
  background:
    radial-gradient(700px 300px at 20% 0%, rgba(0,229,255,.10), transparent 55%),
    radial-gradient(700px 300px at 80% 0%, rgba(255,43,214,.08), transparent 55%),
    rgba(10,12,22,.92);
  color: var(--text);
  padding: 18px;
  border-radius: var(--radius);
  width: min(440px, calc(100% - 32px));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 26px 90px rgba(0,0,0,.65);
}
.modal h3{ margin-top: 0; }
.modal button{ margin-top: 12px; }

/* Camera panel */
.cam-summary{
  display:flex;
  justify-content: space-between;
  align-items:center;
  cursor: pointer;
  user-select: none;
}
.cam-wrap{
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
#camImg{
  width: 100%;
  height: auto;
  display: block;
}

/* Status badge */
.status-badge{
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
  border: 1px solid rgba(255,255,255,0.12);
  letter-spacing: .2px;
  background: rgba(255,255,255,.06);
}
.status-unknown{
  background: rgba(255, 193, 7, 0.14);
  border-color: rgba(255, 193, 7, 0.32);
}
.status-throw{
  background: rgba(46, 204, 113, 0.14);
  border-color: rgba(46, 204, 113, 0.32);
}
.status-idle{
  background: rgba(160, 160, 160, 0.12);
  border-color: rgba(160, 160, 160, 0.28);
}
.status-stopped, .status-disconnect{
  background: rgba(231, 76, 60, 0.14);
  border-color: rgba(231, 76, 60, 0.32);
}
.status-busy{
  background: rgba(52, 152, 219, 0.14);
  border-color: rgba(52, 152, 219, 0.32);
}

/* Version badge (dezent & streamfreundlich) */
.app-version{
  position: fixed;
  bottom: 14px;
  right: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(0,229,255,.22);
  box-shadow: var(--glow2);
  opacity: .9;
  z-index: 9999;
}
