
html, body {
    height: 100%; margin: 0; padding: 0; overflow: hidden;
    background: #07121b;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
.game-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; width: 100%; }

/* ================= 顶部指标栏 ================= */
.game-header {
    flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
    padding: 7px 12px;
    background: linear-gradient(180deg, #16283a 0%, #0d1a26 100%);
    border-bottom: 1px solid rgba(79, 195, 247, .22);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .5);
    overflow-x: auto; overflow-y: hidden; white-space: nowrap;
    scrollbar-width: thin;
}
.game-header::-webkit-scrollbar { height: 4px; }
.game-header::-webkit-scrollbar-thumb { background: rgba(79,195,247,.4); border-radius: 2px; }
.brand-h1 { margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; display: inline-flex; flex: 0 0 auto; }
.brand-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 15px; font-weight: 700; color: #4fc3f7 !important; text-decoration: none !important;
    padding: 4px 10px; border-radius: 6px;
    background: rgba(79, 195, 247, .1); border: 1px solid rgba(79, 195, 247, .25);
    transition: all .2s;
}
.brand-link:hover { background: rgba(79, 195, 247, .22); transform: translateY(-1px); }
.brand-link .glyphicon { font-size: 14px; }

.metric {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 16px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .07);
    font-size: 12.5px; color: #9fb8cc; flex: 0 0 auto; line-height: 1.5;
    transition: background .2s;
}
.metric .glyphicon { color: #4fc3f7; font-size: 12px; }
.metric b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 1.2em; display: inline-block; }
.metric.metric-score b { color: #ffd54f; }
.metric.metric-combo b { color: #ff8a65; }
.metric.metric-acc b { color: #81c784; }
.metric.metric-power b { color: #ff7043; }
.metric.metric-power.is-full {
    background: rgba(255, 213, 79, .18);
    border-color: rgba(255, 213, 79, .55);
    animation: powerHudPulse 1s ease-in-out infinite;
}
.metric.metric-power.is-full b { color: #ffd54f; }
@keyframes powerHudPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 79, .35); }
    50% { box-shadow: 0 0 12px 2px rgba(255, 213, 79, .45); }
}

.hdr-btns { margin-left: auto; display: inline-flex; gap: 6px; flex: 0 0 auto; padding-left: 8px; }
.btn-hdr {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 11px; font-size: 12.5px; color: #cfe3f5;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px; cursor: pointer; transition: all .18s;
    white-space: nowrap; outline: none;
}
.btn-hdr:hover, .btn-hdr:focus {
    background: rgba(79, 195, 247, .25); border-color: rgba(79, 195, 247, .55);
    color: #fff; text-decoration: none;
}
.btn-hdr .glyphicon { font-size: 12px; }

/* ================= 画布 ================= */
.game-main { flex: 1 1 auto; position: relative; overflow: hidden; background: #1b4f7a; min-height: 0; }
#gameCanvas { display: block; width: 100%; height: 100%; }

/* ================= 特效层 ================= */
#fxCanvas {
    position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: 2100; pointer-events: none; display: none;
}

/* ================= 模态框 ================= */
.modal-vertical-center { text-align: center; padding: 0 !important; }
.modal-vertical-center::before {
    content: ""; display: inline-block; height: 100%;
    vertical-align: middle; margin-right: -4px;
}
.modal-vertical-center .modal-dialog {
    display: inline-block; text-align: left; vertical-align: middle;
    margin: 18px auto; width: 560px; max-width: 94vw;
}
.modal-vertical-center .modal-content {
    border-radius: 14px; border: 1px solid rgba(79, 195, 247, .25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
    overflow: hidden; background: #0f1e2b; color: #cfe3f5;
}
.modal-vertical-center .modal-body { padding: 22px 26px 24px; }
.modal-vertical-center .modal-header {
    border-bottom: 1px solid rgba(79, 195, 247, .2);
    padding: 16px 26px;
    background: linear-gradient(180deg, #16283a, #101e2c);
    border-radius: 14px 14px 0 0;
}
.modal-vertical-center .modal-title {
    font-weight: 700; color: #4fc3f7; font-size: 18px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.modal-vertical-center .modal-title .glyphicon { color: #4fc3f7; }
.modal-vertical-center .close {
    margin-top: -6px; color: #cfe3f5; opacity: .7; text-shadow: none; filter: none;
}
.modal-vertical-center .close:hover { color: #fff; opacity: 1; }
.modal .btn-default {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .18);
    color: #cfe3f5;
}
.modal .btn-default:hover, .modal .btn-default:focus {
    background: rgba(79, 195, 247, .2); border-color: rgba(79, 195, 247, .5); color: #fff;
}
.modal .btn-default:active { background: rgba(79, 195, 247, .3); }
.modal-btn-row {
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px;
}
.modal-btn-row .btn {
    min-width: 140px; padding: 9px 18px; border-radius: 9px;
    font-weight: 600; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: all .18s;
}
.modal-btn-row .btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.game-intro {
    text-align: center; color: #8fb3cc; font-size: 14px; line-height: 1.9; margin: 6px 0 2px;
}
.game-intro .glyphicon { color: #4fc3f7; }

.rule-list { list-style: none; padding: 0; margin: 0; }
.rule-list li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 9px 0; border-bottom: 1px dashed rgba(79, 195, 247, .12);
    font-size: 13.5px; color: #a8c5da; line-height: 1.7;
}
.rule-list li:last-child { border-bottom: none; }
.rule-list .glyphicon { color: #4fc3f7; font-size: 14px; margin-top: 3px; flex: 0 0 auto; }
.rule-list kbd { background: #1a3044; color: #cfe3f5; border-radius: 4px; padding: 1px 7px; font-size: 12px; }
.rule-list .hl { color: #ffd54f; font-weight: 700; }
.rule-list .hl-run { color: #ff7043; font-weight: 700; }

.setting-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 4px; border-bottom: 1px dashed rgba(79, 195, 247, .12);
    font-size: 13.5px; color: #a8c5da;
}
.setting-row:last-child { border-bottom: none; }
.setting-row .glyphicon { color: #4fc3f7; margin-right: 6px; }
.setting-row label { font-weight: 500; margin: 0; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 46px; height: 24px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: #2a4054; transition: .25s; border-radius: 24px;
}
.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background-color: #cfdde8;
    transition: .25s; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.switch input:checked + .slider { background-color: #2f8fd0; }
.switch input:checked + .slider:before { background-color: #fff; transform: translateX(22px); }

.lb-table { width: 100%; font-size: 12.5px; border-collapse: separate; border-spacing: 0 5px; table-layout: fixed; }
.lb-table th {
    color: #6b8ba3; font-weight: 600; font-size: 11px;
    text-align: center; padding: 4px 4px;
    text-transform: uppercase; letter-spacing: .3px;
}
.lb-table td {
    background: rgba(79, 195, 247, .06); padding: 8px 4px; text-align: center;
    color: #cfe3f5; font-variant-numeric: tabular-nums; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-table td:first-child { border-radius: 8px 0 0 8px; }
.lb-table td:last-child { border-radius: 0 8px 8px 0; }
.lb-table tr.lb-new td {
    background: linear-gradient(90deg, rgba(255,193,7,.22), rgba(255,193,7,.08));
    color: #ffd54f; animation: lbPulse 1.2s ease-in-out infinite;
}
@keyframes lbPulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(255,193,7,0); }
    50% { box-shadow: inset 0 0 0 2px rgba(255,193,7,.45); }
}
.lb-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(79, 195, 247, .15); color: #8fb3cc;
    font-size: 12px; font-weight: 700;
}
.lb-rank.r1 { background: linear-gradient(135deg,#ffd54f,#ffb300); color: #6b4b00; }
.lb-rank.r2 { background: linear-gradient(135deg,#e0e0e0,#bdbdbd); color: #4a4a4a; }
.lb-rank.r3 { background: linear-gradient(135deg,#ffb74d,#e08b2c); color: #573100; }

.result-hero { text-align: center; padding: 6px 0 4px; }
.result-hero .result-icon {
    font-size: 52px; line-height: 1; display: inline-block;
    animation: heroBounce .9s cubic-bezier(.28,.84,.42,1) both;
}
@keyframes heroBounce {
    0% { transform: scale(.2) rotate(-25deg); opacity: 0; }
    60% { transform: scale(1.18) rotate(6deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.result-hero .result-title { font-size: 22px; font-weight: 800; margin: 10px 0 4px; letter-spacing: 1px; }
.result-hero.win .result-title { color: #ffd54f; }
.result-hero.encourage .result-title { color: #81c784; }
.result-hero .result-score {
    font-size: 46px; font-weight: 900; line-height: 1.1;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #4fc3f7, #2f8fd0);
    -webkit-background-clip: text; background-clip: text;
    color: transparent; letter-spacing: -1px;
}
.result-hero .result-score small { font-size: 17px; font-weight: 600; -webkit-text-fill-color: #7d95a8; color: #7d95a8; }
.result-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 4px;
}
.result-stats .rs-item { background: rgba(79, 195, 247, .08); border-radius: 10px; padding: 9px 4px; text-align: center; }
.result-stats .rs-item .glyphicon { color: #4fc3f7; font-size: 13px; }
.result-stats .rs-item .rs-val {
    display: block; font-size: 16px; font-weight: 800; color: #e8f4fc;
    margin-top: 3px; font-variant-numeric: tabular-nums;
}
.result-stats .rs-item .rs-lbl { font-size: 11px; color: #6b8ba3; }
.rank-tip {
    margin: 12px 0 2px; padding: 10px 14px; border-radius: 10px;
    background: linear-gradient(90deg, rgba(255,193,7,.14), rgba(255,193,7,.05));
    border: 1px solid rgba(255,193,7,.35); color: #ffd54f;
    font-size: 13.5px; text-align: center; font-weight: 600;
    animation: tipGlow 1.6s ease-in-out infinite;
}
@keyframes tipGlow {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,193,7,.3); }
    50% { box-shadow: 0 0 14px 2px rgba(255,193,7,.3); }
}
.lb-empty { text-align: center; color: #6b8ba3; padding: 34px 0; font-size: 13.5px; }
.lb-empty .glyphicon { font-size: 34px; display: block; margin-bottom: 10px; color: #2c4a5e; }
.pause-hint { text-align: center; color: #6b8ba3; font-size: 13px; margin-top: 14px; }

@media (max-width: 767px) {
    .game-header { padding: 6px 8px; gap: 6px; }
    .brand-link { font-size: 13px; padding: 3px 8px; }
    .metric { font-size: 11.5px; padding: 3px 8px; }
    .btn-hdr { font-size: 11.5px; padding: 4px 8px; }
    .result-stats { grid-template-columns: repeat(2, 1fr); }
    .modal-btn-row .btn { min-width: 115px; font-size: 13px; }
    .lb-table { font-size: 11px; }
    .lb-table th, .lb-table td { padding: 6px 2px; }
}
@media (min-width: 768px) {
    .modal-dialog {
        min-width: auto;
        width: auto;
    }
}