/* Wordle Page Styles */
.wordle-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.wordle-content {
    flex: 1;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wordle-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    text-align: center;
}

.subtitle {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 2rem;
    text-align: center;
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.game-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--editor-bg);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.game-btn:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.game-btn i {
    font-size: 1.2rem;
}

/* Game Info */
.game-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
}

.info-item i {
    font-size: 1.2rem;
    color: var(--accent-color);
}

/* Wordle Board */
.wordle-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 350px;
}

.wordle-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.wordle-tile {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--border-color);
    background-color: var(--editor-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.wordle-tile.filled {
    border-color: var(--text-color);
    animation: pop 0.1s ease-in-out;
}

.wordle-tile.correct {
    background-color: #6aaa64;
    border-color: #6aaa64;
    color: white;
    animation: flip 0.5s ease-in-out;
}

.wordle-tile.present {
    background-color: #c9b458;
    border-color: #c9b458;
    color: white;
    animation: flip 0.5s ease-in-out;
}

.wordle-tile.absent {
    background-color: #787c7e;
    border-color: #787c7e;
    color: white;
    animation: flip 0.5s ease-in-out;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.wordle-row.shake {
    animation: shake 0.5s ease-in-out;
}

/* Keyboard */
.keyboard {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.key {
    min-width: 43px;
    height: 58px;
    border: none;
    border-radius: 4px;
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    transition: all 0.1s ease;
}

.key:hover {
    background-color: var(--accent-color);
    color: white;
}

.key.wide {
    min-width: 65px;
    font-size: 0.75rem;
}

.key.correct {
    background-color: #6aaa64;
    color: white;
}

.key.present {
    background-color: #c9b458;
    color: white;
}

.key.absent {
    background-color: #3a3a3c;
    color: #ffffff;
    opacity: 0.5;
}

/* Message Box */
.message-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--editor-bg);
    color: var(--text-color);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    animation: fadeIn 0.3s ease-in-out;
}

.message-box.hidden {
    display: none;
}

.message-box.success {
    border-color: #6aaa64;
}

.message-box.error {
    border-color: #c9b458;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--editor-bg);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: var(--border-color);
}

.modal-body {
    padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Guess Distribution */
.guess-distribution h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.distribution-bar {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.distribution-label {
    width: 20px;
    color: var(--text-color);
    font-weight: bold;
}

.distribution-graph {
    flex: 1;
    height: 24px;
    background-color: var(--sidebar-bg);
    border-radius: 4px;
    margin: 0 0.5rem;
    position: relative;
    overflow: hidden;
}

.distribution-fill {
    height: 100%;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
    min-width: 24px;
    transition: width 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wordle-content {
        padding: 1rem;
    }

    .wordle-content h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .game-controls {
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .game-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .game-info {
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .wordle-board {
        margin-bottom: 1.5rem;
    }

    .wordle-tile {
        font-size: 1.5rem;
    }

    .keyboard {
        gap: 6px;
        margin-bottom: 1rem;
    }

    .keyboard-row {
        gap: 4px;
    }

    .key {
        min-width: 28px;
        height: 48px;
        font-size: 0.7rem;
    }

    .key.wide {
        min-width: 45px;
        font-size: 0.65rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wordle-content {
        padding: 0.75rem;
    }

    .wordle-content h1 {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }

    .subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .game-controls {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .game-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .game-btn i {
        font-size: 1rem;
    }

    .game-info {
        gap: 1rem;
        margin-bottom: 1.25rem;
        font-size: 0.9rem;
    }

    .info-item {
        font-size: 0.9rem;
    }

    .wordle-board {
        max-width: 320px;
        margin-bottom: 1.25rem;
    }

    .wordle-tile {
        font-size: 1.25rem;
    }

    .keyboard {
        max-width: 100%;
        gap: 5px;
        padding: 0 0.25rem;
    }

    .keyboard-row {
        gap: 3px;
    }

    .key {
        min-width: 24px;
        height: 44px;
        font-size: 0.65rem;
        padding: 0.25rem;
    }

    .key.wide {
        min-width: 38px;
        font-size: 0.6rem;
    }

    .message-box {
        min-width: 250px;
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    .wordle-content h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .wordle-board {
        max-width: 280px;
    }

    .wordle-tile {
        font-size: 1.1rem;
    }

    .keyboard {
        padding: 0;
    }

    .keyboard-row {
        gap: 2px;
    }

    .key {
        min-width: 22px;
        height: 40px;
        font-size: 0.6rem;
    }

    .key.wide {
        min-width: 34px;
        font-size: 0.55rem;
    }
}
