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

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: all 0.3s ease;
    font-weight: 400;
    letter-spacing: -0.01em;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Modo Escuro */
body.dark-theme {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #f1f5f9;
}

body.dark-theme .game-container {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #334155;
    color: #f1f5f9;
}

body.dark-theme header h1 {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-theme .subtitle {
    color: #cbd5e1;
    opacity: 0.9;
}

body.dark-theme .card {
    background: linear-gradient(145deg, #1e293b, #334155);
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-theme .card-title {
    color: #f1f5f9;
}

body.dark-theme .card-text {
    color: #cbd5e1;
}

body.dark-theme .power-bar {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #334155;
    color: #f1f5f9;
}

body.dark-theme .power-label {
    color: #f1f5f9;
    font-weight: 600;
}

body.dark-theme .power-value {
    color: #f1f5f9;
    font-weight: 700;
}

body.dark-theme .bar-container {
    background: #0f172a;
    border: 1px solid #334155;
}

body.dark-theme .decision-btn.left {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    color: #ffffff;
}

body.dark-theme .decision-btn.right {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    color: #ffffff;
}

body.dark-theme .decision-effects {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
}

body.dark-theme .stats-modal-content {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

body.dark-theme .stats-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: #ffffff;
}

body.dark-theme .stats-tabs {
    background: #1e293b;
    border-bottom-color: #334155;
}

body.dark-theme .stats-tab {
    color: #cbd5e1;
    font-weight: 500;
}

body.dark-theme .stats-tab:hover {
    background: #334155;
    color: #f1f5f9;
}

body.dark-theme .stats-tab.active {
    color: #60a5fa;
    background: #0f172a;
    border-bottom-color: #60a5fa;
    font-weight: 600;
}

body.dark-theme .stat-card {
    background: linear-gradient(145deg, #1e293b, #334155);
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-theme .stat-card h3 {
    color: #cbd5e1;
}

body.dark-theme .stat-value {
    color: #f1f5f9;
}

body.dark-theme .stat-label {
    color: #94a3b8;
}

body.dark-theme .power-stat-card {
    background: #1e293b;
    border-left-color: #60a5fa;
    color: #f1f5f9;
}

body.dark-theme .power-stat-name {
    color: #f1f5f9;
}

body.dark-theme .power-stat-item {
    background: #0f172a;
}

body.dark-theme .power-stat-item-value {
    color: #f1f5f9;
}

body.dark-theme .power-stat-item-label {
    color: #94a3b8;
}

body.dark-theme .achievement-card {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-theme .achievement-name {
    color: #f1f5f9;
}

body.dark-theme .achievement-description {
    color: #cbd5e1;
}

body.dark-theme .achievement-card.unlocked {
    background: linear-gradient(145deg, #451a03, #92400e);
    border-color: #f59e0b;
}

body.dark-theme .achievement-card.unlocked .achievement-name {
    color: #fbbf24;
}

body.dark-theme .history-item {
    background: #1e293b;
    color: #f1f5f9;
}

body.dark-theme .history-title {
    color: #f1f5f9;
}

body.dark-theme .history-details {
    color: #cbd5e1;
}

body.dark-theme .history-years {
    color: #60a5fa;
}

body.dark-theme .history-date {
    color: #94a3b8;
}

body.dark-theme .ranking-item {
    background: #1e293b;
    color: #f1f5f9;
}

body.dark-theme .ranking-score {
    color: #f1f5f9;
}

body.dark-theme .ranking-details {
    color: #cbd5e1;
}

body.dark-theme .game-over-modal .modal-content {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

body.dark-theme .turn-counter {
    color: #f1f5f9;
    font-weight: 600;
}

body.dark-theme .game-info {
    border-top-color: #334155;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-shadow: none;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    color: #64748b;
    font-size: 1.2em;
    font-weight: 500;
    font-style: normal;
    letter-spacing: -0.01em;
    opacity: 0.8;
}

.power-bars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.power-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.power-icon {
    font-size: 1.5em;
    width: 40px;
    text-align: center;
}

.power-label {
    font-weight: bold;
    color: #4a5568;
    min-width: 70px;
}

.bar-container {
    flex: 1;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 50%;
}

.bar-fill.religion {
    background: linear-gradient(90deg, #ffd700, #ffed4e);
}

.bar-fill.military {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

.bar-fill.economy {
    background: linear-gradient(90deg, #059669, #34d399);
}

.bar-fill.people {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.power-value {
    font-weight: bold;
    color: #4a5568;
    min-width: 30px;
    text-align: center;
}

.card-area {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 50%, #ffffff 100%);
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);
    text-align: center;
    max-width: 520px;
    width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.card:hover {
    transform: translateY(-5px);
}

.card-character {
    font-size: 4em;
    margin-bottom: 15px;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-text {
    font-size: 1.15em;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 25px;
    font-weight: 400;
    letter-spacing: -0.005em;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.decision-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.decision-btn {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.decision-btn.left {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.decision-btn.right {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 50%, #a8edea 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.decision-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.decision-btn:active {
    transform: translateY(0);
}

.decision-text {
    display: block;
    margin-bottom: 8px;
}

.decision-effects {
    font-size: 0.9em;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 8px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.game-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.theme-btn {
    padding: 10px;
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.theme-btn:hover {
    transform: translateY(-2px) rotate(15deg);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.theme-btn.light-mode {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
}

.audio-btn {
    padding: 10px;
    background: linear-gradient(145deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.audio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.audio-btn.muted {
    background: linear-gradient(145deg, #ef4444, #dc2626);
}

.audio-btn.muted::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 20px;
    background: white;
    transform: rotate(45deg);
}

.turn-counter {
    font-size: 1.2em;
    font-weight: bold;
    color: #4a5568;
}

.restart-btn {
    padding: 10px 20px;
    background: linear-gradient(145deg, #ed8936, #dd6b20);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #e53e3e;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal-content p {
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 1.1em;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .power-bars {
        grid-template-columns: 1fr;
    }
    
    .decision-buttons {
        flex-direction: column;
    }
    
    .game-container {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
}

/* Animações */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

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

.pulse {
    animation: pulse 0.6s ease-in-out;
}

/* Efeitos Visuais Avançados */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6); }
}

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

@keyframes slideInFromRight {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromLeft {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes fadeInUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes rotateIn {
    0% { transform: rotate(-180deg) scale(0); opacity: 0; }
    100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

/* Partículas de Fundo */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(odd) {
    animation-delay: -2s;
    animation-duration: 8s;
}

.particle:nth-child(even) {
    animation-delay: -4s;
    animation-duration: 10s;
}

/* Efeitos para Cartas */
.card-enter {
    animation: slideInFromRight 0.8s ease-out;
}

.card-exit {
    animation: slideInFromLeft 0.8s ease-out;
}

.card-special {
    position: relative;
    overflow: visible;
}

.card-special::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #fbbf24);
    border-radius: 25px;
    z-index: -1;
    animation: glow-pulse 2s ease-in-out infinite;
}

/* Efeitos para Barras de Poder */
.power-bar.critical {
    animation: heartbeat 1s ease-in-out infinite;
}

.power-bar.critical .bar-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626) !important;
    animation: glow-pulse 1s ease-in-out infinite;
}

.power-bar.excellent {
    position: relative;
}

.power-bar.excellent .bar-fill {
    background: linear-gradient(90deg, #10b981, #059669) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Efeitos para Botões */
.decision-btn.enhanced {
    position: relative;
    overflow: hidden;
}

.decision-btn.enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.decision-btn.enhanced:hover::before {
    left: 100%;
}

/* Sparkles para Conquistas */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    animation: sparkle 1.5s ease-in-out infinite;
}

.sparkle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 20%; right: 15%; animation-delay: 0.3s; }
.sparkle:nth-child(3) { bottom: 30%; left: 10%; animation-delay: 0.6s; }
.sparkle:nth-child(4) { bottom: 15%; right: 25%; animation-delay: 0.9s; }
.sparkle:nth-child(5) { top: 50%; left: 50%; animation-delay: 1.2s; }

/* Efeitos de Transição para Modais */
.modal-enter {
    animation: fadeInUp 0.5s ease-out;
}

.modal-exit {
    animation: fadeInUp 0.5s ease-out reverse;
}

/* Efeitos para Estatísticas */
.stat-card.animate {
    animation: rotateIn 0.6s ease-out;
}

.stat-value.counting {
    animation: pulse 0.3s ease-in-out;
}

/* Hover Effects Aprimorados */
.power-bar:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

.decision-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.stats-btn:hover {
    animation: glow-pulse 1s ease-in-out infinite;
}

/* Efeitos de Loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Efeitos para Ano/Contador */
.year-change {
    animation: pulse 0.5s ease-in-out, glow-pulse 0.5s ease-in-out;
}

/* Efeitos de Sucesso/Erro */
.success-flash {
    animation: pulse 0.3s ease-in-out;
    background: linear-gradient(145deg, #10b981, #059669) !important;
}

.error-flash {
    animation: shake 0.5s ease-in-out;
    background: linear-gradient(145deg, #ef4444, #dc2626) !important;
}

/* Efeitos para Game Over */
.game-over-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.3) 100%);
    pointer-events: none;
    z-index: 999;
    animation: fadeInUp 1s ease-out;
}

/* Sistema de Tooltips */
.tooltip {
    position: absolute;
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    max-width: 250px;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.4;
    text-align: center;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(30, 41, 59, 0.95);
}

body.dark-theme .tooltip {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .tooltip::before {
    border-bottom-color: rgba(15, 23, 42, 0.95);
}

/* Responsividade para Efeitos */
@media (max-width: 768px) {
    .particle {
        display: none; /* Desabilitar partículas em mobile para performance */
    }
    
    .decision-btn:hover {
        transform: none; /* Simplificar efeitos em mobile */
    }
    
    .power-bar:hover {
        transform: none;
    }
    
    .tooltip {
        font-size: 0.8em;
        max-width: 200px;
        padding: 10px 12px;
    }
}

/* Reduzir animações para usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particle {
        display: none;
    }
}

/* Rodapé do Desenvolvedor */
.dev-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px 0;
    text-align: center;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dev-footer p {
    margin: 0;
    color: #ffffff;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

body.dark-theme .dev-footer {
    background: rgba(15, 23, 42, 0.9);
    border-top-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .dev-footer {
        padding: 6px 0;
    }
    
    .dev-footer p {
        font-size: 0.7em;
    }
}

/* Estilos para o botão de estatísticas */
.stats-btn {
    padding: 10px 20px;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.stats-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Modal de Estatísticas */
.stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.stats-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    height: 80%;
    max-height: 700px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-header h2 {
    margin: 0;
    font-size: 1.8em;
}

.close-stats {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-stats:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Abas de Estatísticas */
.stats-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.stats-tab {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
    color: #64748b;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.stats-tab:hover {
    background: #e2e8f0;
    color: #475569;
}

.stats-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: white;
}

/* Conteúdo das Estatísticas */
.stats-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.stats-panel {
    display: none;
}

.stats-panel.active {
    display: block;
}

/* Grid de Estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    margin: 0 0 15px 0;
    color: #475569;
    font-size: 1.1em;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 10px;
}

.stat-label {
    color: #64748b;
    font-size: 0.9em;
}

/* Estatísticas por Poder */
.power-stats {
    margin-top: 30px;
}

.power-stats h3 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.power-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.power-stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.power-stat-card.religion {
    border-left-color: #fbbf24;
}

.power-stat-card.military {
    border-left-color: #ef4444;
}

.power-stat-card.economy {
    border-left-color: #10b981;
}

.power-stat-card.people {
    border-left-color: #8b5cf6;
}

.power-stat-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.power-stat-icon {
    font-size: 1.5em;
    margin-right: 10px;
}

.power-stat-name {
    font-weight: bold;
    color: #1e293b;
}

.power-stat-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.power-stat-item {
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
}

.power-stat-item-value {
    font-weight: bold;
    color: #1e293b;
    font-size: 1.1em;
}

.power-stat-item-label {
    font-size: 0.8em;
    color: #64748b;
    margin-top: 2px;
}

/* Lista de Histórico */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3b82f6;
}

.history-item.best {
    border-left-color: #fbbf24;
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
}

.history-info {
    flex: 1;
}

.history-title {
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 5px;
}

.history-details {
    color: #64748b;
    font-size: 0.9em;
}

.history-score {
    text-align: right;
}

.history-years {
    font-size: 1.5em;
    font-weight: bold;
    color: #3b82f6;
}

.history-date {
    font-size: 0.8em;
    color: #64748b;
    margin-top: 5px;
}

/* Lista de Ranking */
.ranking-list {
    max-height: 400px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ranking-position {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    margin-right: 15px;
}

.ranking-position.gold {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
}

.ranking-position.silver {
    background: linear-gradient(145deg, #94a3b8, #64748b);
}

.ranking-position.bronze {
    background: linear-gradient(145deg, #f97316, #ea580c);
}

.ranking-position.other {
    background: linear-gradient(145deg, #6b7280, #4b5563);
}

.ranking-info {
    flex: 1;
}

.ranking-score {
    font-size: 1.2em;
    font-weight: bold;
    color: #1e293b;
}

.ranking-details {
    color: #64748b;
    font-size: 0.9em;
    margin-top: 2px;
}

/* Gráficos */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    height: 400px;
}

.chart-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.chart-btn {
    padding: 10px 20px;
    border: 2px solid #3b82f6;
    background: white;
    color: #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.chart-btn:hover,
.chart-btn.active {
    background: #3b82f6;
    color: white;
}

/* Sistema de Conquistas */
.achievements-summary {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.achievement-counter {
    text-align: center;
    min-width: 120px;
}

.achievement-count {
    font-size: 2.5em;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.achievement-total {
    font-size: 1.2em;
    color: #64748b;
    font-weight: bold;
}

.achievement-label {
    color: #475569;
    font-weight: bold;
    margin-top: 5px;
}

.achievement-progress {
    flex: 1;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 10px;
    transition: width 0.8s ease;
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    color: #64748b;
    font-weight: bold;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.achievement-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.unlocked {
    border-color: #fbbf24;
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.2);
}

.achievement-card.locked {
    opacity: 0.6;
    background: #f8fafc;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #fbbf24);
    border-radius: 15px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-card.unlocked::before {
    opacity: 1;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.achievement-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.achievement-icon {
    font-size: 2.5em;
    margin-right: 15px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.achievement-card.unlocked .achievement-icon {
    filter: none;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: bold;
    color: #1e293b;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.achievement-card.unlocked .achievement-name {
    color: #92400e;
}

.achievement-description {
    color: #64748b;
    font-size: 0.9em;
    line-height: 1.4;
}

.achievement-rarity {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
}

.achievement-rarity.common {
    background: #e2e8f0;
    color: #475569;
}

.achievement-rarity.rare {
    background: #dbeafe;
    color: #1d4ed8;
}

.achievement-rarity.epic {
    background: #ede9fe;
    color: #7c3aed;
}

.achievement-rarity.legendary {
    background: #fef3c7;
    color: #92400e;
}

.achievement-date {
    margin-top: 10px;
    font-size: 0.8em;
    color: #64748b;
    text-align: right;
}

.achievement-card.unlocked .achievement-date {
    color: #92400e;
}

/* Notificação de Conquista */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.5s ease;
    max-width: 300px;
}

.achievement-notification.show {
    transform: translateX(0);
}

.achievement-notification-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.achievement-notification-icon {
    font-size: 2em;
    margin-right: 10px;
}

.achievement-notification-title {
    font-weight: bold;
    font-size: 1.1em;
}

.achievement-notification-description {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Responsividade para Estatísticas */
@media (max-width: 768px) {
    .stats-modal-content {
        width: 95%;
        height: 90%;
    }
    
    .stats-tabs {
        flex-wrap: wrap;
    }
    
    .stats-tab {
        flex: 1 1 50%;
        min-width: 120px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .power-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .chart-controls {
        flex-wrap: wrap;
    }
    
    .achievements-summary {
        flex-direction: column;
        gap: 15px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .achievement-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .achievement-notification.show {
        transform: translateY(0);
    }
}