/* Custom Design System for Jogo da Catarina */
:root {
    --bg-dark: #0f141c;
    --bg-card: rgba(30, 39, 51, 0.65);
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --gold-dim: #aa8c2c;
    --emerald: #09d3ac;
    --ruby: #f25c54;
    --text-light: #f4f6f9;
    --text-muted: #a0aec0;
    --font-fancy: 'Cinzel', serif;
    --font-sans: 'Outfit', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background effects */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    z-index: 1;
    pointer-events: none;
    animation: pulse 12s infinite alternate ease-in-out;
}

#orb-1 {
    width: 400px;
    height: 400px;
    background-color: var(--gold);
    top: -100px;
    left: -100px;
}

#orb-2 {
    width: 500px;
    height: 500px;
    background-color: var(--emerald);
    bottom: -150px;
    right: -150px;
    animation-delay: -6s;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.3) translate(50px, 50px); }
}

/* Container */
.container {
    width: 100%;
    max-width: 680px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    position: relative;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
}

.game-title {
    font-family: var(--font-fancy);
    font-size: 2.5rem;
    font-weight: 700;
    color: transparent;
    background: linear-gradient(135deg, #fff, var(--gold) 60%, var(--gold-dim));
    background-clip: text;
    -webkit-background-clip: text;
    letter-spacing: 2px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.4);
    margin-bottom: 5px;
}

.game-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 480px;
}

/* Glassmorphism Panel */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border-radius: 16px;
}

/* Stats Panel */
.stats-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    padding: 15px 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.15);
}

.stat-box, .stat-boxHighlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    transition: transform 0.3s ease;
}

.stat-boxHighlight {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-boxHighlight .stat-value {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Card Showcase with 3D Flip */
.card-container {
    perspective: 1200px;
    width: 100%;
    max-width: 340px;
    height: 510px;
    margin-bottom: 25px;
}

.card-flip-wrapper {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    position: relative;
    cursor: pointer;
}

.card-flip-wrapper.flipped {
    transform: rotateY(180deg);
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 3px solid rgba(212, 175, 55, 0.3);
}

.card-front {
    background-color: #171d26;
    transform: rotateY(0deg);
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-back {
    background: #0d121c;
    transform: rotateY(180deg);
}

.card-back-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Correct / Wrong Glowing States */
.card-container.correct .card-front {
    border-color: var(--emerald);
    box-shadow: 0 0 30px rgba(9, 211, 172, 0.6);
}

.card-container.incorrect .card-front {
    border-color: var(--ruby);
    box-shadow: 0 0 30px rgba(242, 92, 84, 0.6);
}

/* Feedback Box */
.feedback-container {
    width: 100%;
    text-align: center;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--gold);
    transition: all 0.3s ease;
    font-weight: 400;
}

.feedback-container.success {
    border-left-color: var(--emerald);
    background-color: rgba(9, 211, 172, 0.1);
    color: var(--emerald);
    animation: bounceIn 0.5s ease;
}

.feedback-container.error {
    border-left-color: var(--ruby);
    background-color: rgba(242, 92, 84, 0.1);
    color: var(--ruby);
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Controls Area */
.controls-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* Options buttons (A, B, C) */
.options-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    width: 100%;
}

.btn-option {
    background: rgba(30, 39, 51, 0.7);
    border: 2px solid rgba(212, 175, 55, 0.4);
    color: var(--text-light);
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 700;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transition: var(--transition-smooth);
}

.btn-option:hover:not(:disabled) {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 8px 25px var(--gold-glow);
}

.btn-option:active:not(:disabled) {
    transform: translateY(-1px);
}

/* Option Button States */
.btn-option.correct {
    background-color: rgba(9, 211, 172, 0.2);
    border-color: var(--emerald);
    color: var(--emerald);
    box-shadow: 0 0 20px rgba(9, 211, 172, 0.4);
}

.btn-option.incorrect {
    background-color: rgba(242, 92, 84, 0.2);
    border-color: var(--ruby);
    color: var(--ruby);
    box-shadow: 0 0 20px rgba(242, 92, 84, 0.4);
}

.btn-option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Action buttons */
.actions-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    border: none;
    color: #171d26;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 14px 35px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    transition: var(--transition-smooth);
    width: 100%;
    max-width: 250px;
}

.btn-action:hover:not(.disabled):not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
}

.btn-action:active:not(.disabled):not(:disabled) {
    transform: translateY(-1px);
}

.btn-action.disabled, .btn-action:disabled {
    background: #2a3340;
    color: rgba(255,255,255,0.25);
    box-shadow: none;
    cursor: not-allowed;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Footer */
footer {
    margin-top: 40px;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.6;
    text-align: center;
}

/* Responsiveness */
@media (max-width: 480px) {
    .game-title {
        font-size: 2.1rem;
    }
    
    .stats-panel {
        padding: 10px 5px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .card-container {
        max-width: 280px;
        height: 420px;
    }
    
    .btn-option {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }
}
