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

:root {
    --primary: #b11019;
    --primary-dark: #860b12;
    --primary-gradient: linear-gradient(135deg, #b11019, #860b12);
    --bg: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --text: #2D3436;
    --text-light: #636E72;
    --border: #E9ECEF;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-lg: 24px;
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: linear-gradient(180deg, #FFF5F5 0%, #F8F9FA 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -webkit-user-select: none;
    user-select: none;
}

.app-wrapper {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

@media (min-width: 501px) {
    body {
        background: #F0F0F0;
        padding: 20px;
    }
    
    .app-wrapper {
        height: 90vh;
        height: 90dvh;
        max-height: 900px;
        border-radius: 40px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }
}

.logo img{
  width: 156px;
}

.barra{
        background: #ae1315;
    padding: 5px;
    color: #ffffff;
    font-weight: 700;
    border-radius: 14px;
    margin-top: 5px;
}

.screen {
        position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    background: var(--bg);
    padding: 10px;
}

.screen.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.screen-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 20px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 10px;
}

.header h1 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.header p {
        color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Profile Header - Estilo iOS */
.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.profile-header:active {
    transform: scale(0.98);
    background: #FFF5F5;
}

.avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(238, 90, 36, 0.3);
}

.avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-small {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(238, 90, 36, 0.3);
}

.avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-info {
    flex: 1;
}

.profile-info .name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.profile-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 3px;
    font-weight: 500;
}

/* Setup Form */
.setup-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.2px;
}

.input-group input {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 20px;
    font-size: 16px;
    color: var(--text);
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
    transform: translateY(-1px);
}

.input-group input::placeholder {
    color: #B2BEC3;
}

/* Character Selection - Estilo Stories */
.character-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    justify-items: center;
}

.character-option {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: var(--bg-secondary);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 2.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

.character-option::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.character-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.character-option:active {
    transform: scale(0.92);
}

.character-option.selected {
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(238, 90, 36, 0.3);
    transform: scale(1.08);
}

.character-option.selected::before {
    opacity: 1;
}

/* Profiles List */
.profiles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
}

.profile-item:active {
    background: #FFF5F5;
    transform: scale(0.98);
}

.profile-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.profile-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(238, 90, 36, 0.2);
}

.profile-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-item-info {
    flex: 1;
}

.profile-item-name {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.profile-item-date {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
}

.btn-delete-profile {
    background: none;
    border: none;
    color: #B2BEC3;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-profile:active {
    background: #FFE5E5;
    color: var(--primary);
    transform: scale(0.9);
}

/* Buttons - Estilo App */
.btn {
    padding: 16px 30px;
    border: none;
    border-radius: 20px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.2px;
    width: 100%;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn:active {
    transform: scale(0.97);
}

.btn:active::after {
    opacity: 1;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 8px 24px rgba(238, 90, 36, 0.25);
    font-weight: 700;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
   background: #ad0507;
    color: #ffffff;
    border: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 30px;
    line-height: 1.2;
}

.btn-danger {
    background: #FF4757;
    color: white;
    box-shadow: 0 8px 24px rgba(255, 71, 87, 0.25);
}

/* Subjects Grid */
.screen-body {
    flex: 1;
    margin: 16px 0;
}

.screen-body h2,
.screen-body h3 {
    margin-bottom: 20px;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.subject-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.subject-card:active {
    transform: scale(0.95);
}

.subject-card.selected {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(238, 90, 36, 0.25);
}

.subject-card.selected::before {
    opacity: 1;
}

.subject-card.selected .subject-name {
    color: white;
}

.subject-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.subject-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    position: relative;
    z-index: 1;
}

/* Difficulty Screen */
.back-button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 16px;
    text-align: left;
    margin-bottom: 16px;
    border-radius: 16px;
    transition: all 0.2s;
    width: fit-content;
}

.back-button:active {
    background: rgba(255, 107, 107, 0.1);
}

.subject-selected-info {
    text-align: center;
    margin: 24px 0;
}

.subject-icon-large {
    font-size: 4.5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 24px 0;
}

.difficulty-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.difficulty-card:active {
    transform: scale(0.98);
}

.difficulty-card.selected {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(238, 90, 36, 0.08));
    box-shadow: 0 8px 24px rgba(238, 90, 36, 0.15);
    transform: translateY(-2px);
}

.difficulty-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.difficulty-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.difficulty-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 16px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-info {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 600;
}

.game-score {
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 28px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.question-area {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.question-number {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 28px;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.option:active {
    transform: scale(0.98);
}

.option.selected {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.05);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.15);
}

.option-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(238, 90, 36, 0.3);
}

