/* ════════════════════════════════════════════
   web-minichill 主頁樣式（深色遊戲風）
   獨立於 css/app.css（app.css 為編譯版 Tailwind，僅 admin.html 使用）
   ════════════════════════════════════════════ */

:root {
    --bg: #0d1019;
    --bg-soft: #131726;
    --card: #161c2e;
    --card-hover: #1b2340;
    --border: #232a3d;
    --text: #e8edf5;
    --text-dim: #8fa3bd;
    --text-faint: #5d6b82;
    --accent: #7c5cff;
    --accent2: #19c3ff;
    --hot: #ff4757;
    --new: #2ed573;
    --grad1: #b79bff;
    --grad2: #6ad2ff;
    --glow: 124, 92, 255;
    --glow2: 25, 195, 255;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', 'PingFang TC', 'Microsoft JhengHei', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { display: block; }
[x-cloak] { display: none !important; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* ── Header ── */
#site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(13, 16, 25, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #1a2030; }
.brand-name {
    font-size: 18px; font-weight: 800; letter-spacing: .3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: linear-gradient(90deg, var(--grad1), var(--grad2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* 語言選單 */
.lang-box { position: relative; }
.lang-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 13px; border-radius: 999px; cursor: pointer;
    background: var(--card); color: var(--text-dim);
    border: 1px solid var(--border);
    font-size: 13px; font-weight: 600; font-family: inherit;
    transition: color .15s, border-color .15s;
}
.lang-btn:hover { color: #fff; border-color: #3a4663; }
.lang-btn svg { width: 15px; height: 15px; }
.lang-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
    min-width: 150px; padding: 5px;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 13px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .5);
}
.lang-item {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 9px 13px; border: 0; border-radius: 9px; cursor: pointer;
    background: none; color: var(--text-dim);
    font-size: 13px; font-weight: 600; font-family: inherit; text-align: left;
}
.lang-item:hover { background: var(--card-hover); color: #fff; }
.lang-item.on { color: var(--accent2); }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 40px 16px 26px;
    background:
        radial-gradient(640px 230px at 30% -40px, rgba(var(--glow), .28), transparent 70%),
        radial-gradient(640px 230px at 70% -40px, rgba(var(--glow2), .16), transparent 70%);
}
.hero-title {
    margin: 0; font-size: clamp(25px, 5vw, 40px); font-weight: 800; line-height: 1.25;
    background: linear-gradient(92deg, var(--grad1) 10%, var(--grad2) 90%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tagline { margin: 12px auto 0; font-size: 14px; color: var(--text-dim); max-width: 680px; margin-left: auto; margin-right: auto; line-height: 1.8; }
.hero-stats {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 18px; padding: 8px 18px;
    border: 1px solid var(--border); border-radius: 999px;
    background: rgba(22, 28, 46, .65);
    font-size: 13px; color: var(--text-dim);
}
.hero-stats b { color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }

/* 在線綠點（脈衝動畫） */
.live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--new);
    display: inline-block; flex: 0 0 auto;
    animation: livepulse 2s ease-out infinite;
}
.live-dot.small { width: 6px; height: 6px; }
@keyframes livepulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 213, 115, .55); }
    70% { box-shadow: 0 0 0 6px rgba(46, 213, 115, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0); }
}

/* ── 區塊標題 ── */
main { flex: 1 1 auto; }
.sec { margin-top: 8px; }
.sec-title {
    display: flex; align-items: center; gap: 8px;
    margin: 28px 0 16px; font-size: 18px; font-weight: 800; color: #fff;
}
.sec-title svg { width: 19px; height: 19px; color: var(--accent2); flex: 0 0 auto; }

