/* 遊戲限時免費情報站 - 樣式（FreePlay 設計風格） */

:root {
    --bg: #0a0a0f;
    --bg2: #10101a;
    --bg3: #16162a;
    --surface: #1a1a2e;
    --surface2: #222240;
    --border: rgba(255,255,255,0.07);
    --accent: #00e5a0;
    --accent2: #7b5ea7;
    --accent3: #ff6b35;
    --text: #f0f0f5;
    --muted: #7a7a9a;
    --free-green: #00e5a0;
    --deal-orange: #ff6b35;
    --f2p-purple: #7b5ea7;
    /* 內容區最大寬度，區塊置中，內容在內對齊 */
    --content-max: 1280px;
    --content-pad: clamp(16px, 2vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', 'Microsoft JhengHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* 雜訊疊加層 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* ========== HEADER ========== */
header.site-header,
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.header-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--content-pad);
    height: 64px;
    display: flex;
    align-items: center;
    gap: 40px;
}

/* 相容舊版單一 h1 的 header（僅無 .header-inner 時才加 padding，避免新版 header 被加上下 padding）*/
.site-header:not(:has(.header-inner)) {
    padding: 1rem var(--content-pad);
}
.site-header h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.5px;
    margin: 0 0 0.25rem;
}
.site-header .tagline { margin: 0; font-size: 0.9rem; color: var(--muted); }

.logo {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.5px;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.logo:hover { color: var(--text); }

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

nav.nav-main {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-tab {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    text-decoration: none;
    font-family: inherit;
}
.nav-tab:hover { color: var(--text); background: var(--surface); }
.nav-tab.active { color: var(--text); background: var(--surface); }

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 14px;
    width: 220px;
    transition: all 0.2s;
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 229, 160, 0.1);
}
.search-bar input {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    background-color: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    min-height: 0;
    margin: 0;
}
.search-bar input::placeholder { color: var(--muted); }
.search-bar input:focus { outline: none; box-shadow: none; }

/* ========== HERO ========== */
.hero {
    position: relative;
    padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 64px);
    overflow: hidden;
}
.hero-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(0, 229, 160, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--content-pad);
    position: relative;
}
.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}
.hero-label::before {
    content: '';
    width: 16px;
    height: 1px;
    background: var(--accent);
}
.hero h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -2px;
    max-width: 700px;
    margin-bottom: 16px;
}
.hero h1 span { color: var(--accent); }
.hero p {
    font-size: 16px;
    color: var(--muted);
    max-width: 480px;
    line-height: 1.6;
    font-weight: 300;
}

/* ========== STATS BAR ========== */
.stats-bar { padding: 0; margin-bottom: 56px; }
.stats-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--content-pad);
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.stat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
}
.stat-chip .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
.dot-green { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot-orange { background: var(--deal-orange); box-shadow: 0 0 8px var(--deal-orange); }
.dot-purple { background: var(--f2p-purple); box-shadow: 0 0 8px var(--f2p-purple); }

/* ========== SECTIONS ========== */
.section { padding: 0 0 64px 0; }
/* section 在 main 內，main 已有最大寬度與 padding，section-inner 只佔滿 main 寬度 */
.section-inner {
    max-width: 100%;
    margin: 0 auto;
}

.not-found-actions {
    margin-top: 16px;
    text-align: center;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.section-title {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.section-title + .empty {
    margin-top: 8px;
}
.section-title .tag {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}
.tag-free { background: rgba(0, 229, 160, 0.15); color: var(--accent); }
.tag-deal { background: rgba(255, 107, 53, 0.15); color: var(--deal-orange); }
.tag-f2p { background: rgba(123, 94, 167, 0.15); color: var(--f2p-purple); }

.see-all {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}
.see-all:hover { color: var(--text); }

/* 相容舊 .block-header */
.block-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.block-header h2 { margin: 0; font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 700; }
.block-header .view-all {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
}
.block-header .view-all:hover { color: var(--text); }

/* ========== GRID & CARD ========== */
.games-grid,
.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.games-grid.featured,
.card-list.featured {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.25s ease,
                border-color 0.25s ease;
    position: relative;
    animation: fadeInUp 0.4s ease both;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-color: rgba(255,255,255,0.12);
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-img {
    aspect-ratio: 16/9;
    background: var(--bg3);
    overflow: hidden;
    position: relative;
}
.card-img img {
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
    display: block;
}
.card:hover .card-img img { transform: scale(1.05); }

.card-thumb {
    aspect-ratio: 16/9;
    background: var(--bg3);
    overflow: hidden;
    position: relative;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    display: block;
}
.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg3) 0%, var(--surface2) 100%);
    font-size: 40px;
}
.card .card-thumb { grid-area: thumb; }
.card-img .card-thumb-placeholder { position: absolute; inset: 0; }

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    z-index: 2;
}
.badge-free { background: var(--accent); color: #000; }
.badge-deal { background: var(--deal-orange); color: #fff; }
.badge-f2p { background: var(--f2p-purple); color: #fff; }
.badge-pct { background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); color: var(--accent); border: 1px solid rgba(0,229,160,0.3); }

.source-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.7);
    z-index: 2;
}

