:root {
    /* Brand Colors */
    --primary: #7a1c1c;
    --primary-light: #a62a2a;
    --primary-tint: #fff1f2;
    --accent: #facc15;

    /* Semantic Colors */
    --success: #059669;
    --error: #dc2626;
    --warning-tint: #fffbeb;
    --warning-text: #92400e;

    /* SRS Button Colors */
    --srs-again: #e74c3c;
    --srs-hard: #e67e22;
    --srs-good: #2ecc71;
    --srs-easy: #3498db;

    /* Surfacing & Backgrounds */
    --bg-base: #f8fafc;
    --surface-100: #ffffff;
    --surface-200: #f1f5f9;
    --surface-hover: #f1f5f9;

    /* Text & Typography */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;

    /* Borders */
    --border-subtle: rgba(0, 0, 0, 0.05);
    --border-default: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);

    /* Shadows (Layered System) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-x: hidden;
    position: relative;
}

.main-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 2rem;
    background: var(--surface-100);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    position: sticky;
    top: 1rem;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-main {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s ease;
}

.logo-main:hover {
    transform: scale(1.02);
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.global-nav {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
}

.header-auth {
    display: flex;
    align-items: center;
}

.user-info-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.user-email-badge {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--surface-200);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid var(--border-subtle);
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1250px;
    /* Aumentado para comportar o layout de 3 colunas sem estourar */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 4rem;
}

.glass-panel {
    background: var(--surface-100);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
    margin-bottom: 2rem;
}

/* Mascot Removal - Positioned in Tutorial Modal now */


/* Checkbox Groups - Responsive Grid */
.grupos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    /* Aumentado para melhor alinhamento dos tópicos */
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.group-label {
    background: var(--surface-100);
    padding: 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s ease-out;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
    min-height: 120px;
    text-align: center;
}

.group-label:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.group-label.selected {
    background: var(--primary-tint);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 0.95rem;
    width: 100%;
}

.group-title {
    color: var(--text-primary);
}

.group-header input {
    accent-color: var(--primary-light);
    width: 1.2rem;
    height: 1.2rem;
}

.group-preview {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
    line-height: 1.4;
}

/* Mode Selection */
.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mode-category {
    background: var(--surface-200);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-out;
    box-shadow: var(--shadow-sm);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    min-height: auto;
    background: var(--surface-200);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    box-shadow: none;
}

.btn-difficulty {
    border: 2px solid transparent;
}

.btn-difficulty.selected {
    background: var(--primary-tint);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
    transform: none !important;
    box-shadow: none !important;
}

.btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--primary-light);
}

.btn-sm:not(:disabled):hover {
    background: var(--surface-100);
    border-color: var(--border-strong);
}

