/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #1e3799 0%, #0c2461 100%);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== MENU PRINCIPAL ===== */
.main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1e3799 0%, #0c2461 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: menuFadeIn 0.5s ease-in-out;
}

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

.menu-content {
    text-align: center;
    animation: menuSlideUp 0.6s ease-out;
}

@keyframes menuSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Logo do Jogo (Menu Principal) */
.game-logo {
    max-width: 80%;
    width: 600px;
    height: auto;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease-out;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

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

.menu-logo {
    font-size: 4.5rem;
    color: white;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    animation: bounce 2s infinite;
}

.menu-subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 60px;
    font-weight: 300;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.lang-switcher-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    font-size: 0.95rem;
    margin-right: 4px;
}

.lang-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: 22rem;
}

.lang-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(12, 36, 97, 0.45);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.lang-picker-btn:hover {
    background: rgba(12, 36, 97, 0.75);
    border-color: rgba(255, 255, 255, 0.65);
}

.lang-picker-btn.is-active,
.lang-picker-btn[aria-pressed="true"] {
    background: rgba(0, 184, 148, 0.35);
    border-color: #55efc4;
    transform: translateY(-1px);
}

.lang-picker-btn .lang-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    display: block;
}

.lang-select {
    min-width: 148px;
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    background: rgba(12, 36, 97, 0.55);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
}

.lang-select option {
    color: #0c2461;
    background: #fff;
}

.lang-btn {
    min-width: 40px;
    padding: 6px 10px;
    font-size: 0.9rem;
    font-weight: 800;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    background: rgba(12, 36, 97, 0.45);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, background 0.15s ease;
}

.lang-btn:hover {
    transform: translateY(-2px);
    background: rgba(12, 36, 97, 0.7);
}

.lang-btn[aria-pressed="true"] {
    background: #ffeaa7;
    color: #0c2461;
    border-color: #fdcb6e;
}

.menu-btn {
    width: 320px;
    padding: 20px 40px;
    font-size: 1.4rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.menu-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
}

