.wordle-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-top: 80px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.wordle-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.hub-title {
    font-family: 'Lora', serif;
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0;
}

.icon-btn {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.wordle-status-msg {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 50px;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    width: 100%;
    box-shadow: var(--shadow);
}

.wordle-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
}

.wordle-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-gap: 5px;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    max-width: 350px;
    margin: 0 auto 30px auto;
    aspect-ratio: 5/6;
}

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

.wordle-tile {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    text-transform: uppercase;
    box-sizing: border-box;
    pointer-events: none;
}

/* Animations */
.wordle-tile[data-state="active"] {
    border-color: var(--text-secondary);
    animation: popIn 0.1s ease-in-out forwards;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    40%  { transform: scale(1.1); opacity: 1; }
    to   { transform: scale(1); opacity: 1; }
}

.wordle-tile[data-state="correct"] {
    background-color: #538d4e;
    color: white;
    border-color: #538d4e;
}

.wordle-tile[data-state="present"] {
    background-color: #b59f3b;
    color: white;
    border-color: #b59f3b;
}

.wordle-tile[data-state="absent"] {
    background-color: #3a3a3c;
    color: white;
    border-color: #3a3a3c;
}

.wordle-tile.flip {
    animation: flip 0.6s ease-in-out forwards;
}

@keyframes flip {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

/* Keyboard */
.wordle-row.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.wordle-keyboard {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: auto;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    touch-action: manipulation;
}

.key {
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    border: 0;
    padding: 0;
    margin: 0 4px;
    height: 58px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    transition: background-color 0.2s, transform 0.1s;
}

.key:hover {
    filter: brightness(0.9);
}

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

.key.large {
    flex: 1.5;
    font-size: 0.9rem;
}

/* Modal */
.wordle-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.wordle-modal.active {
    display: flex;
}

.wordle-modal-content {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    position: relative;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close-modal-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: none; border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Toasts */
.wordle-toast {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2000;
}

.wordle-toast.show {
    opacity: 1;
}

@media (max-width: 400px) {
    .key {
        margin: 0 2px;
        height: 50px;
        font-size: 1rem;
    }
}
