/* ===== VARIÁVEIS E RESET ===== */
:root {
    --primary-color: #8B5CF6;
    --secondary-color: #A78BFA;
    --accent-color: #F59E0B;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --dark-color: #1F2937;
    --light-color: #F3F4F6;
    --white: #FFFFFF;
    
    --card-length: #3B82F6;
    --card-mass: #10B981;
    --card-time: #F59E0B;
    --card-force: #EF4444;
    --card-electric: #EC4899;
    --card-operation: #ffffff;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.4);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --font-main: 'Comic Neue', cursive;
    --font-title: 'Bangers', cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: var(--white);
    overflow-x: hidden;
}

/* ===== ANIMAÇÕES GLOBAIS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.5); }
    50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.8); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

/* ===== ESTRELAS DE FUNDO ===== */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, white, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent);
    background-size: 350px 200px;
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

/* ===== TELAS ===== */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

/* ===== TELA INICIAL ===== */
#start-screen {
    justify-content: center;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.game-logo {
    font-family: var(--font-title);
    font-size: 4rem;
    color: var(--white);
    text-shadow: 
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 40px var(--primary-color);
    letter-spacing: 4px;
    animation: float 3s ease-in-out infinite;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-top: 15px;
    font-weight: 700;
}

.start-menu {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    max-width: 500px;
}

/* ===== SELEÇÃO DE SÉRIE ===== */
.series-select {
    margin-bottom: 24px;
}

.series-select h3 {
    text-align: center;
    margin-bottom: 16px;
    color: var(--accent-color);
}

.series-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.series-btn {
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.series-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.series-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    animation: glow 2s ease-in-out infinite;
}

.series-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.series-name {
    font-size: 1.1rem;
    color: var(--white);
    font-weight: 700;
    font-family: var(--font-title);
}

.series-desc {
    font-size: 0.75rem;
    color: var(--light-color);
    text-align: center;
    opacity: 0.9;
}

.series-tag {
    font-size: 0.65rem;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    color: var(--white);
    font-weight: 600;
    margin-top: 4px;
}

.series-tag.new-tag {
    background: linear-gradient(135deg, var(--success-color), #059669);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== SELEÇÃO DE PERSONAGEM ===== */
.character-select h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.characters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.character-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.character-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}

.character-btn.selected {
    border-color: var(--accent-color);
    background: rgba(245, 158, 11, 0.2);
    animation: glow 2s ease-in-out infinite;
}

.char-emoji {
    font-size: 2.5rem;
}

.char-name {
    font-size: 0.8rem;
    color: var(--white);
    font-weight: 700;
}

/* ===== INPUTS ===== */
.player-name-input {
    margin-bottom: 24px;
}

.player-name-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--light-color);
}

.player-name-input input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.1);
    color: var(--white);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s;
}

.player-name-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.player-name-input input::placeholder {
    color: rgba(255,255,255,0.5);
}

/* ===== BOTÕES ===== */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-family: var(--font-main);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

.btn-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

/* ===== CRÉDITOS ===== */
.credits {
    position: fixed;
    bottom: 20px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.credits strong {
    color: var(--accent-color);
}

/* ===== TUTORIAL E SOBRE ===== */
.tutorial-container,
.about-container {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    margin-top: 40px;
}

.tutorial-container h2,
.about-container h2 {
    font-family: var(--font-title);
    color: var(--accent-color);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: 2px;
}

.tutorial-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tutorial-section h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.tutorial-section ol,
.tutorial-section ul {
    padding-left: 24px;
}

.tutorial-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.example-box {
    background: rgba(0,0,0,0.3);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    border-left: 4px solid var(--success-color);
}

.example-box .units {
    color: var(--success-color);
    font-family: monospace;
    margin-top: 8px;
}

.card-examples {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.card-example {
    text-align: center;
}

.mini-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 70px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.mini-card.length { background: var(--card-length); }
.mini-card.mass { background: var(--card-mass); }
.mini-card.time { background: var(--card-time); color: var(--dark-color); }
.mini-card.operation { background: var(--card-operation); color: #1a1a1a; border: 2px solid #333; }

.card-example p {
    font-size: 0.75rem;
    color: var(--light-color);
}

.authors {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 24px 0;
}

.author {
    text-align: center;
}

.author-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

/* ===== MAPA DE FASES ===== */
#map-screen {
    padding-top: 80px;
}

.map-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.player-stats {
    display: flex;
    gap: 20px;
    font-weight: 700;
}

.player-stats span {
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: var(--radius-full);
}

.map-container {
    width: 100%;
    max-width: 900px;
}

.map-container h2 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--accent-color);
    letter-spacing: 3px;
}

