:root {
    --duo-green: #58cc02;
    --duo-green-dark: #46a302;
    --duo-blue: #1cb0f6;
    --duo-blue-dark: #1899d6;
    --duo-yellow: #ffc800;
    --duo-yellow-dark: #e5a400;
    --duo-white: #ffffff;
    --duo-gray: #afafaf;
    --duo-text: #4b4b4b;
    --duo-border: #e5e5e5;
    --radius: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.cats-logo-h {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.logo-big {
    width: 140px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.mascot-gif {
    width: 200px;
    height: auto;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.inverted {
    filter: invert(1);
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--duo-text);
    background-color: #f7f7f7;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--duo-white);
    position: relative;
}

@media (min-width: 601px) {
    #app {
        height: 90vh;
        border-radius: var(--radius);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        border: 2px solid var(--duo-border);
    }
}

header {
    padding: 10px 15px;
    border-bottom: 2px solid var(--duo-border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--duo-green);
}

.score-container {
    background: var(--duo-yellow);
    padding: 4px 10px;
    border-radius: 12px;
    border-bottom: 3px solid var(--duo-yellow-dark);
    font-weight: 900;
    font-size: 0.75rem;
    color: #fff;
    display: flex;
    gap: 4px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--duo-border);
    border-radius: 10px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background: var(--duo-green);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

section {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

section.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hero {
    text-align: center;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--duo-text);
    margin-bottom: 0.8rem;
}

p {
    font-size: 1rem;
    color: #777;
    line-height: 1.4;
    margin-bottom: 2rem;
}

.btn-duo {
    background: var(--duo-green);
    color: #fff;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 16px;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 0.8px;
    cursor: pointer;
    border-bottom: 5px solid var(--duo-green-dark);
    transition: transform 0.1s;
    width: 100%;
    max-width: 280px;
    text-decoration: none;
    text-align: center;
    display: block;
}

.btn-duo:active {
    transform: translateY(4px);
    border-bottom-width: 1px;
}

.btn-final {
    background: var(--duo-blue);
    border-bottom-color: var(--duo-blue-dark);
}

.game-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.game-header h2 {
    font-weight: 900;
    font-size: 1.2rem;
    margin: 0;
}

.game-header p {
    margin: 4px 0 0;
    font-size: 0.85rem;
}

/* Termo Grid */
.termo-grid {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 6px;
    margin: 0 auto 1.5rem;
    width: fit-content;
}

.termo-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.tile {
    width: 52px;
    height: 52px;
    border: 2px solid var(--duo-border);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    transition: transform 0.1s, border-color 0.2s;
}

@media (max-width: 400px) {
    .tile {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

.tile.pop {
    transform: scale(1.1);
    border-color: var(--duo-gray);
}

.keyboard {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 10px;
}

.kb-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.key {
    background: var(--duo-border);
    border: none;
    border-radius: 4px;
    padding: 14px 0;
    flex: 1;
    max-width: 40px;
    font-weight: 900;
    font-size: 0.75rem;
    cursor: pointer;
    border-bottom: 3px solid #ccc;
    text-align: center;
}

.key.wide {
    max-width: 65px;
    flex: 1.5;
    font-size: 0.65rem;
}

/* Animations */
@keyframes flip {
    0% {
        transform: rotateX(0);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0);
    }
}

.tile.flip {
    animation: flip 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.termo-row.shake {
    animation: shake 0.4s ease-in-out;
}

.tile.correct {
    background: var(--duo-green) !important;
    border-color: var(--duo-green-dark) !important;
    color: #fff;
    transition: background 0.3s 0.2s;
}

.tile.present {
    background: var(--duo-yellow) !important;
    border-color: var(--duo-yellow-dark) !important;
    color: #fff;
    transition: background 0.3s 0.2s;
}

.tile.absent {
    background: var(--duo-gray) !important;
    border-color: #999 !important;
    color: #fff;
    transition: background 0.3s 0.2s;
}

.key.correct {
    background: var(--duo-green) !important;
    color: #fff;
    border-bottom-color: var(--duo-green-dark) !important;
}

.key.present {
    background: var(--duo-yellow) !important;
    color: #fff;
    border-bottom-color: var(--duo-yellow-dark) !important;
}

.key.absent {
    background: var(--duo-gray) !important;
    color: #fff;
    border-bottom-color: #999 !important;
}

/* Quiz & Final */
.quiz-card {
    background: #fff;
    border: 2px solid var(--duo-border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.quiz-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 900;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    padding: 0.8rem;
    border: 2px solid var(--duo-border);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 4px solid var(--duo-border);
    font-size: 0.9rem;
}

.option:hover {
    background: #f8f8f8;
}

.option.correct {
    border-color: var(--duo-green);
    background: #e8f5e9;
    color: var(--duo-green-dark);
}

.option.wrong {
    border-color: #ff5252;
    background: #ffebee;
    color: #d32f2f;
}

footer {
    padding: 10px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--duo-gray);
    border-top: 1px solid var(--duo-border);
    font-weight: 600;
    margin-top: auto;
}

.final-score {
    font-size: 2rem;
    font-weight: 900;
    color: var(--duo-yellow-dark);
    margin: 0.5rem 0;
}