/* =========================================================
   EVENTS (Liste + Detail)
   Kombi aus turniere + turnier_detail kompatiblen Klassen
========================================================= */

:root{
  --ev-bg:#0b0b10;
  --ev-panel:#111;
  --ev-line:#222;
  --ev-line2:#333;
  --ev-muted:#888;
}

/* ---------- Generic wrappers ---------- */
.turniere-hero{
  text-align:center;
  padding:40px 20px 18px 20px;
  background: radial-gradient(circle at 50% 0%, rgba(48,159,106,0.18) 0%, transparent 62%);
}
.turniere-hero h2{
  margin:0;
  color:#fff;
  font-size:2.2rem;
  text-shadow:0 0 20px rgba(48,159,106,.25);
}
.turniere-hero p{ margin:8px 0 0 0; color:#aaa; }

.turniere-wrap,
.page-wrap{
  max-width:1100px;
  margin:0 auto 50px auto;
  padding:0 20px;
}

/* detail hero (from old turnier_detail) */
.hero{
  text-align:center;
  padding:18px 20px 10px 20px;
}
.hero h2{ margin:0; color:#fff; }
.hero p{ color:#aaa; margin:8px 0 0 0; }

/* pills */
.live-pill,
.finished-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:6px auto 10px auto;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid #333;
  background:#111;
  font-weight:1000;
}
.live-pill{ color:#f59e0b; border-color:rgba(245,158,11,.4); }
.finished-pill{ color:var(--dart-green); border-color:rgba(48,159,106,.4); }
.live-dot{
  width:10px; height:10px; border-radius:50%;
  background:#ef4444;
  box-shadow:0 0 0 0 rgba(239,68,68,.6);
  animation:pulseLive 1.5s infinite;
}
@keyframes pulseLive{
  0%{ box-shadow:0 0 0 0 rgba(239,68,68,.6); }
  70%{ box-shadow:0 0 0 10px rgba(239,68,68,0); }
  100%{ box-shadow:0 0 0 0 rgba(239,68,68,0); }
}

/* ---------- List view ---------- */
.turniere-top-actions{
  display:flex;
  justify-content:flex-end;
  margin-bottom:14px;
}
.section-title{
  margin:22px 0 10px 0;
  color:#fff;
  border-bottom:2px solid #333;
  padding-bottom:8px;
}
.empty-events{
  border:1px dashed #333;
  border-radius:12px;
  background:rgba(255,255,255,.02);
  color:#888;
  padding:22px;
  text-align:center;
}

.event-card{
  background: linear-gradient(145deg,#151526,#0f0f14);
  border:1px solid #2a2a3a;
  border-radius:16px;
  padding:14px;
  margin-bottom:12px;
  display:grid;
  grid-template-columns: 180px 1fr auto;
  gap:14px;
  align-items:stretch;
  box-shadow:0 10px 24px rgba(0,0,0,.35);
}
.event-card:hover{ border-color:#3a3a4c; transform:translateY(-1px); transition:.15s; }

.past-event{
  opacity:.82;
  filter:saturate(.85);
}

.event-image-wrap{
  position:relative;
  border-radius:12px;
  overflow:hidden;
  background:#0a0a0f;
  border:1px solid #222;
  min-height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:zoom-in;
}
.event-image-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.event-image-wrap.placeholder{
  font-size:2rem;
  color:#666;
}
.zoom-icon{
  position:absolute;
  right:8px;
  bottom:8px;
  background:rgba(0,0,0,.6);
  border:1px solid #333;
  border-radius:10px;
  padding:3px 7px;
  font-size:.85rem;
}

.e-content{
  min-width:0;
}
.e-date-badge{
  display:inline-block;
  font-size:.82rem;
  color:#cbd5e1;
  background:#0b1220;
  border:1px solid #243041;
  border-radius:999px;
  padding:5px 10px;
}
.e-title{
  margin:10px 0 8px 0;
  color:#fff;
  font-size:1.18rem;
}
.e-desc{
  margin:0;
  color:#9aa3b2;
  line-height:1.45;
}
.e-chip-external{
  display:inline-block;
  margin-top:10px;
  font-size:.82rem;
  border:1px solid #334155;
  color:#94a3b8;
  border-radius:999px;
  padding:4px 9px;
}

.e-actions{
  display:flex;
  align-items:flex-start;
  gap:8px;
}
.btn-tourney{
  text-decoration:none;
  border-radius:12px;
  padding:9px 12px;
  font-weight:1000;
  border:1px solid #f59e0b;
  color:#fff;
  background:linear-gradient(135deg,#f59e0b,#b45309);
}
.btn-icon{
  border:1px solid #333;
  background:#0d0d14;
  color:#ddd;
  border-radius:10px;
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.btn-icon.del{ border-color:rgba(227,41,46,.5); color:#fca5a5; }
.btn-icon:hover{ border-color:#555; transform:translateY(-1px); transition:.15s; }

/* Lightbox */
#singleLightbox{
  display:none;
  position:fixed;
  inset:0;
  z-index:22000;
  background:rgba(0,0,0,.88);
}
#singleLightbox img{
  max-width:92vw;
  max-height:88vh;
  position:absolute;
  inset:0;
  margin:auto;
  border-radius:12px;
  border:1px solid #444;
}
.sl-close{
  position:absolute;
  top:10px;
  right:16px;
  color:#fff;
  font-size:2rem;
  font-weight:1000;
  cursor:pointer;
}

/* ---------- Shared modal (create/edit) ---------- */
.modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  z-index:21000;
  background:rgba(0,0,0,.75);
  align-items:center;
  justify-content:center;
  padding:14px;
}
.modal-box{
  width:100%;
  max-width:620px;
  background:#111;
  border:1px solid #333;
  border-radius:16px;
  padding:16px;
  box-shadow:0 20px 50px rgba(0,0,0,.5);
}
.modal-box h3{ margin:0 0 12px 0; color:#fff; }
.modal-box label{
  display:block;
  margin:10px 0 6px 0;
  color:#888;
  font-size:.78rem;
  letter-spacing:2px;
  text-transform:uppercase;
  font-weight:900;
}
.modal-box input[type="text"],
.modal-box input[type="datetime-local"],
.modal-box input[type="file"],
.modal-box textarea,
.modal-box select{
  width:100%;
}
.modal-check-wrap{
  display:flex !important;
  align-items:flex-start;
  gap:10px;
  margin-top:10px !important;
}
.modal-check-wrap .t1{
  color:#ddd;
  font-size:.9rem;
  text-transform:none;
  letter-spacing:0;
}
.modal-check-wrap .t2{
  display:block;
  color:#777;
  font-size:.8rem;
  margin-top:2px;
}
.modal-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}
.modal-actions .btn.main{ flex:1; }
.modal-actions .btn.alt{ background:#444; }

/* ---------- Tournament detail core ---------- */
.card{
  background:linear-gradient(180deg,#111,#0d0d14);
  border:1px solid #2a2a3a;
  border-radius:14px;
  padding:14px;
}
.card h3{ margin:0 0 12px 0; color:#fff; }

.setup-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

/* top nav tabs in detail */
.tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:12px 0 14px 0;
}
.tab{
  border:1px solid #333;
  background:#111;
  color:#bbb;
  border-radius:12px;
  padding:9px 12px;
  cursor:pointer;
  font-weight:900;
}
.tab:hover{ border-color:#555; color:#fff; }
.tab.active{
  border-color:var(--dart-green);
  color:#fff;
  box-shadow: inset 0 0 0 1px rgba(48,159,106,.25);
}
.tab-content{ display:none; }
#tab-board{ display:block; } /* default from JS/legacy */

/* players in detail */
.player-badge{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border:1px solid #222;
  background:#0b0b10;
  border-radius:12px;
  padding:10px;
  margin-bottom:8px;
}
.player-badge .n{
  color:#888;
  font-weight:900;
  margin-right:8px;
}

/* next matches list cards */
.player-match{
  border:1px solid #222;
  background:#000;
  border-radius:12px;
  padding:10px;
  cursor:pointer;
}
.player-match:hover{ border-color:#444; transform:translateY(-1px); transition:.15s; }
.pm-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.pm-k{
  color:#888;
  font-size:.8rem;
  font-weight:900;
  letter-spacing:.5px;
}
.pm-v{
  margin-top:6px;
  color:#fff;
  font-weight:1000;
}

/* ---------- Generic form polish ---------- */
.form-input{
  background:#0b0b10;
  color:#fff;
  border:1px solid #333;
  border-radius:10px;
  padding:10px 12px;
}
.form-input:focus{
  outline:none;
  border-color:var(--dart-green);
  box-shadow:0 0 0 3px rgba(48,159,106,.15);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .event-card{
    grid-template-columns:140px 1fr;
  }
  .e-actions{
    grid-column: 1 / -1;
    justify-content:flex-end;
  }
}
@media (max-width: 760px){
  .turniere-wrap,
  .page-wrap{ padding:0 12px; }

  .setup-grid{ grid-template-columns:1fr; }

  .event-card{
    grid-template-columns:1fr;
  }
  .event-image-wrap{
    min-height:180px;
  }

  .modal-actions{
    flex-direction:column;
  }
}

/* ---------- Light mode ---------- */
html[data-theme="light"] .turniere-hero{
  background: radial-gradient(circle at 50% 0%, rgba(48,159,106,0.12) 0%, transparent 62%), #f6f9ff;
}
html[data-theme="light"] .turniere-hero h2{ color:#0f172a; text-shadow:none; }
html[data-theme="light"] .turniere-hero p{ color:#64748b; }

html[data-theme="light"] .hero h2{ color:#0f172a; }
html[data-theme="light"] .hero p{ color:#64748b; }

html[data-theme="light"] .section-title{ color:#0f172a; border-color:#d6e1ef; }
html[data-theme="light"] .empty-events{
  border-color:#d6e1ef;
  color:#64748b;
  background:#fff;
}

html[data-theme="light"] .event-card,
html[data-theme="light"] .card,
html[data-theme="light"] .modal-box,
html[data-theme="light"] .player-badge,
html[data-theme="light"] .player-match{
  background:#fff !important;
  border-color:#d6e1ef !important;
  box-shadow:0 8px 20px rgba(15,23,42,.08);
}

html[data-theme="light"] .e-title,
html[data-theme="light"] .card h3,
html[data-theme="light"] .pm-v{
  color:#0f172a;
}
html[data-theme="light"] .e-desc,
html[data-theme="light"] .pm-k,
html[data-theme="light"] .player-badge .n{
  color:#64748b;
}
html[data-theme="light"] .e-date-badge{
  background:#f8fbff;
  border-color:#d6e1ef;
  color:#334155;
}

html[data-theme="light"] .btn-icon{
  background:#f8fbff;
  border-color:#d6e1ef;
  color:#334155;
}
html[data-theme="light"] .btn-icon:hover{
  border-color:#b8cbe3;
  color:#0f172a;
}

html[data-theme="light"] .modal-box label,
html[data-theme="light"] .modal-check-wrap .t2{
  color:#64748b;
}
html[data-theme="light"] .modal-check-wrap .t1{ color:#334155; }

html[data-theme="light"] .form-input{
  background:#fff;
  color:#0f172a;
  border-color:#d6e1ef;
}
html[data-theme="light"] .tabs .tab{
  background:#fff;
  border-color:#d6e1ef;
  color:#334155;
}
html[data-theme="light"] .tabs .tab.active{
  color:#0f172a;
  border-color:#8ac6a6;
}

html[data-theme="light"] .live-pill,
html[data-theme="light"] .finished-pill{
  background:#fff;
  border-color:#d6e1ef;
}
html[data-theme="light"] .finished-pill{ color:#15803d; }
html[data-theme="light"] .live-pill{ color:#b45309; }