.btn span {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

/* Screens */
.screen {
    animation: fadeIn 0.5s ease-out;
    text-align: center;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem;
    background: var(--surface-200);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.score-correct {
    color: var(--success);
}

.score-wrong {
    color: var(--error);
}


.flash-stroke-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flash-stroke-item span {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.flash-stroke-item img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 3px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Question Area */
.question-card {
    text-align: center;
    margin-bottom: 2rem;
}

.romaji-display {
    font-size: clamp(4rem, 15vw, 8rem);
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 10px 20px rgba(122, 28, 28, 0.15);
}

.opcoes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.opcao {
    background: var(--surface-100);
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 2.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease-out;
    border: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    min-height: 100px;
}

.opcao:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.opcao.correct {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.opcao.disabled {
    cursor: default;
}

/* Flashcards */
.flashcard-container {
    perspective: 1200px;
    width: 100%;
    max-width: 450px;
    /* Evitar que fique enorme na horizontal */
    margin: 1.5rem auto 1.5rem auto;
    /* Centraliza e afasta do cabeçalho / SRS */
    height: clamp(320px, 60vh, 420px);
    overflow: visible;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Suporte Safari/Chrome legados */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 1rem;
    padding: 1.5rem;
    /* Reduzido de 2rem para ganhar espaço */
    background: var(--surface-100);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease-out;
    transform: rotateX(0deg);
    /* Força criação de contexto 3D */
}

.flashcard-back {
    transform: rotateY(180deg);
    background: var(--surface-100);
    /* Keep it consistent white for better GIF blending */
    padding: 1.5rem;
    /* Reduced padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center items instead of spreading them to edges */
    align-items: center;
    gap: 1rem;
    /* Reduced gap */
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.02);
}

.card-jp {
    font-size: clamp(3rem, 15vw, 6rem);
    /* Grande o suficiente para ser a âncora */
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    transition: font-size 0.3s ease;
}

/* Tamanho reduzido para quando o caractere está no verso junto com o GIF */
.flashcard-back .card-jp {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.card-romaji {
    font-size: clamp(1.25rem, 5vw, 2rem);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

.card-pt {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: var(--text-tertiary);
}

/* Integrated Flashcard Strokes */
.flash-stroke-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.flash-stroke-item {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flash-stroke-item img {
    width: 200px;
    /* Reduced further */
    height: auto;
    max-width: 100%;
    max-height: 25vh;
    /* More conservative height */
    display: block;
    object-fit: contain;
}

/* Builder Mode Layout */
.builder-target {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    min-height: 100px;
    margin-bottom: 2rem;
}

.drop-zone {
    width: 80px;
    height: 80px;
    border: 3px dashed #cbd5e1;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.drop-zone.drag-over {
    background: rgba(122, 28, 28, 0.1);
    border-color: var(--primary);
}

.srs-controls {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    width: 100%;
    padding: 0 1rem;
}

/* Botões do SRS (Estilo Memrise / Anki Moderno) */
.btn-srs-again,
.btn-srs-hard,
.btn-srs-good,
.btn-srs-easy {
    flex: 1;
    min-width: 70px;
    max-width: 120px;
    padding: 0.8rem 0.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-srs-again {
    background: var(--srs-again);
}

.btn-srs-hard {
    background: var(--srs-hard);
}

.btn-srs-good {
    background: var(--srs-good);
}

.btn-srs-easy {
    background: var(--srs-easy);
}

.srs-controls button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: var(--shadow-md);
}

.srs-controls button:active {
    transform: translateY(0);
}

.builder-sources {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

.tile {
    width: 75px;
    height: 75px;
    background: var(--surface-100);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    /* Alterado de grab para pointer */
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease-out;
}

.tile:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.builder-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 2rem;
    /* Espaçamento generoso para não colar nas opções */
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.03em;
    width: 100%;
}

/* Dica (Hint) System */
.quiz-question-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.btn-dica {
    background: #ffffff;
    border: 2px solid var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    padding: 0.4rem 1.2rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2rem;
    font-weight: 600;
}

.btn-dica:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.quiz-dica-box {
    background: var(--warning-tint);
    border-left: 4px solid var(--accent);
    padding: 1rem;
    margin: 0 auto 2rem auto;
    border-radius: 8px;
    font-size: 1.1rem;
    color: var(--warning-text);
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Global Buttons & Nav */
.nav-controls,
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-nav,
.btn-secondary {
    background: var(--surface-200);
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.15s ease-out;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.btn-nav:hover,
.btn-secondary:hover {
    background: var(--surface-100);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

/* Audio Question Card & Button */
#audio-question-card {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    background: var(--surface-200);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    margin-bottom: 2rem;
}

#btn-audio-repeat {
    display: flex;
    padding: 1.5rem;
    border-radius: 50%;
    width: 90px;
    height: 90px;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-default);
    background: var(--surface-100);
    cursor: pointer;
    transition: all 0.15s ease-out;
}

#btn-audio-repeat:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

#btn-audio-repeat span {
    font-size: 3rem;
}

.romaji-display {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary);
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popCorrect {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px var(--success);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shakeError {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.animate-correct {
    animation: popCorrect 0.4s ease-out;
}

.animate-error {
    animation: shakeError 0.3s ease-in-out;
}

.animate-bounce {
    animation: fadeIn 0.5s ease;
}

@media (max-width: 768px) {
    .main-header {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .header-branding {
        align-items: center;
    }

    .subtitle {
        text-align: center;
    }

    .user-info-box {
        align-items: center;
    }
}

@media (max-width: 600px) {
    .main-header {
        margin-bottom: 1.5rem;
        border-radius: 1rem;
    }

    .logo-main {
        max-width: 220px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .container {
        padding-bottom: 0.5rem;
    }

    .glass-panel {
        padding: 1rem 0.8rem;
        /* Reduzido verticalmente */
        border-radius: 1rem;
        margin-bottom: 0.5rem;
        /* Reduzido de 0.8rem */
    }

    .stats-bar {
        padding: 0.5rem;
        font-size: 0.75rem;
        gap: 0.3rem;
        margin-bottom: 0.5rem;
        /* Ultra-compact */
    }

    .question-card {
        margin-bottom: 0.5rem !important;
        /* Reduzido de 1rem */
        min-height: 100px !important;
        /* Mais baixo */
    }

    .romaji-display {
        font-size: 3.5rem !important;
        /* Reduzido de 5vw+ */
    }

    #btn-audio-repeat {
        width: 60px !important;
        height: 60px !important;
        padding: 0.8rem !important;
    }

    #btn-audio-repeat span {
        font-size: 1.8rem !important;
    }

    .opcoes {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        max-width: 100%;
    }

    .opcao {
        padding: 0.8rem 1rem;
        min-height: 75px;
        font-size: 1.8rem;
    }

    .btn {
        padding: 0.8rem;
        font-size: 1rem;
    }

    .controls {
        margin-top: 0.8rem;
    }

    /* Flashcard Scaling */
    .flashcard-container {
        height: clamp(250px, 45vh, 350px);
    }

    .flashcard-front,
    .flashcard-back {
        padding: 1rem;
    }

    .card-jp {
        font-size: 4rem !important;
    }

    .card-emoji {
        font-size: 3.5rem !important;
    }
}

/* Extra Tight Mobile */
@media (max-width: 380px) {
    .logo-main {
        max-width: 180px;
    }

    .glass-panel {
        padding: 1rem;
    }
}

/* Gojuon Table Styles */
.gojuon-table {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.gojuon-group {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}

.gojuon-group:last-child {
    border-bottom: none;
}

.gojuon-group:hover,
.gojuon-group:has(input:hover) {
    background: #f8fafc;
}

.gojuon-group.selected {
    background: var(--primary-tint);
}

.gojuon-checkbox-cell {
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #f1f5f9;
    flex-shrink: 0;
    background: #ffffff;
    padding: 10px 0;
}

.gojuon-checkbox-cell input {
    width: 1.5rem;
    height: 1.5rem;
    accent-color: var(--primary-light);
    cursor: pointer;
}

.gojuon-rows-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

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

.gojuon-row+.gojuon-row {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gojuon-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 70px;
}

.gojuon-cell:last-child {
    border-right: none;
}

.gojuon-char {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.gojuon-group.selected .gojuon-char {
    color: var(--primary-light);
}

.gojuon-romaji {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
    letter-spacing: 1px;
}

@media (max-width: 600px) {
    .gojuon-checkbox-cell {
        width: 40px;
    }

    .gojuon-checkbox-cell span {
        font-size: 0.6rem !important;
    }

    .gojuon-char {
        font-size: 1.6rem;
    }

    .gojuon-cell {
        padding: 8px 2px;
        min-height: 50px;
    }

    .gojuon-romaji {
        font-size: 0.75rem;
    }
}

/* Flashcards Section Integration */
.category-title-centered {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-banner {
    width: 100%;
    margin-bottom: 1.5rem;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    display: block;
    background: var(--surface-100);
    border: 1px solid var(--border-default);
    border-radius: 0.75rem;
}

.btn-flashcards-premium {
    background: var(--text-primary) !important;
    color: white !important;
    font-size: 1.25rem !important;
    padding: 1.5rem !important;
    box-shadow: var(--shadow-sm) !important;
    border: none !important;
    font-weight: 600 !important;
    border-radius: 0.75rem;
    width: 100%;
    transition: all 0.15s ease-out;
}

.btn-flashcards-premium .highlight-word {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.5rem;
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
}

.btn-flashcards-premium:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md) !important;
    background: black !important;
}

.btn-flashcards-premium:disabled {
    opacity: 0.5;
    background: var(--surface-100) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    border: 1px solid var(--border-default) !important;
}

.btn-flashcards-premium:disabled .highlight-word {
    color: var(--text-muted);
}

/* Tutorial Overlay & Mascot Modal */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.4s ease;
}

.tutorial-card {
    max-width: 500px;
    width: 90%;
    padding: 4rem 2rem 2.5rem;
    position: relative;
    text-align: center;
    border: none;
    border-top: 6px solid var(--primary-light);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 20px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    border-radius: 1.5rem;
}

.tutorial-btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1.2rem !important;
    font-size: 1.2rem !important;
    border-radius: 1rem !important;
}

@media (max-width: 500px) {
    .tutorial-card {
        padding: 2rem 1.2rem 1.5rem;
        /* Reduzido significativamente */
        border-radius: 1.5rem;
    }

    .tutorial-mascot-container {
        top: -65px;
        /* Mais baixo */
        width: 110px;
        /* Menor */
    }

    .tutorial-content h2 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .tutorial-content p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .tutorial-steps {
        margin-bottom: 1rem;
    }

    .tutorial-steps li {
        padding: 0.7rem;
        /* Mais compacto */
        font-size: 0.85rem;
        gap: 0.6rem;
        margin-bottom: 0.5rem;
    }

    .tutorial-btn {
        padding: 0.8rem !important;
        font-size: 1rem !important;
    }
}


.tutorial-mascot-container {
    position: absolute;
    top: -110px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
}

.tutorial-mascot {
    width: 100%;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.3));
}

.tutorial-content h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    font-weight: 800;
}

.tutorial-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.tutorial-steps {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.tutorial-steps li {
    padding: 1.2rem;
    background: var(--surface-200);
    border-radius: 1rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-left: 5px solid var(--accent);
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 1rem;
    line-height: 1.5;
    text-align: left;
}

.step-icon {
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
}

.step-text {
    flex: 1;
}

.step-text strong {
    color: var(--primary);
    font-weight: 800;
}


.bounce-anim {
    animation: bounceTutorial 2s infinite ease-in-out;
}

@keyframes bounceTutorial {

    0%,
    100% {
        transform: translateY(0);
    }


    50% {
        transform: translateY(-20px);
    }
}

/* --- Auth Modal (Modern & Clean) --- */
.auth-card {
    background: var(--surface-100);
    max-width: 420px;
    width: 90%;
    padding: 2.5rem 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    text-align: center;
    border: 1px solid var(--border-default);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.5rem;
    background: var(--surface-100);
    color: var(--text-primary);
    transition: all 0.2s;
    outline: none;
    font-family: inherit;
}

.auth-input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.1);
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-btn-primary {
    background: var(--primary);
    color: white;
    font-weight: 600;
    padding: 1rem;
    border-radius: 0.8rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-btn-primary:active {
    transform: scale(0.98);
}

.auth-btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.auth-btn-secondary {
    background: var(--surface-100);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-strong);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.auth-btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-secondary);
}

.auth-btn-secondary:active {
    transform: scale(0.98);
}

.auth-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.auth-link-small {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
}

.auth-link-small:hover {
    color: var(--text-secondary);
}

/* Home Layout Grid Desktop */
.home-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1200px) {
    .home-grid {
        display: grid;
        grid-template-columns: 2.0fr 0.6fr 340px;
        /* Col 1 ampliada, Col 2 reduzida */
        gap: 2.5rem;
        align-items: start;
    }

    /* Força 1 item por linha no vocabulário conforme solicitado */
    .home-col-vocab .grupos {
        grid-template-columns: 1fr !important;
    }

    /* Separa controles do vocabulário em duas linhas para maior clareza */
    .home-col-vocab .section-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .home-col-vocab .section-header-row .section-controls {
        width: 100%;
        justify-content: flex-start;
        display: flex;
        gap: 0.8rem;
        flex-direction: row;
        /* Mantém lado a lado na segunda linha */
        align-items: center;
    }

    .home-col-vocab .control-separator {
        display: block;
    }
}

@media (max-width: 600px) {
    .glass-panel {
        padding: 1.25rem 1rem;
    }

    .home-grid {
        gap: 1.25rem;
    }
}

/* Colunas Internas - Ritmo Vertical */
.home-col-chars,
.home-col-vocab,
.home-col-modes {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sistema de Fluxo Visual - Refinado (Crafted) */
.config-section {
    background: var(--surface-100);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.config-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.config-section .section-title {
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
}

/* Identificador sutil de passo (Opcional, minimalista) */
.section-title::before {
    content: attr(data-step);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    opacity: 0.6;
}

/* Removemos as classes .step-1..4 pesadas */
.step-1,
.step-2,
.step-3,
.step-4 {
    border-left: none;
}

.step-1 .step-badge,
.step-2 .step-badge,
.step-3 .step-badge,
.step-4 .step-badge {
    display: none;
}

/* Hub Principal (Dashboard) */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.hub-card {
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default);
    background: var(--surface-100);
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.hub-card:hover::before {
    transform: scaleX(1);
}

.hub-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.hub-card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.hub-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.hub-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.hub-card-link {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: auto;
}

.hub-welcome h1 {
    letter-spacing: -0.02em;
}

.srs-status-mini {
    animation: fadeIn 0.8s ease-out;
}

/* ── Custom Modal System ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.modal-overlay.visible {
    opacity: 1;
}

.modal-card {
    background: var(--surface-100);
    max-width: 400px;
    width: 90%;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-subtle);
    text-align: center;
    animation: modalSlideUp 0.25s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-btn-primary {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.8rem;
    letter-spacing: 0.02em;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.modal-actions .modal-btn-cancel,
.modal-actions .modal-btn-confirm {
    flex: 1;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.8rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-actions .modal-btn-cancel {
    background: var(--surface-200);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.modal-actions .modal-btn-cancel:hover {
    background: var(--surface-100);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.modal-actions .modal-btn-confirm {
    background: var(--primary);
    color: white;
}

.modal-btn-danger {
    background: var(--error) !important;
}

.modal-btn-danger:hover {
    background: #b91c1c !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.modal-toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.25s ease-out;
}

.modal-toast.visible {
    opacity: 1;
    transform: translateX(0);
}

.modal-toast-success {
    background: var(--success);
    color: white;
}

.modal-toast-error {
    background: var(--error);
    color: white;
}

.modal-toast-info {
    background: var(--text-primary);
    color: white;
}

.modal-toast-warning {
    background: var(--warning-text);
    color: white;
}

.toast-icon {
    display: none;
}

@media (max-width: 600px) {
    #toast-container {
        right: 0.75rem;
        left: 0.75rem;
    }

    .modal-toast {
        transform: translateY(-10px);
    }

    .modal-toast.visible {
        transform: translateY(0);
    }
}

/* Selection Controls - Premium Refinement */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 480px) {
    .section-header-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }

    .section-controls {
        width: 100%;
        justify-content: center;
        gap: 0.8rem;
    }

    .control-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}

.section-title-clean {
    margin-bottom: 0 !important;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.section-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.control-link {
    color: var(--primary);
    /* Mesma cor da Coluna 1 */
    opacity: 0.6;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}

.control-link:hover {
    opacity: 1;
    background: var(--primary-tint);
}

.control-separator {
    width: 1px;
    height: 12px;
    background: var(--border-strong);
    opacity: 0.3;
}


/* Taxonomy Help Card */
.edu-help-container {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
    width: 100%;
}

.edu-help-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: var(--surface-200);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.edu-help-trigger:hover {
    background: var(--surface-100);
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.edu-help-trigger i {
    font-size: 0.9rem;
    background: var(--primary);
    color: white;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-style: normal;
}

.edu-help-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.help-expanded .edu-help-content {
    max-height: 800px;
    opacity: 1;
    margin-top: -12px;
    /* Encaixa no bar */
    padding-top: 24px;
}

.help-inner-card {
    background: var(--surface-100);
    border: 1px solid var(--border-subtle);
    border-top: none;
    /* Remove borda do topo para parecer um painel aberto do bar */
    border-radius: 0 0 12px 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

.glossary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.glossary-term {
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
}

.glossary-def {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}


/* Fix Accordion Layout */
.taxonomy-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--surface-100);
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-trigger {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    cursor: pointer;
    background: var(--surface-200);
    user-select: none;
    transition: background 0.2s;
}

.accordion-trigger:hover {
    background: var(--surface-300);
}

.accordion-header-main {
    display: flex;
    align-items: center;
    flex: 1;
}

.accordion-title {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.accordion-local-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 1.5rem;
}

.accordion-local-controls .control-link {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.6;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: 0.05em;
}

.accordion-local-controls .control-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.accordion-icon {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.expanded .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.expanded .accordion-content {
    max-height: 2000px;
    padding: 1.2rem;
    opacity: 1;
    border-top: 1px solid var(--border-subtle);
}

/* Vocabulary Subtitles */
.category-taxonomy-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.7;
    margin-bottom: 0.4rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Flashcards Premium Button Highlight */
.btn-flashcards-premium {
    background: #0f172a !important;
    /* Slate 900 */
    color: white !important;
    border: 2px solid #334155 !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3) !important;
}

.btn-flashcards-premium .highlight-word {
    color: var(--accent);
    font-weight: 900;
}

.btn-flashcards-premium:hover:not(:disabled) {
    background: #1e293b !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.4) !important;
    border-color: var(--accent) !important;
}

.btn-flashcards-premium:active:not(:disabled) {
    transform: translateY(0) scale(1);
}

.btn-flashcards-premium::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: rotate(45deg);
    animation: premiumGlow 3s infinite;
}

@keyframes premiumGlow {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Flashcard Selection UI */
.flashcard-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.option-card {
    background: var(--surface-200);
    border: 1px dashed var(--border-subtle);
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    border-style: dashed;
}

.option-card:hover {
    transform: translateY(-2px);
    border-style: solid;
    border-color: var(--primary);
    background: var(--surface-300);
}

.option-card.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    filter: grayscale(1);
    pointer-events: none;
}

.option-icon {
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.05);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.option-content h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.option-content p {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.3;
}

.badge-mode {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.55rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: var(--primary);
    color: white;
    opacity: 0.8;
}

.mode-kana .option-icon {
    color: #3498db;
}

.mode-vocab .option-icon {
    color: #e67e22;
}

/* --- MOBILE OVERRIDES & NEW RESPONSIVE STYLES --- */

/* Flashcard Header and Counters */
.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    width: 100%;
    gap: 1rem;
}

.srs-counters {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 700;
    font-size: 0.85rem;
    background: var(--surface-200);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

.srs-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.srs-badge .dot {
    font-size: 0.75rem;
}

.badge-new {
    color: #3498db;
}

.badge-learning {
    color: #e74c3c;
}

.badge-review {
    color: #2ecc71;
}

.badge-known {
    color: #f39c12;
}

@media (max-width: 600px) {

    /* 2x2 Grid for SRS Action Buttons */
    .srs-controls {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.8rem !important;
        width: 100%;
        max-width: 400px;
        margin-top: 1rem;
        margin-left: auto;
        margin-right: auto;
    }

    .srs-controls button {
        margin: 0 !important;
        width: 100% !important;
        padding: 1rem 0.5rem !important;
        flex-direction: column;
        gap: 0.4rem;
        height: auto !important;
        max-width: none !important;
    }

    .srs-controls button .time-label {
        font-size: 0.75rem;
        opacity: 0.8;
        display: block;
        margin-top: 2px;
    }
}

@media (max-width: 540px) {
    .flashcard-header {
        flex-direction: column;
        gap: 0.8rem;
    }

    .srs-counters {
        width: 100%;
        justify-content: center;
        gap: 1.2rem;
        padding: 0.6rem;
    }

    .srs-badge .label {
        display: none;
    }

    .srs-badge {
        gap: 0.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .section-header-row {
        gap: 0.4rem;
        padding-bottom: 0.8rem;
    }

    .section-controls {
        gap: 0.6rem;
    }

    .control-link {
        padding: 0.5rem 0.7rem;
        background: var(--surface-200);
        border: 1px solid var(--border-subtle);
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}