:root {
    --wordle-cell-size: 58px;
    --wordle-accent: #22c55e;
    --wordle-correct: #16a34a;
    --wordle-present: #ca8a04;
    --wordle-absent: #4b5563;
}

.stats-bar > button.stat-card {
    border: 0;
    color: inherit;
    font: inherit;
}

.game-surface {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(5, var(--wordle-cell-size));
    gap: 6px;
    margin: 8px auto 12px;
}

.word-cell {
    width: var(--wordle-cell-size);
    height: var(--wordle-cell-size);
    border: 2px solid var(--border-color);
    background: var(--panel-bg);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 28px;
    text-transform: uppercase;
    transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.word-cell.filled {
    border-color: var(--text-secondary);
}

.word-cell.current {
    border-color: var(--game-accent);
}

.word-cell.correct {
    color: #fff;
    border-color: var(--wordle-correct);
    background: var(--wordle-correct);
}

.word-cell.present {
    color: #fff;
    border-color: var(--wordle-present);
    background: var(--wordle-present);
}

.word-cell.absent {
    color: #fff;
    border-color: var(--wordle-absent);
    background: var(--wordle-absent);
}

.word-cell.revealing {
    animation: flip 0.22s ease;
}

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

.status-text {
    min-height: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0 0 8px;
}

.hint-inline-btn {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 7px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 10px;
    cursor: pointer;
    font-weight: 700;
}

.hint-inline-btn svg {
    width: 16px;
    height: 16px;
}

.keyboard {
    display: grid;
    gap: 4px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.keyboard-row {
    display: grid;
    gap: 4px;
    width: 100%;
    grid-auto-flow: column;
}

.kb-spacer {
    width: 100%;
}

.kb-key {
    min-width: 0;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    padding: 0 4px;
    cursor: pointer;
    user-select: none;
}

.kb-key.wide {
    min-width: 0;
    font-size: 12px;
}

.kb-key.correct { background: var(--wordle-correct); color: #fff; }
.kb-key.present { background: var(--wordle-present); color: #fff; }
.kb-key.absent { background: var(--wordle-absent); color: #fff; }

.record-list {
    max-height: 170px;
    overflow: auto;
}

.modal-card p {
    color: var(--text-secondary);
    margin: 8px 0;
    line-height: 1.5;
}

.howto-example-row {
    display: flex;
    gap: 4px;
    margin: 8px 0 4px;
}

.howto-example-cell {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.howto-example-cell.correct { background: var(--wordle-correct); border-color: var(--wordle-correct); color: #fff; }
.howto-example-cell.present { background: var(--wordle-present); border-color: var(--wordle-present); color: #fff; }
.howto-example-cell.absent { background: var(--wordle-absent); border-color: var(--wordle-absent); color: #fff; }

@media (max-width: 600px) {
    :root {
        --wordle-cell-size: 50px;
    }

    .word-cell {
        font-size: 24px;
    }

    .kb-key {
        height: 44px;
        font-size: 13px;
        padding: 0 3px;
    }

    .kb-key.wide {
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    :root {
        --wordle-cell-size: 44px;
    }

    .word-cell {
        font-size: 20px;
    }

    .kb-key {
        height: 40px;
        font-size: 12px;
        border-radius: 7px;
        padding: 0 2px;
    }

    .kb-key.wide {
        font-size: 10px;
    }

    .action-bar {
        gap: 6px;
    }

    .action-label {
        font-size: 8px;
    }
}
