*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

::selection { background: rgba(0,0,0,0.08); color: #333; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #F5F5F0; }
::-webkit-scrollbar-thumb { background: #D4D4D4; }

.fw-body {
    font-family: 'Inter', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #F5F5F0 0%, #EBE9E4 50%, #E0DDD6 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

.fw-body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(transparent 0px, transparent 1px, rgba(0,0,0,0.02) 1px, rgba(0,0,0,0.02) 2px);
    pointer-events: none;
    z-index: 0;
}

/* ===== Navbar ===== */
.fw-navbar {
    position: sticky; top: 0; z-index: 100;
    background: #FFFFFF;
    border-bottom: 1px solid #E8E8E8;
}
.fw-navbar-inner {
    max-width: 1200px; margin: 0 auto;
    height: 56px; display: flex; align-items: center;
    padding: 0 20px; gap: 28px;
}
.fw-logo {
    font-size: 20px; font-weight: 300; color: #333;
    text-decoration: none; letter-spacing: 2px;
    flex-shrink: 0;
}
.fw-nav-links {
    display: flex; gap: 28px; align-items: center;
}
.fw-nav-link {
    font-size: 13px; font-weight: 400; color: #888;
    text-decoration: none; letter-spacing: 0.5px;
    transition: color 0.2s; position: relative;
}
.fw-nav-link::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 1px; background: #333;
    transition: width 0.3s;
}
.fw-nav-link:hover { color: #333; }
.fw-nav-link:hover::after { width: 100%; }
.fw-search-wrap {
    display: flex; align-items: center; gap: 8px;
    margin-left: auto;
}
.fw-search-icon { flex-shrink: 0; }
.fw-search-input {
    width: 200px; height: 36px; border: 1px solid #E8E8E8;
    background: #FAFAFA; padding: 0 12px; font-family: inherit;
    font-size: 13px; color: #333; outline: none;
    transition: border-color 0.2s;
}
.fw-search-input:focus { border-color: #D4D4D4; }
.fw-search-input::placeholder { color: #AAA; }
.fw-mobile-menu-btn {
    display: none; flex-direction: column; gap: 4px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.fw-mobile-menu-btn span {
    display: block; width: 20px; height: 1px; background: #333;
    transition: all 0.3s;
}
.fw-mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(3px, 3px); }
.fw-mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.fw-mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(3px, -3px); }
.fw-mobile-nav-panel {
    display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
    background: #FFFFFF; z-index: 99; padding: 20px;
    flex-direction: column; gap: 0;
}
.fw-mobile-nav-panel.open { display: flex; }
.fw-mobile-nav-panel .fw-nav-link {
    display: block; padding: 14px 0; font-size: 15px;
    border-bottom: 1px solid #E8E8E8;
}

/* ===== Hero Stack ===== */
.fw-hero-section {
    max-width: 1200px; margin: 0 auto;
    padding: 20px 20px 0;
    max-height: 221px; overflow: hidden;
}
.fw-hero-stack {
    position: relative;
    width: 100%; max-width: 400px;
    height: 180px; margin: 0 auto;
}
.fw-stack-card {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 160px;
    background: #FFFFFF;
    border: 1px solid #E8E8E8;
    transition: all 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    cursor: pointer;
}
.fw-stack-card:nth-child(1) { top: 0; left: 0; }
.fw-stack-card:nth-child(2) { top: 6px; left: 6px; }
.fw-stack-card:nth-child(3) { top: 12px; left: 12px; }
.fw-stack-card:nth-child(4) { top: 18px; left: 18px; }
.fw-stack-card.active {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.fw-stack-card:not(.active) {
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.fw-stack-card.fly-out {
    transform: translateY(-40px) rotate(-2deg);
    opacity: 0;
}
.fw-stack-card.spread {
    transition: margin-left 0.3s ease;
}
.fw-stack-card-link {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 24px; text-decoration: none; color: #333;
    height: 100%;
}
.fw-stack-card-thumb {
    width: 80px; height: 80px; flex-shrink: 0;
    border: 1px solid #E8E8E8; overflow: hidden;
}
.fw-stack-card-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    filter: saturate(0.85);
}
.fw-stack-card-info {
    flex: 1; min-width: 0;
}
.fw-stack-card-title {
    font-size: 28px; font-weight: 300; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 8px;
}
.fw-stack-card-type {
    font-size: 12px; color: #888; letter-spacing: 1px; text-transform: uppercase;
}
.fw-stack-card-color-bar {
    position: absolute; top: 0; right: -4px;
    width: 4px; height: 100%;
    background: var(--card-color);
}

/* ===== Categories ===== */
.fw-categories-section {
    max-width: 1200px; margin: 0 auto;
    padding: 20px 20px 0;
}
.fw-categories-scroll {
    display: flex; gap: 0; overflow-x: auto;
    border-bottom: 1px solid #E8E8E8;
}
.fw-category-item {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 20px; text-decoration: none;
    cursor: pointer; white-space: nowrap;
    transition: all 0.2s;
}
.fw-cat-line {
    width: 2px; height: 20px;
    background: var(--cat-color);
    transition: all 0.3s;
}
.fw-category-item:hover .fw-cat-line {
    width: 20px; height: 2px;
}
.fw-cat-label {
    font-size: 12px; color: #888; letter-spacing: 1px; text-transform: uppercase;
    transition: color 0.2s;
}
.fw-category-item:hover .fw-cat-label { color: #333; }

/* ===== Main ===== */
.fw-main {
    max-width: 1200px; margin: 0 auto;
    padding: 0 20px;
    position: relative; z-index: 1;
}

/* ===== Section ===== */
.fw-sector {
    margin-top: 32px;
}
.fw-section-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 0; cursor: pointer;
    border-bottom: 1px solid #E8E8E8;
}
.fw-section-line {
    width: 2px; height: 20px;
    background: #D4D4D4;
    transition: all 0.3s;
}
.fw-sector.open .fw-section-line {
    width: 40px; height: 2px;
}
.fw-section-title {
    font-size: 20px; font-weight: 300; color: #333;
    letter-spacing: 0.5px;
}
.fw-section-right {
    margin-left: auto; display: flex; align-items: center; gap: 12px;
}
.fw-section-more {
    font-size: 12px; color: #888; text-decoration: none;
    transition: color 0.2s;
}
.fw-section-more:hover { color: #333; }
.fw-section-arrow {
    font-size: 10px; color: #888;
    transition: transform 0.3s;
}
.fw-sector.open .fw-section-arrow { transform: rotate(180deg); }
.fw-section-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease;
}
.fw-sector.open .fw-section-content {
    max-height: 20000px;
}

/* ===== Game Grid ===== */
.fw-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px 0;
}
.fw-game-card {
    background: #FFFFFF;
    border: 1px solid #E8E8E8;
    overflow: hidden;
    transition: box-shadow 0.3s ease, opacity 0.5s ease, transform 0.5s ease;
    opacity: 1;
    transform: translateY(0);
}
.fw-game-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.fw-game-card:hover {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.fw-card-link {
    display: block; text-decoration: none; color: #333;
}
.fw-card-image {
    width: 100%; aspect-ratio: 1/1; overflow: hidden;
    border-bottom: 1px solid #E8E8E8;
}
.fw-card-image img {
    width: 100%; height: 100%; object-fit: cover;
    filter: saturate(0.85);
    transition: filter 0.3s;
}
.fw-game-card:hover .fw-card-image img {
    filter: saturate(1);
}
.fw-card-info {
    padding: 12px;
}
.fw-card-title {
    font-size: 14px; font-weight: 300; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Footer ===== */
.fw-footer {
    background: #F5F5F0;
    border-top: 1px solid #E8E8E8;
    padding: 48px 20px 24px;
    margin-top: 48px;
    position: relative; z-index: 1;
}
.fw-footer::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(transparent 0px, transparent 1px, rgba(0,0,0,0.02) 1px, rgba(0,0,0,0.02) 2px);
    pointer-events: none;
}
.fw-footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
    position: relative; z-index: 1;
}
.fw-footer-heading {
    font-size: 12px; font-weight: 400; color: #888;
    margin-bottom: 14px; letter-spacing: 1px; text-transform: uppercase;
}
.fw-footer-desc { color: #888; font-size: 13px; line-height: 1.7; font-weight: 300; }
.fw-footer-links { display: flex; flex-direction: column; gap: 8px; }
.fw-footer-links a {
    color: #999; text-decoration: none; font-size: 13px;
    transition: all 0.2s; cursor: pointer; font-weight: 300;
    display: inline-block;
}
.fw-footer-links a:hover { color: #555; }
.fw-footer-links a:active { transform: translateY(1px); color: #555; }
.fw-footer-rings {
    display: flex; align-items: center; justify-content: center; gap: 16px;
}
.fw-ring {
    width: 24px; height: 24px;
    border: 1px solid #D4D4D4;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}
.fw-ring-dot {
    width: 4px; height: 4px;
    background: #888;
    border-radius: 50%;
    position: absolute;
    transition: all 0.3s ease;
}
.fw-ring[data-pos="9"] .fw-ring-dot { left: 2px; top: 50%; transform: translateY(-50%); }
.fw-ring[data-pos="12"] .fw-ring-dot { left: 50%; top: 2px; transform: translateX(-50%); }
.fw-ring[data-pos="3"] .fw-ring-dot { right: 2px; top: 50%; transform: translateY(-50%); }
.fw-ring[data-pos="6"] .fw-ring-dot { left: 50%; bottom: 2px; transform: translateX(-50%); }
.fw-footer-bottom {
    max-width: 1200px; margin: 28px auto 0;
    padding-top: 20px; border-top: 1px solid #E8E8E8;
    text-align: center; position: relative; z-index: 1;
}
.fw-footer-bottom p { color: #AAA; font-size: 13px; font-weight: 300; }

/* ===== Mobile Bottom Nav ===== */
.fw-bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #FFFFFF;
    border-top: 1px solid #E8E8E8;
    z-index: 100;
    padding: 8px 0;
}
.fw-bottom-nav a {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; text-decoration: none; color: #888;
    font-size: 10px; font-weight: 300;
}
.fw-bottom-nav-icon { font-size: 16px; }
.fw-bottom-nav-active { color: #333 !important; }

/* ===== Detail Page ===== */
.fw-detail-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E8E8E8;
    padding: 16px 20px;
}
.fw-back-btn {
    font-size: 13px; font-weight: 300; color: #888;
    text-decoration: none; transition: color 0.2s;
}
.fw-back-btn:hover { color: #333; }
.fw-detail-main {
    max-width: 900px; margin: 0 auto;
    padding: 24px 20px;
    position: relative; z-index: 1;
}
.fw-detail-image {
    width: 100%; max-width: 350px; margin: 24px auto;
    border: 1px solid #E8E8E8; overflow: hidden;
}
.fw-detail-image img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover;
    filter: saturate(0.85);
}
.fw-detail-info {
    padding: 24px;
    background: #FFFFFF;
    border: 1px solid #E8E8E8;
}
.fw-detail-title {
    font-size: 28px; font-weight: 300; color: #333;
    margin-bottom: 16px; line-height: 1.2;
}
.fw-detail-desc {
    font-size: 14px; line-height: 1.8; color: #888; font-weight: 300;
}
.fw-detail-play {
    text-align: center; margin: 24px 0;
}
.fw-play-btn {
    background: #333; color: #FFFFFF;
    border: none; padding: 14px 48px;
    font-size: 14px; font-weight: 300; font-family: inherit;
    cursor: pointer; letter-spacing: 1px;
    transition: all 0.2s;
}
.fw-play-btn:hover { background: #555; }
.fw-play-btn:active { transform: translateY(1px); }
.fw-game-container {
    width: 100%; height: 600px;
    border: 1px solid #E8E8E8;
    margin-top: 24px;
}
.fw-detail-related {
    margin-top: 40px;
}
.fw-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.fw-related-card .fw-card-image { aspect-ratio: 1/1; }

/* ===== Static Page ===== */
.fw-static-content {
    background: #FFFFFF;
    border: 1px solid #E8E8E8;
    padding: 32px;
    font-size: 14px; line-height: 1.8; color: #555; font-weight: 300;
}
.fw-static-content h2 { font-size: 20px; font-weight: 300; color: #333; margin-top: 24px; }
.fw-static-content h3 { font-size: 16px; font-weight: 400; color: #333; margin-top: 20px; }
.fw-static-content h4 { font-size: 14px; font-weight: 500; color: #333; margin-top: 16px; }
.fw-static-content ul { padding-left: 20px; margin-top: 8px; }
.fw-static-content li { margin-bottom: 4px; }
.fw-static-content a { color: #555; text-decoration: underline; }
.fw-static-content a:hover { color: #333; }

/* ===== Responsive ===== */
@media (min-width: 640px) {
    .fw-games-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .fw-related-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
@media (min-width: 1024px) {
    .fw-games-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .fw-nav-links { display: flex; }
    .fw-mobile-menu-btn { display: none; }
    .fw-search-input { width: 320px; }
}
@media (min-width: 1440px) {
    .fw-games-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1023px) {
    .fw-nav-links { display: none; }
    .fw-mobile-menu-btn { display: flex; }
}
@media (max-width: 639px) {
    .fw-bottom-nav {
        display: grid; grid-template-columns: repeat(5, 1fr);
    }
    .fw-body { padding-bottom: 60px; }
    .fw-hero-stack { max-width: 100%; }
    .fw-stack-card-title { font-size: 22px; }
    .fw-footer-inner { grid-template-columns: 1fr; gap: 24px; }
}