/* ========== Grundlayout ========== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f5f6fa;
  color: #2c3e50;
}

.container {
  width: 95%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px;
  box-sizing: border-box;
}


.orientation-select {
    width: 200px;          /* Breite */
    padding: 10px;         /* Innenabstand */
    font-size: 16px;       /* größere Schrift */
    border-radius: 6px;    /* abgerundete Ecken */
    border: 1px solid #ccc;
    margin-right: 10px;    /* Abstand zum Button */
}


/* ========== Header ========== */
.site-header {
  background: #2c3e50;
  color: white;
  padding: 10px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  margin: 0;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.welcome {
  margin-right: 10px;
  font-weight: bold;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin: 4px;
  background: #3498db;
  color: white !important;    
  text-decoration: none !important; 
  border-radius: 6px;
  transition: background 0.2s ease;
  font-size: 14px;
  cursor: pointer;
}

.btn:hover:not(.disabled) {
  background: #2980b9;
}

.btn.small {
  padding: 6px 10px;
  font-size: 13px;
}

.btn.disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.btn.danger {
  background: #e74c3c;
}

.btn.danger:hover {
  background: #c0392b;
}

.join-button {
  background: #2ecc71;
}

/* Login Button zentrieren */
form button.join-button {
    display: block;    /* Block-Level, damit margin wirkt */
    margin: 20px auto; /* Automatisch links/rechts zentrieren, optional oben/unten Abstand */
}


.join-button:hover {
  background: #27ae60;
}

.leave-button {
  background: #e74c3c;
}

.leave-button:hover {
  background: #c0392b;
}

/* ========== Karten / Sections ========== */
.card {
  background: white;
  padding: 20px;
  margin: 15px auto;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card h2 {
  margin-top: 0;
  font-size: 20px;
  color: #34495e;
}

/* ========== Flash Messages ========== */
.flash {
  background: #f39c12;
  color: white;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
}

/* ========== Tabelle für Turniere ========== */
.responsive-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.responsive-table th,
.responsive-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.responsive-table th {
  background: #3498db;
  color: white;
  font-weight: bold;
}

.responsive-table tr:hover {
  background: #f1f1f1;
}

.responsive-table a {
  color: #3498db;
  text-decoration: none;
}

.responsive-table a:hover {
  text-decoration: underline;
}

/* ========== Countdown & Teilnehmer ========== */
.countdown {
  font-weight: bold;
  color: #e67e22;
}

.participants-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}

/* ========== Tournament Info (Quill HTML) ========== */
.tournament-info {
  padding: 10px;
  background: #ecf0f1;
  border-radius: 6px;
  word-wrap: break-word;      /* ältere Browser */
  overflow-wrap: break-word;  /* moderne Browser */
  white-space: pre-wrap;      /* Zeilenumbrüche im Text erhalten */
  max-width: 100%;            /* darf Container nicht sprengen */
  box-sizing: border-box;
}

.tournament-info p {
  margin: 0 0 10px 0;
}


/* Quill Textausrichtung */
.ql-align-center {
  text-align: center;
}
.ql-align-right {
  text-align: right;
}
.ql-align-justify {
  text-align: justify;
}


/* ========== Responsive Header & Buttons ========== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn-group {
    flex-direction: column;
  }
}

/* ========== Hervorhebung angemeldeter Turniere ========== */
tr.highlight {
  background-color: #dff0d8;
  border-left: 4px solid #27ae60;
}

/* ========== Responsive Tabelle für Mobile ========= */
@media (max-width: 768px) {
  .responsive-table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  .responsive-table thead {
    display: none;
  }
  
  .responsive-table tbody {
    display: flex;         /* Flex für zentrierte Zeilen */
    flex-direction: column;
    align-items: center;   /* Zentriert die Zeilen horizontal */
    gap: 15px;             /* Abstand zwischen Zeilen */
  }

    .responsive-table tbody tr {
    display: block;
    width: 95%;            /* Breite der "Karten" */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
  }

  .responsive-table tbody td {
    display: block;
    width: 100%;
    text-align: center;
    padding: 6px 0;
    border: none;
    margin: 0;
    box-sizing: border-box;
  }

  .responsive-table tbody td::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
    color: #2c3e50;
  }

  /* Hervorhebung für angemeldete Turniere auf Mobile */
  .responsive-table tbody tr.highlight td {
    background-color: #dff0d8;
    border-left: 4px solid #27ae60;
    border-radius: 8px;
    padding: 6px 0;
  }
}



/* ========== Responsive Matchbaum ========= */
@media (max-width: 768px) {
  .match {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .match .vs {
    margin: 5px 0;
    text-align: center;
  }

  .match .player input[type="number"] {
    width: 100%;
  }
}

/* ========== Matchbaum Rundenüberschrift ========= */
.round-title {
  text-align: center;
  font-weight: bold;
  margin: 20px 0 10px 0;
  font-size: 16px;
  color: #34495e;
}

/* ========== Freilos hervorheben ========= */
.freilos {
  color: #999;
  font-style: italic;
}

/* ===== Formular Styles ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* zwei Spalten */
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
}

.form-row.full {
  grid-column: 1 / -1; /* über beide Spalten */
}

.form-row label {
  font-weight: bold;
  margin-bottom: 6px;
  color: #2c3e50;
}

.form-row input,
.form-row select,
#editor {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

.form-row input:focus,
.form-row select:focus,
#editor:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 4px rgba(52, 152, 219, 0.4);
}

/* ========== Match Winner hervorheben ========= */
.match-winner {
  font-weight: bold;
  color: #27ae60;
  }
  .danger-zone {
    border: 2px solid #e74c3c;
    background: #fdecea;
}
.btn.danger {
    background: #e74c3c;
    color: #fff;
}
.btn.danger:hover {
    background: #c0392b;
}



.edit-btn {
  background: #f39c12;
  color: white;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 6px;
}
.edit-btn:hover {
  background: #d68910;
}
/* ========== Banner Slider ========= */

.banner-slider {
    padding: 0;
    overflow: hidden;
    position: relative;
}

.slider-container {
    width: 100%;
    max-height: 300px; 
    position: relative;
}

.slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slides img {
    width: 100%;
	max-width: 100%;
    height: auto;        /* Höhe wird automatisch anhand des Containers angepasst */
    flex-shrink: 0;      /* verhindert das Schrumpfen */
    object-fit: cover;   /* Bild füllt den Container, ohne Verzerrung */
    max-height: 300px;   /* passt sich an maximale Höhe an */
}

/* Optional: Pfeile */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    z-index: 10;
}

.slider-arrow.left { left: 10px; }
.slider-arrow.right { right: 10px; }




/* ========== Zusätzliche Optimierung für Handys ========= */
@media (max-width: 480px) {
  body {
    padding: 0 6px; /* Abstand links/rechts */
  }

  .container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
  }

  .header-inner {
    flex-direction: column;   /* Header-Inhalte untereinander */
    align-items: stretch;     /* Inhalte füllen volle Breite */
    gap: 10px;
  }

  .header-actions {
    flex-direction: column; /* Login/Logout + Buttons untereinander */
    width: 100%;
    gap: 8px;
  }

  .header-actions form {
    width: 100%;
  }

  .header-actions input,
  .header-actions button {
    width: 100%;
  }
}


.styled-table {
  width: 100%;
  border-collapse: collapse;
}
.styled-table th, .styled-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #ddd;
}
.styled-table tr:nth-child(even) {
  background: #f9f9f9;
}
.styled-table th {
  background: #333;
  color: #fff;
  text-align: left;
}
.pagination {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}