.card-body { padding: 14px 16px 16px; }

.card-title {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
    letter-spacing: -0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-platforms {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.platform-chip {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--surface2);
    color: var(--muted);
    letter-spacing: 0.3px;
}

.card-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.price-free {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}
.price-orig,
.price-free-old,
.price-old {
    font-size: 13px;
    color: var(--muted);
    text-decoration: line-through;
}
.price-new,
.price-now {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--deal-orange);
}
.price-free-zero { font-size: 20px; font-weight: 800; color: var(--accent); }
.price-free-unit { font-size: 14px; color: var(--accent); }

.card-dates,
.end-date,
.detail-end {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.7;
    font-weight: 300;
}
.card-dates,
.detail-end {
    display: grid;
    /* 第一欄：Starts / Ends / Released，第二欄：日期時間 */
    grid-template-columns: 52px 1fr;
    column-gap: 6px;
    align-items: baseline;
}
.date-label {
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    text-align: left;
}
.date-label::after {
    content: ':';
    margin-left: 2px;
}
.date-value {
    color: var(--muted);
}

.time-left {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 8px;
}

/* 詳細頁剩餘時間：字體和詳細頁 Starts/Ends 一樣大（0.9rem） */
.detail-meta .time-left {
    font-size: 0.9rem;
    font-weight: 300;
}

/* 相容舊 .price-row */
.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0.35rem 0 0;
}
.price-row .price-old { color: var(--muted); text-decoration: line-through; }
.price-row .price-now { color: var(--deal-orange); font-weight: 700; }

/* CLAIM BUTTON */
.claim-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}
.claim-btn:hover {
    background: #00ffc0;
    box-shadow: 0 4px 20px rgba(0, 229, 160, 0.4);
}
.claim-btn.deal {
    background: var(--deal-orange);
    color: #fff;
}
.claim-btn.deal:hover {
    background: #ff8c5a;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

/* ========== FILTERS & SORT ========== */
.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.filter-btn {
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}
.filter-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.filter-btn.active { color: #000; background: var(--accent); border-color: var(--accent); }

.sort-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}
.sort-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    cursor: pointer;
    outline: none;
}

