/* =============================================================================
   RED LINE SCORING – GLOBAL FRONTEND STYLES
   -----------------------------------------------------------------------------
   Von allen Frontend-Shortcodes genutzt (App, Rangliste, Competitions).
   Die Primaerfarbe kommt aus der CSS-Variable --mf-color, die pro Wettkampf
   inline gesetzt wird (siehe styles.php). Hier NIE die Farbe hardcoden,
   sondern immer var(--mf-color) verwenden.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   BASIS-CONTAINER
   ----------------------------------------------------------------------------- */
.mf {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #111827;
  box-sizing: border-box;
}

/* -----------------------------------------------------------------------------
   HEADER
   ----------------------------------------------------------------------------- */
.mf-header {
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 12px;
}

.mf-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #111827;
}

.mf-round-badge {
  font-size: 12px;
  color: #6b7280;
}

/* -----------------------------------------------------------------------------
   BOX
   ----------------------------------------------------------------------------- */
.mf-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
}

.mf-accent-border {
  border-left: 3px solid var(--mf-color);
}

/* -----------------------------------------------------------------------------
   SECTION LABEL
   ----------------------------------------------------------------------------- */
.mf-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  text-align: center;
  margin-bottom: 20px;
}

/* -----------------------------------------------------------------------------
   FORMS
   ----------------------------------------------------------------------------- */
.mf label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.mf input[type=text],
.mf select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  color: #111827;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  margin-bottom: 14px;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.mf input[type=text]:focus,
.mf select:focus {
  outline: none;
  border-color: var(--mf-color);
}

/* Pflichtfeld-Markierung (ersetzt inline style="color:#dc2626") */
.mf-required {
  color: #dc2626;
}

.mf-pin-input {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
}

/* -----------------------------------------------------------------------------
   CHECKBOX
   ----------------------------------------------------------------------------- */
.mf-privacy label,
.mf .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 400;
}

.mf-privacy input[type=checkbox],
.mf .checkbox-row input {
  width: auto;
  margin-top: 2px;
  flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   BUTTON
   ----------------------------------------------------------------------------- */
.mf-btn {
  width: 100%;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--mf-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.mf-btn:hover {
  opacity: 0.9;
}

/* -----------------------------------------------------------------------------
   LINK
   ----------------------------------------------------------------------------- */
.mf-link {
  display: block;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: var(--mf-color);
}

.mf-link a {
  color: var(--mf-color);
  text-decoration: none;
}

/* -----------------------------------------------------------------------------
   MESSAGES
   ----------------------------------------------------------------------------- */
.mf-ok {
  padding: 10px 12px;
  font-size: calc(13px + 0.1vw);
  background: #f0fdf4;
  color: #059669;
  border-radius: 4px;
  margin-bottom: 14px;
}

.mf-err {
  padding: 10px 12px;
  font-size: 13px;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 4px;
  margin-bottom: 14px;
}

/* Dezenter Hinweistext (ersetzt inline style="font-size:13px;color:#6b7280") */
.mf-note {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

/* -----------------------------------------------------------------------------
   USER BAR
   ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
   KOPF-BOX (Name, ID, Gruppe, Ausloggen + Statistik-Kacheln)
   ----------------------------------------------------------------------------- */
.mf-headbox {
  padding: 14px 16px;
}

.mf-head-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mf-head-id {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.mf-head-name {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}

.mf-logout {
  font-size: 12px;
  color: #6b7280;
  text-decoration: none;
  white-space: nowrap;
}

.mf-logout:hover {
  color: #dc2626;
}

.mf-grp {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 3px;
  margin-left: 6px;
}

.mf-uid {
  font-weight: 600;
  color: #9ca3af;
  margin-left: 4px;
}

/* Statistik-Kacheln (Platz / Runde / Gesamt) */
.mf-head-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.mf-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.mf-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #9ca3af;
}

.mf-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--mf-color, #ea580c);
  line-height: 1.1;
}

.mf-stat-sub {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
}

/* -----------------------------------------------------------------------------
   SCORE TABLE
   ----------------------------------------------------------------------------- */
.mf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mf-table th {
  padding: 8px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.mf-table th:first-child {
  text-align: left;
}

.mf-table td {
  padding: 10px 6px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
}

.mf-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: #111827;
}

.mf-table tr:hover td {
  background: #f9fafb;
}

/* -----------------------------------------------------------------------------
   SCORE CHECKBOXES (kompakt)
   ----------------------------------------------------------------------------- */
.mf-check {
  display: none;
}

.mf-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.mf-check:checked + .mf-label {
  border-color: var(--mf-color);
  background: #fff7ed;
}

/* -----------------------------------------------------------------------------
   SAVING STATE
   ----------------------------------------------------------------------------- */
.mf-saving {
  opacity: 0.4;
  pointer-events: none;
}

/* -----------------------------------------------------------------------------
   RESPONSIVE
   ----------------------------------------------------------------------------- */
@media (max-width: 400px) {
  .mf-table th,
  .mf-table td {
    padding: 8px 4px;
  }
  .mf-label {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
}
