* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #070b14;
    color: #d0d8e8;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ===== Site Header ===== */
.site-header {
    text-align: center;
    padding: 30px 20px 20px;
    position: relative;
    z-index: 1;
}
.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}
.brand-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 8px rgba(255,180,50,0.4));
}
.brand-name {
    font-size: 28px;
    font-weight: 800;
    color: #ffb432;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255,180,50,0.3);
}
.header-tagline {
    font-size: 13px;
    color: rgba(176, 196, 222, 0.55);
    letter-spacing: 1px;
}

/* ===== Tree Container ===== */
.tree-container {
    position: relative;
    padding-left: 50px;
    margin-top: 30px;
}
.tree-trunk {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #3b4a5e, #b0c4de, #3b4a5e);
    border-radius: 2px;
    z-index: 0;
}

/* ===== Branch Section ===== */
.branch-section {
    position: relative;
    margin-bottom: 45px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}
.branch-section.visible {
    opacity: 1;
    transform: translateY(0);
}
.branch-node {
    position: absolute;
    left: -38px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cat-color, #3498db);
    box-shadow: 0 0 12px var(--cat-color, #3498db);
    z-index: 2;
    animation: nodePulse 3s ease-in-out infinite;
}
@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 8px var(--cat-color, #3498db); }
    50% { box-shadow: 0 0 18px var(--cat-color, #3498db), 0 0 30px var(--cat-color, #3498db); }
}
.branch-line {
    position: absolute;
    left: -24px;
    top: 24px;
    width: 24px;
    height: 2px;
    background: var(--cat-color, #3498db);
    opacity: 0.6;
    z-index: 1;
}
.branch-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border-left: 3px solid var(--cat-color, #3498db);
}
.branch-icon {
    font-size: 22px;
}
.branch-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cat-color, #3498db);
    letter-spacing: 0.5px;
}
.branch-count {
    font-size: 12px;
    color: rgba(176, 196, 222, 0.55);
    margin-left: auto;
}
.branch-random-btn {
    background: rgba(255,180,50,0.08);
    border: 1px solid rgba(255,180,50,0.2);
    color: #ffb432;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.branch-random-btn:hover {
    background: rgba(255,180,50,0.15);
    box-shadow: 0 0 12px rgba(255,180,50,0.2);
}
.branch-random-btn:active {
    transform: scale(0.9);
    background: rgba(255,180,50,0.25);
}
.branch-content {
    padding-left: 4px;
}

/* ===== Leaf Grid ===== */
.leaf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
@media (min-width: 768px) {
    .leaf-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}
@media (min-width: 1024px) {
    .leaf-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* ===== Leaf Card ===== */
.leaf-card {
    position: relative;
    border-radius: 12px 24px 12px 4px;
    overflow: hidden;
    background: rgba(12, 18, 32, 0.92);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: leafFloat var(--float-dur, 9s) ease-in-out var(--float-delay, 0s) infinite;
}
@keyframes leafFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}
.leaf-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px var(--cat-color, #3498db);
    border-color: var(--cat-color, #3498db);
    animation-play-state: paused !important;
}
.leaf-card:active {
    transform: scale(0.97) translateY(2px) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.leaf-link {
    text-decoration: none;
    color: #d0d8e8;
    display: block;
}
.leaf-image {
    width: 100%;
    height: 168px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}
.leaf-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(7,11,20,0.7) 100%);
    pointer-events: none;
}
.leaf-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
    z-index: 2;
}
.leaf-info {
    padding: 10px 14px;
}
.leaf-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #d0d8e8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    letter-spacing: 0.2px;
}
.leaf-glow-border {
    position: absolute;
    inset: -1px;
    border-radius: 12px 24px 12px 4px;
    border: 1px solid transparent;
    pointer-events: none;
    transition: all 0.35s ease;
}
.leaf-card:hover .leaf-glow-border {
    border-color: var(--cat-color, #3498db);
    box-shadow: inset 0 0 15px var(--cat-color, #3498db);
}

/* ===== Ad Slot ===== */
.ad-slot-wrap {
    margin: 16px 0;
}

/* ===== Floating Panels ===== */
.floating-panel {
    position: fixed;
    z-index: 100;
    background: rgba(10, 15, 25, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 180, 50, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    overflow: hidden;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,180,50,0.1);
    cursor: default;
}
.panel-icon {
    font-size: 14px;
}
.panel-title {
    font-size: 12px;
    font-weight: 600;
    color: #e0c88b;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex: 1;
}
.panel-toggle {
    background: none;
    border: none;
    color: #e0c88b;
    cursor: pointer;
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.panel-toggle:hover {
    background: rgba(255,180,50,0.1);
}
.panel-body {
    padding: 10px 14px;
}

/* Search Panel */
.search-panel {
    top: 20px;
    right: 20px;
    width: 280px;
}
.search-input-wrap {
    display: flex;
    gap: 6px;
}
.search-input-wrap input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,180,50,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    color: #d0d8e8;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}
.search-input-wrap input:focus {
    border-color: #ffb432;
    box-shadow: 0 0 8px rgba(255,180,50,0.15);
}
.search-input-wrap input::placeholder {
    color: rgba(176, 196, 222, 0.55);
}
.search-btn {
    background: rgba(255,180,50,0.12);
    border: 1px solid rgba(255,180,50,0.2);
    color: #ffb432;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.search-btn:hover {
    background: rgba(255,180,50,0.2);
}
.search-btn:active {
    transform: scale(0.92);
    background: rgba(255,180,50,0.3);
}
.search-results {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.search-count {
    font-size: 11px;
    color: rgba(176, 196, 222, 0.55);
    margin-bottom: 6px;
}
.search-result-item {
    display: block;
    padding: 6px 8px;
    font-size: 12px;
    color: #d0d8e8;
    text-decoration: none;
    border-radius: 6px;
    border-left: 2px solid var(--cat-color, #3498db);
    margin-bottom: 4px;
    transition: all 0.2s ease;
}
.search-result-item:hover {
    background: rgba(255,180,50,0.06);
}

/* Category Panel */
.category-panel {
    top: 80px;
    left: 20px;
    width: 200px;
}
.cat-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cat-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    color: #d0d8e8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}
.cat-filter-btn:hover {
    background: rgba(255,180,50,0.06);
    border-color: var(--cat-color, #3498db);
}
.cat-filter-btn:active {
    transform: scale(0.96);
    background: rgba(255,180,50,0.12);
}
.cat-filter-btn.active {
    background: rgba(255,180,50,0.1);
    border-color: var(--cat-color, #3498db);
    box-shadow: 0 0 8px var(--cat-color, #3498db);
}
.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Compass Panel */
.compass-panel {
    bottom: 90px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
}
.compass-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,180,50,0.15);
    color: #e0c88b;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}
.compass-btn:hover {
    background: rgba(255,180,50,0.1);
    border-color: #ffb432;
}
.compass-btn:active {
    transform: scale(0.9);
    background: rgba(255,180,50,0.2);
}

/* ===== Sport Dock ===== */
.sport-dock {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(10, 15, 25, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 180, 50, 0.25);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.dock-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}
.dock-btn:hover {
    background: rgba(255,180,50,0.1);
    border-color: var(--cat-color, #3498db);
    box-shadow: 0 0 10px var(--cat-color, #3498db);
    transform: scale(1.1);
}
.dock-btn:active {
    transform: scale(0.9);
    background: rgba(255,180,50,0.2);
}

/* ===== Random Game Modal ===== */
.random-game-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}
.random-game-modal.active {
    pointer-events: auto;
    opacity: 1;
}
.random-game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 11, 20, 0.8);
    backdrop-filter: blur(4px);
}
.random-game-content {
    position: relative;
    z-index: 1;
    background: rgba(10, 15, 25, 0.88);
    border: 1px solid rgba(255, 180, 50, 0.25);
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: all 0.3s ease;
}
.random-game-modal.active .random-game-content {
    transform: scale(1);
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #e0c88b;
    font-size: 22px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.modal-close:hover {
    background: rgba(255,180,50,0.1);
}
.modal-close:active {
    transform: scale(0.9);
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.modal-icon {
    font-size: 20px;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #ffb432;
}
.random-game-card {
    margin-bottom: 16px;
}
.random-card-link {
    text-decoration: none;
    color: #d0d8e8;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.random-card-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}
.random-card-link:active {
    transform: scale(0.97);
}
.random-card-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}
.random-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}
.random-card-info {
    padding: 12px;
}
.random-card-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #d0d8e8;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.try-another-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,180,50,0.1);
    border: 1px solid rgba(255,180,50,0.2);
    color: #ffb432;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.try-another-btn:hover {
    background: rgba(255,180,50,0.18);
    box-shadow: 0 0 12px rgba(255,180,50,0.15);
}
.try-another-btn:active {
    transform: scale(0.97);
    background: rgba(255,180,50,0.25);
}

/* ===== Related Articles ===== */
.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
@media (min-width: 768px) {
    .related-articles-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}
.related-article {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(12, 18, 32, 0.92);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.35s ease;
}
.related-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 15px var(--cat-color, #3498db);
    border-color: var(--cat-color, #3498db);
}
.related-article:active {
    transform: scale(0.97);
}
.related-thumb {
    width: 100%;
    height: 100px;
    background-size: cover;
    background-position: center;
    border-bottom: 2px solid var(--cat-color, #3498db);
}
.related-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
}

/* ===== General ===== */
button {
    transition: all 0.3s ease;
}
img {
    max-width: 100%;
    height: auto;
}
a {
    transition: all 0.3s ease;
}
::selection {
    background: rgba(255, 180, 50, 0.3);
    color: #d0d8e8;
}
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #070b14;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 180, 50, 0.25);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 180, 50, 0.45);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .search-panel {
        top: auto;
        bottom: 70px;
        right: 10px;
        left: 10px;
        width: auto;
    }
    .category-panel {
        display: none;
    }
    .tree-container {
        padding-left: 20px;
    }
    .tree-trunk {
        left: 8px;
    }
    .branch-node {
        left: -18px;
        width: 10px;
        height: 10px;
    }
    .branch-line {
        left: -8px;
        width: 8px;
    }
    .compass-panel {
        bottom: 75px;
        right: 10px;
    }
    .compass-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .sport-dock {
        bottom: 10px;
        padding: 6px 10px;
        gap: 4px;
        max-width: 95vw;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .sport-dock::-webkit-scrollbar {
        display: none;
    }
    .dock-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
        flex-shrink: 0;
    }
    .brand-name {
        font-size: 22px;
    }
    .branch-title {
        font-size: 15px;
    }
    .leaf-image {
        height: 140px;
    }
}
@media (max-width: 480px) {
    .leaf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .leaf-title {
        font-size: 12px;
    }
    .leaf-info {
        padding: 8px 10px;
    }
    .leaf-image {
        height: 120px;
    }
    .related-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}