/* 星火游戏厅 · 共享样式 v2（质感升级：渐变/动效/移动端优化） */

/* ── 基础 ── */
.sg-wrap { max-width: 820px; margin: 0 auto; padding: 16px 16px 64px; }

/* ── 顶栏 ── */
.sg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sg-top .sg-back { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.88rem; padding: 7px 14px; border:1px solid rgba(255,255,255,0.15); border-radius: 22px; transition: all .2s; display:inline-flex; align-items:center; gap:6px; }
.sg-top .sg-back:hover { border-color: rgba(139,92,246,0.6); color: #c4b5fd; transform: translateX(-2px); }
.sg-top .sg-back .arrow { transition: transform .2s; display:inline-block; }
.sg-top .sg-back:hover .arrow { transform: translateX(-3px); }
.sg-title { font-size: 1.3rem; font-weight: 800; color: var(--form-text, #e2e8f0); display:flex; align-items:center; gap:10px; }
.sg-title .sg-emoji { font-size: 1.6rem; animation: sg-float 3s ease-in-out infinite; }
@keyframes sg-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }

/* ── 日报条（渐变升级）── */
.sg-briefing { font-size: 0.84rem; color: rgba(255,255,255,0.75); background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(236,72,153,0.08)); border: 1px solid rgba(139,92,246,0.3); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; line-height: 1.6; }

/* ── 画布区（移动端修复）── */
.sg-stage { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; padding: 12px; margin-bottom: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
#sg-canvas-wrap { display: flex; justify-content: center; }
#sg-canvas-wrap canvas { max-width: 100%; height: auto; border-radius: 12px; background: #0f172a; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }

/* ── 控制条（移动端优化）── */
.sg-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.sg-btn { padding: 10px 18px; border: none; border-radius: 12px; font-size: 0.88rem; font-weight: 600; cursor: pointer; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); transition: all .2s; text-decoration:none; display:inline-flex; align-items:center; gap:6px; box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.sg-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99,102,241,0.4); }
.sg-btn:active { transform: scale(0.95); }
.sg-btn.violet { background: linear-gradient(135deg, #8b5cf6, #d946ef); box-shadow: 0 4px 12px rgba(139,92,246,0.3); }
.sg-btn.amber { background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }
.sg-btn.secondary { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); color: rgba(255,255,255,0.85); box-shadow: none; }
.sg-btn.secondary:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }
.sg-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.sg-guest { font-size: 0.78rem; color: rgba(255,255,255,0.5); }

