/* ==== Grundlayout & Typografie ===================================== */

:root {
  --ml-bg: #ffffff;
  --ml-border: #444444;   /* Anthrazit */
  --ml-border-light: #dddddd;
  --ml-accent: #0066ff;
  --ml-text: #111111;
  --ml-muted: #666666;
}

/* max. drei Textgrößen */
html, body {
  margin: 0;
  padding: 0;
  background: var(--ml-bg);
  color: var(--ml-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;       /* Grundgröße */
  line-height: 1.4;
}

/* Headline-Größe */
.ml-heading {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
}

/* Abschnittsüberschrift (z.B. „Einzel“, „Doppel“) */
.ml-table-title {
  font-size: 15px;
  font-weight: 700;
  margin: 16px 0 6px;
}

/* Zusatzinfos (Meta-Texte) */
.ml-meta,
.ml-player-meta,
.ml-score-meta-line,
.ml-autosave-status {
  font-size: 11px;
  color: var(--ml-muted);
}

/* ==== Layout-Container ============================================= */

.ml-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--ml-border-light);
}

.ml-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ml-logo {
  max-width: 160px;
  width: 100%;
  height: auto;
  display: block;
}

.ml-header-title {
  font-size: 15px;
  font-weight: 600;
}

.ml-main {
  max-width: 960px;
  margin: 16px auto;
  padding: 0 12px;
}

.ml-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--ml-border-light);
  font-size: 11px;
  color: var(--ml-muted);
}

/* Card-Layout */
.ml-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--ml-border-light);
  border-radius: 6px;
  padding: 14px 12px;
  box-sizing: border-box;
}

.ml-card-wide {
  max-width: 880px;
  margin: 0 auto;
}

/* ==== Formulare (Editor) =========================================== */

.ml-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ml-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ml-field label {
  font-size: 12px;
  font-weight: 600;
}

.ml-field select,
.ml-field input[type="text"] {
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--ml-border-light);
  background: #ffffff;
  box-sizing: border-box;
}

.ml-field select:focus,
.ml-field input[type="text"]:focus {
  outline: 1px solid var(--ml-accent);
  outline-offset: 1px;
}

/* Button schlicht, ohne Schatten */
.ml-btn {
  border-radius: 4px;
  border: 1px solid var(--ml-border);
  background: var(--ml-accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

.ml-btn:hover {
  filter: brightness(0.95);
}

/* Link-Styles */
.ml-link {
  color: var(--ml-accent);
  text-decoration: underline;
  font-weight: 500;
}

/* Autosave-Status */
.ml-autosave-status {
  margin: 4px 0 10px;
}

/* ==== Score-Übersicht (Editor & Live) ============================== */

.ml-score-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.ml-score-summary-table td {
  border: none;
  padding: 2px 4px;
  vertical-align: middle;
}

.ml-score-cell-main {
  width: 60%;
}

.ml-score-meta-line {
  font-weight: 600;
}

.ml-score-team {
  font-size: 14px;   /* Textgröße */
  font-weight: 700;
}

.ml-score-team-home {
  color: var(--ml-text);
}

.ml-score-team-away {
  color: var(--ml-text);
}

.ml-score-cell-heading {
  width: 20%;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ml-muted);
}

.ml-score-cell-value {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

/* ==== Tabellen (Einzel / Doppel / Live-Liste) ====================== */

.nb-table,
.ml-live-list-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}

.nb-table th,
.nb-table td,
.ml-live-list-table th,
.ml-live-list-table td {
  border: 1px solid var(--ml-border-light);
  padding: 6px 4px;
  vertical-align: top;
  box-sizing: border-box;
}

.nb-table thead th,
.ml-live-list-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ml-muted);
  background: #f7f7f7;
}

/* Spaltenbreiten für Scoreboard-Tabellen */
.nb-col-pos {
  width: 32px;
  text-align: center;
  font-weight: 700;
}

.nb-col-players {
  width: 45%;
}

.nb-col-sets {
  width: 40px;
  text-align: center;
}

/* Live-Liste */
.ml-live-list-table th,
.ml-live-list-table td {
  border: none;
  border-bottom: 1px solid var(--ml-border-light);
}

.ml-live-list-table tr:last-child td {
  border-bottom: none;
}

/* ==== Spieler-Anzeige ============================================== */

.ml-player-name {
  font-size: 13px;
  font-weight: 600;
}

.ml-player-meta {
  margin-top: 1px;
}

/* ==== Satz-Eingaben im Editor ====================================== */

.nb-set-input,
.ml-set-input {
  width: 26px;
  padding: 3px 2px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid var(--ml-border-light);
  font-size: 13px;
  box-sizing: border-box;
}

.nb-set-sep,
.ml-set-sep {
  font-size: 13px;
  color: var(--ml-muted);
}

/* Fehlerzustand für Satzfelder (Validation) */
.ml-set-input-error,
.nb-set-input.ml-set-input-error {
  border-color: #e53935;
  background-color: #ffecec;
}

/* ==== Layout-Abstände ============================================== */

.ml-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.ml-share-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ml-border-light);
  background: #f7f7f7;
}

.ml-share-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ml-muted);
}

.ml-share-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ml-share-input {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--ml-border-light);
  padding: 5px 6px;
  font-size: 12px;
  background: #ffffff;
  font-family: monospace;
  box-sizing: border-box;
}

/* ==== Responsive Anpassungen ======================================= */

@media (min-width: 640px) {
  .ml-share-links {
    flex-direction: row;
  }

  .ml-share-input {
    flex: 1;
  }
}

.ml-textarea {
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--ml-border-light);
  background: #ffffff;
  resize: vertical;
  box-sizing: border-box;
}

.ml-live-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}

.ml-icon-btn {
  border: 1px solid var(--ml-border-light);
  background: #ffffff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 14px; /* gleiche Textgröße wie sonst */
  cursor: pointer;
}

.ml-icon-btn:hover {
  background: #f0f0f0;
}

.ml-match-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ml-muted);
}

.ml-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.ml-status-live {
  background: #d50000;
  animation: ml-blink 1s infinite;
}

.ml-status-finished {
  background: #2e7d32;
}

.ml-status-label {
  font-weight: 600;
}

@keyframes ml-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}
.ml-tabs {
  display: inline-flex;
  border-bottom: 1px solid var(--ml-border-light);
  margin-bottom: 10px;
}

.ml-tab-btn {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ml-muted);
  border-bottom: 2px solid transparent;
}

.ml-tab-btn-active {
  color: var(--ml-text);
  font-weight: 600;
  border-bottom-color: var(--ml-accent);
}

.ml-tab-panel {
  display: none;
}

.ml-tab-panel-active {
  display: block;
}
