/* Grundlayout für FullHD */
body {
  margin: 0; padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: url(bg.jpg) no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  color: #222;
  display: flex; flex-direction: column; align-items: center;
  min-height: 50vh;
  user-select: none;
  opacity: .9;
  padding: 20px 10px 60px;
}

#main {
  text-align: center;
}

h1, p {
  color: #64c2f5;
}

/* ── Container ── */
.container {
  position: relative;
  background: rgb(215, 208, 204);
  border-radius: 15px;
  box-shadow: 0 0 30px rgb(218, 185, 157);
  padding: 30px;
  width: fit-content;
  max-width: 90vw;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.spieler-name-container {
  margin-bottom: 25px;
}

input#spieler-name-0 {
  font-size: 1.4rem;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid #4e54c8;
  width: 250px;
  font-weight: 600;
  transition: border-color 0.3s ease;
}
input#spieler-name-0:focus {
  outline: none;
  border-color: #8f94fb;
  box-shadow: 0 0 6px #8f94fb;
}

button#start-button {
  background: #4e54c8;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 12px 30px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-left: 20px;
}
button#start-button:hover {
  background: #6c73e6;
}

.spielbereich {
  margin-top: 20px;
  display: none;
}

.würfel-container {
  display: flex;
  justify-content: center;
  margin: 20px 0 35px;
  gap: 15px;
}

.würfel {
  width: 90px;
  height: 90px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  font-weight: 900;
  color: #4e54c8;
}
.würfel.gehalten {
  box-shadow: 0 0 12px 4px #8f94fb inset;
  transform: scale(1.1);
}

#würfel-button {
  display: block;
  margin: 0 auto 30px;
  background: #4e54c8;
  color: white;
  border: none;
  padding: 14px 50px;
  font-size: 1.5rem;
  border-radius: 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}
#würfel-button:hover:not(:disabled) {
  background: #6c73e6;
}
#würfel-button:disabled {
  background: #a3a7ee;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.15rem;
}
th, td {
  border: 2px solid #4e54c8;
  padding: 10px 15px;
  text-align: center;
}
th {
  background: #6c73e6;
  color: white;
}
td.kategorie {
  font-weight: 700;
  text-align: left;
}
td.punkte {
  cursor: pointer;
  transition: background 0.3s ease;
}
td.punkte:hover {
  background: #e0e4ff;
}
td.punkte.bereits-getippt {
  background: #d4d4d4;
  cursor: default;
  color: #666;
}

.gesamtzeile {
  font-weight: 800;
  background: #c3c7ff;
}

#highscore {
    padding: 1px 20px 20px 20px;
    background: #ddd;
    width: max-content;
    margin: auto;
    border-radius: 10px;
}

table {
    border-collapse: collapse;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
}

th, td {
    border: 1px solid #ccc;
    padding: 6px 12px;
	color: #000;
}

th {
    background-color: #e0f0ff;
}

tr:not(.rank-1):not(.rank-2):not(.rank-3):nth-child(even) {
    background-color: #e8fde8;
}

tr:not(.rank-1):not(.rank-2):not(.rank-3):nth-child(odd) {
    background-color: #defffc;
}

tr.rank-1 {
    background-color: #ffe680;
}

tr.rank-2 {
    background-color: #c0c0c0;
}

tr.rank-3 {
    background-color: #cd7f32;
}

/* Animation Würfeln */
@keyframes würfel-schütteln {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  50% { transform: rotate(-10deg); }
  75% { transform: rotate(8deg); }
  100% { transform: rotate(0deg); }
}
.würfel.schütteln {
  animation: würfel-schütteln 0.5s ease-in-out;
}

@media (max-width: 768px) {
.würfel {
  width: 60px;
  height: 60px;
  font-size: 2.5rem;
}
input#spieler-name-0 {
  width: 180px;
  font-size: 1rem;
}
button#start-button {
  padding: 8px 20px;
  font-size: 1rem;
}
}

table#highscoreTableBody tr:not(.rank-1):not(.rank-2):not(.rank-3):nth-child(even) {
    background-color: #e8fde8;
}

table#highscoreTableBody tr:not(.rank-1):not(.rank-2):not(.rank-3):nth-child(odd) {
    background-color: #defffc;
}

table#highscoreTableBody tr.rank-1 {
    background-color: #ffe680; /* Gold */
}

table#highscoreTableBody tr.rank-2 {
    background-color: #c0c0c0; /* Silver */
}

table#highscoreTableBody tr.rank-3 {
    background-color: #cd7f32; /* Bronze */
}

/* ── Eigener Score hervorheben ── */
table#highscoreTableBody tr.eigener-score {
    outline: 2px solid #4e54c8;
    background-color: #e8eaff !important;
    font-weight: bold;
}

/* ── Bonus-Fortschrittsanzeige ── */
.bonus-info {
    background: #f0f2ff;
    border: 2px solid #c3c7ff;
    border-radius: 10px;
    padding: 10px 18px;
    margin: 0 auto 18px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #4e54c8;
    max-width: fit-content;
    transition: all 0.3s;
}
.bonus-info--erreicht {
    background: #e6ffed;
    border-color: #4caf50;
    color: #2e7d32;
}
.bonus-fortschritt {
    font-size: 0.88em;
    color: #888;
    font-weight: 400;
}
.bonus-erreicht {
    color: #2e7d32;
    font-weight: 700;
}

/* ── Vorschau 0-Punkte: streichbar ── */
td.punkte.vorschau-null {
    color: #c0392b;
    background: #fff0f0;
    font-style: italic;
}
td.punkte.vorschau-null:hover {
    background: #ffd5d5;
}

/* ── Eingetragene 0: gestrichen ── */
td.punkte.gestrichen {
    color: #999;
    text-decoration: line-through;
    font-style: italic;
    cursor: default;
}

/* ── Noch nicht gewürfelt ── */
td.punkte.noch-nicht-gewuerfelt {
    color: #bbb;
    cursor: default;
}

/* ── Spielende-Overlay ── */
#spielende-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
.spielende-box {
    background: #fff;
    border-radius: 18px;
    padding: 40px 55px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(78,84,200,0.35);
    max-width: 380px;
}
.spielende-box h2 {
    font-size: 2rem;
    color: #4e54c8;
    margin-bottom: 12px;
}
.spielende-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin: 6px 0;
}
.spielende-punkte {
    font-size: 2.5rem;
    font-weight: 900;
    color: #4e54c8;
    margin: 8px 0 4px;
}
.spielende-bonus {
    color: #2e7d32;
    font-size: 1rem;
    margin-bottom: 18px;
}
.spielende-box button {
    background: #4e54c8;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 12px 32px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s;
}
.spielende-box button:hover {
    background: #6c73e6;
}

footer {
    background: #ddd;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 20px auto;
    width: max-content;
}