body {
    min-height: 100vh;
    background-color: #f3f4f6;
    padding: 2rem 1rem;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

h1 {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
    color: #1f2937;
}

.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

#guessInput {
    width: 100%;
    font-size: 1.25rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
}

.tiles-area {
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

#tileContainer {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.letter-tile {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: white;
    color: #1f2937;
    transition: all 0.2s;
    border: 2px solid #d1d5db;
    user-select: none;
    cursor: pointer;
}

.letter-tile.filled {
    border-color: #4b5563;
    background-color: #f3f4f6;
}

.letter-tile.absent {
    background-color: #6b7280;
    color: white;
    border-color: #6b7280;
}

.letter-tile.present {
    background-color: #fbbf24;
    color: white;
    border-color: #fbbf24;
}

.letter-tile.correct {
    background-color: #34d399;
    color: white;
    border-color: #34d399;
}

.letter-tile.focused {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.tile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 50px;
}

.validation-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.validation-button {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    background-color: rgba(107, 114, 128, 0.3);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.validation-button.yellow {
    border-color: #fbbf24;
}

.validation-button.yellow.active {
    background-color: #fbbf24;
}

.validation-button.green {
    border-color: #34d399;
}

.validation-button.green.active {
    background-color: #34d399;
}

.button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 0.5rem;
}

.button-primary {
    background-color: #3b82f6;
}

.button-primary:hover {
    background-color: #2563eb;
}

.button-danger {
    background-color: #ef4444;
}

.button-danger:hover {
    background-color: #dc2626;
}

#errorMessage {
    color: #ef4444;
    text-align: center;
    margin-bottom: 1rem;
    display: none;
}

#errorMessage.visible {
    display: block;
}

#results {
    display: none;
}

#results.visible {
    display: block;
}

.results-header {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.best-guess-container {
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.best-guess-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#bestGuess {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
}

#calculating {
    display: none;
    color: #6b7280;
    font-style: italic;
}

#calculating.visible {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#solutionsGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-height: 15rem;
    overflow-y: auto;
}

.solution-item {
    padding: 0.5rem;
    text-align: center;
    border-radius: 0.25rem;
    background: #f3f4f6;
}

.solution-item.best {
    background: #dbeafe;
    color: #2563eb;
    font-weight: bold;
}

#moreResults {
    margin-top: 1rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
    display: none;
}

#moreResults.visible {
    display: block;
}

/* Keyboard Styles */
#keyboard {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.15rem;
    margin-bottom: 0.15rem;
}

.key {
    min-width: 2.25rem;
    height: 3.25rem;
    border: none;
    border-radius: 0.25rem;
    background: white;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.key:hover {
    background: #e5e7eb;
}

.key:active {
    transform: translateY(2px);
}

.key-wide {
    min-width: 4rem;
    padding: 0 1rem;
}

/* Hints Layer */
.hints-layer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    background: white;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    touch-action: pan-x;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

.hints-layer.visible {
    display: flex;
    flex-direction: column;
}

.hints-layer.slided {
    transform: translateX(100%);
    pointer-events: none;
}

.hints-tab {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-100%);
    width: 40px;
    height: 120px;
    background: white;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: 600;
    color: #3b82f6;
    user-select: none;
    z-index: 1001;
    pointer-events: auto;
}

.hints-content {
    height: 100%;
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.hints-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.hints-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.hints-close {
    padding: 1rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hints-close::after {
    content: '→';
    display: block;
}

.hints-close:hover {
    color: #1f2937;
}

/* Overlay für den Hintergrund */
.hints-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.hints-overlay.visible {
    display: block;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .letter-tile {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    .tile-container {
        width: 45px;
    }

    .key {
        min-width: 2rem;
        height: 3rem;
        font-size: 1rem;
    }

    .key-wide {
        min-width: 3.5rem;
    }

    .hints-content {
        margin: 1rem;
    }
}

.word-info-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    display: none;
    flex: 1;
    min-height: 0; /* Wichtig für Flexbox-Scrolling */
}

.word-info-section.visible {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.word-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.word-info-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.word-info-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #4b5563;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE und Edge */
    scrollbar-width: none;  /* Firefox */
    flex: 1;
    min-height: 0; /* Wichtig für Flexbox-Scrolling */
}

.word-info-text::-webkit-scrollbar {
    display: none;  /* Chrome, Safari und Opera */
} 
/* Ergänzungen für styles.css */

/* Styling für den Zurück-Button */
#backToResultsButton {
    background-color: #64748b;
    margin-top: 1rem;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

#backToResultsButton:hover {
    background-color: #475569;
}

/* Verbesserte Darstellung der Wortinformation im Vollbild-Modus */
.word-info-section.fullscreen {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.word-info-text {
    max-height: none; /* Kein Höhenlimit im Vollbildmodus */
    flex: 1;
    padding: 1.25rem;
}

/* Verbesserte Darstellung der Wort-Info-Inhalte */
.word-info h3 {
    color: #3b82f6;
    margin: 1.25rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.word-info h3:first-child {
    margin-top: 0;
}

.word-info p {
    margin-bottom: 1rem;
    line-height: 1.6;
}