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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121213;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

.left-stats {
    position: fixed;
    left: 20px;
    top: 20px;
    width: 220px;
    background: #1a1a1b;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: fit-content;
    z-index: 5;
    flex-shrink: 0;
}

.left-stats div {
    font-size: 1rem;
    color: #ffffff;
}

.left-stats span {
    color: #6aaa64;
    font-weight: bold;
}

.main-container {
    max-width: 500px;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin: 0 auto;
    transform: translateX(-300px);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 1px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 10px;
}

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

.message {
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 1.5rem;
}

.game-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #121213;
}

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

.tile {
    width: 58px;
    height: 58px;
    border: 2px solid #3a3a3c;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #1a1a1b;
    color: #ffffff;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

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

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

.tile.flip {
    animation: flip 0.5s ease-in-out;
}

.tile.focused {
    border-color: #6aaa64;
    box-shadow: 0 0 10px rgba(106, 170, 100, 0.5);
}

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

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 8px;
}

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

.key {
    height: 50px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.1s ease;
    background-color: #818384;
    color: #ffffff;
    border: none;
    min-width: 44px;
    padding: 0 8px;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.key.wide {
    min-width: 90px;
}

.key.backspace {
    min-width: 100px;
}

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

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

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

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

.key.correct:hover,
.key.present:hover,
.key.absent:hover {
    opacity: 0.8;
}

#toggle-btn {
    height: 40px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.1s ease;
    background-color: #4a90e2;
    color: #ffffff;
    border: none;
    padding: 0 12px;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#toggle-btn:hover {
    background-color: #357abd;
}

.right-panel {
    position: fixed;
    right: -200px;
    top: 0;
    width: 200px;
    height: 100vh;
    background: #1a1a1b;
    padding: 20px;
    border-radius: 8px 0 0 8px;
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 10;
    box-shadow: -2px 0 8px rgba(0,0,0,0.3);
}

.right-panel.show {
    right: 0;
}

.right-panel h3 {
    margin-bottom: 10px;
    color: #ffffff;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    margin: 10px 0;
    padding: 5px;
    background: #121213;
    border-radius: 4px;
}

.mini-tile {
    width: 25px;
    height: 25px;
    border: 1px solid #3a3a3c;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #1a1a1b;
    color: #ffffff;
}

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

.mini-tile.required {
    background-color: #c9b458;
    border-color: #c9b458;
    color: #ffffff;
}

.letter-prob {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #ffffff;
}

.right-panel ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.right-panel li {
    padding: 5px;
    background: #3a3a3c;
    margin: 2px 0;
    border-radius: 4px;
    text-align: center;
    color: #ffffff;
    font-size: 0.9rem;
}

.win-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: #121213;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
}

#win-word {
    font-size: 2rem;
    margin: 20px 0;
    color: #6aaa64;
}

.color-chart {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 20px 0;
}

.win-grid {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #121213;
}

.chart-row {
    display: flex;
    gap: 2px;
    justify-content: space-around;
}

.color-bar {
    height: 20px;
    border-radius: 2px;
    flex: 1;
    max-width: 100px;
}

.color-bar.correct {
    background: #6aaa64;
}

.color-bar.present {
    background: #c9b458;
}

.color-bar.absent {
    background: #3a3a3c;
}

footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 0.9rem;
}

footer a {
    color: #6aaa64;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    body {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }

    .left-stats {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .right-panel {
        width: 100%;
        right: -100%;
    }

    .main-container {
        max-width: 95%;
        padding: 0px 0;
    }

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

    .key {
        height: 50px;
        font-size: 0.75rem;
        min-width: 35px;
    }

    .key.wide {
        min-width: 50px;
    }

    h1 {
        font-size: 2rem;
    }

    .game-board {
        padding: 10px;
    }

    .keyboard {
        padding: 0 10px;
    }

    .game-info {
        padding: 0 10px;
    }
}