/* ── 熱門遊戲卡片 ── */
.hot-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 22px 12px; padding: 2px 0 4px;
}
.gcard { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.gcard-icon {
    position: relative; width: 100%; max-width: 116px; aspect-ratio: 1;
    border-radius: 24%; overflow: hidden; background: #1a2030;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
    transition: transform .22s ease, box-shadow .22s ease;
}
.gcard-icon img { width: 100%; height: 100%; object-fit: cover; }
.gcard:hover .gcard-icon {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 12px 30px rgba(var(--glow), .38);
}
.gcard-badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; }
.badge {
    font-size: 9px; font-weight: 800; letter-spacing: .5px; line-height: 1;
    padding: 3px 5px; border-radius: 5px; color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.badge-hot { background: var(--hot); }
.badge-new { background: var(--new); color: #0a2614; }
.gcard-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(9, 11, 19, .5); opacity: 0; transition: opacity .18s ease;
}
.gcard:hover .gcard-overlay { opacity: 1; }
.play-circle {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; font-size: 15px; padding-left: 3px;
    box-shadow: 0 4px 16px rgba(var(--glow), .6);
}
.gcard-name {
    font-size: 13px; font-weight: 700; color: var(--text); text-align: center;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gcard-online {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}

/* ── 中段廣告 ── */
.ad-mid {
    margin: 28px 0; width: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}

/* 廣告測試模式占位框 */
.ad-ph {
    display: flex; align-items: center; justify-content: center;
    border: 1px dashed #5d6b82; border-radius: 8px;
    background: rgba(42, 52, 80, .35);
    color: var(--text-dim); font-size: 12px; letter-spacing: 1px;
    text-align: center; line-height: 1.6;
}

/* ── 全部遊戲列表（排行榜式） ── */
.game-list {
    border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
    background: var(--bg-soft);
}
.game-row {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 18px; border-bottom: 1px solid var(--border);
    transition: background .15s ease;
}
.game-row:last-child { border-bottom: 0; }
.game-row:hover { background: var(--card-hover); }
.rank {
    width: 26px; flex: 0 0 auto; text-align: center;
    font-size: 15px; font-weight: 800; color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}
.rank-1 { color: #ffc24b; }
.rank-2 { color: #c8d2e0; }
.rank-3 { color: #d4915f; }
.row-icon {
    width: 72px; height: 72px; flex: 0 0 auto;
    border-radius: 16px; overflow: hidden; background: #1a2030;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.row-icon img { width: 100%; height: 100%; object-fit: cover; }
.row-info { flex: 1 1 auto; min-width: 0; }
.row-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.row-name {
    font-size: 17px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-online {
    display: flex; align-items: center; gap: 5px; margin-top: 3px;
    font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.row-desc {
    margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--text-faint);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.row-play {
    flex: 0 0 auto; padding: 9px 22px; border-radius: 999px;
    background: linear-gradient(92deg, var(--accent), var(--accent2));
    color: #fff; font-size: 14px; font-weight: 800; white-space: nowrap;
    box-shadow: 0 3px 12px rgba(var(--glow), .35);
    transition: transform .15s ease, box-shadow .15s ease;
}
.game-row:hover .row-play {
    transform: scale(1.06);
    box-shadow: 0 5px 18px rgba(var(--glow), .55);
}

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
    border: 1px solid var(--border); border-radius: 13px;
    background: var(--bg-soft); overflow: hidden;
}
.faq-item summary {
    padding: 13px 16px; cursor: pointer; list-style: none;
    font-size: 14px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--text-faint); font-size: 17px; font-weight: 400; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { margin: 0; padding: 0 16px 14px; font-size: 13px; line-height: 1.7; color: var(--text-dim); }

/* ── 側欄廣告（超寬螢幕才顯示） ── */
.rail {
    position: fixed; top: 50%; transform: translateY(-50%); z-index: 40;
    display: none; flex-direction: column; align-items: center;
    width: 160px; min-height: 600px;
}
.rail-l { right: calc(50% + 560px); }
.rail-r { left: calc(50% + 560px); }
@media (min-width: 1560px) {
    .rail { display: flex; }
}

/* ── 載入 / 空狀態 ── */
.loader { display: flex; flex-direction: column; align-items: center; padding: 80px 0; color: var(--text-faint); }
.spinner {
    width: 34px; height: 34px; margin-bottom: 14px;
    border: 4px solid rgba(var(--glow), .25); border-top-color: var(--accent);
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 48px 0; color: var(--text-faint); font-size: 14px; }

/* ── Footer ── */
footer {
    margin-top: 44px; padding: 26px 16px 34px;
    border-top: 1px solid var(--border);
    text-align: center; font-size: 13px; color: var(--text-faint);
}
.foot-links { margin-bottom: 10px; }
.foot-links a { color: var(--text-dim); font-weight: 600; transition: color .15s; }
.foot-links a:hover { color: #fff; }
.foot-sep { margin: 0 10px; color: var(--text-faint); }

/* ── 手機微調 ── */
@media (max-width: 480px) {
    .hot-grid { gap: 18px 8px; }
    .gcard-name { font-size: 12px; }
    .row-desc { -webkit-line-clamp: 1; }
    .row-play { padding: 7px 14px; font-size: 12px; }
    .rank { width: 20px; font-size: 13px; }
}

/* ── 主頁風格主題（後台「主頁風格」選擇，類別掛 body）── */
body.theme-violet  { --bg:#120b1d; --bg-soft:#1a1128; --card:#1e1430; --card-hover:#271a40; --border:#332347; --accent:#a855f7; --accent2:#ec4899; --grad1:#d8b4fe; --grad2:#f9a8d4; --glow:168,85,247; --glow2:236,72,153; }
body.theme-forest  { --bg:#0a1410; --bg-soft:#0f1d17; --card:#13241c; --card-hover:#1a3026; --border:#23402f; --accent:#10b981; --accent2:#34d399; --grad1:#6ee7b7; --grad2:#a7f3d0; --glow:16,185,129; --glow2:52,211,153; }
body.theme-crimson { --bg:#160b0d; --bg-soft:#201013; --card:#271317; --card-hover:#331a20; --border:#46232b; --accent:#f43f5e; --accent2:#fb923c; --grad1:#fda4af; --grad2:#fdba74; --glow:244,63,94; --glow2:251,146,60; }
body.theme-slate   { --bg:#0a0a0c; --bg-soft:#121216; --card:#16161c; --card-hover:#1e1e26; --border:#2a2a34; --accent:#64748b; --accent2:#94a3b8; --grad1:#cbd5e1; --grad2:#94a3b8; --glow:100,116,139; --glow2:148,163,184; }
