* { box-sizing: border-box; }
html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;   /* 平时防止横向滚动 */
}

/* ★ 全屏时：锁定 body 高度，彻底消除纵向滚动条 */
html.cc-fullscreen, body.cc-fullscreen {
    height: 100vh;
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    top: 0; left: 0;
}

body {
    background: #06080f;
    background-image:
            radial-gradient(ellipse 80% 50% at 50% -20%, rgba(90,130,240,.12), transparent 65%),
            linear-gradient(180deg, #0a0d1a 0%, #05060c 100%);
    background-attachment: fixed;
    color: #c7d0f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.cc-app { display: flex; flex-direction: column; min-height: 100vh; padding: 0 14px 14px; max-width: 100%; }

/* ---------- 顶栏 ---------- */
.cc-topbar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
    padding: 9px 16px; margin: 0 -14px 12px;
    background: linear-gradient(180deg, #141a30 0%, #0e1224 100%);
    border-bottom: 1px solid #1e2545; box-shadow: 0 4px 18px rgba(0,0,0,.5);
    position: relative; z-index: 5;
}
.cc-brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; margin-right: 4px; }
.cc-brand-mark {
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(145deg, #ff8a6a, #c0291e);
    box-shadow: 0 0 14px rgba(255,120,90,.45), inset 0 1px 0 rgba(255,255,255,.3);
    position: relative; flex: 0 0 28px;
}
.cc-brand-mark::after {
    content: "★"; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #ffe9a8;
}
.cc-brand-title {
    font: 800 14px/1.1 "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 3px; color: #ffd54f;
    text-shadow: 0 0 14px rgba(255,213,79,.28);
}
.cc-stats {
    display: flex; align-items: center; flex: 1 1 auto; flex-wrap: wrap;
    gap: 6px 14px; min-width: 0; justify-content: center;
}
.cc-stat { display: flex; flex-direction: column; align-items: flex-start; min-width: 52px; line-height: 1.15; }
.cc-stat-label {
    font-size: 10px; letter-spacing: 1.2px; color: #5f6894;
    display: flex; align-items: center; gap: 4px;
}
.cc-stat-label .glyphicon { font-size: 9px; }
.cc-stat-value {
    font: 800 15px/1.2 Consolas, "Courier New", monospace;
    color: #d5ddff; font-variant-numeric: tabular-nums;
    transition: color .2s, transform .1s; white-space: nowrap;
}
.cc-stat-value.is-gold  { color: #ffd54f; text-shadow: 0 0 10px rgba(255,213,79,.3); }
.cc-stat-value.is-red   { color: #ff8095; text-shadow: 0 0 10px rgba(255,128,149,.28); }
.cc-stat-value.is-cyan  { color: #8cdcff; text-shadow: 0 0 10px rgba(140,220,255,.25); }
.cc-stat-value.is-green { color: #95e8a8; text-shadow: 0 0 10px rgba(149,232,168,.25); }
.cc-stat-value.pulse    { animation: statPulse .3s ease; }
@keyframes statPulse { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); } }

.cc-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; }
.btn.cc-act {
    background: linear-gradient(180deg, #1c2240 0%, #141936 100%);
    border: 1px solid #2a3158; color: #b8c3ec;
    font-size: 12px; padding: 6px 11px; border-radius: 7px;
    box-shadow: 0 2px 0 #0a0d1c, inset 0 1px 0 rgba(150,175,255,.08);
    transition: all .15s; white-space: nowrap; line-height: 1.2;
}
.btn.cc-act:hover, .btn.cc-act:focus {
    background: linear-gradient(180deg, #242c54 0%, #1a2044 100%);
    border-color: #3d67c9; color: #e8eeff; outline: none;
}
.btn.cc-act:active { transform: translateY(1px); box-shadow: 0 0 0 #0a0d1c, inset 0 2px 6px rgba(0,0,0,.45); }
.btn.cc-act .glyphicon { margin-right: 4px; font-size: 11px; }

/* ---------- 主游戏区 ---------- */
.cc-main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.cc-stage-frame {
    position: relative; width: 100%; border-radius: 14px; background: #04060d;
    border: 1px solid #1e2545;
    box-shadow: 0 0 0 1px #03050c, 0 22px 60px rgba(0,0,0,.7),
    0 0 80px rgba(70,95,200,.07), inset 0 1px 0 rgba(120,145,230,.06);
    overflow: hidden; transition: box-shadow .3s;
}
.cc-stage-frame.is-active {
    box-shadow: 0 0 0 1px #03050c, 0 22px 60px rgba(0,0,0,.7),
    0 0 90px rgba(120,160,255,.18), inset 0 1px 0 rgba(120,145,230,.12);
}
.cc-stage { position: relative; width: 100%; padding-bottom: 56.25%; background: #02030a; }
.cc-stage canvas {
    position: absolute; inset: 0;
    width: 100% !important; height: 100% !important; display: block;
    image-rendering: pixelated; image-rendering: crisp-edges;
}

/* ★ 全屏：脱离文档流 + 严格等比铺满视口，绝不溢出 */
.cc-stage-frame:fullscreen,
.cc-stage-frame:-webkit-full-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    border: none; border-radius: 0;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    box-shadow: none;
    overflow: hidden;
}
.cc-stage-frame:fullscreen .cc-stage,
.cc-stage-frame:-webkit-full-screen .cc-stage {
    width: min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw * 9 / 16));
    padding-bottom: 0;
    border-radius: 0;
}

.cc-understage {
    display: flex; align-items: center; gap: 14px;
    margin-top: 10px; padding: 0 4px; min-height: 26px;
}
.cc-progress-wrap { flex: 1 1 auto; min-width: 0; }
.cc-progress-head {
    display: flex; justify-content: space-between;
    font-size: 11px; color: #5f6894; margin-bottom: 5px; letter-spacing: .5px;
}
.cc-progress-head b { color: #9fb2c9; font-weight: 600; }
.cc-progress {
    height: 7px; border-radius: 4px; background: #0d1224;
    border: 1px solid #1e2545; overflow: hidden;
}
.cc-progress-fill {
    height: 100%; width: 0%; border-radius: 3px;
    background: linear-gradient(90deg, #3a86ff, #8cdcff);
    box-shadow: 0 0 10px rgba(140,220,255,.55);
    transition: width .18s linear, background .3s;
}
.cc-progress-fill.is-boss {
    background: linear-gradient(90deg, #d0291e, #ff8a6a);
    box-shadow: 0 0 12px rgba(255,120,90,.6);
}
.cc-combo-float {
    flex: 0 0 auto; font: 800 16px Consolas, monospace; color: #ffd54f;
    text-shadow: 0 0 16px rgba(255,213,79,.6);
    opacity: 0; transform: scale(.7) translateY(4px);
    transition: opacity .15s, transform .15s;
    white-space: nowrap; pointer-events: none;
}
.cc-combo-float.show { opacity: 1; transform: scale(1) translateY(0); }

/* ---------- 通用弹层遮罩（严格居中） ---------- */
.cc-overlay {
    position: fixed; inset: 0; z-index: 1900;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(4,6,14,.9);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    overflow-y: auto;
}
.cc-overlay.show { display: flex; }
.cc-overlay-inner {
    margin: auto;
    width: 100%;
    max-width: 440px;
    padding: 34px 30px 26px;
    background: linear-gradient(180deg, #141a30 0%, #0d1122 100%);
    border: 1px solid #232a4e; border-radius: 18px;
    box-shadow: 0 40px 100px rgba(0,0,0,.85), inset 0 1px 0 rgba(140,165,255,.08);
    text-align: center;
    transform: scale(.96); transition: transform .35s;
}
.cc-overlay.show .cc-overlay-inner { transform: scale(1); }

.cc-overlay-title {
    font: 800 34px/1.1 "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 6px; margin: 0 0 8px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
}
.cc-overlay-title .glyphicon { font-size: 26px; }
.cc-overlay-title.is-over { color: #ff6a7e; text-shadow: 0 0 30px rgba(255,106,126,.4); }
.cc-overlay-title.is-win  { color: #ffd54f; text-shadow: 0 0 30px rgba(255,213,79,.4); }
.cc-overlay-title.is-pause { color: #ffd54f; text-shadow: 0 0 30px rgba(255,213,79,.3); }
.cc-overlay-sub {
    font-size: 13.5px; color: #9fb2c9; margin: 0 0 22px; letter-spacing: 1px;
}

.cc-overlay-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px;
}
.cc-overlay-stat {
    padding: 11px 8px; background: #0d1224; border: 1px solid #1e2545;
    border-radius: 9px; text-align: center;
}
.cc-overlay-stat-label {
    font-size: 10.5px; color: #6d76a3; letter-spacing: 1px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}
.cc-overlay-stat-label .glyphicon { font-size: 10px; }
.cc-overlay-stat-value {
    font: 800 18px Consolas, monospace; color: #8cdcff; margin-top: 3px;
}
.cc-overlay-stat-value.gold { color: #ffd54f; }
.cc-overlay-stat-value.green { color: #95e8a8; }

.cc-overlay-buttons { display: flex; flex-direction: column; gap: 10px; }
.cc-overlay-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px; border-radius: 10px;
    border: 1px solid #2a3158;
    background: linear-gradient(180deg, #1c2240 0%, #141936 100%);
    color: #c1cbf0; font-size: 14px; font-weight: 600; letter-spacing: 2px;
    cursor: pointer; transition: all .15s; text-decoration: none;
    text-align: center; font-family: inherit;
}
.cc-overlay-btn:hover {
    border-color: #3d67c9; color: #e8eeff; text-decoration: none;
    background: linear-gradient(180deg, #242c54 0%, #1a2044 100%);
}
.cc-overlay-btn .glyphicon { font-size: 13px; }
.cc-overlay-btn.primary {
    background: linear-gradient(180deg, #ff8a6a 0%, #c0291e 100%);
    border: none; color: #fff;
    box-shadow: 0 4px 0 #7a1810, 0 8px 24px rgba(255,120,90,.35);
}
.cc-overlay-btn.primary:hover {
    background: linear-gradient(180deg, #ff9a7a 0%, #d0352a 100%);
    box-shadow: 0 4px 0 #7a1810, 0 12px 32px rgba(255,120,90,.5);
    color: #fff;
}
.cc-overlay-btn.primary:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #7a1810, 0 4px 14px rgba(255,120,90,.3);
}

/* ---------- 开始界面 ---------- */
.cc-start {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(70,100,200,.16), transparent 70%), rgba(4,6,14,.92);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
    opacity: 1; transition: opacity .35s;
}
.cc-start.hide { opacity: 0; pointer-events: none; }
.cc-start-inner {
    margin: auto;
    width: 100%; max-width: 560px;
    background: linear-gradient(180deg, #141a30 0%, #0d1122 100%);
    border: 1px solid #232a4e; border-radius: 18px;
    padding: 32px 30px 26px;
    box-shadow: 0 40px 100px rgba(0,0,0,.8), 0 0 0 1px rgba(140,165,255,.06), inset 0 1px 0 rgba(140,165,255,.08);
    transform: scale(1); transition: transform .35s;
}
.cc-start.hide .cc-start-inner { transform: scale(.96); }
.cc-start-logo { text-align: center; margin-bottom: 24px; }
.cc-start-logo h1 {
    font: 800 32px/1.1 "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 8px; color: #ffd54f; margin: 0 0 8px;
    text-shadow: 0 0 30px rgba(255,213,79,.3), 0 2px 0 #6b3a06;
}
.cc-start-logo p { margin: 0; font-size: 12px; letter-spacing: 6px; color: #6d76a3; }
.cc-start-section { margin-bottom: 20px; }
.cc-start-section:last-of-type { margin-bottom: 24px; }
.cc-start-label {
    font-size: 11px; color: #6d76a3; letter-spacing: 2px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
}
.cc-start-label .glyphicon { font-size: 11px; color: #5f6894; }
.cc-start-label::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, #1e2545, transparent);
}
.cc-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-choice-btn {
    flex: 1 1 90px; padding: 10px 12px; border-radius: 9px;
    background: #0d1224; border: 1px solid #232a4e;
    color: #9aa4cc; font-size: 13px; cursor: pointer;
    text-align: center; transition: all .15s; user-select: none;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.cc-choice-btn .glyphicon { font-size: 16px; }
.cc-choice-btn:hover { border-color: #3d67c9; color: #cdd7ff; background: #111834; }
.cc-choice-btn.is-active {
    border-color: #ffd54f; color: #ffd54f;
    background: linear-gradient(180deg, #1e2340 0%, #161b34 100%);
    box-shadow: 0 0 0 1px rgba(255,213,79,.18), 0 0 18px rgba(255,213,79,.12);
}
.cc-choice-btn .sub { display: block; font-size: 10px; color: #5f6894; }
.cc-choice-btn.is-active .sub { color: rgba(255,213,79,.7); }
.cc-start-btn {
    width: 100%; padding: 14px; border-radius: 11px; border: none;
    background: linear-gradient(180deg, #ff8a6a 0%, #c0291e 100%);
    color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 4px;
    cursor: pointer;
    box-shadow: 0 6px 0 #7a1810, 0 10px 30px rgba(255,120,90,.35);
    transition: all .15s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.cc-start-btn .glyphicon { font-size: 15px; }
.cc-start-btn:hover {
    background: linear-gradient(180deg, #ff9a7a 0%, #d0352a 100%);
    box-shadow: 0 6px 0 #7a1810, 0 12px 40px rgba(255,120,90,.5);
}
.cc-start-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #7a1810, 0 4px 14px rgba(255,120,90,.4); }
.cc-start-hint {
    margin-top: 14px; text-align: center;
    font-size: 11px; color: #4e5678; letter-spacing: .6px;
}
.cc-start-hint b { color: #ffd54f; font-weight: 600; }

/* ---------- 模态 ---------- */
.cc-modal .modal-content {
    background: linear-gradient(180deg, #141a30 0%, #0e1224 100%);
    border: 1px solid #232a4e; border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,.85), inset 0 1px 0 rgba(140,165,255,.06);
}
.cc-modal .modal-header { border-bottom: 1px solid #1e2545; padding: 15px 20px; }
.cc-modal .modal-title {
    color: #ffd54f; font-size: 15px; font-weight: 700; letter-spacing: .8px;
    display: flex; align-items: center; gap: 8px;
}
.cc-modal .modal-title .glyphicon { font-size: 13px; }
.cc-modal .modal-header .close { color: #6d76a3; opacity: .9; text-shadow: none; margin-top: 2px; }
.cc-modal .modal-header .close:hover { color: #fff; opacity: 1; }
.cc-modal .modal-body { padding: 18px 20px 22px; color: #a8b2d8; }
.cc-modal .modal-footer { border-top: 1px solid #1e2545; padding: 12px 20px; }
.cc-field { margin-bottom: 16px; }
.cc-field:last-child { margin-bottom: 0; }
.cc-field-label {
    font-size: 11px; color: #6d76a3; margin-bottom: 7px;
    letter-spacing: .8px;
    display: flex; align-items: center; gap: 6px;
}
.cc-field-label .glyphicon { font-size: 11px; }
.cc-keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 13px; align-items: center; }
.cc-keys .kk { text-align: right; }
.cc-keys .dd { color: #9aa4cc; }
kbd {
    display: inline-block; padding: 2px 7px; min-width: 22px; text-align: center;
    font: 600 11px/15px Consolas, monospace; color: #cdd6ff;
    background: #1a2040; border: 1px solid #333c6b;
    border-bottom-width: 2px; border-radius: 5px;
}

@media (max-width: 991px) {
    .cc-topbar { padding: 8px 12px; gap: 6px 10px; }
    .cc-stats { gap: 4px 12px; justify-content: flex-start; }
    .cc-stat-value { font-size: 14px; }
    .cc-brand-title { font-size: 13px; letter-spacing: 2px; }
}
@media (max-width: 640px) {
    .cc-app { padding: 0 8px 10px; }
    .cc-topbar { margin: 0 -8px 10px; }
    .cc-stat-label { font-size: 9px; }
    .cc-stat-value { font-size: 13px; }
    .cc-act { padding: 5px 8px; font-size: 11px; }
    .cc-start-inner { padding: 24px 20px 20px; }
    .cc-start-logo h1 { font-size: 24px; letter-spacing: 4px; }
    .cc-start-logo p { font-size: 10px; letter-spacing: 4px; }
    .cc-overlay-inner { padding: 26px 20px 20px; max-width: 100%; }
    .cc-overlay-title { font-size: 26px; letter-spacing: 4px; }
    .cc-overlay-title .glyphicon { font-size: 22px; }
    .cc-overlay-stat-value { font-size: 16px; }
}