.option span:last-child {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.3;
    font-weight: 500;
}

/* Modals - Estilo iOS */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: flex-end;
    z-index: 2000;
}

.modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--bg-secondary);
    padding: 24px 20px calc(24px + var(--safe-bottom));
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    -webkit-overflow-scrolling: touch;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@media (min-width: 501px) {
    .modal {
        align-items: center;
    }
    
    .modal-content {
        border-radius: var(--radius-lg);
        max-height: 80vh;
        margin: 20px;
        animation: scaleIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    }
    
    @keyframes scaleIn {
        from {
            transform: scale(0.9);
            opacity: 0;
        }
        to {
            transform: scale(1);
            opacity: 1;
        }
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.result-emoji {
    font-size: 3rem;
    animation: bounce 0.6s ease;
}

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

.correct {
    color: #00B894;
}

.incorrect {
    color: #FF4757;
}

.explanation {
    background: #F8F9FA;
    padding: 18px;
    border-radius: var(--radius);
    margin: 18px 0;
    line-height: 1.6;
    border-left: 4px solid var(--primary);
    font-size: 0.92rem;
    font-weight: 500;
}

.score-display {
    text-align: center;
    margin: 18px 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.final-score {
    text-align: center;
    font-size: 1.4rem;
    margin: 18px 0;
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.motivational-message {
    text-align: center;
    font-size: 1.15rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 18px 0;
    font-weight: 700;
    line-height: 1.4;
}

.ranking {
    background: #F8F9FA;
    padding: 18px;
    border-radius: var(--radius);
    margin: 18px 0;
    font-size: 0.92rem;
}

.ranking ol {
    margin-left: 24px;
}

.ranking li {
    margin: 10px 0;
    font-weight: 500;
}

.profile-stats-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--border);
}

/* Estatísticas do Perfil */
.subject-stats-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

.subject-stats-header {
    padding: 18px;
    background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
    border-bottom: 2px solid var(--border);
}

.subject-stats-title {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.subject-stats-title h4 {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    color: var(--text);
    font-weight: 700;
}

.subject-stats-icon {
    font-size: 2.8rem;
    line-height: 1;
}

.subject-stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #F0F0F0;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
}

.stat-badge.best {
    background: linear-gradient(135deg, #FFF9E6, #FFF3CD);
    color: #856404;
}

/* Histórico de Jogos */
.games-history {
    padding: 16px;
}

.games-history-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-entry {
    background: #F8F9FA;
    border-radius: 14px;
    padding: 14px;
    transition: all 0.2s;
    border: 1px solid #E8E8E8;
}

.game-entry:active {
    background: #F0F0F0;
    transform: translateX(4px);
}

.game-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.game-number {
    font-weight: 700;
    font-size: 0.88rem;
    color: #333;
}

.game-difficulty {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.game-entry-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.game-score-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-score {
    font-size: 1.4rem;
    font-weight: 800;
}

.game-points {
    font-size: 0.82rem;
    color: #888;
    font-weight: 500;
}

.game-date {
    font-size: 0.78rem;
    color: #999;
}

.game-progress-bar {
    width: 100%;
    height: 4px;
    background: #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
}

.game-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Confirm Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

.confirm-modal.show {
    display: flex;
}

.confirm-modal-content {
    background: var(--bg-secondary);
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

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

.confirm-modal-content h3 {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 1.25rem;
    background: none;
    -webkit-text-fill-color: initial;
    font-weight: 700;
}

.confirm-modal-content p {
    margin-bottom: 24px;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal-actions .btn {
    width: auto;
    min-width: 120px;
    flex: 1;
}

/* Utility */
.mt-20 {
    margin-top: 20px;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .screen-content {
        padding: 16px 16px 0;
    }

    .header h1 {
       font-size: 1.5rem;
    }

    .character-select {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .character-option {
        width: 75px;
        height: 75px;
    }

    .subjects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .subject-card {
        padding: 14px 8px;
    }

    .subject-icon {
        font-size: 1.8rem;
    }

    .subject-name {
        font-size: 0.7rem;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .option {
        padding: 14px 16px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    .modal-content {
        padding: 20px 16px calc(20px + var(--safe-bottom));
    }
}

@media (max-width: 360px) {
    .character-option {
        width: 65px;
        height: 65px;
    }

    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .subject-card {
        padding: 12px 6px;
    }

    .subject-name {
        font-size: 0.68rem;
    }
}

/* Landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
    .screen-content {
        padding: 10px 16px 0;
    }

    .subjects-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .question-area {
        max-height: 200px;
    }
}

/* Utility para toasts */
@keyframes slideUpToast {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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