.level-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    padding: 20px;
}

.level-node {
    background: rgba(255,255,255,0.1);
    border: 3px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.level-node:hover:not(.locked) {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.2);
    box-shadow: var(--shadow-lg);
}

.level-node.completed {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.2);
}

.level-node.current {
    border-color: var(--accent-color);
    animation: glow 2s ease-in-out infinite;
}

.level-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-number {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 8px;
}

.level-title {
    font-size: 0.9rem;
    color: var(--light-color);
    margin-bottom: 8px;
}

.level-stars {
    font-size: 1.2rem;
    letter-spacing: 4px;
}

.level-node.locked .level-number::after {
    content: '🔒';
    display: block;
    font-size: 1.5rem;
    margin-top: 8px;
}

/* ===== TELA DE DESAFIO ===== */
#challenge-screen {
    padding-top: 70px;
}

.challenge-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.challenge-info {
    display: flex;
    gap: 20px;
    font-weight: 700;
}

.challenge-timer {
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

/* ===== PAINEL DE HISTÓRIA ===== */
.story-panel {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 30px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    max-width: 800px;
    width: 100%;
    margin: 20px auto;
    animation: fadeIn 0.5s ease;
}

.character-portrait {
    font-size: 4rem;
    background: rgba(255,255,255,0.1);
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

.story-content {
    flex: 1;
}

.story-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    min-height: 80px;
}

.btn-story {
    background: var(--accent-color);
    color: var(--dark-color);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-story:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

/* ===== PAINEL DO PROBLEMA ===== */
.problem-panel {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

.problem-box {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.problem-box h3 {
    color: var(--accent-color);
    margin-bottom: 12px;
}

.problem-text {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.target-unit {
    background: rgba(0,0,0,0.3);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    gap: 12px;
    align-items: center;
    border-left: 4px solid var(--primary-color);
}

.target-unit strong {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* ===== CONSTRUTOR DE FÓRMULA ===== */
.formula-builder {
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.formula-builder h4 {
    color: var(--light-color);
    margin-bottom: 16px;
}

.formula-area {
    min-height: 100px;
    background: rgba(0,0,0,0.3);
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.formula-area.drag-over {
    border-color: var(--accent-color);
    background: rgba(245, 158, 11, 0.1);
}

.formula-placeholder {
    color: rgba(255,255,255,0.4);
    font-style: italic;
}

.formula-result {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--light-color);
}

.formula-result strong {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-family: monospace;
}

/* ===== CARTAS ===== */
.game-card {
    width: 70px;
    height: 90px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    border: 2px solid rgba(255,255,255,0.2);
}

.game-card:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255,255,255,0.5);
}

.game-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.game-card.in-formula {
    cursor: pointer;
    width: 80px;
    height: 100px;
}

.game-card.in-formula:hover::after {
    content: '✕';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Cores por tipo de unidade */
.game-card.length { background: linear-gradient(135deg, #3B82F6, #1D4ED8); color: #1a1a1a; }
.game-card.mass { background: linear-gradient(135deg, #10B981, #059669); color: #1a1a1a; }
.game-card.time { background: linear-gradient(135deg, #F59E0B, #D97706); color: #1a1a1a; }
.game-card.electric { background: linear-gradient(135deg, #EC4899, #DB2777); color: #1a1a1a; }
.game-card.operation { background: linear-gradient(135deg, #ffffff, #e5e5e5); color: #1a1a1a; border: 2px solid #333; }
.game-card.operation .card-symbol { font-weight: 900; }
.game-card.number { background: linear-gradient(135deg, #8B5CF6, #7C3AED); color: #1a1a1a; }
.game-card.thermal { background: linear-gradient(135deg, #F97316, #EA580C); color: #1a1a1a; }

.card-symbol {
    font-size: 1.4rem;
    font-family: var(--font-title);
    letter-spacing: 2px;
    text-shadow: none;
}

.card-label {
    font-size: 0.55rem;
    margin-top: 2px;
    opacity: 0.9;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.card-description {
    display: none !important;
}

/* ===== DECK DE CARTAS - SISTEMA VISÍVEL COMPLETO ===== */
.deck-section {
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.deck-header {
    margin-bottom: 16px;
}

.deck-header h4 {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--accent-color);
    margin: 0;
}

.deck-subtitle {
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    font-weight: normal;
}

.deck-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.deck-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
}

.legend-item {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-item.length::before { content: ''; width: 12px; height: 12px; background: #3B82F6; border-radius: 3px; }
.legend-item.mass::before { content: ''; width: 12px; height: 12px; background: #10B981; border-radius: 3px; }
.legend-item.time::before { content: ''; width: 12px; height: 12px; background: #F59E0B; border-radius: 3px; }
.legend-item.electric::before { content: ''; width: 12px; height: 12px; background: #EC4899; border-radius: 3px; }
.legend-item.thermal::before { content: ''; width: 12px; height: 12px; background: #F97316; border-radius: 3px; }
.legend-item.operation::before { content: ''; width: 12px; height: 12px; background: #ffffff; border: 1px solid #333; border-radius: 3px; }

.btn-clear,
.btn-check {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear {
    background: rgba(255,255,255,0.1);
    color: white;
}

.btn-check {
    background: var(--success-color);
    color: white;
}

.btn-clear:hover,
.btn-check:hover {
    transform: scale(1.05);
}

.player-hand {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 110px;
    padding: 10px;
}

.player-hand.full-deck {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding: 12px;
    background: rgba(0,0,0,0.15);
    border-radius: var(--radius-md);
    border: 2px dashed rgba(255,255,255,0.2);
}

/* Botão de dica */
.btn-hint {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: var(--dark-color);
}

.btn-hint:hover {
    transform: scale(1.05);
}

.btn-hint.hidden {
    display: none;
}

/* Hint de clique */
.hint-click {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    font-weight: normal;
}

/* ===== DICA ===== */
.hint-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--white);
    color: var(--dark-color);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 300px;
    animation: fadeIn 0.5s ease;
    z-index: 200;
}

.close-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    color: var(--dark-color);
}

.close-hint:hover {
    opacity: 1;
}

.hint-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.hint-icon {
    font-size: 1.5rem;
}

/* ===== MODAIS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: fadeIn 0.3s ease;
}

.result-animation {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 1s ease-in-out infinite;
}

.result-content h2 {
    font-family: var(--font-title);
    font-size: 2rem;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.result-explanation {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    text-align: left;
    font-family: monospace;
    line-height: 1.8;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 24px 0;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--light-color);
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: var(--white);
    padding: 16px 32px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.info { border-left: 4px solid var(--primary-color); }

/* ===== CONFETTI ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== FLOATING ICONS ===== */
.floating-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.float-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.3;
    animation: floatRandom 15s ease-in-out infinite;
}

.float-icon:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.float-icon:nth-child(2) { top: 20%; right: 15%; animation-delay: 3s; }
.float-icon:nth-child(3) { bottom: 30%; left: 20%; animation-delay: 6s; }
.float-icon:nth-child(4) { bottom: 20%; right: 10%; animation-delay: 9s; }

@keyframes floatRandom {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(90deg); }
    50% { transform: translate(-10px, 20px) rotate(180deg); }
    75% { transform: translate(30px, 10px) rotate(270deg); }
}

.version-tag {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-top: 10px;
    background: rgba(139, 92, 246, 0.3);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.btn-glow {
    animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(16, 185, 129, 0.8); }
}

.secondary-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.secondary-buttons .btn-secondary {
    flex: 1;
    padding: 12px;
    font-size: 0.9rem;
}

/* ===== TELA DE BADGES ===== */
.badges-container {
    max-width: 800px;
    width: 100%;
    padding: 20px;
    text-align: center;
}

.badges-container h2 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px var(--accent-color);
}

.badges-progress {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 1.2rem;
}

.badges-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.badge-card {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.badge-card.earned {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(139, 92, 246, 0.2));
}

.badge-card.locked {
    opacity: 0.5;
}

.badge-card.earned:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.badge-icon-large {
    font-size: 3rem;
}

.badge-info {
    text-align: left;
}

.badge-info h3 {
    color: var(--accent-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.badge-info p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

/* ===== BADGE NOTIFICATION MODAL ===== */
.badge-notification {
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
}

.badge-notification-content {
    text-align: center;
    animation: badgePop 0.5s ease;
    position: relative;
}

@keyframes badgePop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.badge-notification-content .badge-icon-large {
    font-size: 6rem;
    display: block;
    margin-bottom: 20px;
    animation: float 2s ease-in-out infinite;
}

.badge-notification-content h2 {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.badge-notification-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.badge-notification-content p {
    color: rgba(255,255,255,0.8);
}

.badge-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseGlow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulseGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
}

/* ===== CERTIFICADO ===== */
.certificate-content {
    max-width: 700px;
    width: 95%;
    text-align: center;
}

.certificate-border {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 15px;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.certificate-inner {
    background: rgba(255,255,255,0.95);
    border-radius: var(--radius-md);
    padding: 40px 30px;
    color: #333;
}

.certificate-inner h1 {
    font-family: var(--font-title);
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 5px;
}

.certificate-inner h2 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: #764ba2;
    margin-bottom: 5px;
}

.cert-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

.cert-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #764ba2, transparent);
    margin: 20px 0;
}

.cert-text {
    color: #555;
    margin: 10px 0;
}

.cert-name {
    font-family: var(--font-title);
    font-size: 2rem;
    color: #667eea;
    margin: 15px 0;
}

.cert-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
}

.cert-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cert-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #764ba2;
}

.cert-stat-label {
    font-size: 0.85rem;
    color: #888;
}

.cert-date {
    font-style: italic;
    color: #888;
    margin-top: 20px;
}

.cert-authors {
    font-weight: 700;
    color: #764ba2;
    margin-top: 10px;
}

.cert-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.cert-buttons button {
    flex: 1;
    max-width: 200px;
}

/* ===== LEVEL MAP IMPROVEMENTS ===== */
.progress-text {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.level-node {
    position: relative;
}

.level-category {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.2rem;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-points {
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-top: 4px;
}

.level-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.5;
}

/* ===== CHALLENGE CONTEXT ===== */
.challenge-context {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-left: 10px;
}

/* ===== HINT BUTTON ===== */
.btn-hint {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent-color), #e67e00);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: var(--font-main);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-hint:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* ===== REAL EXAMPLE ===== */
.real-example {
    margin-top: 15px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success-color);
    font-size: 0.95rem;
}

/* ===== TEACHING POINT (Série Intermediária) ===== */
.teaching-point {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

#teaching-point {
    margin-top: 10px;
    padding: 10px 15px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--accent-color);
    font-style: italic;
}

/* ===== SERIES TITLE ===== */
#series-title {
    text-align: center;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-weight: 700;
}

/* ===== BOTÕES DE SAVE ===== */
.save-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.btn-save {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--light-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-save:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--primary-color);
    color: white;
}

/* ===== MODAL DE PERFIS ===== */
.profiles-content {
    max-width: 450px;
}

.modal-subtitle {
    color: var(--light-color);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.profiles-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 20px 0;
}

.no-profiles {
    text-align: center;
    color: var(--light-color);
    padding: 30px;
    font-style: italic;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.profile-item:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
}

.profile-item.current {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.15);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.profile-stats {
    font-size: 0.8rem;
    color: var(--light-color);
}

.profile-actions {
    display: flex;
    gap: 8px;
}

.profile-actions button {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.profile-actions .btn-load-profile:hover {
    background: var(--success-color);
}

.profile-actions .btn-delete-profile:hover {
    background: var(--danger-color);
}

/* ===== MODAL DE EXPORTAR/IMPORTAR ===== */
.export-content {
    max-width: 500px;
}

.export-section,
.import-section {
    margin: 20px 0;
    text-align: left;
}

.export-section label,
.import-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--light-color);
}

.export-section textarea,
.import-section textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: white;
    font-family: monospace;
    font-size: 0.8rem;
    resize: none;
}

.export-section textarea:focus,
.import-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-import {
    background: var(--success-color);
}

.btn-import:hover {
    background: #059669;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ===== HIDDEN ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .game-logo {
        font-size: 2.5rem;
    }
    
    .characters {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .char-emoji {
        font-size: 2rem;
    }
    
    .story-panel {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .character-portrait {
        width: 80px;
        height: 80px;
        font-size: 3rem;
    }
    
    .game-card {
        width: 55px;
        height: 80px;
    }
    
    .card-symbol {
        font-size: 1.2rem;
    }
    
    .card-examples {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .deck-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .result-stats {
        gap: 15px;
    }
    
    .badges-list {
        grid-template-columns: 1fr;
    }
    
    .cert-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .cert-buttons {
        flex-direction: column;
    }
    
    .secondary-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .start-menu {
        padding: 24px;
    }
    
    .challenge-header {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    
    .game-card {
        width: 50px;
        height: 70px;
    }
    
    .card-symbol {
        font-size: 1rem;
    }
    
    .card-label {
        display: none;
    }
    
    .hint-bubble {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .certificate-inner {
        padding: 25px 15px;
    }
    
    .certificate-inner h1 {
        font-size: 1.5rem;
    }
    
    .cert-name {
        font-size: 1.5rem;
    }
}

/* ===== SÉRIE INTERMEDIÁRIA: BOTÕES SIM/NÃO ===== */
.yesno-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 15px;
    width: 100%;
}

.yesno-instruction {
    font-size: 1.1rem;
    text-align: center;
    color: var(--white);
    margin-bottom: 5px;
}

.yesno-instruction strong {
    color: var(--accent-color);
}

.yesno-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.yesno-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 30px;
    border: 3px solid;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    font-family: var(--font-main);
}

.yesno-btn .yesno-icon {
    font-size: 1.8rem;
}

.yesno-btn .yesno-text {
    font-size: 1.4rem;
    font-weight: bold;
    font-family: var(--font-title);
    letter-spacing: 2px;
}

.yes-btn {
    background: linear-gradient(135deg, #10B981, #059669);
    border-color: #047857;
    color: white;
}

.yes-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.no-btn {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    border-color: #B91C1C;
    color: white;
}

.no-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* ===== HISTÓRIA INTERMEDIÁRIA ===== */
.intermediate-story {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

.intermediate-story p {
    margin: 8px 0;
    line-height: 1.5;
}

.intermediate-question {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-color);
}

.claimed-unit-badge {
    font-size: 1.8rem;
    font-family: var(--font-title);
    background: var(--accent-color);
    color: #1a1a1a;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: bold;
}

.question-text {
    font-size: 1.1rem;
    flex: 1;
}

/* ===== INSTRUÇÃO NO DECK ===== */
.hand-instruction {
    text-align: center;
    color: var(--light-color);
    opacity: 0.8;
    font-size: 0.9rem;
    margin-bottom: 10px;
    width: 100%;
}

.derived-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* ===== CARDS DE UNIDADES DERIVADAS ===== */
.game-card.derived-unit {
    cursor: pointer;
    transition: all 0.3s ease;
    border-width: 3px;
    border-style: solid;
    min-width: 70px;
    padding: 12px 8px;
}

.game-card.derived-unit:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.game-card.derived-unit .card-symbol {
    font-size: 1.4rem;
    font-weight: bold;
    font-family: var(--font-title);
    letter-spacing: 1px;
}

/* ===== CLAIMED UNIT DISPLAY ===== */
.claimed-unit-display {
    font-size: 1.1rem;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: inline-block;
}

.claimed-unit-display strong {
    color: var(--accent-color);
    font-size: 1.4rem;
    font-family: var(--font-title);
}

/* ===== RESPONSIVO PARA SIM/NÃO ===== */
@media (max-width: 600px) {
    .yesno-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .yesno-btn {
        padding: 20px 30px;
        min-width: 140px;
    }
    
    .yesno-btn .yesno-icon {
        font-size: 2rem;
    }
    
    .yesno-btn .yesno-text {
        font-size: 1.5rem;
    }
    
    .game-card.derived-unit {
        min-width: 65px;
        padding: 8px;
    }
    
    .game-card.derived-unit .card-symbol {
        font-size: 1rem;
    }
}