* {
    border: none;
    margin: 0px;
    border: border-box;

}

body {
    background-color: #f5f0e8;
}

h1 {
    text-align: center;
    font-size: 3rem;
    background-color: #1a1a2e;
    color: #f0c040;
    height: 70px;
    line-height: 70px;
    letter-spacing: 2px;
}

h2, h3 {
    text-decoration: none;
}

/* Scoreboard */
#scoreboard {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 16px;
    background-color: #1a1a2e;
}

.score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.score-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #d4cfc7;
}

.score-val {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f0c040;
}


/* Turn Indicator */
#turn-indicator {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e63946;
    margin-top: 26px;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

/* Game Board Section */
.gameSection {
    
    height: 400px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
}
.gameBoard {
    height: 360px;
    width: 360px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.box {
    border: 4px solid #1a1a2e;
    height: 120px;
    width: 120px;
    font-size: 70px;
    font-family: "Boogaloo", sans-serif;
    background-color: #f5f0e8;
    cursor: pointer;
    transition: background-color 0.15s ease;
    
}

.box:hover {
    background-color: #e8e0d0;
}

.row {
    display: flex;
    height: 120px;
    width: 360px;
}

#box1, #box2, #box3{border-top: none;}
#box1, #box4, #box7{border-left: none;}
#box7, #box8, #box9{border-bottom: none;}
#box3, #box6, #box9{border-right: none;}

/* Win Line Strike-through */

.win-line {
    border: 2px solid #f0c040;
    background-color: #f0c040;
    width: 360px;
    height: 6px;
    position: absolute;
    visibility: hidden;
    border-radius: 4px;
    z-index: 10;
    left: 0;
}

#win-line-r1 {top: 60px; visibility: visible !important;}
#win-line-r2 {top: 180px; visibility: visible !important;}
#win-line-r3 {top: 300px; visibility: visible !important;}

#win-line-c1 {left: 60px; transform-origin: left center ; transform: rotate(90deg); visibility: visible !important;}

#win-line-c2 {left: 180px; transform-origin: left center ; transform: rotate(90deg); visibility: visible !important;}

#win-line-c3 {left: 300px; transform-origin: left center ; transform: rotate(90deg); visibility: visible !important;}

#win-line-d1 {width: 505px; transform-origin: left center ; transform: rotate(45deg); visibility: visible !important;}

#win-line-d2 {width: 505px; top: 360px; transform-origin: left center ; transform: rotate(-45deg); visibility: visible !important;}

@keyframes pop {
    0%   { transform: scale(0.5); opacity: 0; }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.box.pop {
    animation: pop 0.2s ease forwards;
}


/* Restart button */
#replay {
    background-color: #1a1a2e;
    color: #f0c040;
    height: 50px;
    width: 120px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    font-family: "Fredoka", sans-serif;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease;

}

/* Status Message */
#status-msg {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-top: 12px;
    min-height: 32px;
    letter-spacing: 1px;
}

#replay:hover {
    background-color: #2e2e50;
}

/* Rules Section */
.rules {
    margin: 40px 10px 60px;
    background-color: #1a1a2e;
    border-radius: 20px;
    padding: 36px 40px;
}

.rules h2 {
    font-size: 1.8rem;
    color: #f0c040;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.rule-card {
    background-color: #252545;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.rule-card h3 {
    font-size: 0.85rem;
    color: #f0c040;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.rule-card p, .rule-card li {
    color: #d4cfc7;
    font-size: 0.98rem;
    line-height: 1.75;
}

.rules ol {
    list-style-position: inside;
    text-align: left;
}

.rules ol li {
    margin-bottom: 6px;
}

/* Footer Section */

footer {
    background-color: #1a1a2e;
    text-align: center;
    padding: 32px 20px;
    margin-top: 40px;
}

.footer-title {
    font-size: 1.5rem;
    color: #f0c040;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.footer-sub {
    font-size: 0.9rem;
    color: #d4cfc7;
    margin-bottom: 16px;
}

.footer-copy {
    font-size: 0.78rem;
    color: #6b6b8a;
}

/* Responsive */
@media (max-width: 420px) {
    .gameBoard {
        height: 300px;
        width: 300px;
    }

    .box {
        height: 100px;
        width: 100px;
        font-size: 54px;
    }

    .row {
        height: 100px;
        width: 300px;
    }

    .win-line {
        width: 300px;
    }

    #win-line-r1 { top: 50px; }
    #win-line-r2 { top: 150px; }
    #win-line-r3 { top: 250px; }

    #win-line-c1 { left: 50px; }
    #win-line-c2 { left: 150px; }
    #win-line-c3 { left: 250px; }

    #win-line-d1 { width: 424px; }
    #win-line-d2 { width: 424px; top: 300px; }

    .rules {
        padding: 24px 16px;
    }
}