* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #0b0e14;
    color: #e6e9ef;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

#stage {
    display: block;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

.screen {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 8, 12, 0.82);
}

.screen.hidden { display: none; }

.panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(100%, 400px);
    padding: 22px 20px;
    background: #121722;
    border: 1px solid #2a3346;
    border-radius: 14px;
    text-align: center;
}

.ticker { margin: 0; font-size: 12px; letter-spacing: 3px; color: #ef4b4b; font-family: Menlo, monospace; }
.panel h1 { margin: 0; font-size: 38px; letter-spacing: 4px; color: #fff; }
.panel h2 { margin: 0; font-size: 26px; color: #ef4b4b; }
.sub { margin: 0; color: #9aa4b8; }
.rules { margin: 4px 0; padding: 0; list-style: none; text-align: left; font-size: 14px; line-height: 1.8; }
.rules b { color: #ffd166; }
.final { margin: 6px 0; font-size: 18px; }
.final strong { font-size: 32px; color: #ffd166; font-family: Menlo, monospace; }
.best { margin: 0; font-size: 13px; color: #7d879b; min-height: 1em; }

.btn {
    padding: 12px 10px;
    border: none;
    border-radius: 10px;
    background: #ef4b4b;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

.btn-big { font-size: 20px; padding: 14px; }
.btn-ghost { background: transparent; border: 1px solid #2f3a50; color: #cfd6e4; }

.panel { max-height: calc(100vh - 32px); overflow-y: auto; }
.share-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.share-img { display: block; width: auto; max-width: 100%; max-height: 42vh; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
.share-hint { margin: 0; font-size: 12px; color: #7d879b; }
.share-actions { display: flex; gap: 8px; width: 100%; }
.share-actions:empty { display: none; }
.share-btn { flex: 1; padding: 10px; border: 1px solid #ffd166; border-radius: 10px; background: transparent; color: #ffd166; font-size: 15px; font-weight: bold; font-family: inherit; cursor: pointer; }

/* 结算页：先看离最高还差多少，再一键重开；交割单点开才生成 */
.gap { margin: 4px 0 0; font-size: 21px; font-weight: bold; color: #ffd166; line-height: 1.4; }
.gap small { display: block; font-size: 13px; font-weight: normal; color: #9aa4b8; }
.gap.record { color: #ef4b4b; }
.panel > * { flex-shrink: 0; }   /* 展开交割单后面板超高时滚动，而不是把进度条压没 */
.gap-bar { height: 6px; border-radius: 3px; background: #1c2333; overflow: hidden; }
.gap-bar span { display: block; height: 100%; width: 0; background: #ffd166; }
.gap.record + .gap-bar span { background: #ef4b4b; }
.final { margin: 0; font-size: 15px; color: #9aa4b8; }
.final strong { font-size: 24px; }
.final-pct { font-family: Menlo, monospace; color: #ef4b4b; }
#againButton { transition: opacity 0.15s; }
#againButton.arming { opacity: 0.55; }
.over-actions { display: flex; }
.over-actions .btn { flex: 1; min-width: 0; }
.over-actions .btn + .btn { margin-left: 8px; }
.share-box.hidden { display: none; }

/* 今日行情 */
.daily-info { margin: -2px 0 2px; font-size: 12px; color: #ffd166; line-height: 1.6; }
.rank-line { margin: 0; font-size: 14px; color: #ffd166; }
.rank-line:empty { display: none; }
.btn-rank { padding: 9px 10px; font-size: 15px; background: transparent; border: 1px solid #ffd166; color: #ffd166; }
.btn-rank.hidden { display: none; }
.btn-rank:disabled { opacity: 0.6; }
.over-actions .btn { padding-left: 4px; padding-right: 4px; font-size: 14px; }
/* 英雄榜的「今日行情 / 自由盘」切换（B站适配层生成，样式只有本游戏用到） */
.lb-tabs { display: flex; margin: 10px 0 4px; }
/* 榜单卡片是浅色底（共用的 leaderboard.css） */
.lb-tab { flex: 1; padding: 8px 4px; border: 1px solid #d8cfb6; background: transparent; color: #6b6250; font: bold 14px 'PingFang SC', sans-serif; cursor: pointer; }
.lb-tab + .lb-tab { border-left: none; }
.lb-tab:first-child { border-radius: 8px 0 0 8px; }
.lb-tab:last-child { border-radius: 0 8px 8px 0; }
.lb-tab.active { color: #fff; border-color: #ef4b4b; background: #ef4b4b; }

/* 关注猴导送护盘（只在 B站 Toy 里出现） */
.btn-follow { padding: 10px; font-size: 15px; background: #ffd166; color: #3a2a00; box-shadow: 0 0 14px rgba(255, 209, 102, 0.35); }
.btn-follow[hidden] { display: none; }
.btn-follow.done { background: transparent; border: 1px solid #62c8ff; color: #62c8ff; box-shadow: none; }
.btn-follow:disabled { cursor: default; }
.follow-hint { margin: -4px 0 0; font-size: 12px; color: #7d879b; }
.follow-hint:empty, .btn-follow[hidden] + .follow-hint { display: none; }

/* 音乐开关：左下角，盖在画布上，点它不会触发跳跃 */
.mute-btn { position: fixed; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60; width: 36px; height: 36px; padding: 0; border: 1px solid #2f3a50; border-radius: 50%; background: rgba(18, 23, 34, 0.7); font-size: 17px; line-height: 34px; cursor: pointer; }