/* ── tips ── */
.sg-tips { min-height: 0; font-size: 0.84rem; color: #fbbf24; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.2); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; display: none; line-height: 1.6; }
.sg-tips.show { display: block; }

/* ── 经济口径行 ── */
.sg-costs { font-size: 0.8rem; color: rgba(255,255,255,0.55); line-height: 1.7; margin-bottom: 16px; }

/* ── HUD/toast/遮罩 ─ */
#sg-hud { position: relative; }
.sg-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: rgba(15,23,42,0.96); border: 1px solid rgba(139,92,246,0.6); color: #e2e8f0; padding: 12px 20px; border-radius: 26px; font-size: 0.88rem; opacity: 0; pointer-events: none; transition: all .3s; z-index: 900; max-width: 88vw; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.sg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sg-mask { position: fixed; inset: 0; background: rgba(2,6,23,0.78); display: flex; align-items: center; justify-content: center; z-index: 950; padding: 18px; backdrop-filter: blur(4px); }
.sg-dialog { background: #111827; border: 1px solid rgba(139,92,246,0.4); border-radius: 20px; padding: 24px; max-width: 440px; width: 100%; max-height: 82vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.6); }
.sg-dialog-title { font-size: 1.05rem; font-weight: 700; color: #e2e8f0; margin-bottom: 14px; }
.sg-settle-score { font-size: 2.2rem; font-weight: 800; text-align: center; background: linear-gradient(135deg, #a78bfa, #f472b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 8px; }
.sg-goal { text-align: center; font-size: 0.88rem; color: rgba(255,255,255,0.6); margin-bottom: 14px; }
.sg-goal.ok { color: #34d399; }
.sg-award { text-align: center; font-size: 0.94rem; color: #fbbf24; background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(245,158,11,0.08)); border: 1px solid rgba(251,191,36,0.3); border-radius: 12px; padding: 9px 12px; margin-bottom: 10px; animation: sg-shine 2s ease-in-out infinite; }
@keyframes sg-shine { 0%,100%{box-shadow:0 0 0 rgba(251,191,36,0)} 50%{box-shadow:0 0 12px rgba(251,191,36,0.3)} }
.sg-settle-note { font-size: 0.82rem; color: rgba(255,255,255,0.55); text-align: center; margin-bottom: 10px; line-height: 1.6; }
.sg-settle-note a { color: #a78bfa; }
.sg-btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 10px; }
.sg-settle-tip { font-size: 0.8rem; color: rgba(255,255,255,0.45); text-align: center; border-top: 1px dashed rgba(255,255,255,0.15); padding-top: 12px; margin-top: 12px; }
.sg-lb-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.sg-lb-table th { color: rgba(255,255,255,0.45); text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.1); font-weight: 500; }
.sg-lb-table td { color: rgba(255,255,255,0.8); padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sg-lb-rank { font-weight: 700; width: 36px; }
.sg-lb-rank.gold { color: #fbbf24; } .sg-lb-rank.silver { color: #94a3b8; } .sg-lb-rank.bronze { color: #cd7f32; }

/* ── 玩法/FAQ/互荐 ── */
.sg-section { margin-top: 26px; }
.sg-section h2 { font-size: 1.08rem; font-weight: 700; color: var(--form-text, #e2e8f0); border-left: 3px solid #8b5cf6; padding-left: 12px; margin-bottom: 14px; }
.sg-howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.sg-howto .step { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 14px; font-size: 0.86rem; color: rgba(255,255,255,0.75); line-height: 1.6; transition: all .2s; }
.sg-howto .step:hover { background: rgba(255,255,255,0.08); border-color: rgba(139,92,246,0.3); }
.sg-howto .step b { color: #a78bfa; display: block; margin-bottom: 5px; font-size: 0.9rem; }
.sg-faq details { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; transition: all .2s; }
.sg-faq details[open] { background: rgba(255,255,255,0.06); border-color: rgba(139,92,246,0.3); }
.sg-faq summary { cursor: pointer; font-size: 0.92rem; font-weight: 600; color: var(--form-text, #e2e8f0); }
.sg-faq details p { font-size: 0.86rem; color: rgba(255,255,255,0.65); margin: 10px 0 2px; line-height: 1.7; }
.sg-rec { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.sg-rec a { display: block; background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.06)); border: 1px solid rgba(99,102,241,0.3); border-radius: 14px; padding: 14px 16px; text-decoration: none; transition: all .2s; }
.sg-rec a:hover { transform: translateY(-3px); border-color: rgba(139,92,246,0.5); box-shadow: 0 8px 20px rgba(99,102,241,0.2); }
.sg-rec .r-name { color: #a5b4fc; font-weight: 700; font-size: 0.92rem; }
.sg-rec .r-why { color: rgba(255,255,255,0.6); font-size: 0.8rem; margin-top: 4px; }
.sg-notice { font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-top: 20px; line-height: 1.7; }

/* ── 大厅 hub（质感升级）── */
.sg-hub-hero { text-align: center; padding: 36px 24px 28px; background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(168,85,247,0.08), rgba(236,72,153,0.06)); border-radius: 20px; margin-bottom: 20px; border: 1px solid rgba(139,92,246,0.2); }
.sg-hub-hero h1 { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 10px; }
.sg-hub-hero .sg-tag { color: rgba(255,255,255,0.7); font-size: 0.95rem; max-width: 580px; margin: 0 auto 16px; line-height: 1.7; }
.sg-hub-hero .sg-sub { color: rgba(255,255,255,0.5); font-size: 0.82rem; margin-bottom: 20px; }
.sg-hub-hero .sg-cta { display: inline-block; padding: 12px 28px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border-radius: 28px; font-weight: 700; font-size: 0.95rem; text-decoration: none; transition: all .2s; box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.sg-hub-hero .sg-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.5); }

/* 积分可视化卡片 */
.sg-credit-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.sg-credit-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 14px; text-align: center; }
.sg-credit-card .cc-icon { font-size: 1.6rem; margin-bottom: 6px; }
.sg-credit-card .cc-label { font-size: 0.78rem; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.sg-credit-card .cc-value { font-size: 1.1rem; font-weight: 700; color: #fbbf24; }

/* 分类区（色条升级） */
.sg-cat { margin-top: 30px; }
.sg-cat > h2 { font-size: 1.12rem; color: var(--form-text, #e2e8f0); margin-bottom: 6px; display:flex; align-items:center; gap:8px; }
.sg-cat > .sg-cat-blurb { font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-bottom: 14px; }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.sg-card { display: block; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; padding: 20px; text-decoration: none; transition: all .25s; position: relative; overflow: hidden; }
.sg-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.sg-card[data-cat="match"]::before { background: linear-gradient(90deg, #f472b6, #ec4899); }
.sg-card[data-cat="tower"]::before { background: linear-gradient(90deg, #34d399, #10b981); }
.sg-card[data-cat="sim"]::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.sg-card[data-cat="board"]::before { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.sg-card:hover { transform: translateY(-4px) rotate(-0.5deg); border-color: rgba(139,92,246,0.5); box-shadow: 0 16px 40px rgba(99,102,241,0.2); }
.sg-card .sg-c-emoji { font-size: 2.2rem; margin-bottom: 10px; transition: transform .2s; }
.sg-card:hover .sg-c-emoji { transform: scale(1.15); }
.sg-card .sg-c-name { color: var(--form-text, #e2e8f0); font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.sg-card .sg-c-tag { color: rgba(255,255,255,0.6); font-size: 0.8rem; line-height: 1.5; }
.sg-card .sg-c-state { position: absolute; top: 14px; right: 14px; font-size: 0.7rem; padding: 3px 10px; border-radius: 12px; background: rgba(52,211,153,0.15); color: #34d399; font-weight: 600; }
.sg-card .sg-c-state.gold { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* ── 亮色主题 ── */
body.light .sg-toast { background: rgba(255,255,255,0.98); color: #1e293b; border-color: rgba(139,92,246,0.5); }
body.light .sg-dialog { background: #ffffff; border-color: rgba(139,92,246,0.35); }
body.light .sg-dialog *, body.light .sg-lb-table td { color: #334155; }
body.light .sg-settle-score { background: linear-gradient(135deg, #7c3aed, #db2777); -webkit-background-clip: text; }

/* ── 移动端优化 ── */
@media (max-width: 480px) {
    .sg-wrap { padding: 12px 12px 52px; }
    .sg-btn { padding: 9px 14px; font-size: 0.82rem; min-width: 80px; }
    .sg-hub-hero { padding: 28px 16px 22px; }
    .sg-hub-hero h1 { font-size: 1.6rem; }
    .sg-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .sg-card { padding: 16px; }
    .sg-dialog { padding: 20px; max-height: 80vh; }
    .sg-settle-score { font-size: 1.8rem; }
}
