/* ===================== Global ===================== */
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:#f9f9f9;
  font-family: system-ui, sans-serif;
}

/* .rel-link.a { */
	/* text-align: center; */
	/* font-size: .75em; */
	/* color: #e6e6e6; */
	/* text-decoration: none; */
	/* text-align: center; */
	/* padding:.5em; */
/* } */

/* .rel-link.a:hover { */
    /* text-decoration: underline !important; */
/* } */

#container {
  flex: 1;
}

footer {
  width: 100%;
  padding: .8em 0;
  text-align: center;
  background: #222;
  color: #e6e6e6;
  font-size: .75em;
  opacity: .8;
}


footer a {
    color: #e6e6e6;
    text-decoration: underline;
}

/* ===================== Statistik ===================== */
.stats-box {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:1em;
  margin-bottom:1.5em;
}
.stats-item {
  background:linear-gradient(135deg,#fff,#f1f1f1);
  border-radius:12px;
  padding:1em;
  text-align:center;
  box-shadow:0 4px 10px rgba(0,0,0,.08);
}
.stats-num { font-size:1.6em; font-weight:bold; margin:.2em 0; }
.stats-sub { font-size:.75em; opacity:.65; }

/* ===================== Streak ===================== */
.streak-box { margin-top:.5em; }
.streak-item { padding:.7em; }
.streak-title {
  margin: 1.5em 0 0.5em;
  font-size: 1.05em;
  letter-spacing: .02em;
  color: #666;
  text-align:center;
}

/* ===================== Filter ===================== */
.column-filters-container {
  display:flex; flex-wrap:wrap; gap:.5em;
  margin-bottom:1em;
  position:sticky;
  top:0;
  background:#fff;
  padding:.5em;
  z-index:10;
  box-shadow:0 2px 5px rgba(0,0,0,.1);
}
.column-filters-container input {
  flex:1 1 120px;
  padding:.4em;
  border:1px solid #ccc;
  border-radius:4px;
}

/* ===================== Tabelle ===================== */
details {
  background:#fff;
  border-radius:8px;
  padding:.5em;
  margin-bottom:1em;
  box-shadow:0 2px 5px rgba(0,0,0,.08);
}
summary {
  cursor:pointer;
  background:#eee;
  padding:.5em;
  border-radius:5px;
}
table {
  width:100%;
  border-collapse:collapse;
  table-layout:auto;
}
th,td {
  padding:.4em .6em;
  vertical-align:top;
  word-wrap:break-word;
}
th { background:#f7f7f7; }

/* ===================== Spoiler ===================== */
.spoiler {
  color: transparent;
  background-color: #eee;
  border-radius: 4px;
  padding: 0.1em 0.4em;
  user-select: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.spoiler:hover {
  color: black;
  background-color: white;
}

/* ===================== Datapills für "Gelöst von" ===================== */
.geloest-pill {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
  color: #000;
  
  display: flex;
  justify-content: center;
  align-items: center;
  
  text-align: center;
  min-width: 50px;
  margin: 0.1em 0.1em;
}
.geloest-jochen.geloest-pill { background-color: #a8d0e6; color:#000; }
.geloest-etienne.geloest-pill { background-color: #f28b82; color:#000; }
.geloest-george.geloest-pill { background-color: #fbbc04; color:#000; }
.geloest-kompliziert.geloest-pill { background: linear-gradient(90deg, #f28b82 40%, #a8d0e6 60%); color:#000; }
.geloest-none.geloest-pill { background-color:#ccc; color:#000; }

/* ===================== Mobile Card-Ansicht ===================== */
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead { display: none; } /* Kopfzeile ausblenden */

  tr {
    margin-bottom: 1em;
    border-radius: 12px;
    background: #fff;
    padding: 1em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }

  td {
    display: flex;
    justify-content: space-between;
    padding: 0.4em 0;
    word-wrap: break-word;
  }

  td::before {
    content: attr(data-label);
    font-weight: bold;
    flex: 0 0 120px; /* Label Breite */
    color: #555;
  }

  .geloest-pill {
    margin: 0.3em 0 0 0;
    width: auto;
  }
}
/* ===================== Feste Spaltenbreiten ===================== */ 
th:nth-child(1), td:nth-child(1) { width: 3%;  text-align: center;} /* Folge */ 
th:nth-child(2), td:nth-child(2) { width: 4%; } /* # / Frage-Nr */ 
th:nth-child(3), td:nth-child(3) { width: 40%;} /* Frage */ 
th:nth-child(4), td:nth-child(4) { width: 6%;  text-align: center;} /* Gestellt von */ 
th:nth-child(5), td:nth-child(5) { width: 41%; } /* Antwort */ 
th:nth-child(6), td:nth-child(6) { width: 6%; } /* Gelöst von */


/* ===================== Dark Mode ===================== */
@media (prefers-color-scheme: dark) {

  body {
    background: #121212;
    color: #e6e6e6;
  }

  h1 {
    color: #ffffff;
  }

  /* Statistik */
  .stats-item {
    background: linear-gradient(135deg, #1e1e1e, #252525);
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
  }

  .stats-sub {
    opacity: .6;
  }

  /* Streak */
  .streak-title {
    color: #aaa;
  }

  /* Filter */
  .column-filters-container {
    background: #1a1a1a;
    box-shadow: 0 2px 6px rgba(0,0,0,.6);
  }

  .column-filters-container input {
    background: #222;
    color: #eee;
    border: 1px solid #444;
  }

  /* Details & Tabellen */
  details {
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,.6);
  }

  summary {
    background: #2a2a2a;
    color: #fff;
  }

  th {
    background: #222;
  }

  td {
    border-color: #333;
  }

  /* Spoiler */
  .spoiler {
    background-color: #333;
  }

  .spoiler:hover {
    background-color: #555;
    color: #fff;
  }

  /* Mobile Cards */
  @media (max-width: 600px) {
    tr {
      background: #1a1a1a;
      box-shadow: 0 3px 8px rgba(0,0,0,.6);
    }

    td::before {
      color: #bbb;
    }
  }

  /* Gelöst Pills (leicht angepasst für Dark Mode) */
  .geloest-jochen.geloest-pill { background-color: #5fa8d3; color:#000; }
  .geloest-etienne.geloest-pill { background-color: #e57373; color:#000; }
  .geloest-george.geloest-pill { background-color: #f6c026; color:#000; }
  .geloest-kompliziert.geloest-pill { 
    background: linear-gradient(90deg, #e57373 40%, #5fa8d3 60%);
    color:#000;
  }
  .geloest-none.geloest-pill { background-color:#555; color:#fff; }
}