body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #111;
    color: #f0f0f0;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    text-align: center;
    max-width: 90%;
    margin: 0 auto;
}
.game-container {
  position: relative;
  width: 100%;
  max-width: 330px; /* Adjust based on your game board size */
  margin: 0 auto;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 0.2em;
  margin-top: 0.4em;
  margin-bottom: 0.1em;
  justify-content: center;
}

.hint-button {
  position: absolute;
  right: -100px; /* Adjust this value to position the button */
  top: 48%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #d5ae03;
  color: #fff;
  font-size: 1.5em;
  font-weight: bold;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  padding: 0; /* Remove any default padding */
  line-height: 1; /* Set line-height to 1 for perfect vertical centering */
  text-align: center; /* Ensure text is centered horizontally */
}

.hint-button::after {
  content: "?";
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.hint-button:hover {
  background-color: #c2a003;
}

@media screen and (max-width: 500px) {
  .game-container {
    max-width: 280px; /* Adjust for smaller screens */
  }

  .hint-button {
    right: -60px;
    width: 1.8em;
    height: 1.8em;
    font-size: 1.4em;
  }
}

.correct-letter-button {
  position: absolute;
  right: -100px;
  top: calc(55% + 50px); /* Position it below the hint button */
 transform: translateY(-50%);
 width: 40px;
 height: 40px;
 border-radius: 50%;
 background-color: #15a208;
 color: #fff;
 font-size: 1.5em;
 font-weight: bold;
 border: none;
 cursor: pointer;
 display: flex;
 justify-content: center;
 align-items: center;
 box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
 padding: 0; /* Remove any default padding */
 line-height: 1; /* Set line-height to 1 for perfect vertical centering */
 text-align: center; /* Ensure text is centered horizontally */
}

.correct-letter-button::after {
  content: "1";
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}
@media screen and (max-width: 500px) {
  .game-container {
    max-width: 280px; /* Adjust for smaller screens */
  }

  .correct-letter-button {
    right: -60px;
    width: 1.8em;
    height: 1.8em;
    font-size: 1.4em;
  }
}

@media screen and (max-width: 500px) {
    .container {
        max-width: 60vw;
    }
}
@media screen and (min-width: 501px) {
    .container {
        max-width: 55vw;
    }
}

@media screen and (min-width: 1001px) {
    .container {
        max-width: 28vw;
    }
}

.mode-buttons {
    margin-bottom: 0.4em;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ... (keep the existing styles) ... */

.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4em;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin: 0 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.mode-label {
    font-size: 14px;
    font-weight: bold;
}

#hint-button {
    margin-top: 10px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 0.2em;
    margin-top: 0.4em;
    margin-bottom: 0.1em;
    justify-content: center;
}
:root {
  /* Define the color for correct letter guesses */
  --correct-color: #6aaa64; /* This is a common "correct" green color used in word games */
}

/* Styling for game over alerts */
.game-over-alert {
  text-align: center;
  padding: 20px;
  background-color: #222222;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 436px; /* Match the keyboard width */
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Style for the alert container that overlays the game */
.alert-container {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  /* Safari iOS fix to ensure overlay works properly */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.word-info-container {
position: relative;
z-index: 2001;
}

/* Button in game over alert */
.game-over-alert button {
  margin-top: 15px;
  padding: 8px 16px;
  background-color: #538d4e;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  align-self: center; /* Zus�tzliche Zentrierung des Buttons */
}

.game-over-alert button:hover {
  background-color: #446e3f;
}
.tile {
    width: 100%;
    padding-top: 100%;
    position: relative;
    border: 2px solid #aaa;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    background-color: #333;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.tile > span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tile.correct { background-color: #15a208 !important; color: #fff !important; }
.tile.present { background-color: #d5ae03 !important; color: #fff !important; }
.tile.absent { background-color: #222 !important; color: #f0f0f0 !important; }

@keyframes flip {
    0% { transform: rotateX(0); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

.tile.flipping {
    animation: flip 0.8s;
}

.keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.keyboard-row {
    display: flex;
    gap: 4px;
}

.key {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

.key:hover {
    background-color: #444;
}

.key.wide {
    width: 80px;
}

.key.correct { background-color: #15a208 !important; color: #fff !important; }
.key.present { background-color: #d5ae03 !important; color: #fff !important; }
.key.absent { background-color: #000 !important; color: #666 !important; }

#hint-list {
    margin-top: 0.8em;
}

.bottom-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .2em;
    box-sizing: border-box;
}

.bottom-alert {
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    max-width: 80%;
    text-align: center;
    display: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #222;
    color: #fff;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#modal-message {
    font-size: 1.2em;
    margin-bottom: 20px;
}

#play-again-button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 5px;
}

#play-again-button:hover {
    background-color: #45a049;
}

.hint-list {
    width: 100%;
    max-width: 330px; /* Match the game-container max-width */
    margin: 20px auto 0;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px;
    text-align: center;
    box-sizing: border-box;
    font-size: 1em;
    overflow-wrap: break-word;
    border-radius: 5px;
    display: none; /* Hide by default */
}

@media (max-width: 600px) {
    .hint-list {
        font-size: 1em;
    }
}

@media (max-width: 500px) {
    .key {
        width: 30px;
        height: 30px;
        font-size: 0.8em;
    }

    .key.wide {
        width: 120px;
    }
    
    .game-over-alert {
        max-width: 334px; /* 10 keys at 30px + 9 gaps at 4px */
        padding: 15px;
    }
}
/* Erweiterung f�r die Wortinfo-Anzeige */
.word-info-container {
    width: 100%; /* Full width of its container */
    max-width: 436px; /* 10 keys at 40px + 9 gaps at 4px */
    max-height: 90vh;
    margin: 0 auto;
    overflow-y: auto;
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For IE/Edge */
    padding: 20px;
    background-color: #222;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    box-sizing: border-box; /* Ensure padding is included in width */
}

.info-content {
    width: 100%;
    max-height: 65vh; /* Reduced to ensure it fits on smaller screens */
    margin: 10px 0 20px 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    line-height: 1.4;
    box-sizing: border-box; /* Ensure consistent sizing */
}

/* Versteckt die Scrollbar f�r Webkit-Browser (Chrome, Safari) */
.word-info-container::-webkit-scrollbar,.info-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.info-header {
    margin: 15px 0;
    font-size: 1.3em;
    color: var(--correct-color);
    text-align: center;
}

.info-divider {
    margin: 15px 0;
    border: 0;
    height: 1px;
    background-color: #555;
}

.game-over-message {
    text-align: center;
    margin-bottom: 15px;
}

/* Info content styles moved above */

.spinner {
    margin: 20px auto;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid var(--correct-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Text alignment f�r alle Elemente in der Wortinfo */
.word-info-container * {
    text-align: left !important;
}

/* Explizite Regeln f�r Listen */
.word-info ul, 
.word-info ol,
.word-info li {
    text-align: left !important;
    list-style-position: outside; /* Damit die Bullets/Zahlen links ausgerichtet sind */
    padding-left: 0.5em !important;
}

/* Auch f�r Paragraphen */
.word-info p {
    text-align: left !important;
}
/* Responsive Design */
@media (max-width: 768px) {
    .word-info-container {
        max-width: 436px; /* Match the keyboard width */
        max-height: 90vh;
        padding: 15px;
    }
    
    .info-header {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .word-info-container {
        max-width: 334px; /* 10 keys at 30px + 9 gaps at 4px */
        padding: 10px;
    }
}
@media screen and (min-width: 320px) and (max-width: 460px) {
    /* Cover all iPhones including smaller models */
    .word-info-container {
        max-width: 334px; /* 10 mobile keys at 30px + 9 gaps at 4px */
        padding: 8px;
        max-height: 80vh; /* Further reduced height for small screens */
        padding-top: max(env(safe-area-inset-top), 8px);
        padding-bottom: max(env(safe-area-inset-bottom), 8px);
        padding-left: max(env(safe-area-inset-left), 8px);
        padding-right: max(env(safe-area-inset-right), 8px);
    }
    
    .info-content {
        max-height: 80vh;
        font-size: 1.1em; /* Slightly smaller font for mobile */
    }
    
    .word-info h3 {
        font-size: 1.4em;
    }
    
    .info-header {
        font-size: 1.4em;
    }
    
    .game-over-message {
        font-size: 1.1em;
    }
}

/* Styling f�r die HTML-Elemente, die von Gemini API zur�ckgegeben werden */
.word-info h3 {
    color: var(--correct-color);
    margin-top: 15px;
    margin-bottom: 8px;
}

.word-info p {
    margin-bottom: 15px;
    text-align: left;
    font-size: 1.1em; /* Slightly smaller for better fit */
    overflow-wrap: break-word; /* Prevent text overflow */
    word-break: break-word;
}

.play-again-button {
    display: block;
    margin: 15px auto;
    padding: 10px 20px;
    background-color: var(--correct-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.play-again-button:hover {
    background-color: #589e53;
}