/* 相容舊 .front-tabs / .front-filter */
.front-tabs { display: flex; gap: 0.5rem; margin: 0 0 1rem; flex-wrap: wrap; }
.front-tabs a {
    padding: 6px 16px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
}
.front-tabs a:hover { color: var(--text); }
.front-tabs a.active { color: #000; background: var(--accent); border-color: var(--accent); }
.front-tabs.front-tabs-compact { margin-top: 0; }

.front-filter {
    margin: 0 0 1.75rem;
    font-size: 0.9rem;
    padding: 12px 16px 14px;
    border-radius: 14px;
    background: rgba(22, 22, 40, 0.9);
    border: 1px solid var(--border);
}
.front-filter-toggle {
    display: none;
}
.front-filter-body {
    margin-top: 0.5rem;
}
.front-filter .filter-row {
    display: flex;
    flex-wrap: wrap;
    /* zh-tw：標題對齊該列「第一行」的中線，多行 chips 時不要整個被拉到垂直正中 */
    align-items: flex-start;
    gap: 0.4rem 0.75rem;
    margin-bottom: 0.6rem;
}
.front-filter .filter-row + .filter-row {
    position: relative;
    padding-top: 0.8rem;
    margin-top: 0.2rem;
}
.front-filter .filter-row + .filter-row::before {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    top: 0;
    height: 1px;
    background: rgba(255,255,255,0.06);
}
.front-filter .filter-label {
    color: var(--muted);
    margin-right: 0.5rem;
    padding-top: 4px;
    flex-shrink: 0;
    min-width: 60px;
}
.front-filter .filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}
.front-filter .chip {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 100px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.front-filter .chip:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.front-filter .chip.active { color: #000; background: var(--accent); border-color: var(--accent); }
.front-filter .filter-row-keyword label { display: inline-flex; align-items: center; gap: 0.35rem; }
.front-filter input[type="text"] {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}
.front-filter button {
    padding: 7px 16px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #000;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

/* 舊 badge 相容（列表卡上的來源/平台標籤） */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
}
.badge.worth { background: rgba(0, 229, 160, 0.2); color: var(--accent); }
.badge.platform { background: var(--surface2); color: var(--muted); }
.badge.genre { background: rgba(123, 94, 167, 0.2); color: var(--f2p-purple); }
.badge.source {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.7);
    margin: 0;
    transform: none;
}
.badge.source-gp { background: rgba(79, 195, 247, 0.9); color: #fff; }
.badge.source-itad { background: rgba(255, 183, 77, 0.9); color: #1a1a1a; }
.badge.source-ftg { background: rgba(129, 199, 132, 0.9); color: #0d1f0d; }

/* ========== MAIN LAYOUT ========== */
.main {
    max-width: var(--content-max);
    margin: 0 auto;
    /* zh-tw：讓內容與固定 header 之間保留一點垂直間距 */
    padding: 24px var(--content-pad) 2rem;
    position: relative;
    z-index: 1;
}
.block { margin-bottom: 2.5rem; }
.block h2 {
    margin: 0 0 1rem;
    font-family: 'Syne', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
}

/* 總價值摘要（首頁） */
.worth-summary {
    padding: 12px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    margin-bottom: 1.5rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.worth-summary p { margin: 0; font-size: 0.95rem; color: var(--text); }
.worth-summary strong { color: var(--accent); }

.empty,
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
}
.empty-state h3 { font-family: 'Syne', sans-serif; font-size: 20px; margin-bottom: 8px; color: var(--text); }

.block-more { margin-top: 1.25rem; }
.block-more a {
    display: block;
    width: 100%;
    padding: 10px 20px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
}
.block-more a:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }

/* ========== DETAIL PAGE ========== */
.main-detail { max-width: 720px; }
.header-link { color: inherit; text-decoration: none; }
.header-link:hover { color: var(--accent); }

.detail-article {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
}
.detail-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.25rem;
    align-items: flex-start;
}
.detail-thumb {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: var(--bg3);
    border-radius: 16px;
}
.detail-meta { flex: 1; min-width: 200px; }
.detail-title {
    margin: 0 0 0.5rem;
    font-family: 'Syne', sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
}
.detail-price {
    margin: 0.5rem 0 0;
    font-size: 1rem;
}
.detail-price .price-old { color: var(--muted); text-decoration: line-through; margin-right: 0.5rem; }
.detail-price .price-now { color: var(--accent); font-weight: 700; }
.detail-end,
.detail-meta-line {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}
.detail-section {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}
.detail-section h3 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--muted); }
.detail-content { font-size: 0.95rem; line-height: 1.6; }
.detail-cta-wrap {
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}
.btn-cta {
    display: inline-block;
    padding: 14px 28px;
    background: var(--accent);
    color: #000;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
}
.btn-cta:hover {
    background: #00ffc0;
    box-shadow: 0 4px 24px rgba(0, 229, 160, 0.4);
}
.inline-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.inline-link:hover {
    text-decoration: underline;
}
.detail-out-hint { margin: 0.75rem 0 0; font-size: 0.8rem; color: var(--muted); }

