/* MAGICSHOT MEMORY GAME - STYLES */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a0a1e 50%, #000000 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* HEADER */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.game-header h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    background: linear-gradient(45deg, #ff004f, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.tagline {
    color: #cccccc;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

/* GAME CONTROLS */
.game-controls {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 79, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

.stat-label {
    font-size: 0.9rem;
    color: #999;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff004f, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* DIFFICULTY */
.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
}

.difficulty-cards {
    display: block;
    font-size: 0.75rem;
    color: #999;
    font-weight: normal;
}

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

.difficulty-btn.active {
    background: linear-gradient(135deg, #ff004f, #ff8c00);
    border-color: transparent;
}

/* ACTION BUTTONS */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-reset,
.btn-sound {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 0, 79, 0.3);
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
}

.btn-reset:hover,
.btn-sound:hover {
    background: rgba(255, 0, 79, 0.2);
    transform: scale(1.05);
}

/* GAME BOARD */
.game-board {
    display: grid;
    gap: 15px;
    margin-bottom: 40px;
    perspective: 1000px;
}

.game-board.easy {
    grid-template-columns: repeat(4, 1fr);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.game-board.medium {
    grid-template-columns: repeat(4, 1fr);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.game-board.hard {
    grid-template-columns: repeat(6, 1fr);
}

/* CARD */
.card {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

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

.card.matched {
    pointer-events: none;
}

.card.matched .card-back {
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.card-front {
    background: linear-gradient(135deg, #1a0a1e, #2a1a2e);
    border: 3px solid transparent;
    border-image: linear-gradient(45deg, #ff004f, #ff8c00) 1;
}

.card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/logo_white_simple.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
    opacity: 0.3;
    pointer-events: none;
}

.card-front::after {
    display: none;
}

.card-back {
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(255, 140, 0, 0.5);
    transform: rotateY(180deg);
}

.card-back img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 140, 0, 0.5));
}

.card:not(.flipped):not(.matched):hover {
    transform: scale(1.05);
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a0a1e, #2a1a2e);
    border: 3px solid transparent;
    border-image: linear-gradient(45deg, #ff004f, #ff8c00) 1;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.victory-animation {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.modal-content h2 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #ff004f, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.victory-message {
    font-size: 1.2rem;
    color: #cccccc;
    margin-bottom: 30px;
}

.victory-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.victory-stat {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.victory-stat .label {
    color: #999;
}

.victory-stat .value {
    color: #ff8c00;
    font-weight: bold;
}

.victory-stat.best {
    background: linear-gradient(135deg, rgba(255, 0, 79, 0.2), rgba(255, 140, 0, 0.2));
    border: 2px solid rgba(255, 0, 79, 0.5);
    justify-content: center;
}

.victory-stat.best.hidden {
    display: none;
}

.victory-cta {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-subtitle {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 20px;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cta {
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-cta.primary {
    background: linear-gradient(135deg, #ff004f, #ff8c00);
    border: none;
    color: #ffffff;
}

.btn-cta.primary:hover {
    transform: translateY(-2px);
}

.btn-cta.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 140, 0, 0.5);
    color: #ffffff;
}

/* INSTRUCTIONS */
.instructions {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.instructions h3 {
    color: #ff8c00;
    margin-bottom: 15px;
}

.instructions ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.instructions li {
    color: #cccccc;
}

/* FOOTER */
.game-footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

.game-footer a {
    color: #ff8c00;
    text-decoration: none;
}

.events-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #555;
}

/* ANIMATIONS */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* RESPONSIVE */
@media (max-width: 768px) {
    .game-board.hard {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .card-front::before {
        font-size: 2rem;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-cta {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* MODO FÁCIL: 4 cartas por linha (2x4 = 8 cartas) */
    .game-board.easy {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    /* MODO MÉDIO: 3 cartas por linha (3x6 = 18 cartas) */
    .game-board.medium {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    /* MODO DIFÍCIL: 3 cartas por linha (3x8 = 24 cartas) */
    .game-board.hard {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}
