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

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background: #fefaf6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(8, 6, 85, 0.08);
    padding: 40px;
    max-width: 540px;
    width: 100%;
    border: 1px solid #e5ede5;
}

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #00b2ff;
    padding-bottom: 20px;
}

.header-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo {
    height: 60px;
    width: auto;
}

h1 {
    color: #f1416c;
    font-size: 2.8em;
    margin: 0;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.subtitle {
    color: #181c39;
    font-size: 1em;
    font-weight: 400;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Word Length Display */
.word-length-display-container {
    text-align: center;
    margin-bottom: 25px;
    padding: 12px;
    background: #e6f7ff;
    border-radius: 10px;
    border: 2px solid #00b2ff;
}

.word-length-info {
    font-weight: 600;
    color: #080655;
    font-size: 1em;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

.info-button, .stats-button {
    background: #00b2ff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.info-button:hover, .stats-button:hover {
    background: #0080cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 178, 255, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close, .stats-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover, .stats-close:hover {
    color: #00b2ff;
}

.modal-content h2 {
    color: #080655;
    margin-bottom: 15px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.modal-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.examples {
    margin-top: 20px;
}

.example-row {
    display: flex;
    gap: 5px;
    margin: 10px 0;
}

.examples p {
    margin: 5px 0 20px 0;
    font-size: 0.9em;
}

/* Stats Styles */
.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.2em;
    font-weight: 600;
    color: #080655;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    font-size: 0.85em;
    color: #181c39;
    margin-top: 5px;
    font-weight: 400;
}

/* Game Board */
#game-board {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 20px auto;
    max-width: 100%;
    padding: 0 10px;
}

.row {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.tile {
    width: 58px;
    height: 58px;
    min-width: 40px;
    min-height: 40px;
    border: 2px solid #e5ede5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 600;
    text-transform: uppercase;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

/* Responsive tile sizing for different word lengths */
@media (max-width: 600px) {
    .tile {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .tile {
        width: 42px;
        height: 42px;
        font-size: 1.3em;
    }

    .row {
        gap: 3px;
    }
}

.tile.filled {
    border-color: #181c39;
    animation: pop 0.1s;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.tile.correct {
    background: #50cd89;
    color: white;
    border-color: #50cd89;
    animation: flip 0.5s ease;
}

.tile.present {
    background: #ffc700;
    color: #080655;
    border-color: #ffc700;
    animation: flip 0.5s ease;
}

.tile.absent {
    background: #181c39;
    color: white;
    border-color: #181c39;
    animation: flip 0.5s ease;
}

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

/* Message */
.message {
    text-align: center;
    margin: 20px 0;
    min-height: 30px;
    font-weight: 500;
    color: #00b2ff;
    font-size: 1.1em;
    font-family: 'Outfit', sans-serif;
}

.message.error {
    color: #f1416c;
}

.message.success {
    color: #50cd89;
}

.message.info {
    color: #00b2ff;
}

/* Keyboard */
#keyboard {
    margin-top: 30px;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 6px 0;
}

.key {
    min-width: 43px;
    height: 58px;
    border-radius: 6px;
    border: 1px solid #e5ede5;
    background: #f6f6f9;
    color: #181c39;
    font-weight: 500;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-family: 'Outfit', sans-serif;
}

.key:hover {
    background: #e5ede5;
    transform: scale(1.05);
}

.key:active {
    transform: scale(0.95);
}

.key.wide {
    min-width: 65px;
    font-size: 0.85em;
}

.key.correct {
    background: #50cd89;
    color: white;
    border-color: #50cd89;
}

.key.present {
    background: #ffc700;
    color: #080655;
    border-color: #ffc700;
}

.key.absent {
    background: #181c39;
    color: white;
    border-color: #181c39;
}

footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5ede5;
}

footer p {
    color: #181c39;
    font-size: 0.9em;
}

footer a {
    color: #00b2ff;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    color: #0080cc;
    text-decoration: underline;
}

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

    .logo {
        height: 50px;
    }

    h1 {
        font-size: 2.2em;
    }

    .word-length-info {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .header-logo {
        gap: 8px;
    }

    .logo {
        height: 45px;
    }

    h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .word-length-display-container {
        padding: 10px;
    }

    .word-length-info {
        font-size: 0.9em;
    }

    .key {
        min-width: 30px;
        height: 48px;
        font-size: 0.85em;
    }

    .key.wide {
        min-width: 50px;
        font-size: 0.75em;
    }

    .info-button, .stats-button {
        padding: 10px 18px;
        font-size: 0.85em;
    }
}