.detail-api-dump { margin: 1.5rem 1.25rem; padding: 0; font-size: 0.8rem; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.detail-api-json { margin: 0; padding: 1rem; background: rgba(0,0,0,0.35); overflow-x: auto; max-height: 24rem; white-space: pre; font-size: 0.75rem; color: var(--muted); }
.sysreq-list { margin: 0; padding-left: 1.25rem; font-size: 0.9rem; color: var(--muted); }
.sysreq-list li { margin-bottom: 0.35rem; }
.screenshots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.screenshot-item { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.screenshot-item img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }

.desc { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

/* ========== FOOTER ========== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 32px;
    position: relative;
    z-index: 1;
}
.footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--content-pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px; color: var(--text); opacity: 0.5; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: var(--muted); opacity: 0.6; }

.site-footer > p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ========== PAGE CONTENT (about / privacy / terms) ========== */
.main-page { max-width: 52em; margin-left: auto; margin-right: auto; }
.page-content { padding: 1.5rem 1.25rem; }
.page-content h2 { margin: 0 0 1rem; font-family: 'Syne', sans-serif; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.page-content h3 { margin: 1.75rem 0 0.5rem; font-size: 1.05rem; font-weight: 600; color: var(--muted); }
.page-content p { margin: 0 0 1rem; line-height: 1.7; color: var(--text); }
.page-content ul { margin: 0 0 1rem; padding-left: 1.5rem; }
.page-content li { margin-bottom: 0.4rem; line-height: 1.6; }
.page-content a { color: var(--accent); text-decoration: none; }
.page-content a:hover { text-decoration: underline; }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }

/* ========== UTILITY ========== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    right: clamp(16px, 4vw, 32px);
    bottom: clamp(16px, 4vw, 32px);
    z-index: 90;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    font-size: 20px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s, border-color 0.2s;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ========== MOBILE NAV (BOTTOM) ========== */
.mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    display: none;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
}
.mobile-nav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mobile-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid transparent;
}
.mobile-nav-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--surface2);
}
.mobile-nav-item:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.14);
}
.mobile-nav-item.active {
    color: #000;
    background: var(--accent);
    border-color: var(--accent);
}
.mobile-nav-item.active::before {
    background: #000;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .header-inner { gap: 20px; }
    .games-grid.featured,
    .card-list.featured { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 768px) {
    body { padding-bottom: 72px; }
    .header-inner { gap: 12px; min-height: 52px; height: auto; padding-top: 8px; padding-bottom: 8px; }
    .logo { font-size: 18px; }
    .search-bar { width: 160px; min-width: 120px; }
    nav.nav-main { display: none; }
    .hero { padding: clamp(32px, 6vw, 64px) 0 clamp(24px, 4vw, 48px); }
    .hero h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); letter-spacing: -1px; }
    .hero p { font-size: 0.95rem; }
    .stats-bar { margin-bottom: 32px; }
    .stats-inner { flex-wrap: wrap; gap: 12px; }
    .stat-chip { font-size: 13px; padding: 6px 12px; }
    .card-list,
    .games-grid { grid-template-columns: 1fr; gap: 12px; }
    .card { border-radius: 12px; }
    .section-inner { padding-bottom: 1.5rem; }
    .section-title { font-size: 1.25rem; }
    .detail-hero { flex-direction: column; gap: 1rem; }
    .detail-thumb { max-width: 100%; min-width: 0; }
    .detail-meta { min-width: 0; }
    .detail-title { font-size: 1.35rem; }
    .screenshots { grid-template-columns: 1fr 1fr; gap: 8px; }
    .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
    .main-page { padding-left: var(--content-pad); padding-right: var(--content-pad); }
    .page-content { padding: 1.25rem 0; }
    .mobile-nav { display: block; }
    /* zh-tw：避免 m 版「回到最上方」按鈕遮住底部導覽 */
    .back-to-top {
        bottom: calc(72px + 16px + env(safe-area-inset-bottom, 0px));
    }
    /* zh-tw：m 版篩選改為可收合，預設收起來，點 Filters 展開 */
    .front-filter {
        padding: 10px 12px;
        margin-bottom: 1.5rem;
    }
    .front-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 8px 12px;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--text);
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }
    .front-filter-body {
        display: none;
        margin-top: 0.75rem;
    }
    .front-filter.is-open .front-filter-body {
        display: block;
    }
}

@media (max-width: 600px) {
    .header-inner { gap: 8px; }
    .search-bar { width: 140px; padding: 6px 10px; }
    .hero h1 { font-size: 1.5rem; line-height: 1.25; }
    .stats-inner { flex-direction: column; align-items: stretch; }
    .stat-chip { justify-content: center; }
    .front-tabs { margin-bottom: 0.75rem; }
    .front-tabs a { padding: 8px 14px; font-size: 13px; }
    .front-filter .filter-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .front-filter .filter-chips { flex-wrap: wrap; }
    .block-more a { padding: 10px 16px; font-size: 12px; }
    .btn-cta { padding: 10px 20px; font-size: 14px; }
    .detail-cta-wrap .btn-cta { display: block; text-align: center; }
    .screenshots { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .logo { font-size: 16px; }
    .search-bar { width: 120px; }
}
