* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    background-color: #121213;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #3a3a3c;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #6aaa64, #c9b458);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: #818384;
    margin-bottom: 0;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.game-section, .results-section {
    background: #1a1a1b;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #3a3a3c;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #ffffff;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #ffffff;
}

.instructions {
    color: #818384;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* Wordle Grid */
.grid-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.grid {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    padding: 10px;
}

.row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.cell {
    width: 62px;
    height: 62px;
    border: 2px solid #3a3a3c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    background-color: #121213;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cell:hover {
    border-color: #565758;
}

.cell:focus {
    outline: none;
    border-color: #6aaa64;
    box-shadow: 0 0 0 1px #6aaa64;
}

/* Touch feedback for mobile */
.cell:active {
    transform: scale(0.95);
    background-color: #2a2a2b;
}

/* Mobile-specific styles */
@media (max-width: 768px) and (pointer: coarse) {
    .cell {
        width: 55px;
        height: 55px;
        font-size: 1.8rem;
        /* Larger touch target */
        min-width: 44px;
        min-height: 44px;
    }

    .grid {
        gap: 4px;
    }

    /* Better touch feedback */
    .cell:active {
        transform: scale(0.9);
        background-color: #3a3a3c;
        border-color: #6aaa64;
    }
}

.cell.empty {
    border-color: #3a3a3c;
    background-color: #121213;
    color: #ffffff;
}

.cell.absent {
    background-color: #3a3a3c;
    border-color: #3a3a3c;
    color: #ffffff;
}

.cell.present {
    background-color: #c9b458;
    border-color: #c9b458;
    color: #ffffff;
}

.cell.correct {
    background-color: #6aaa64;
    border-color: #6aaa64;
    color: #ffffff;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #6aaa64;
}

.option label {
    color: #ffffff;
    cursor: pointer;
}

/* Buttons */
.solve-button, .clear-button {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.solve-button {
    background: linear-gradient(135deg, #6aaa64, #5a9a54);
    color: white;
}

.solve-button:hover {
    background: linear-gradient(135deg, #5a9a54, #4a8a44);
    transform: translateY(-2px);
}

.solve-button:disabled {
    background: #3a3a3c;
    cursor: not-allowed;
    transform: none;
}

.clear-button {
    background: linear-gradient(135deg, #787c7e, #565758);
    color: white;
    margin-top: 10px;
}

.clear-button:hover {
    background: linear-gradient(135deg, #565758, #464748);
    transform: translateY(-2px);
}

/* Results */
.results-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    padding: 20px;
    background: #2a2a2b;
    border-radius: 8px;
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #6aaa64;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #818384;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Suggestions */
.suggestion-grid, .words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.suggestion-word, .word-item {
    background: #2a2a2b;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.suggestion-word {
    background: linear-gradient(135deg, #6aaa64, #5a9a54);
    color: white;
    font-size: 1.1rem;
}

.suggestion-word.answer-found {
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(106, 170, 100, 0.3);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.word-item:hover, .suggestion-word:hover {
    transform: translateY(-2px);
    border-color: #6aaa64;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #3a3a3c;
    border-top: 4px solid #6aaa64;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #ffffff;
    font-size: 1.2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid #3a3a3c;
    margin-top: 40px;
    color: #818384;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .cell {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .game-section, .results-section {
        padding: 20px;
    }

    .stats {
        gap: 20px;
    }

    .suggestion-grid, .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .controls {
        gap: 15px;
    }

    .options {
        gap: 8px;
    }

    .suggestion-grid, .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}
