/* Global */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    color: #222222;
}

:target::before {
    content: "";
    display: block;
    height: 100px;
    margin-top: -100px;
    visibility: hidden;
}

/* -- Navbar -- */
.spms-navbar {
    background-color: #1a1410;
    border-bottom: 1px solid rgba(184, 137, 74, 0.3);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

/* -- Brand -- */
.spms-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: "Georgia", serif;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.03em;
    color: #fff0db;
    text-decoration: none;
}

.spms-brand:hover {
    color: #d4a96a;
}

.brand-stone {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        #ffffff 0%,
        #d4a96a 55%,
        #b8894a 100%
    );
    box-shadow:
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(200, 169, 110, 0.4);
    flex-shrink: 0;
    transition: transform 0.35s ease;
}

.spms-brand:hover .brand-stone {
    transform: rotate(180deg) scale(1.1);
}

/* -- Hamburger button -- */
.spms-toggler {
    border: 1px solid rgba(184, 137, 74, 0.4) !important;
    border-radius: 4px;
    padding: 6px 10px;
    background: transparent;
}

.spms-toggler:focus {
    box-shadow: 0 0 0 2px rgba(184, 137, 74, 0.25);
}

/* -- Nav links -- */
.spms-nav-link {
    font-family: "Georgia", serif;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 240, 219, 0.75) !important;
    padding: 1rem 1.2rem !important;
    transition: color 0.2s;
}

.spms-nav-link:hover {
    color: #fff0db !important;
}

.spms-nav-link.active {
    color: #fff0db !important;
    border-bottom: 2px solid #b8894a;
}

/* -- Mobile dropdown -- */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #1a1410;
        border-top: 1px solid rgba(184, 137, 74, 0.15);
        padding: 0.5rem 0 1rem;
    }

    .spms-nav-link {
        padding: 0.75rem 1.5rem !important;
    }
}

/* -- Hero section -- */
.hero {
    background-color: #fff4e6;
    padding: 100px 0;
}

.hero h1 {
    font-family: "Playfair Display", serif;
    font-weight: 700;
}

/* -- General section -- */
section:not(.hero) {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 100px 0;
}

/* -- Fade in animation -- */
.fade-in {
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
}

.fade-in.show {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-left {
    transform: translateX(-40px);
}

.fade-in-right {
    transform: translateX(40px);
}

@media (max-width: 767.98px) {
    .fade-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* -- About section (What is Weiqi | index.html) -- */
.about {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stones {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stone {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.stone.black {
    background: radial-gradient(circle at 35% 35%, #555555, #000000);
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
}

.stone.white {
    background: radial-gradient(circle at 35% 35%, #ffffff, #d0cfc8);
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.25);
    border: 1px solid #ccc;
}

.stone-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a08050;
    margin-left: 4px;
}

/* -- Benefits section (Why play Weiqi | index.html) -- */
.benefits {
    background-color: #fde9cc;
}

/* -- History section (History of Weiqi | index.html) -- */
.history {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* -- Rules section (Rules of Weiqi | index.html) -- */
.rules {
    background-color: #fde9cc;
}

/* -- Resources section (Beginner resources | index.html) -- */
.resources {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.resources .card {
    border-radius: 12px;
    transition: 0.3s ease;
}

.resources .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

/* -- Join section (Join SPMS | index.html) -- */
.join {
    background-color: #f6d8a8;
}

/* -- Footer -- */
footer {
    background-color: #1a1410;
    border-top: 1px solid rgba(184, 137, 74, 0.3);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.35);
    font-family: "Georgia", serif;
    color: rgba(255, 240, 219, 0.75);
    font-size: 0.9rem;
}

/* -- Images -- */

figcaption {
    font-size: 0.9em;
    color: #222222;
}

.weiqi-image {
    max-width: 400px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* -- Beginner button (Hero | rules.html) -- */
.beginner-btn {
    display: inline-block;
    background-color: #222222;
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.beginner-btn:hover {
    background-color: #444444;
    transform: translateY(-2px);
}

/* -- Rules section (Full Rules | rules.html) -- */
.rules-content {
    background-color: #ffffff;
    padding: 100px 0;
}

.rules-text {
    max-width: 800px;
    margin: 0 auto;
}

.rules-text h2 {
    font-family: "Georgia", serif;
    font-size: 2rem;
    margin-bottom: 25px;
}

.rules-text h3 {
    font-size: 1.45rem;
    margin-bottom: 5px;
}

.rules-text p {
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.rules-text a {
    color: #a38550;
    font-weight: 500;
    transition: color 0.2s;
}

.rules-text a:hover {
    color: #d4a96a;
}

.rules-text ul {
    margin-top: 10px;
    padding-left: 1.5rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.rules-text ul li {
    margin-bottom: 10px;
}

.rules-text li p {
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.rule-block {
    margin-bottom: 80px;
}

.rule-block:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 60px;
}

/* -- Diagram in Rules section (Full Rules | rules.html) --  */
.diagram {
    text-align: center;
    margin: 30px 0 10px;
}

.diagram img {
    max-width: 420px;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.diagram-caption {
    font-size: 0.9rem;
    color: #666666;
    margin-top: 10px;
}

/* -- Game panel (play.html) -- */
.game-panel {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* -- Game info bar (Game panel | play.html) -- */
.game-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #333333;
}
.label {
    display: block;
    color: #333333;
    font-weight: normal;
}

.value {
    font-weight: bold;
}

#mark-dead-btn:hover {
    background-color: transparent;
    color: #dc3545;
    border-color: #dc3545;
}

#mark-dead-btn.active:hover {
    background-color: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
}

/* -- Diffculty Colours (Game panel | puzzles.html) -- */
.bg-light-green {
    background-color: #8fd694;
}
.bg-light-green:not(.collapsed) {
    background-color: #8fd694;
}

.bg-light-blue {
    background-color: #8ecae6;
}
.bg-light-blue:not(.collapsed) {
    background-color: #8ecae6;
}

.bg-warning {
    background-color: #ffd166;
}
.bg-warning:not(.collapsed) {
    background-color: #ffd166;
}

.bg-light-red {
    background-color: #f28b82;
}
.bg-light-red:not(.collapsed) {
    background-color: #f28b82;
}

.bg-purple {
    background-color: #9b5de5;
}
.bg-purple:not(.collapsed) {
    background-color: #9b5de5;
}
.btn-master {
    background-color: #d4a6ff;
    color: #ffffff;
    border: none;
}
.btn-master:hover {
    background-color: #7a46c5;
    color: #ffffff;
}