/* =========================================================
   DARTS APP – DARK THEME (Anthrazit)
   ---------------------------------------------------------
   Typo/Beispiel-Farben:
   - Hintergrund:   #0f1115
   - Oberfläche:    #171a21
   - Kacheln:       #1c2028
   - Kontrast:      #2a3140
   - Text hell:     #e6eaf3
   - Text subtil:   #98a2b3
   - Primär:        #4da3ff
   - Akzent Grün:   #34d399
   - Warnungen:     #ffb86b / #ef4444
   ========================================================= */

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #0f1115;
  color: #e6eaf3;
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

a { color: #8ec1ff; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

.container { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* ---------- Cards / Surfaces ---------- */
.card {
  background: #1c2028;
  border: 1px solid #2a3140;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  padding: 18px;
}

.stack { display: grid; gap: 16px; }
.section { display: grid; gap: 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
@media (max-width: 760px){
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Top Navigation ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15,17,21,.72);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #2a3140;
}
.topnav .wrap {
  display: flex; align-items: center; gap: 10px;
  max-width: 1000px; margin: 0 auto; padding: 10px 16px;
}
.topnav a {
  color: #cfd6e4;
  padding: 8px 10px;
  border-radius: 10px;
}
.topnav a:hover { background: #171a21; color: #fff; }
.topnav a.active { background: #1c2028; color: #fff; border: 1px solid #2a3140; }

/* ---------- Buttons ---------- */
button, .button, .primary, .ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 800; cursor: pointer; text-decoration: none;
  background: #2a3140; color: #e6eaf3;
}
button:hover, .button:hover, .ghost:hover { background: #323a4b; }

.primary {
  background: #4da3ff; color: #0e1220; border-color: #4da3ff;
  text-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.primary:hover { background: #328ffd; border-color: #328ffd; }

/* ---------- Forms ---------- */
label { color: #cbd3e6; font-weight: 700; }
input[type="text"], input[type="password"], input[type="number"], input[type="file"], input[type="search"], select, textarea {
  width: 100%; padding: 12px; border-radius: 10px;
  background: #171a21; color: #e6eaf3; border: 1px solid #2a3140;
  outline: none;
}
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:focus, select:focus, textarea:focus { border-color: #4da3ff; box-shadow: 0 0 0 2px rgba(77,163,255,.2); }

.help, .muted { color: #98a2b3; }

/* ---------- Messages ---------- */
.msg { padding: 12px 14px; border-radius: 12px; border: 1px solid; }
.msg-ok { background: rgba(52, 211, 153, .12); border-color: #34d399; color: #b8f3db; }
.msg-error { background: rgba(239, 68, 68, .12); border-color: #ef4444; color: #fecaca; }
.msg-warn { background: rgba(255, 184, 107, .12); border-color: #ffb86b; color: #fdecc8; }

/* ---------- Chips (Quick-Picks) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  background: #171a21; border: 1px solid #2a3140; color: #cfd6e4;
  cursor: pointer; user-select: none;
}
.chip input { appearance: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #4da3ff; }
.chip input:checked { background: #4da3ff; }
.chip.active { background: #25324a; border-color: #3b4762; color: #fff; }
.chip-input { width: 130px; padding: 10px 12px; border: 1px solid #2a3140; border-radius: 10px; background:#171a21; color: #e6eaf3; }

/* ---------- Segmented Control ---------- */
.seg { display: inline-flex; border: 1px solid #2a3140; border-radius: 12px; overflow: hidden; background: #0f1115; }
.seg-item { position: relative; }
.seg-item input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-item span { display: inline-block; padding: 10px 14px; color: #cfd6e4; }
.seg-item input:checked + span { background: #4da3ff; color: #0f1115; }

/* ---------- Freundeliste ---------- */
.list { display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid #2a3140; border-radius: 12px;
  background: #171a21;
}
.row:hover { background: #1a1f28; }
.row-ava { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #2a3140; background: #0f1115; }
.row-main { flex: 1; min-width: 140px; }
.row-title { font-weight: 800; color: #e6eaf3; }
.row-sub { font-size: 12px; color: #98a2b3; }
.row-check { width: 18px; height: 18px; }

/* ---------- Summary (Neues Spiel) ---------- */
.summary {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: #171a21; border: 1px solid #2a3140; border-radius: 12px; padding: 12px;
}
.sum-title { font-weight: 900; }
.sum-line { color: #cfd6e4; }

/* ---------- Empty ---------- */
.empty { padding: 16px; border: 1px dashed #3b4762; border-radius: 12px; color: #98a2b3; background: #151922; }

/* ---------- Tabellen allgemein ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
th, td { text-align: left; padding: 8px; }
thead th { color: #cbd3e6; font-weight: 800; }

/* =========================================================
   CRICKET – Spielfeld-Buttons (mit Spieler-Farben)
   ========================================================= */
.cricket-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }

.hit-btn {
  position: relative;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .2s ease, background .2s ease;
  font-size: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), #1c2028);
  color: #e6eaf3;
  box-shadow: inset 0 0 0 2px #2a3140;
}
.hit-btn:hover { transform: translateY(-1px); }
.hit-btn .mark {
  display: inline-block; font-weight: 900; letter-spacing: 3px; min-width: 42px; text-align: center;
}

/* Dynamische Farbe via --col (pro Spieler) */
.hit-btn[data-marks="0"] { background: linear-gradient(180deg, #171a21, #1c2028); }
.hit-btn[data-marks="1"] { background: linear-gradient(180deg, color-mix(in srgb, var(--col) 18%, #1c2028), #1c2028); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--col) 55%, #2a3140); }
.hit-btn[data-marks="2"] { background: linear-gradient(180deg, color-mix(in srgb, var(--col) 28%, #1c2028), #1c2028); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--col) 75%, #2a3140); }
.hit-btn[data-marks="3"] { background: linear-gradient(180deg, color-mix(in srgb, var(--col) 45%, #1c2028), #3a2f12); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--col) 85%, #2a3140); }

/* Geschlossen-Overlay (weiter klickbar) */
.hit-btn.closed { position: relative; }
.hit-btn.closed::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 6px, rgba(255,255,255,.03) 6px 12px);
  border-radius: 12px; pointer-events: none;
}

/* Pulse beim Treffer */
.hit-btn.pulse { animation: pulseMark .22s ease; }
@keyframes pulseMark { 0%{transform:scale(1);} 50%{transform:scale(1.06);} 100%{transform:scale(1);} }

/* =========================================================
   GAMES LIST – Karten & bündige Buttons
   ========================================================= */
.games-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.game-card {
  background: #1c2028; border: 1px solid #2a3140; border-radius: 14px;
  padding: 14px; box-shadow: 0 8px 20px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 10px;
}
.gc-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge {
  font-size: 12px; padding: 4px 8px; border-radius: 999px;
  border: 1px solid #2a3140; color: #cfd6e4; background: #171a21;
}
.badge.open { background: rgba(255,184,107,.12); border-color: #ffb86b; color: #ffd8a8; }
.badge.running { background: rgba(52,211,153,.12); border-color: #34d399; color: #b8f3db; }

.gc-body { display: flex; flex-direction: column; gap: 6px; }
.gc-line { color: #cfd6e4; }
.gc-players { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ava { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid #2a3140; background: #0f1115; }

.gc-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px;
}
.action-buttons { display: flex; align-items: center; gap: 8px; }
.action-buttons form { margin: 0; padding: 0; display: contents; }

/* Gemeinsame Button-Basis (A & Button) – pixelgenau bündig */
.action-buttons a,
.action-buttons button {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  height: 38px; padding: 0 14px; gap: 6px;
  border-radius: 10px; font-weight: 700; font-size: 14px; line-height: 1;
  cursor: pointer; border: none; text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .05s ease;
}

/* SVG Icons */
.action-buttons svg { display: block; width: 16px; height: 16px; margin: 0; }

/* Varianten */
.btn-open { background: #4da3ff; color: #0e1220; }
.btn-open:hover { background: #328ffd; }

.btn-del { background: rgba(239, 68, 68, .12); color: #fecaca; border: 1px solid rgba(239,68,68,.35); }
.btn-del:hover { background: rgba(239, 68, 68, .18); }

/* ---------- Footer / Misc ---------- */
footer { margin: 24px 0; color: #98a2b3; text-align: center; }

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }

/* === Cricket: sichtbarere, größere Treffer-Buttons === */
.cricket-table { width:100%; border-collapse:separate; border-spacing:0 12px; }
.cricket-table th, .cricket-table td { text-align:center; padding:8px; }

/* === CRICKET: Neon-Glow in Grün für offene Felder, Rot für geschlossene === */
.hit-btn {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: radial-gradient(circle at 35% 30%, #10141b 0%, #0a0d12 70%);
  color: #eaf3ff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    inset 0 0 6px rgba(0, 255, 100, 0.3),
    0 0 10px rgba(0, 255, 100, 0.15);
  transition: all 0.25s ease;
  outline: none;
}

/* Grund-Glow für offene Felder (grün) */
.hit-btn::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  z-index: -1;
  background: radial-gradient(circle, rgba(0,255,120,0.25) 0%, rgba(0,255,100,0.05) 70%, transparent 100%);
  box-shadow:
    0 0 12px rgba(0,255,100,0.45),
    0 0 25px rgba(0,255,100,0.35),
    0 0 50px rgba(0,255,100,0.25);
  opacity: 0.6;
  transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

/* Hover – leichtes Aufleuchten */
.hit-btn:hover::after {
  opacity: 1;
}

/* Trefferstufen – stärkerer Glow */
.hit-btn[data-marks="1"]::after {
  box-shadow:
    0 0 14px rgba(0,255,100,0.55),
    0 0 30px rgba(0,255,100,0.45),
    0 0 60px rgba(0,255,100,0.35);
}
.hit-btn[data-marks="2"]::after {
  box-shadow:
    0 0 16px rgba(0,255,100,0.65),
    0 0 35px rgba(0,255,100,0.55),
    0 0 70px rgba(0,255,100,0.45);
}
.hit-btn[data-marks="3"]::after {
  /* Geschlossen – rot statt grün */
  background: radial-gradient(circle, rgba(255,50,50,0.3) 0%, rgba(255,0,0,0.1) 70%, transparent 100%);
  box-shadow:
    0 0 20px rgba(255,50,50,0.7),
    0 0 40px rgba(255,20,20,0.6),
    0 0 70px rgba(255,0,0,0.4);
  opacity: 1;
}

/* Geschlossenes Feld – grauer Text, kein Grün-Glow mehr */
.hit-btn.closed {
  border-color: #ff3c3c;
  color: #ff6666;
  text-decoration: line-through;
}

/* Puls beim Treffer */
.hit-btn.pulse {
  animation: pulseGreen 0.25s ease;
}
@keyframes pulseGreen {
  0% { transform: scale(1); box-shadow: 0 0 12px rgba(0,255,120,0.7); }
  50% { transform: scale(1.12); box-shadow: 0 0 28px rgba(0,255,180,0.9); }
  100% { transform: scale(1); box-shadow: 0 0 14px rgba(0,255,120,0.6); }
}

/* Zielzahl als Hintergrund leicht sichtbar */
.hit-btn::before {
  content: attr(data-target-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  opacity: 0.18;
  color: #00ff88;
  pointer-events: none;
  filter: blur(0.3px);
}
.hit-btn[data-bull="1"]::before {
  content: "🎯";
  font-size: 28px;
  opacity: 0.25;
}

/* Zielzeilen etwas abgesetzt */
.cricket-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}
.cricket-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.01);
}

/* Zielbeschriftung links */
.td-target {
  font-weight: 900;
  text-align: left !important;
  padding-left: 12px !important;
  color: #cfd7e3;
}

/* Mobile Anpassung */
@media (max-width: 680px) {
  .hit-btn {
    width: 68px;
    height: 68px;
    font-size: 20px;
  }
  .hit-btn::before {
    font-size: 28px;
  }
}

.btn-green {
  background: #27ae60;
  color: #fff !important;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-green:hover {
  background: #2ecc71;
}

.btn-danger {
  background: #c0392b;
  color: #fff !important;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-danger:hover {
  background: #e74c3c;
}

:root{ --btnSize:58px; }

/* ... */

.hit-btn{
  position:relative;
  width:var(--btnSize);
  height:var(--btnSize);              /* <- Fallback für Tablets ohne aspect-ratio */
  /* aspect-ratio:1/1;  kann bleiben, aber height ist der harte Fallback */
  display:inline-flex;                /* <- statt inline-grid: flex ist robuster */
  align-items:center;
  justify-content:center;
  border-radius:9999px;
  overflow:hidden;
  isolation:isolate;
  border:2px solid transparent;
  outline:none;
  background:radial-gradient(circle at 35% 30%,#10141b 0%,#0a0d12 70%);
  color:#eaf3ff;
  font-size:clamp(14px,calc(var(--btnSize)*0.33),22px);
  font-weight:900;
  letter-spacing:1px;
  cursor:pointer;
  box-shadow:inset 0 0 4px rgba(0,255,100,.22),0 0 6px rgba(0,255,100,.1);
  transition:all .22s ease;
  -webkit-tap-highlight-color:transparent;
  user-select:none;
  touch-action:manipulation;
}
.hit-btn .mark{ pointer-events:none; }  /* Text im Button bleibt klickbar */