#summaryModal {
    color: #505050;
}

/* Layout */
.game {
    display: flex;
    margin: 0;
    background: #0f172a;
    color: white;
    font-family: Arial;
}

/* History (scroll left) */
#history {
    width: 120px;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding: 10px;

    scroll-behavior: smooth;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

#history::-webkit-scrollbar {
    height: 6px;
}

#history::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.history-item {
    font-size: 12px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.history-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 10px;
    text-align: center;

    backdrop-filter: blur(6px);
}

.history-top {
    font-size: 12px;
    margin-bottom: 5px;
}

.history-top.correct {
    color: #2ecc71;
}

.history-top.wrong {
    color: #e74c3c;
}

.history-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin: 5px 0;
}

.history-details {
    font-size: 11px;
    opacity: 0.8;
}

/* MOBILE */
@media (max-width: 768px) {
    .main {
        flex: 1; /* 👈 THIS is the key */
        display: flex;
        flex-direction: column;
    }

    .game {
        display: flex;
        flex-direction: column;
        height: 100dvh;
    }

    #history {
        width: 100%;
        height: auto;

        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;

        gap: 10px;
        padding: 10px;

        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);

        scroll-snap-type: x mandatory;
    }

    .history-card {
        min-width: 90px;   /* key for horizontal scroll */
        flex-shrink: 0;

        padding: 6px;

        scroll-snap-align: start;
    }

    .history-img {
        width: 40px;
        height: 40px;
    }

    .history-details {
        font-size: 10px;
    }

    .circle {
        width: min(90vw, 360px);
        height: min(90vw, 360px);
    }
}

/* Main */
.main {
    flex: 1;
    text-align: center;
    padding-top: 20px;
}

#hud {
    margin-bottom: 10px;
}

#footer {
    margin-top: 15px;
    font-size: 14px;
}

/* Circle */
.circle {
    position: relative;
    width: 360px;
    height: 360px;
    margin: 0 auto;
    border-radius: 50%;
    background: url('https://www.jokean.com/images/zodiacbg.png') center/cover no-repeat;
    transition: transform 0.6s ease, opacity 0.4s ease;
}

.circle.spin {
    transform: rotate(360deg);
    opacity: 0.4;
}

/* Center */
.center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}

.center img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(255,255,255,0.8);
}

/* Buttons */
.sign {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 120px;
    height: 40px;
    border-radius: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
    font-weight: bold;
    cursor: pointer;

    background-image: linear-gradient(
            rgba(255,255,255,0.2),
            rgba(0,0,0,0.3)
    );

    transition: box-shadow 0.2s, filter 0.2s;
}

.sign:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 12px white;
}

/* Feedback */
.sign.dim {
    filter: brightness(0.3);
    opacity: 0.6;
}

.correct {
    box-shadow: 0 0 20px #2ecc71, 0 0 40px #2ecc71;
    z-index: 2;
}

.wrong {
    box-shadow: 0 0 15px #e74c3c;
}

/* High score glow */
#highScore.glow {
    color: gold;
    text-shadow: 0 0 10px gold;
}

#highScore.beaten {
    color: #00ffcc;
    text-shadow: 0 0 20px #00ffcc;
}

#crown {
    display: none;
}

.xicon {
    width: 48px;
    height: 48px;

    background-image: url('https://www.jokean.com/images/zodiac-sprite.png');
    background-size: 400% 300%; /* 4 columns x 3 rows */
    background-repeat: no-repeat;

    display: inline-block;
}

.sign {
    --glow: white;
}

.sign .icon {
    filter: drop-shadow(0 0 8px var(--glow));
}

#screenGlow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;

    background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.8));
}

#screenGlow.correct {
    background: radial-gradient(circle, rgba(46,204,113,0.4), transparent 60%);
    opacity: 1;
}

#screenGlow.wrong {
    background: radial-gradient(circle, rgba(231,76,60,0.4), transparent 60%);
    opacity: 1;
}

.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Row 1 */
.icon-Ar { background-position: 0% 0%; }
.icon-Ta { background-position: 33.33% 0%; }
.icon-Ge { background-position: 66.66% 0%; }
.icon-Ca { background-position: 100% 0%; }

/* Row 2 */
.icon-Le { background-position: 0% 50%; }
.icon-Vi { background-position: 33.33% 50%; }
.icon-Li { background-position: 66.66% 50%; }
.icon-Sc { background-position: 100% 50%; }

/* Row 3 */
.icon-Sa { background-position: 0% 100%; }
.icon-Cp { background-position: 33.33% 100%; }
.icon-Aq { background-position: 66.66% 100%; }
.icon-Pi { background-position: 100% 100%; }

