/* ============================================================
 * 微游戏公共样式（光球不落 / 转盘停针 / 光环接球 / 一刀切准 / 光点逃生 / 弹球拆砖 / 雷霆空战）
 * 仅被新增小游戏页面引用，不改动其他工具页
 * ============================================================ */

.mg-panel {
    position: relative;
    padding: 14px;
    border-radius: 20px;
    background: radial-gradient(120% 130% at 50% 0%, #0e2439 0%, #081420 45%, #050c15 100%);
    border: 1px solid rgba(56, 189, 248, 0.16);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mg-hud {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px 12px;
}

.mg-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 72px;
}

.mg-stat.center {
    flex: 1;
    align-items: center;
    text-align: center;
}

.mg-stat.right {
    align-items: flex-end;
    text-align: right;
}

.mg-label {
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    color: #94a3b8;
    text-transform: uppercase;
    white-space: nowrap;
}

.mg-value {
    font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.mg-value.small {
    font-size: 1.05rem;
    color: #fbbf24;
}

.mg-value.accent {
    color: var(--mg-accent, #22d3ee);
}

.mg-sub-value {
    font-size: 0.72rem;
    color: #94a3b8;
    letter-spacing: 0.06em;
}

.mg-lives {
    display: flex;
    gap: 4px;
    font-size: 0.88rem;
    color: #ef4444;
}

.mg-lives i.off {
    color: rgba(148, 163, 184, 0.35);
}

.mg-stage {
    position: relative;
    width: 100%;
    height: clamp(340px, 60vh, 600px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: #050d18;
    box-shadow: inset 0 0 80px rgba(34, 211, 238, 0.05), 0 18px 50px rgba(0, 0, 0, 0.45);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: crosshair;
}

.mg-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.mg-toast {
    position: absolute;
    left: 50%;
    top: 16%;
    transform: translateX(-50%);
    max-width: 82%;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #e2e8f0;
    background: rgba(8, 18, 30, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.14);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 5;
}

.mg-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 20px;
    background: radial-gradient(circle at 50% 40%, rgba(18, 40, 64, 0.82), rgba(4, 10, 18, 0.92));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.mg-overlay h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #f8fafc;
    text-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.mg-overlay .mg-logo {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    line-height: 1;
    color: var(--mg-accent, #22d3ee);
    text-shadow: 0 0 34px rgba(34, 211, 238, 0.35);
}

.mg-overlay .mg-sub {
    max-width: 360px;
    margin: 12px 0 0;
    font-size: 0.84rem;
    line-height: 1.75;
    color: #94a3b8;
}

.mg-overlay .mg-best {
    margin-top: 14px;
    font-size: 0.78rem;
    color: #64748b;
}

.mg-overlay .mg-best b {
    color: #fbbf24;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 1rem;
}

.mg-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.mg-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    border-radius: 12px;
    transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}

.mg-btn.primary {
    padding: 12px 40px;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    color: #07131f;
    background: linear-gradient(135deg, var(--mg-accent, #22d3ee), var(--mg-accent-2, #818cf8));
    box-shadow: 0 10px 28px rgba(34, 211, 238, 0.26);
}

.mg-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(34, 211, 238, 0.38);
}

.mg-btn.primary:active {
    transform: translateY(0) scale(0.97);
}

.mg-btn.ghost {
    padding: 10px 22px;
    font-size: 0.82rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.mg-btn.ghost:hover {
    background: rgba(255, 255, 255, 0.13);
}

.mg-btn.ghost:active {
    transform: scale(0.96);
}

.mg-tips {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 18px;
    font-size: 0.73rem;
    color: #64748b;
}

.mg-tips i {
    color: var(--mg-accent, #22d3ee);
    margin-right: 4px;
}

.mg-final {
    margin-top: 14px;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    color: var(--mg-accent, #22d3ee);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 6px 26px rgba(34, 211, 238, 0.24);
}

.mg-final-label {
    margin-top: 4px;
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    color: #64748b;
}

.mg-record {
    display: inline-block;
    margin-top: 12px;
    padding: 3px 14px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    animation: mgRecordPulse 1.2s ease-in-out infinite;
}

.mg-record.muted {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.2);
    animation: none;
}

@keyframes mgRecordPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.mg-result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 360px;
    margin-top: 16px;
}

.mg-result-grid div {
    padding: 9px 4px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
}

.mg-result-grid b {
    display: block;
    font-size: 1rem;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', Consolas, monospace;
}

.mg-result-grid span {
    font-size: 0.62rem;
    color: #64748b;
}

.mg-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.04em;
}

.mg-foot i {
    color: var(--mg-accent, #22d3ee);
    margin-right: 5px;
}

.mg-fps {
    margin-left: auto;
    font-family: 'JetBrains Mono', Consolas, monospace;
    color: #475569;
}

.mg-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--mg-accent, #22d3ee);
    box-shadow: 0 0 8px var(--mg-accent, #22d3ee);
}

@media (max-width: 600px) {
    .mg-panel {
        padding: 10px;
        border-radius: 16px;
    }
    .mg-stage {
        height: clamp(320px, 58vh, 520px);
        border-radius: 13px;
    }
    .mg-value {
        font-size: 1.4rem;
    }
    .mg-value.small {
        font-size: 0.92rem;
    }
    .mg-hud {
        gap: 8px;
        padding-bottom: 10px;
    }
    .mg-label {
        font-size: 0.6rem;
        letter-spacing: 0.1em;
    }
    .mg-overlay .mg-logo {
        font-size: 1.9rem;
    }
    .mg-overlay h2 {
        font-size: 1.3rem;
    }
    .mg-final {
        font-size: 2.4rem;
    }
    .mg-result-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .mg-foot {
        gap: 10px;
        font-size: 0.68rem;
    }
    .mg-fps {
        display: none;
    }
}

/* ===================== 亮色主题 ===================== */
html[data-theme="light"] .mg-panel {
    background: radial-gradient(120% 130% at 50% 0%, #ffffff 0%, #eef4fb 50%, #e6eef8 100%);
    border-color: rgba(79, 70, 229, 0.16);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .mg-label {
    color: #64748b;
}

html[data-theme="light"] .mg-value {
    color: #0f172a;
    text-shadow: none;
}

html[data-theme="light"] .mg-value.small {
    color: #b45309;
}

html[data-theme="light"] .mg-sub-value {
    color: #64748b;
}

html[data-theme="light"] .mg-stage {
    background: #eef2ff;
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: inset 0 0 70px rgba(99, 102, 241, 0.07), 0 18px 44px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .mg-toast {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .mg-overlay {
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.94));
}

html[data-theme="light"] .mg-overlay h2 {
    color: #0f172a;
    text-shadow: none;
}

html[data-theme="light"] .mg-overlay .mg-sub {
    color: #475569;
}

html[data-theme="light"] .mg-overlay .mg-best {
    color: #64748b;
}

html[data-theme="light"] .mg-overlay .mg-best b {
    color: #b45309;
}

html[data-theme="light"] .mg-btn.primary {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5, #0e7490);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .mg-btn.ghost {
    color: #334155;
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .mg-tips,
html[data-theme="light"] .mg-foot {
    color: #64748b;
}

html[data-theme="light"] .mg-record {
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.3);
}

html[data-theme="light"] .mg-record.muted {
    color: #64748b;
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .mg-result-grid div {
    background: rgba(15, 23, 42, 0.045);
}

html[data-theme="light"] .mg-result-grid b {
    color: #0f172a;
}

html[data-theme="light"] .mg-final {
    color: #4f46e5;
    text-shadow: none;
}
