body {
    background-color: #121212;
    color: #FFFFFF;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    text-align: center;

}

#scoreboard {
    align-items: center;
    #flex-direction: column;

    display: flex;
    justify-content: space-around;
    width: 80%;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#timer, #current-score, #games-played, #overall-score {
    font-size: 24px;
}

#hex-grid {
    display: block;
    margin: 0 auto;
    background: radial-gradient(circle at center, #1e1e1e, #121212);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    width: 90vw;  /* 90% of viewport width */
    height: 90vh; /* 90% of viewport height */
}

.hexagon-path {
    transition: fill 0.3s ease, transform 0.3s ease;
    stroke: #3498DB; /* Soothing border color */
    stroke-width: 2;
}

.hexagon-path:hover {
    transform: scale(1.1);
}

.selected path {
    fill: #FFD700; /* Yellow color for selected cells */
}

.selected text {
    fill: #000000; /* Black text for selected cells */
}

.victory {
    font-size: 48px;
    color: #FFD700;
    text-align: center;
    position: relative;
    width: 100%;
    height: 100%;
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; }
}

.explode {
    animation: explode 0.5s forwards;
}

.hexagon-path-wrong {
    fill: red;
    stroke: #E74C3C;
    stroke-width: 2;
}

/* Tablet Styles */
@media (max-width: 768px) {
    #scoreboard {
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 5px;
    }
    
    #timer, #current-score, #games-played, #overall-score {
        font-size: 18px;
        margin-bottom: 5px;
    }

    #hex-grid {
        width: 95vw;  /* Adjust based on desired size */
        height: 95vh; /* Adjust based on desired size */
    }
}

/* Mobile Styles */
@media (max-width: 480px) {
    #scoreboard {
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 5px;
    }
    
    #timer, #current-score, #games-played, #overall-score {
        font-size: 16px;
        margin-bottom: 5px;
    }

    #hex-grid {
        width: 100vw;  /* Fill the width of the viewport */
        height: 100vh; /* Fill the height of the viewport */
    }
}

.victory-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    color: gold;
    font-size: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Pb2b5 */
#color-palette {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

/* Pd507 */
#color-palette .color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #FFFFFF;
}

#memory-match {
    width: 90vw;
    max-width: 1100px;
    margin: 30px auto 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#memory-match h2 {
    margin: 0 0 6px 0;
}

#memory-match p {
    margin: 0;
    color: #dcdcdc;
}

#memory-reset {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #4CAF50, #81C784);
    color: #0d0d0d;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

#memory-reset:hover {
    transform: translateY(-1px);
}

.memory-stats {
    display: flex;
    gap: 16px;
    margin: 16px 0;
    font-size: 18px;
    flex-wrap: wrap;
    align-items: center;
}

#memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.memory-card {
    position: relative;
    height: 140px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    background: linear-gradient(145deg, #1c1c1c, #2a2a2a);
}

.memory-card.flipped .card-inner,
.memory-card.matched .card-inner {
    transform: rotateY(180deg);
}

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

.card-front {
    background: linear-gradient(135deg, #3949ab, #5c6bc0);
    color: #fff;
    font-size: 32px;
    letter-spacing: 2px;
}

.card-back {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotateY(180deg);
    text-align: center;
}

.card-detail {
    display: block;
    margin-top: 8px;
    color: #c5e1a5;
    font-size: 14px;
}

.memory-card.matched .card-back {
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: #0b0b0b;
}

#memory-status {
    min-height: 24px;
    color: #FFD700;
    font-weight: bold;
}

@media (max-width: 768px) {
    .memory-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #memory-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}