.menu-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.menu-btn-primary {
    background: linear-gradient(135deg, #55efc4, #00b894);
    color: white;
    font-size: 1.6rem;
}

.menu-btn-primary:hover {
    background: linear-gradient(135deg, #00b894, #55efc4);
}

.menu-btn-secondary {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.menu-btn-secondary:hover {
    background: linear-gradient(135deg, #0984e3, #74b9ff);
}

.menu-btn-exit {
    background: linear-gradient(135deg, #ff7675, #d63031);
    color: white;
    font-size: 1.2rem;
    padding: 15px 40px;
    margin-top: 20px;
}

.menu-btn-exit:hover {
    background: linear-gradient(135deg, #d63031, #ff7675);
}

.menu-footer {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    margin-top: 30px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== CONTAINER DO JOGO ===== */
.container {
    display: none; /* Oculto por padrão, mostrado ao iniciar jogo */
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 100vh;
    max-width: 100vw;
    text-align: center;
    overflow: hidden;
    
    /* Flexbox Vertical - Core Layout */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ===== HUD (PLACAR) - TOPO ===== */
.hud {
    flex-shrink: 0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0 0 20px 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo do HUD */
.hud-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.hud-logo:hover {
    transform: scale(1.05);
}

/* IDEA-G14: layout ativo (lab multi-idioma) */
.layout-badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(12, 36, 97, 0.88);
    color: #ffeaa7;
    border: 1px solid rgba(255, 234, 167, 0.45);
    user-select: none;
    line-height: 1;
}

/* Botões do HUD */
.hud-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Botão Ver Ranking */
.ranking-button {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-family: inherit;
}

.ranking-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #ffed4e, #ffd700);
}

.ranking-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Botão de Encerrar Jogo */
.end-game-button {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: bold;
    background: linear-gradient(135deg, #e17055, #d63031);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-family: inherit;
}

.end-game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ff7675, #e17055);
}

.end-game-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Título antigo (removido, agora usa logo) */
/* .title {
    font-size: 2rem;
    color: #ff6b9d;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    animation: bounce 1s ease-in-out infinite alternate;
} */

@keyframes bounce {
    from {
        transform: translateY(0px);
    }
    to {
        transform: translateY(-5px);
    }
}

.stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 0;
}

.stat-box {
    background: linear-gradient(135deg, #74b9ff 0%, #a29bfe 100%);
    border-radius: 10px;
    padding: 8px 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    min-width: 100px;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: white;
    font-weight: bold;
    margin-bottom: 3px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    transition: color 0.3s ease; /* ✅ Transição suave para mudanças de cor WPM */
}

/* ===== WPM STAT (v1.1.0) ===== */
.wpm-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.wpm-stat .stat-emoji {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
    display: inline-block;
}

.wpm-stat .stat-unit {
    font-size: 0.7rem;
    opacity: 0.9;
    text-transform: uppercase;
    color: white;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ===== ÁREA DE JOGO (CENTRO EXPANSÍVEL) ===== */
.game-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    overflow: hidden;
    min-height: 0;
}

.instruction {
    margin-bottom: 5px;
}

.instruction p {
    font-size: 1.1rem;
    color: #6c5ce7;
    font-weight: bold;
}

/* Imagem da palavra (Alfabetização) - Tamanho relativo à altura */
#word-image {
    max-height: 18vh;
    max-width: 90%;
    height: auto;
    border-radius: 12px;
    margin: 8px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 3px solid #fff;
    animation: fadeIn 0.4s ease-in-out;
    display: block;
    object-fit: contain;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.letter-display {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 15px;
    padding: 20px 30px;
    margin: 8px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.letter {
    font-size: 5rem;
    font-weight: bold;
    color: #e74c3c;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    animation: pulse 2s ease-in-out infinite;
    line-height: 1;
}

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

.feedback {
    margin-top: 8px;
}

.feedback p {
    font-size: 1rem;
    color: #636e72;
    font-weight: 600;
}

/* Animações para feedback positivo */
.success {
    animation: successPulse 0.5s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    }
    50% {
        transform: scale(1.1);
        background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
    }
    100% {
        transform: scale(1);
        background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    }
}

/* ===== TECLADO E MÃOS (BASE FIXA) ===== */
.keyboard-hands-section {
    flex-shrink: 0;
    padding: 10px 15px 15px 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px 20px 0 0;
    max-height: 40vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== TECLADO VIRTUAL ===== */
.keyboard {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.keyboard .row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: nowrap;
}

.keyboard .row:last-child {
    margin-bottom: 0;
}

.key {
    min-width: 36px;
    width: 36px;
    height: 38px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border: 2px solid #d1d1d1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: #2d3436;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    user-select: none;
    flex-shrink: 0;
}

.key:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.key:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Barra de Espaço */
.space-bar {
    min-width: 180px;
    max-width: 350px;
    width: 45%;
    font-size: 0.75rem;
    letter-spacing: 1px;
    flex-grow: 1;
}

/* Estado Ativo da Tecla */
.key.active {
    background: linear-gradient(145deg, #55efc4, #00b894);
    border-color: #00b894;
    color: white;
    transform: translateY(1px) scale(1.05);
    box-shadow: 
        0 0 20px rgba(0, 184, 148, 0.6),
        0 0 40px rgba(0, 184, 148, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: keyGlow 0.5s ease-in-out;
}

@keyframes keyGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(0, 184, 148, 0.6),
            0 0 40px rgba(0, 184, 148, 0.4),
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(0, 184, 148, 0.8),
            0 0 60px rgba(0, 184, 148, 0.6),
            inset 0 1px 2px rgba(255, 255, 255, 0.5);
    }
}

/* ===== MÃOS GUIAS ===== */
.hands-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
    padding: 5px 10px;
    max-height: 120px;
}

.hand-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hand-label {
    font-size: 0.75rem;
    color: #6c5ce7;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hand {
    width: 100%;
    max-width: 120px;
    max-height: 100px;
    height: auto;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.hand:hover {
    transform: scale(1.03);
}

/* Dedos */
.finger {
    transition: all 0.3s ease;
    cursor: pointer;
}

.finger:hover {
    fill: #ffd7a8;
    stroke: #ff9f43;
    stroke-width: 3;
}

/* Estado Ativo do Dedo */
.finger-active {
    fill: #ff6348 !important;
    stroke: #e84118 !important;
    stroke-width: 4 !important;
    filter: drop-shadow(0 0 8px rgba(255, 99, 72, 0.8));
    animation: fingerPulse 0.6s ease-in-out;
}

@keyframes fingerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Responsividade para telas menores */
@media (max-width: 900px) {
    .title {
        font-size: 1.5rem;
    }
    
    /* Logo responsivo */
    .game-logo {
        max-width: 90%;
        width: 400px;
    }
    
    .hud-logo {
        height: 40px;
    }

    .key {
        min-width: 30px;
        width: 30px;
        height: 32px;
        font-size: 0.85rem;
    }

    .keyboard .row {
        gap: 3px;
        margin-bottom: 3px;
    }

    .space-bar {
        min-width: 120px;
        width: 50%;
        font-size: 0.65rem;
    }

    .letter {
        font-size: 3.5rem;
    }

    #word-image {
        max-height: 15vh;
    }

    .hand {
        max-width: 90px;
        max-height: 80px;
    }

    .hand-label {
        font-size: 0.65rem;
    }
}

/* Telas muito pequenas (altura) */
@media (max-height: 700px) {
    .title {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }
    
    /* Logo responsivo para telas baixas */
    .game-logo {
        max-width: 70%;
        width: 350px;
        margin-bottom: 10px;
    }
    
    .hud-logo {
        height: 35px;
    }

    .stat-box {
        padding: 5px 15px;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .letter {
        font-size: 3rem;
    }

    .letter-display {
        padding: 15px 20px;
        min-height: 80px;
    }

    #word-image {
        max-height: 12vh;
    }

    .keyboard-hands-section {
        max-height: 35vh;
    }

    .key {
        min-width: 28px;
        width: 28px;
        height: 30px;
        font-size: 0.75rem;
    }

    .hands-container {
        max-height: 90px;
    }

    .hand {
        max-width: 80px;
        max-height: 70px;
    }
    
    /* ✅ WPM Display responsivo (v1.1.0) */
    .wpm-stat .stat-emoji {
        font-size: 1.2rem;
    }
    
    .wpm-stat .stat-unit {
        font-size: 0.6rem;
    }
    
    .session-stats .wpm-value {
        font-size: 1.5rem;
    }
    
    .session-stats .wpm-emoji {
        font-size: 1.5rem;
    }
}

/* ===== MODAL DE RANKING ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    padding: 40px;
    max-width: 720px;
    width: 94%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.4s ease-out;
    position: relative;
}

.ranking-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 1rem;
    justify-content: center;
}

.ranking-tab {
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.ranking-tab.active {
    background: #ffd700;
    color: #2d3436;
}

.online-hint {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.online-auth-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 700px) {
    .online-auth-forms { grid-template-columns: 1fr; }
}

.online-form {
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 0.75rem;
}

.online-form h4 { margin: 0 0 0.5rem; color: #ffeaa7; }
.online-form input,
.online-select {
    width: 100%;
    margin: 0.25rem 0;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.95);
}

.online-check {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    font-size: 0.8rem;
    color: #fff;
    margin: 0.35rem 0;
}

.menu-btn-account {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: #06261e;
    border: 3px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.45);
    animation: account-pulse 2.4s ease-in-out infinite;
}

.menu-btn-account:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
}

@keyframes account-pulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(0, 184, 148, 0.35); }
    50% { box-shadow: 0 8px 28px rgba(0, 206, 201, 0.55); }
}

.lang-improve-wrap {
    margin: 0.75rem 0 0;
    text-align: center;
}

.lang-improve-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffeaa7;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lang-improve-link:hover {
    color: #fff;
}

.menu-account-chip {
    margin: 0.75rem auto 0;
    max-width: 360px;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f5f6fa;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.online-rank-badge {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #2d3436;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    animation: badge-in 0.4s ease-out;
}

@keyframes badge-in {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.season-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #fff;
    font-size: 0.9rem;
}

.period-toggle { display: flex; gap: 0.3rem; }

.period-btn {
    border: 0;
    border-radius: 8px;
    padding: 0.3rem 0.65rem;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.period-btn.active {
    background: #ffeaa7;
    color: #2d3436;
}

.ranking-tab-account {
    background: rgba(0, 184, 148, 0.35) !important;
    border: 1px solid rgba(0, 184, 148, 0.6);
}

.ranking-tab-account.active {
    background: #00b894 !important;
    color: #06261e !important;
}

.auth-mode-toggle {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.auth-mode-btn {
    flex: 1;
    border: 0;
    border-radius: 10px;
    padding: 0.55rem;
    font-weight: 800;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.auth-mode-btn.active {
    background: #ffeaa7;
    color: #2d3436;
}

.online-form-wide { max-width: 100%; }
.btn-block { width: 100%; margin-top: 0.5rem; }
.online-hint-strong { font-size: 0.95rem; }

.captcha-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem;
    align-items: end;
    margin: 0.35rem 0;
}

.captcha-row .online-label { grid-column: 1 / -1; margin: 0; }
.captcha-row input { margin: 0; }

.inline-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.inline-row input { flex: 1; min-width: 140px; }

.panel-soft {
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 0.75rem;
    margin: 0.75rem 0;
}

.panel-soft h4 { margin: 0 0 0.35rem; color: #ffeaa7; }

.online-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    z-index: 10001;
    background: #00b894;
    color: #06261e;
    font-weight: 800;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    animation: toast-in 0.35s ease-out;
}

.online-toast.error { background: #e17055; color: #fff; }

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.btn-submit-ok {
    background: #00b894 !important;
    animation: score-pop 0.45s ease;
}

@keyframes score-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-title {
    font-size: 2.5rem;
    color: #ffd700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: bounce 1s ease-in-out infinite alternate;
}

.final-score {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-bottom: 25px;
}

.score-label {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 10px;
}

.score-value {
    font-size: 3.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===== ESTATÍSTICAS DE WPM NO MODAL (v1.1.0) ===== */
.session-stats {
    margin: 15px 0 20px 0;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    text-align: center;
}

.session-stats .wpm-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.session-stats .wpm-label {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

.session-stats .wpm-value {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
}

.session-stats .wpm-emoji {
    font-size: 2rem;
    animation: bounce 1s ease-in-out infinite;
}

.session-stats .wpm-classification {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    margin-top: 5px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.name-input-section {
    margin-bottom: 25px;
    text-align: center;
}

.name-input-section label {
    display: block;
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 10px;
    font-weight: bold;
}

.name-input-section input {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    font-size: 1.2rem;
    border: 3px solid #ffd700;
    border-radius: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-weight: bold;
    transition: all 0.3s ease;
}

.name-input-section input:focus {
    outline: none;
    border-color: #00b894;
    box-shadow: 0 0 20px rgba(0, 184, 148, 0.6);
    transform: scale(1.05);
}

.ranking-list {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.ranking-list h3 {
    font-size: 1.5rem;
    color: #ffd700;
    text-align: center;
    margin-bottom: 15px;
}

#ranking-table {
    width: 100%;
    border-collapse: collapse;
}

#ranking-table th {
    background: rgba(255, 215, 0, 0.3);
    color: #fff;
    padding: 10px;
    font-size: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

#ranking-table td {
    padding: 12px 10px;
    text-align: center;
    color: #fff;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#ranking-table tr:hover td {
    background: rgba(255, 255, 255, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #fdcb6e, #fd79a8);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* ===== ANIMAÇÕES DE PONTUAÇÃO ===== */
.score-pop-up {
    animation: scorePop 0.6s ease-out;
}

@keyframes scorePop {
    0% {
        transform: scale(1);
        color: #fff;
    }
    50% {
        transform: scale(1.3);
        color: #00b894;
    }
    100% {
        transform: scale(1);
        color: #fff;
    }
}

.score-shake {
    animation: scoreShake 0.5s ease-out;
}

@keyframes scoreShake {
    0%, 100% {
        transform: translateX(0);
        color: #fff;
    }
    25% {
        transform: translateX(-10px);
        color: #e74c3c;
    }
    50% {
        transform: translateX(10px);
    }
    75% {
        transform: translateX(-5px);
    }
}
