/* Merged: collection.css, fishing.css, rocket.css, boss.css, group_battle.css, brawl.css, monopoly.css */

/* --- collection.css --- */
/* =========================================
   css/collection.css — 个人空间 (冒险基地) 全新白净版设计
   替代 adventure_base.css
   左侧：属性色渐变 + 砖砌花纹 + 宠物图 + 展示架
   右侧：深色面板 #1e1e2e + Tab(信息/图鉴)
   ========================================= */

/* ======== 主容器 ======== */
.adventure-base {
    width: 100%;
    height: 680px;
    max-height: calc(100vh - 64px);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: row;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border);
    box-sizing: border-box;
}

/* ======== 左侧：宠物展示区 (45%) ======== */
.ps-left {
    width: 44%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 属性主题背景色 */
.adventure-base[data-theme="fire"],
.ps-left-fire {
    background: linear-gradient(135deg, #ff6b3a 0%, #e74c2e 50%, #c0392b 100%);
}
.adventure-base[data-theme="water"],
.ps-left-water {
    background: linear-gradient(135deg, #4fc3f7 0%, #2196f3 50%, #1565c0 100%);
}
.adventure-base[data-theme="grass"],
.ps-left-grass {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 50%, #2e7d32 100%);
}
.adventure-base[data-theme="electric"],
.ps-left-electric {
    background: linear-gradient(135deg, #ffee58 0%, #fbc02d 50%, #f57f17 100%);
}
.adventure-base[data-theme="psychic"],
.ps-left-psychic {
    background: linear-gradient(135deg, #ce93d8 0%, #9c27b0 50%, #6a1b9a 100%);
}
.adventure-base[data-theme="ice"],
.ps-left-ice {
    background: linear-gradient(135deg, #80deea 0%, #26c6da 50%, #00838f 100%);
}
.adventure-base[data-theme="mech"],
.ps-left-mech {
    background: linear-gradient(135deg, #90a4ae 0%, #546e7a 50%, #37474f 100%);
}
.adventure-base[data-theme="ghost"],
.ps-left-ghost {
    background: linear-gradient(135deg, #b39ddb 0%, #7e57c2 50%, #4527a0 100%);
}
.adventure-base[data-theme="fairy"],
.ps-left-fairy {
    background: linear-gradient(135deg, #f48fb1 0%, #ec407a 50%, #c2185b 100%);
}

/* 属性花纹（砖砌错落） */
.ps-pattern {
    position: absolute;
    inset: -30px;
    right: -80px;
    opacity: 0.06;
    font-size: 5.5rem;
    color: #fff;
    z-index: 0;
    pointer-events: none;
    line-height: 1;
}

.ps-pattern .prow {
    display: flex;
    gap: 50px;
    margin-bottom: 30px;
}

.ps-pattern .prow:nth-child(even) {
    margin-left: 55px;
}

.ps-pattern i {
    transform: rotate(-20deg);
    flex-shrink: 0;
}

/* 左上角标签 */
.ps-label {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 16px;
    border-radius: var(--r-pill);
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-label-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 宠物图 */
.ps-pet {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ab-pet-img {
    width: auto;
    height: clamp(320px, 44vh, 420px);
    max-width: 76%;
    object-fit: contain;
    animation: ab-pet-breathe 3s ease-in-out infinite;
}

@keyframes ab-pet-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.ps-showcases {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 2;
    display: flex;
    gap: 12px;
}

.ps-show-frame {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.ps-show-frame.equipped {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(255, 255, 255, 0.72);
}

.ps-show-frame.empty i {
    opacity: 0.62;
}

.ps-show-frame:active {
    transform: scale(0.94);
}

.ps-show-frame img,
.ps-show-frame .ink-badge-icon {
    width: 88%;
    height: 88%;
    object-fit: contain;
}

/* ======== 右侧：深色信息面板 (55%) ======== */
.ps-right {
    width: 56%;
    background: #1e1e2e;
    padding: 24px 24px;
    display: flex;
    flex-direction: column;
    color: #fff;
    position: relative;
    z-index: 2;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.ps-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tab 栏 */
.ps-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ps-tab {
    min-height: 36px;
    padding: 8px 16px;
    border-radius: var(--r-pill);
    border: none;
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ps-tab.active {
    background: #fff;
    color: #1e1e2e;
}

.ps-tab-count {
    min-width: 34px;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.18);
    color: #ffd45a;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ps-tab.active .ps-tab-count {
    background: #ffd700;
    color: #1e1e2e;
}

/* 内容区 */
.ps-content {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.ps-content .ps-view.scrollable {
    overflow-y: auto;
    height: 100%;
    padding-right: 14px;
}

.ps-content .ps-view.scrollable::-webkit-scrollbar {
    width: 8px;
}

.ps-content .ps-view.scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.ps-content .ps-view.scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.ps-content .ps-view.scrollable::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.35);
}

.ps-view {
    display: none !important;
}

.ps-view.active {
    display: block !important;
}

.ps-view.active.ps-info-view {
    display: flex !important;
}

.ps-view.active.ps-showcase-view {
    display: flex !important;
    height: 100%;
    min-height: 0;
}

.ps-view.active.ps-synthesis-view {
    display: flex !important;
    height: 100%;
    min-height: 0;
}

/* === 信息页内容 === */
.ps-name {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 4px;
}

.ps-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.ps-name .type-badge,
.ps-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.ps-name .type-badge,
.ps-badge-type {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.12);
    margin-left: 0;
}

.ps-badge-lv {
    background: rgba(255, 215, 0, 0.16);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ps-pill i,
.ps-name .type-badge i {
    font-size: 0.72rem;
}

.adventure-base[data-theme="fire"] .ps-badge-type {
    background: rgba(255, 107, 58, 0.2);
    border-color: rgba(255, 145, 100, 0.34);
}

.adventure-base[data-theme="water"] .ps-badge-type {
    background: rgba(79, 195, 247, 0.2);
    border-color: rgba(133, 216, 255, 0.34);
}

.adventure-base[data-theme="grass"] .ps-badge-type {
    background: rgba(102, 187, 106, 0.2);
    border-color: rgba(146, 221, 150, 0.34);
}

.adventure-base[data-theme="electric"] .ps-badge-type {
    background: rgba(251, 192, 45, 0.22);
    border-color: rgba(255, 223, 120, 0.34);
    color: #fff7cc;
}

.adventure-base[data-theme="psychic"] .ps-badge-type {
    background: rgba(156, 39, 176, 0.22);
    border-color: rgba(214, 147, 232, 0.34);
}

.adventure-base[data-theme="ice"] .ps-badge-type {
    background: rgba(38, 198, 218, 0.2);
    border-color: rgba(141, 236, 247, 0.34);
}

.adventure-base[data-theme="mech"] .ps-badge-type {
    background: rgba(144, 164, 174, 0.2);
    border-color: rgba(194, 207, 214, 0.34);
}

.adventure-base[data-theme="ghost"] .ps-badge-type {
    background: rgba(126, 87, 194, 0.22);
    border-color: rgba(179, 157, 219, 0.34);
}

.adventure-base[data-theme="fairy"] .ps-badge-type {
    background: rgba(236, 64, 122, 0.2);
    border-color: rgba(244, 143, 177, 0.34);
}

.ps-title-tag {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    padding: 3px 12px;
    border-radius: var(--r-pill);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.ps-xp-bar {
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    overflow: hidden;
}

.ps-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #f39c12);
    border-radius: 7px;
}

/* 区块标签 */
.ps-section-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 勋章 */
.ps-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ps-badge {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.ps-badge.unlocked {
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.08);
}

.ps-badge.locked {
    color: rgba(255, 255, 255, 0.1);
}

/* 挂饰展示 */
.ps-ornaments {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.ps-ornaments-manage {
    margin-top: 6px;
    margin-bottom: 10px;
}

.ps-showcase-slot {
    text-align: center;
    width: 76px;
}

.ps-ornament {
    width: 68px;
    height: 68px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.25);
    padding: 0;
    cursor: pointer;
}

.ps-ornament.equipped {
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

.ps-ornament.empty i {
    opacity: 0.28;
}

.ps-ornament:active,
.ps-showcase-candidate:active,
.ps-filter-tab:active {
    transform: scale(0.96);
}

.ps-ornament.ink-featured {
    overflow: hidden;
}

.ps-ornament-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    margin-top: 2px;
}

/* 统计 */
.ps-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.ps-stat {
    text-align: center;
}

.ps-stat-val {
    font-size: 1.2rem;
    font-weight: 900;
    color: #ffd700;
}

.ps-stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
}

/* === 图鉴网格 (右侧Tab: 海怪/火箭) === */
.ps-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ps-gcard {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    color: inherit;
    font: inherit;
    position: relative;
}

.ps-gcard-img {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.2);
}

.ps-gcard-name {
    padding: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
}

.ps-gcard-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: calc(100% - 12px);
    min-height: 20px;
    margin: 0 6px 5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.ps-gcard.locked {
    opacity: 0.4;
}

.ps-gcard.locked .ps-gcard-img::after {
    content: '?';
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.15);
}

.ps-gcard-equip {
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    border: none;
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 6px;
}

.ps-gcard-equip.set {
    background: #ffd700;
    color: #1e1e2e;
}

.ps-gcard-equip.unset {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.ps-gcard-equip.full {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.32);
}

.ps-gcard-equip.disabled,
.ps-gcard-equip:disabled {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.28);
    cursor: default;
}

.ps-gcard-state {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
    min-height: 20px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ps-gcard-state.set {
    background: #ffd700;
    color: #1e1e2e;
}

.ps-gcard-state.unset {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
}

.ps-gcard-state.full {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.38);
}

.ps-gcard-count {
    position: absolute;
    right: 7px;
    bottom: 7px;
    z-index: 2;
    min-width: 28px;
    min-height: 20px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ffd700;
    color: #1e1e2e;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ps-showcase-manager {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.ps-showcase-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.ps-showcase-help {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}

.ps-showcase-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 20px;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.14);
    color: #ffd979;
    font-size: 0.66rem;
    font-weight: 900;
}

.ps-showcase-note {
    position: absolute;
    top: 4px;
    right: 0;
    z-index: 3;
    min-height: 26px;
    max-width: 170px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.14);
    color: #ffd979;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
}

.ps-showcase-note.active {
    opacity: 1;
}

.ps-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
    flex-shrink: 0;
}

.ps-filter-tab {
    min-height: 32px;
    padding: 5px 9px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.68rem;
    font-weight: 900;
    cursor: pointer;
}

.ps-filter-tab.active {
    background: #fff;
    border-color: #fff;
    color: #1e1e2e;
}

.ps-filter-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    font-size: 0.62rem;
}

.ps-showcase-gallery {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 8px;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 126px;
    align-content: start;
}

.ps-synthesis-manager {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ps-synthesis-tabs {
    margin-bottom: 12px;
}

.ps-synthesis-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(166px, auto);
    gap: 12px;
    align-content: start;
}

.ps-synthesis-list::-webkit-scrollbar,
.ps-showcase-gallery::-webkit-scrollbar {
    width: 8px;
}

.ps-synthesis-list::-webkit-scrollbar-track,
.ps-showcase-gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.ps-synthesis-list::-webkit-scrollbar-thumb,
.ps-showcase-gallery::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.24);
    border-radius: 999px;
}

.ps-synth-card {
    --synth-accent: #38bdf8;
    --synth-accent-soft: rgba(56, 189, 248, 0.1);
    --synth-accent-border: rgba(56, 189, 248, 0.55);
    min-height: 166px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    position: relative;
}

.ps-synth-card.synth-rarity-2 {
    --synth-accent: #38bdf8;
    --synth-accent-soft: rgba(56, 189, 248, 0.1);
    --synth-accent-border: rgba(56, 189, 248, 0.55);
}

.ps-synth-card.synth-rarity-3 {
    --synth-accent: #a78bfa;
    --synth-accent-soft: rgba(167, 139, 250, 0.11);
    --synth-accent-border: rgba(167, 139, 250, 0.58);
}

.ps-synth-card.synth-rarity-4 {
    --synth-accent: #fb923c;
    --synth-accent-soft: rgba(251, 146, 60, 0.11);
    --synth-accent-border: rgba(251, 146, 60, 0.58);
}

.ps-synth-card.synth-rarity-5 {
    --synth-accent: #f472b6;
    --synth-accent-soft: rgba(244, 114, 182, 0.12);
    --synth-accent-border: rgba(244, 114, 182, 0.6);
}

.ps-synth-card.ready {
    border-color: var(--synth-accent-border);
    background: var(--synth-accent-soft);
}

.ps-synth-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 58px;
}

.ps-synth-stack {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.ps-synth-stack span,
.ps-synth-result {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.ps-synth-stack span {
    opacity: 0.72;
}

.ps-synth-result {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    background: var(--synth-accent-soft);
    border: 1.5px solid var(--synth-accent-border);
}

.ps-synth-stack img,
.ps-synth-result img {
    max-width: 82%;
    max-height: 82%;
    object-fit: contain;
}

.ps-synth-stack span {
    position: relative;
}

.ps-synth-stack b {
    position: absolute;
    right: 3px;
    bottom: 3px;
    z-index: 2;
    min-width: 24px;
    min-height: 18px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--synth-accent);
    color: #111827;
    font-size: 0.56rem;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
}

.ps-synth-arrow {
    flex: 0 0 26px;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
}

.ps-synth-main {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 0;
}

.ps-synth-title {
    color: #fff;
    font-size: 0.86rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-synth-sub {
    color: rgba(255, 255, 255, 0.46);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25;
}

.ps-synth-progress {
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.ps-synth-progress div {
    height: 100%;
    border-radius: 999px;
    background: var(--synth-accent);
}

.ps-synth-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ps-synth-foot span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.76rem;
    font-weight: 900;
}

.ps-synth-btn {
    min-width: 78px;
    min-height: 34px;
    border: none;
    border-radius: 999px;
    background: var(--synth-accent);
    color: #1e1e2e;
    font-size: 0.76rem;
    font-weight: 900;
    cursor: pointer;
}

.ps-synth-btn:active {
    transform: scale(0.96);
}

.ps-synth-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

.ps-synth-card.is-synth-success .ps-synth-stack span {
    animation: psSynthMaterialUse 280ms ease-out;
}

.ps-synth-card.is-synth-success .ps-synth-result {
    animation: psSynthResultPop 420ms ease-out;
}

.ps-synth-card.is-synth-success .ps-synth-btn {
    background: #ffffff;
    color: #111827;
}

.ps-synth-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    min-width: 170px;
    max-width: 78%;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--synth-accent);
    color: #111827;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-synth-card.is-synth-success .ps-synth-toast {
    animation: psSynthToast 1100ms ease-out forwards;
}

@keyframes psSynthMaterialUse {
    0% { opacity: 0.72; transform: scale(1); }
    55% { opacity: 0.32; transform: scale(0.86); }
    100% { opacity: 0.72; transform: scale(1); }
}

@keyframes psSynthResultPop {
    0% { opacity: 0.65; transform: scale(0.94); }
    45% { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes psSynthToast {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
    18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -54%) scale(0.98); }
}

.ps-showcase-candidate {
    width: 100%;
    min-height: 126px;
    padding: 8px 4px 7px;
    box-sizing: border-box;
}

.ps-showcase-candidate.showcased {
    border-color: rgba(255, 215, 0, 0.58);
    background: rgba(255, 215, 0, 0.1);
}

.ps-showcase-candidate.is-full {
    opacity: 0.76;
}

.ps-showcase-empty {
    grid-column: 1 / -1;
    min-height: 155px;
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.36);
    font-size: 0.82rem;
    font-weight: 900;
}

.ps-showcase-empty i {
    font-size: 1.7rem;
    opacity: 0.45;
}

.ps-showcase-empty span {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.28);
}

.ink-badge-icon {
    width: 54px;
    height: 54px;
    display: inline-block;
    background-repeat: no-repeat;
    border-radius: 14px;
    flex-shrink: 0;
}

.ps-ornament .ink-badge-icon {
    width: 62px;
    height: 62px;
}

.ps-gcard-img .ink-badge-icon {
    width: 64px;
    height: 64px;
}

.ink-badge-card.ink-rarity-common { border-color: rgba(170, 190, 210, 0.34); }
.ink-badge-card.ink-rarity-rare { border-color: rgba(58, 210, 118, 0.4); }
.ink-badge-card.ink-rarity-epic { border-color: rgba(178, 92, 255, 0.48); }
.ink-badge-card.ink-rarity-legendary { border-color: rgba(255, 204, 74, 0.54); }
.ink-badge-card.ink-rarity-mythic { border-color: rgba(91, 222, 255, 0.58); }

/* ======== 无宠物状态 ======== */
.ab-no-pet {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.3rem;
    gap: 15px;
}

.ab-no-pet i {
    font-size: 4rem;
    opacity: 0.3;
}

/* ======== 响应式 ======== */
@media (max-height: 700px) {
    .ab-pet-img {
        width: 220px;
        height: 220px;
    }

    .ps-show-frame {
        width: 60px;
        height: 60px;
    }
}

/* --- fishing.css --- */
/* css/fishing.css - 最终完美版 (低配优化 + 居中布局) */

/* 1. 深海场景容器 */
#scene-game-fishing {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg,
            #4facfe 0%,
            #00f2fe 15%,
            #0575E6 45%,
            #021B79 75%,
            #020b2e 90%,
            #000000 100%);
}

/* 2. 泳道布局 (已修复：居中 + 宽度限制) */
.fishing-stage {
    width: 100%;
    height: 100%;
    position: relative;
    padding-top: 0;
}

.fishing-grid {
    /* --- 恢复单行水平轨道排列 --- */
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center; /* 修复少数人时过于分散 */
    gap: 15px;
    padding: 15px;

    width: calc(100% - 60px);
    /* 减去右侧栏宽度 */
    height: 100%; /* 取消 100vh，改为 100% */
    margin: 0;
    overflow: hidden !important;
}

/* 田字格模式 (Quadrant Layout) */
.fishing-grid.quadrant-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px; /* 加粗间隙，使分割线更明显 */
    background-color: rgba(255, 255, 255, 0.6); /* 提高不透明度，使十字分割线更明亮 */
    padding: 0; /* 去除全局 padding，最大化空间 */
    border: none; /* 移除外边框，仅保留中心十字分割线 */
}

.fishing-quadrant {
    position: relative;
    /* 组内单行水平排列 */
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center; /* 修复少数人时过于分散 */
    gap: 4px; /* 减小组内间距 */

    width: 100%;
    height: 100%;
    padding: 0; /* 移除内边距，完全填满 */
    background: linear-gradient(180deg, #4facfe 0%, #00f2fe 15%, #0575E6 45%, #021B79 75%, #020b2e 90%, #000000 100%);
    overflow: hidden;
    border-radius: 0; /* 移除圆角 */
}

.fishing-quadrant-title {
    display: none !important; /* 直接隐藏原生组号，现在组号已融合在组间大分数中 */
}

.fishing-lane {
    flex: 1 1 0;
    min-width: 0;
    max-width: 180px; /* 限制最大宽度，人少时不会被无限拉伸 */
    height: 100%;
    position: relative;
    cursor: pointer;
    overflow: visible; /* 改为 visible，允许顶部的水平信息栏超出泳道 */
    background: transparent; /* 移除泳道区分色 */
    border-radius: 0;
}

.quadrant-mode .fishing-lane {
    max-width: 170px;
}

/* 3. 潜水艇 - 三段式重构：头部固定，中间下潜 */
.sub-fixed {
    position: absolute;
    top: clamp(86px, 13%, 120px);
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(92px, 68%, 156px);
    height: 70px;
    z-index: 30;
    transition: transform 0.2s;
}

.sub-fixed:active {
    /* 修复点击瞬间丢失Y轴 -50% 偏移导致的跳动Bug */
    transform: translate(-50%, -50%) scale(0.95);
}

.sub-hull {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    background: url("../assets/game_fishing/submarine_cartoon.png") center / contain no-repeat;
}

/* 顶部信息容器 (固定在潜艇顶部，自下而上生长) */
.sub-header-container {
    position: absolute;
    bottom: 100%; /* 从潜艇顶部往上排布 */
    margin-bottom: 6px; /* 留出一定间隙 */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row; /* 横向排列：徽章和名字并排 */
    align-items: center;
    justify-content: center; /* 居中对齐 */
    gap: 6px;
    z-index: 40;
    width: max-content; /* 仅根据内容宽度自适应，防止强制拉伸变长 */
    max-width: 180%;
}

/* 圆形序号徽章 */
.sub-number-badge {
    background: #021B79;
    color: #fff;
    font-family: "Press Start 2P", monospace;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #4facfe;
    pointer-events: none;
    flex-shrink: 0;
    box-sizing: border-box;
    /* 确保边框包含在宽高内 */
}

/* 学生信息卡片 */
.sub-info {
    position: relative;
    width: auto;
    /* 移除 flex: 1，使其不被强制拉长 */
    min-width: 60px;
    max-width: 120px;
    height: 40px;
    /* 与徽章高度一致 */
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #4facfe;
    border-radius: 20px;
    overflow: hidden;
    box-sizing: border-box;
    /* 确保边框包含在宽高内 */

    /* ✅ 关键修改：让卡片本身成为 Flex 容器 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-xp-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #89f7fe 0%, #66a6ff 100%);
    z-index: 0;
    transition: width 0.5s;
}

.sub-name-wrapper {
    position: relative;
    z-index: 1;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
}

.sub-name-text {
    color: #021B79;
    font-size: clamp(0.9rem, 2vmin, 1.4rem);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

/* 4. 鱼线系统 */
.fishing-line-group {
    position: absolute;
    top: clamp(86px, 13%, 120px);
    left: 50%;
    /* 配合潜水艇居中 */
    width: 3px;
    height: 0%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 20;
    transition: height 0.5s;
}

.fishing-line-group.presenting {
    height: 30% !important;
    transition: height 0.8s ease-out;
}

.fishing-line-group.retracting {
    transition: height 0.6s;
}

.fishing-hook {
    position: absolute;
    bottom: -15px;
    left: -7px;
    width: 16px;
    height: 16px;
    border: 5px solid #fff;
    border-top: none;
    border-left: none;
    border-radius: 0 0 10px 0;
    transform: rotate(45deg);
}

.fish-presentation-name {
    position: absolute;
    bottom: -150px; /* 鱼变大了，名字也要往下挪，避免重叠 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #021B79;
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid #4facfe;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    animation: bubblePop 0.4s forwards 0.5s;
    z-index: 100;
    pointer-events: none;
}

/* 田字格模式下，各元素的位置微调 */
.quadrant-mode .sub-fixed,
.quadrant-mode .fishing-line-group {
    top: clamp(82px, 21%, 112px);
}

.quadrant-mode .fish-presentation-name {
    bottom: -80px;
    font-size: 0.8rem;
    padding: 4px 10px;
}

/* =========================================
   因为全面使用了自适应 Grid 和 Clamp，
   旧的硬编码尺寸覆盖规则可以废除了
   ========================================= */

/* XP 弹窗适配 */
.quadrant-mode .sub-xp-popup {
    top: 28px;
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* 象限内岩石缩小下移 */
.fishing-quadrant .rock-layer {
    width: 25% !important;
    bottom: -25px !important;
}

/* =========================================
   低配机专用：高性能特效系统
   ========================================= */

/* 1. 基础鱼样式 */
.hooked-fish {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 144px; /* 缩小鱼 */
    height: 144px;
    object-fit: contain;
    /* 移除 filter 提升性能 */
    animation: fishStruggle 1s infinite alternate;
    will-change: transform;
}

/* 2. 稀有度光效 (移除 filter 提升性能，使用普通样式代替或省略) */
.hooked-fish.rarity-2 {
    /* 移除 filter */
}

.hooked-fish.rarity-3 {
    /* 移除 filter */
}

/* 3. 闪光特效：移除高消耗的全息滤镜动画，只保留挣扎 */
.hooked-fish.is-shiny-catch {
    animation: fishStruggle 1s infinite alternate;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%); /* 用背景渐变替代光效 */
    border-radius: 50%;
}

/* 6. 收杆飞升 */
.fish-flying {
    animation: flyToBag 0.8s ease-in forwards;
}

/* 7. 前景岩石 (静态化) */
.foreground-rocks {
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(100% - 60px);
    /* 减去右侧栏宽度 */
    height: 0;
    pointer-events: none;
    z-index: 50;
    transform: translateZ(0);
}

.rock-layer {
    position: absolute;
    bottom: -15px;
    height: auto;
    width: 40%;
    object-fit: contain;
}

.rock-1 {
    left: -10%;
    width: 35%;
    z-index: 48;
    transform: scale(1.1);
}

.rock-2 {
    left: 10%;
    width: 30%;
    z-index: 50;
    transform: scaleX(-1);
    bottom: -20px;
}

.rock-3 {
    left: 28%;
    width: 38%;
    z-index: 49;
    transform: scale(1.3) rotate(-3deg);
}

.rock-6 {
    left: 48%;
    width: 35%;
    bottom: -20px;
    z-index: 51;
    transform: scale(1.2) rotate(2deg);
}

.rock-4 {
    left: 65%;
    width: 32%;
    z-index: 50;
    transform: scaleX(-1) scale(1.1);
}

.rock-5 {
    left: 85%;
    width: 35%;
    z-index: 48;
    transform: rotate(10deg);
}

/* 大屏适配 */
@media (min-width: 1600px) and (min-height: 900px) {
    /* ✅ 废弃潜艇、鱼线、名字卡片的硬编码绝对像素定位，统一沿用上面的相对弹性布局 */
    
    /* 仅保留岩石的大屏适配 */
    .rock-layer {
        width: 25%;
        bottom: -5px;
    }

    .rock-1 {
        left: -5%;
    }

    .rock-5 {
        left: 80%;
    }
}

/* XP 弹窗 */
.sub-xp-popup {
    position: absolute;
    top: 50px;
    /* 配合潜水艇上移 */
    left: 50%;
    /* 配合潜水艇居中 */
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ffd700;
    border-radius: 12px;
    color: #ffd700;
    padding: 4px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.sub-xp-popup.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(10px);
}

/* 气泡 */
.sea-bubble {
    position: absolute;
    bottom: 50px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4));
    border-radius: 50%;
    pointer-events: none;
    z-index: 55;
    opacity: 0;
    will-change: transform, opacity;
}

/* 水族馆 & 图鉴系统样式已统一迁移到 style.css，此处不再重复定义 */

/* --- rocket.css --- */
/* css/rocket.css - 星际火箭专属样式 */

#scene-game-rocket {
    background-color: #0d1117;
    background-image:
        radial-gradient(circle at 8% 24%, rgba(255,255,255,0.8) 0 1px, transparent 1.6px),
        radial-gradient(circle at 18% 58%, rgba(255,255,255,0.62) 0 1px, transparent 1.5px),
        radial-gradient(circle at 31% 34%, rgba(255,255,255,0.72) 0 1px, transparent 1.5px),
        radial-gradient(circle at 47% 67%, rgba(255,255,255,0.58) 0 1px, transparent 1.4px),
        radial-gradient(circle at 62% 29%, rgba(255,255,255,0.7) 0 1px, transparent 1.5px),
        radial-gradient(circle at 78% 54%, rgba(255,255,255,0.64) 0 1px, transparent 1.5px),
        radial-gradient(circle at 91% 18%, rgba(255,255,255,0.74) 0 1px, transparent 1.6px),
        radial-gradient(circle at 94% 73%, rgba(255,255,255,0.54) 0 1px, transparent 1.4px);
    background-repeat: no-repeat;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.meteor-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 60%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.meteor {
    position: absolute;
    top: -50px;
    width: 120px; height: 2px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, white 100%);
    border-radius: 50%;
    /* 移除高性能消耗的 drop-shadow */
    transform: rotate(-35deg);
    opacity: 0;
}
.meteor-1 { left: 90%; animation: meteorFly 10s linear infinite; animation-delay: 2s; }
.meteor-2 { left: 50%; width: 80px; animation: meteorFly 15s linear infinite; animation-delay: 10s; }
.meteor-3 { left: 10%; width: 150px; animation: meteorFly 20s linear infinite; animation-delay: 15s; }

.moon {
    position: absolute;
    top: 70px; right: 100px;
    width: 70px; height: 70px;
    border-radius: 50%;
    background: #f1c40f; /* 简化渐变为纯色 */
    box-shadow: none; /* 移除阴影 */
    z-index: 0;
    opacity: 0.9;
}

#scene-game-rocket .grid-container.game-grid {
    position: relative;
    /* --- 恢复单行水平轨道排列 --- */
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-end !important;
    gap: 10px !important;
    
    padding: 15px !important;       
    max-width: none !important;  
    margin: 0 !important;        
    width: calc(100% - 60px); /* 减去右侧栏宽度 */
    flex: 1;
    height: 100% !important; /* 取消 100vh，改为 100% */

    background: transparent; /* 移除灰色的背景色，直接看到天空黑色 */
    z-index: 10;
    overflow: hidden !important;
}

/* 田字格模式 (Quadrant Layout) */
#scene-game-rocket .grid-container.game-grid.quadrant-mode {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 4px !important; /* 加粗间隙，使分割线更明显 */
    background-image: none !important; /* 移除全局背景 */
    background-color: rgba(255, 255, 255, 0.6) !important; /* 提高不透明度，使十字分割线更明亮 */
    width: calc(100% - 60px) !important;
    height: 100% !important;
    padding: 0 !important; /* 去除全局 padding，最大化空间 */
    border: none; /* 移除外边框，仅保留中心十字分割线 */
}

.rocket-quadrant {
    position: relative;
    /* 组内单行水平排列 */
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 4px; /* 减小组内间距 */
    width: 100%;
    height: 100%;
    min-height: 0;
    background-color: #0d1117; /* 恢复每个象限的背景色，遮挡底层背景，只露出 gap */
    background-image:
        radial-gradient(circle at 9% 27%, rgba(255,255,255,0.78) 0 1px, transparent 1.6px),
        radial-gradient(circle at 22% 61%, rgba(255,255,255,0.56) 0 1px, transparent 1.4px),
        radial-gradient(circle at 36% 38%, rgba(255,255,255,0.7) 0 1px, transparent 1.5px),
        radial-gradient(circle at 51% 68%, rgba(255,255,255,0.58) 0 1px, transparent 1.4px),
        radial-gradient(circle at 63% 25%, rgba(255,255,255,0.72) 0 1px, transparent 1.6px),
        radial-gradient(circle at 76% 56%, rgba(255,255,255,0.62) 0 1px, transparent 1.5px),
        radial-gradient(circle at 88% 33%, rgba(255,255,255,0.66) 0 1px, transparent 1.5px),
        radial-gradient(circle at 95% 74%, rgba(255,255,255,0.52) 0 1px, transparent 1.4px);
    background-repeat: no-repeat;
    overflow: hidden;
    border-radius: 0; /* 移除圆角 */
    border: none; /* 移除厚重边框 */
}

.energy-fluid.level-3 {
    background-color: #e15f41;
    box-shadow: none;
}

/* 收藏馆火箭图鉴样式已移至 collection.css */

.rocket-quadrant-title {
    position: absolute;
    top: 10px;
    left: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
    /* 移除 -webkit-text-stroke 保持纯白字体 */
}

.rocket-lane {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    cursor: pointer;
    position: relative;
    border: none;
    overflow: hidden; /* 核心：禁止越界 */
    background: transparent; /* 移除泳道区分色 */
    border-radius: 0;
}

.quadrant-mode .rocket-lane {
    max-width: none;
}

/* 三段式核心：天空占主体，底部只保留紧凑信息底座 */
.sky-zone {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    width: 100%;
    position: relative; z-index: 2;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 0; 
    transition: transform 0.1s; 
}
.rocket-body {
    width: 100%; height: 100%; /* 占满天空区 */
    display: flex; align-items: flex-end; justify-content: center;
    position: relative;
}

/* =========================================
   火箭稀有度相关样式 (Gacha System)
   ========================================= */
/* 火箭名字标签 */
.rocket-name-tag {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(0.9rem, 1.8vmin, 1.2rem);
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid transparent;
}
.rocket-name-tag.rarity-1 { color: #ffffff; border-color: rgba(255, 255, 255, 0.3); }
.rocket-name-tag.rarity-2 { color: #3498db; border-color: rgba(52, 152, 219, 0.5); }
.rocket-name-tag.rarity-3 { color: #9b59b6; border-color: rgba(155, 89, 182, 0.5); }
.rocket-name-tag.rarity-4 { color: #f1c40f; border-color: rgba(241, 196, 15, 0.6); }

/* 发光底图隐藏，改用火箭图片的 drop-shadow */
.rocket-glow {
    display: none !important;
}

/* 火箭图片及发光特效 (边缘发光) */
.rocket-img {
    height: auto; 
    max-height: 50%; /* 进一步限制最大高度，使竖向火箭不至于显得过于巨大 */
    width: 100%;
    object-fit: contain;
    transform: translateY(-10%); /* 缩小后稍微再上移一点，保持在天空中央且远离分割线 */
    transition: transform 0.1s;
    filter: none;
}

.rocket-body.rarity-1 .rocket-img,
.rocket-body.rarity-2 .rocket-img,
.rocket-body.rarity-3 .rocket-img,
.rocket-body.rarity-4 .rocket-img {
    filter: none;
}

.rocket-body.is-shiny .rocket-img {
    filter: none;
}

/* 经验值飘字弹窗 (同钓鱼游戏款式，置于发射台上方) */
.rocket-xp-popup {
    position: absolute;
    bottom: 20px; /* 置于天空区域底部，即发射台紧上方 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ffd700;
    border-radius: 12px;
    color: #ffd700;
    padding: 4px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.rocket-xp-popup.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.rocket-img.ready {
    animation: none;
    transform-origin: bottom center;
}
.rocket-body.blasting-off {
    animation: flyHigh 1s ease-in forwards;
}

.ground-base {
    flex: 0 0 clamp(92px, 14.5vmin, 118px);
    height: clamp(92px, 14.5vmin, 118px);
    width: 100%;
    position: relative; z-index: 3;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    padding: 6px 3px 5px;
    transition: transform 0.1s;
    background: #374151;
    border-top: 3px solid #1f2937;
    box-shadow: none; /* 移除内阴影 */
    pointer-events: none;
    overflow: hidden;
}

.ground-base::after {
    display: none;
}

.energy-fluid {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 100%;
    transform-origin: bottom;
    transform: scaleY(0);
    z-index: 0;
    transition: none;
    border-top: 2px solid rgba(255, 255, 255, 0.75);
    opacity: 0.88;
}

.energy-fluid.level-1,
.energy-fluid.level-2,
.energy-fluid.level-3 {
    background-color: #fbbf24;
}

.energy-fluid.level-1 { background-color: #ef4444; }
.energy-fluid.level-2 { background-color: #f59e0b; }
.energy-fluid.level-3 { background-color: #22c55e; }

.energy-fluid.ready {
    animation: none;
    background-color: #38bdf8;
    border-top: 2px solid rgba(255, 255, 255, 0.9);
}

/* 轨道被点击时，天空区和底座作为一个整体一起下沉，消除脱节感 */
.rocket-lane:active .ground-base,
.rocket-lane:active .sky-zone {
    transform: translateY(8px);
}
.rocket-lane:active .ground-base {
    border-top-color: #1f2937;
    /* 移除点击时的内阴影，改为透明度变化 */
    background: #4b5563;
}

.mech-number {
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    font-size: clamp(1.8rem, 4.2vmin, 3.3rem); font-weight: 900; 
    color: rgba(255,255,255,0.16); /* 调整颜色，让燃料涨上来时能透出一点 */
    font-family: sans-serif;
    line-height: 1;
    z-index: 1;
}

.base-info {
    width: 95%; text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2; /* 确保在燃料上方可见 */
}

.ground-base .base-info {
    width: min(96%, 188px);
    padding: 3px 4px 4px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.student-name-tag {
    color: #fff; font-weight: bold; 
    font-size: clamp(1rem, 2vmin, 2rem); line-height: 1.2;
    margin-bottom: 4px; /* 移除 -webkit-text-stroke 保持纯白字体 */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ground-base .student-name-tag {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.08rem, 2.35vmin, 1.58rem);
    line-height: 1.2;
    margin-bottom: 2px;
    padding-bottom: 1px;
}

.mini-xp-bar {
    width: 88%; height: 6px;
    background: #34495e; border-radius: 3px; overflow: hidden; margin: 0 auto;
}
.mini-xp-fill {
    height: 100%; 
    background-color: #f1c40f; /* 移除渐变，改用纯色 */
    width: 100%; /* 改为100%宽度，用scaleX控制 */
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.3s;
}

/* =========================================
   田字格模式下的尺寸适配
   ========================================= */
.quadrant-mode .mech-number {
    font-size: 2.5rem;
}
.quadrant-mode .student-name-tag {
    font-size: 1.4rem;
}
.quadrant-mode .mini-xp-bar {
    height: 6px;
}

.quadrant-mode .ground-base .student-name-tag {
    font-size: clamp(1.08rem, 2.35vmin, 1.58rem);
    line-height: 1.2;
}

.quadrant-mode .moon {
    width: 40px; height: 40px;
    top: 30px; right: 40px;
}

/* --- boss.css --- */
/* css/boss.css - 讨伐魔王专属样式 */

#boss-fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 500;
    overflow: hidden;
}

/* 字体与像素化设置 */
.scene-game-boss,
.boss-card,
.damage-text,
.boss-name,
.boss-hp-text {
    font-family: "Press Start 2P", "Courier New", Courier, monospace, sans-serif;
    text-transform: uppercase;
}

#scene-game-boss img {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 1. 场景容器 (JS 会在这里设置 background-image 包括蒙版) */
#scene-game-boss {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2c2c2c;
    z-index: 1;
    overflow: hidden;
}

/* 2. 上层：Boss战场 */
.boss-stage {
    height: 70%;
    width: calc(100% - 60px);
    /* 减去右侧栏宽度 */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 改为从上往下排，避免Boss变大后血条被顶出去 */
    padding-top: 10px; /* 顶部留白 */
    box-sizing: border-box;
    z-index: 10 !important;
}

/* Boss UI (优化版：数字嵌入，名字变大) */
.boss-hp-container {
    width: 75%;
    max-width: 650px;
    margin-bottom: 10px; /* 减小间距，为boss留空间 */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0; /* 确保血条不会被压缩 */
}

.boss-name {
    color: #fff;
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    background: #8D6E63;
    border: 4px solid #3E2723;
    padding: 8px 30px;
    border-radius: 0;
    /* 移除 text-shadow 和 text-stroke 以提升低配机型性能 */
}

.boss-hp-bar-bg {
    width: 100%;
    height: 36px;
    background: #534b4b;
    border: 4px solid #000;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    /* box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3); */
}

.boss-hp-fill {
    height: 100%;
    background: #FF5555;
    width: 100%;
    transition: width 0.2s steps(10);
}

.boss-hp-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #000;
    z-index: 2;
    transform: translateX(-50%); /* 确保准确定位在百分比线上 */
}

.boss-hp-text {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    height: 36px;
    line-height: 36px;
    color: #fff;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 5;
    -webkit-text-stroke: 1.5px #000;
}

/* Boss 本体 */
.boss-avatar-wrapper {
    position: relative;
    width: 100%;
    flex: 1 1 0%; /* 占据剩余可用空间 */
    min-height: 0; /* 允许无限压缩，避免超出父容器 */
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.boss-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: none !important;
    transition: filter 0.5s, transform 0.5s;
    image-rendering: pixelated;
}

/* 3. 下层：方块控制台 */
.console-stage {
    height: 30%;
    width: calc(100% - 60px);
    position: relative;
    z-index: 30 !important; /* 提高 z-index，让其浮现在 boss-stage 之上 */
    background: #3E2723;
    border-top: 4px solid #2A1710;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 0;
    max-width: none !important;
    margin: 0 !important;
}

.boss-grid {
    width: 100%;
    height: 100%;
    /* --- 恢复单行水平轨道排列 --- */
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 8px;
    padding: 10px;
    margin: 0;
    overflow: visible !important; /* 允许皇冠溢出 */
}

/* Boss 战分组模式 (Grouped Console) - 底部控制台切分（田字格） */
.boss-grid.grouped-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px; /* 极简十字分割线 */
    padding: 0;
    background-color: #2A1710; /* 作为分割线的底色 */
    min-height: 0; /* 关键：防止网格被撑开 */
}

.boss-group-panel {
    position: relative;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: row; /* 改为水平排列，标题在左侧 */
    align-items: stretch;
    padding: 0;
    overflow: visible; /* 允许皇冠溢出 */
    height: 100%; 
    min-height: 0; 
    min-width: 0;
}

.boss-group-title {
    position: relative; 
    color: rgba(255, 255, 255, 0.7);
    min-width: clamp(34px, 2.15vw, 46px);
    font-size: clamp(1.2rem, 2.35vmin, 1.55rem);
    font-weight: 950;
    z-index: 10;
    pointer-events: none;
    background: #222;
    padding: 0 6px;
    border-right: 2px solid #000; /* 右侧分割线 */
    flex-shrink: 0; 
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    letter-spacing: 0;
}

.boss-group-title .group-title-char {
    display: block;
    line-height: 1;
}

.boss-group-grid {
    flex: 1 1 0;
    min-height: 0; 
    min-width: 0;
    /* 象限内部恢复单行水平排列 */
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 4px;
    height: 100%;
    overflow: visible; /* 允许皇冠溢出 */
}

.boss-lane {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
    user-select: none;
    border: none;
    overflow: visible; /* 允许皇冠溢出 */
}

.boss-grid.grouped-mode .boss-lane {
    max-width: none;
}

/* 学生信息牌：保留原褐色底座质感，删掉宠物图撑高空间 */
.boss-console {
    height: clamp(86px, 12vmin, 104px);
    min-height: clamp(86px, 12vmin, 104px);
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 5px 8px;
    background: #795548;
    border-radius: 0;
    border-top: 3px solid #4CAF50;
    border-right: 2px solid #000;
    border-bottom: 3px solid #3E2723;
    border-left: 2px solid #3E2723;
    box-shadow: none;
    transition: none;
    overflow: visible; /* 允许皇冠溢出 */
}

.boss-grid.grouped-mode .boss-console {
    height: 100%;
    min-height: 0;
}

.boss-lane:active .boss-console {
    transform: translateY(3px);
}

/* 控制台内部元素 */
.boss-console .mech-number {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 auto 3px;
    padding: 0 2px;
    font-size: clamp(1.95rem, 4.15vmin, 3.45rem);
    font-family: "Arial Black", Impact, sans-serif;
    font-weight: 950;
    line-height: 1;
    color: rgba(43, 24, 20, 0.88);
    background: transparent;
    border: none;
    border-radius: 0;
    pointer-events: none;
    z-index: 2;
}

.boss-console .base-info {
    flex-shrink: 0; /* 底部不压缩 */
    width: min(94%, 208px);
    background: #A1887F;
    border: 2px solid #5D4037;
    border-radius: 4px;
    padding: 4px 6px 5px;
    text-align: center;
    z-index: 3;
    /* box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2); */
    position: relative; /* 成为皇冠的定位基准 */
    margin: 0 auto;
    box-sizing: border-box;
}

.boss-console .student-name-tag {
    color: #fff;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.18rem, 2.35vmin, 1.58rem);
    line-height: 1.24;
    font-weight: 900;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.boss-console .mini-xp-bar {
    width: 90%;
    height: 10px;
    background: #212121;
    border: 1px solid #000;
    border-radius: 0;
    margin: 0 auto;
    overflow: hidden;
}

.boss-console.is-frozen {
    opacity: 0.82;
}

.boss-console .mini-xp-fill {
    height: 100%;
    background-color: #76FF03;
    width: 100%;
    /* 改为100%宽度，用scaleX控制 */
    transform-origin: left;
    transform: scaleX(0);
    /* 移除复杂的条纹背景以提升性能 */
    transition: transform 0.2s ease-out;
    will-change: transform;
}

/* --- 战斗特效 (原 Section 6) --- */

.boss-damage-text {
    position: absolute;
    color: #ff3333;
    font-size: 3rem;
    font-weight: 900;
    -webkit-text-stroke: 2px #fff;
    /* text-shadow: 0 0 10px #ff0000; 移除阴影 */
    pointer-events: none;
    z-index: 100;
    animation: floatUp 1s ease-out forwards;
}

.boss-heal-text {
    color: #33ff33;
    -webkit-text-stroke: 2px #000;
    /* text-shadow: 0 0 10px #00ff00; 移除阴影 */
}

/* css/boss.css */

/* 攻击弹道 (性能优化版：移除 text-shadow，使用 text-stroke) */
.projectile {
    position: absolute;
    font-size: 5rem;
    z-index: 100;
    pointer-events: none;

    /* ✅ 优化：使用 text-stroke 代替多重 shadow，性能提升明显 */
    color: #fff;
    -webkit-text-stroke: 3px #000;

    /* 恢复 left 和 top 的 transition，因为脱离了文档流且节点少，开销可控 */
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, left, top;
    /* 提示 GPU 提前准备 */
}

/* 伤害数字基础样式 (高性能：仅依赖字体和描边) */
.damage-text {
    font-weight: 900;
    letter-spacing: 2px;
    position: absolute;
    z-index: 500;
    pointer-events: none;
    white-space: nowrap;
    will-change: transform, top, opacity;
}

/* 伤害数字进阶等级系统 */
.dmg-tier-0,
.dmg-tier-1 {
    font-size: 5.0rem !important;
    color: #ffffff !important;
}

.dmg-tier-2 {
    font-size: 6.0rem !important;
    color: #76FF03 !important; /* 亮绿 */
    -webkit-text-stroke: 3px #1B5E20 !important; /* 深绿描边 */
}

.dmg-tier-3 {
    font-size: 7.0rem !important;
    color: #00E5FF !important; /* 天蓝 */
    -webkit-text-stroke: 4px #01579B !important; /* 深蓝描边 */
}

.dmg-tier-4 {
    font-size: 8.5rem !important;
    color: #FF9800 !important; /* 亮橙 */
    -webkit-text-stroke: 4px #4E342E !important; /* 深褐描边 */
}

.dmg-tier-5 {
    font-size: 10.0rem !important;
    color: #FF1744 !important; /* 猩红 */
    -webkit-text-stroke: 5px #3E2723 !important; /* 极粗暗黑红描边 */
}

/* 暴击专属样式 (覆盖等级颜色) */
.dmg-crit {
    color: #FFEA00 !important; /* 极其鲜艳的亮金/亮黄 */
    -webkit-text-stroke: 4px #000000 !important; /* 极粗黑边保证高对比度 */
    z-index: 600; /* 让暴击显示在最上层 */
}

/* 经验条闪烁 */
.xp-flashing {
    animation: xpGainFlash 0.5s ease-out forwards;
}

/* =========================================
   Boss反击及盲盒特效 (新增)
   ========================================= */

/* 小组面板被攻击抖动 */
.shake-anim {
    animation: panelShake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes panelShake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
    40%, 60% { transform: translate3d(8px, 0, 0); }
}

/* 冰冻状态面板 */
.frozen-panel {
    position: relative;
    /* pointer-events: none; 移除禁用点击，因为玩家需要点击敲冰块复活 */
    opacity: 0.8;
    background-color: rgba(0, 150, 255, 0.3); /* 替代 filter 实现变色 */
    transition: opacity 0.3s ease;
}

/* 给冰冻面板加一层冰霜覆盖 */
.frozen-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.3"><path d="M50 10 L60 40 L90 50 L60 60 L50 90 L40 60 L10 50 L40 40 Z" fill="white"/></svg>') repeat;
    pointer-events: none; /* 伪元素不阻挡点击 */
    background-size: 50px 50px;
    z-index: 50;
    opacity: 0.7;
}

/* 盲盒掉落数字特效 (复用 .damage-text，做少许调整) */
.loot-text {
    z-index: 500;
    color: #ffd700;
    will-change: transform, opacity; /* 提示GPU加速 */
}

/* =========================================
   Boss战：MVP 皇冠特效
   ========================================= */

/* 皇冠图标样式 */
.mvp-crown {
    position: absolute;
    /* 调整位置到 base-info 的左上角 */
    top: -18px;
    left: -10px;
    transform: rotate(-15deg);
    /* 稍微歪一点，比较俏皮 */

    color: #ffd700;
    /* 金色 */
    font-size: 1.6rem;
    /* 稍微调小一点以适应角落 */

    /* 发光滤镜 */
    /* 移除 filter 提升性能 */

    /* 浮动动画 */
    /* animation: crownFloatCorner 2s ease-in-out infinite; 移除闲置动画提升性能 */
    z-index: 999;
    /* 确保在最上层 */
}

/* 3. 皇冠上下浮动动画 */
@keyframes crownFloatCorner {

    0%,
    100% {
        transform: rotate(-15deg) translateY(0);
    }

    50% {
        transform: rotate(-15deg) translateY(-5px);
    }
}

/* --- group_battle.css --- */
/* css/group_battle.css - 组间对抗可视化 (纯叠加层，零侵入) */

/* ========== 确保象限容器是定位上下文 ========== */
.rocket-quadrant,
.fishing-quadrant,
.boss-group-panel {
    position: relative !important;
    overflow: hidden;
}

/* ========== 背景融合大字（分数） ========== */
.battle-bg-score {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10rem;
    font-weight: 900;
    color: rgba(255,255,255,0.06);
    z-index: 1;
    pointer-events: none;
    transition: color 0.5s;
    line-height: 1;
    font-family: 'Arial Black', Impact, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.battle-bg-group-id {
    font-size: 0.3em;
    font-weight: bold;
    letter-spacing: 5px;
    opacity: 0.8;
    margin-bottom: 5px;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 火箭游戏分数放在天空区域中心 */
.rocket-quadrant .battle-bg-score {
    top: 36%;
}

/* 领先标签 */
.battle-leading-tag {
    position: absolute;
    top: calc(50% + 5rem);
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: transparent;
    z-index: 1;
    pointer-events: none;
    transition: color 0.5s;
    white-space: nowrap;
}

/* 火箭游戏领先标签跟随天空中心分数 */
.rocket-quadrant .battle-leading-tag {
    top: calc(36% + 5rem);
}

/* ========== 领先组状态 ========== */
.battle-is-leading .battle-bg-score {
    color: rgba(255,215,0,0.4) !important; /* 金色，中等透明度 */
    /* 移除 text-shadow */
}
.battle-is-leading .battle-leading-tag {
    color: rgba(255,215,0,0.4) !important; /* 金色，中等透明度 */
    -webkit-text-stroke: 1px rgba(255,215,0,0.4);
}
.battle-is-leading .battle-crown {
    display: inline-block;
}

/* 非领先组：稍暗 */
.battle-is-trailing .battle-bg-score {
    color: rgba(255,255,255,0.04);
}

/* ========== 象限内弹出提醒 ========== */
.battle-alert {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%) scale(0);
    font-size: 2.8rem;
    font-weight: 900;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}
.battle-alert.show {
    animation: battleAlertPop 0.4s cubic-bezier(0.175,0.885,0.32,1.275) forwards,
               battleAlertOut 0.6s ease-in 2.4s forwards;
}
@keyframes battleAlertPop {
    0% { transform: translate(-50%,-50%) scale(0); opacity: 0; }
    100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}
@keyframes battleAlertOut {
    0% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(0.9); }
}

/* --- brawl.css --- */
/* css/brawl.css - 魔法大乱斗专用样式 */

#scene-game-brawl {
    background: radial-gradient(circle at center, #2a1a4a 0%, #110d21 100%);
    position: relative;
    overflow: hidden;
}

/* 教师控制台 */
.brawl-teacher-controls {
    display: flex;
    gap: 10px;
    margin: 0 15px;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 大乱斗网格布局 (复用分组网格，但可能需要稍微调整间距) */
.brawl-grid {
    display: flex;
    flex-direction: column;
    padding: 70px 0 0 0; /* 仅保留顶部 header 空间，其余方向填满 */
    gap: 0; /* 移除粗大间距 */
    height: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    /* 不允许 wrap，强制两行显示 */
}

/* 覆盖可能冲突的 quadrant-row */
.brawl-grid .quadrant-row {
    flex: 1;
    display: flex;
    gap: 0; /* 移除粗大间距 */
    min-height: 0;
    /* flex 内部滚动的必要条件 */
}

/* 象限容器样式微调 (极简模式) */
.brawl-grid .brawl-quadrant {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
    position: relative;
    border: none;
}

/* 极简十字分割线 */
.brawl-grid .quadrant-row:first-child .brawl-quadrant {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}
.brawl-grid .quadrant-row .brawl-quadrant:first-child {
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.brawl-quadrant .quadrant-title {
    color: rgba(255, 255, 255, 0.6);
    position: absolute; /* 悬浮标题，不挤占网格 */
    top: 5px;
    left: 10px;
    padding: 0;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.8); /* 替代 text-shadow */
    background: transparent;
    border: none;
    z-index: 10;
    pointer-events: none;
}

.brawl-quadrant .quadrant-cards {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 1), 1fr);
    grid-template-rows: repeat(var(--grid-rows, 1), 1fr);
    gap: 4px; /* 极简卡片间距 */
    padding: 4px; /* 极简内边距 */
    /* 移除原生滚动条限制，靠弹性压缩塞进整个画面 */
    overflow: hidden;
    min-height: 0;
}

/* 乱斗卡片 */
.brawl-card {
    background: #1e1e30; /* 移除渐变 */
    border: 2px solid #444; /* 加粗边框替代阴影 */
    border-radius: 12px;
    padding: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* 保证内部元素宽度撑满 */
    transition: transform 0.2s;
    user-select: none;
    /* 移除 box-shadow */
    min-height: 0; /* 三段式压缩必备 */
    min-width: 0;
}

/* 根据宠物属性给卡片加上环境光 (使用边框颜色代替内阴影) */
.brawl-card[data-type="fire"] {
    border-color: rgba(255, 69, 0, 0.5);
}

.brawl-card[data-type="water"] {
    border-color: rgba(30, 144, 255, 0.5);
}

.brawl-card[data-type="grass"] {
    border-color: rgba(50, 205, 50, 0.5);
}

.brawl-card[data-type="electric"] {
    border-color: rgba(255, 215, 0, 0.5);
}

/* 名字和星星栏 */
.brawl-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    font-weight: bold;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.brawl-name {
    color: #e0e0e0;
    -webkit-text-stroke: 1px #000; /* 替代 text-shadow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brawl-stars {
    color: #ffd700;
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 头像区 - 放大版本 */
.brawl-avatar-container {
    position: relative;
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4px 0;
}

.brawl-level-badge {
    color: rgba(255,255,255,0.88);
    font-size: clamp(1.4rem, 4vmin, 3rem);
    font-weight: 900;
    line-height: 1;
    padding: 6px 12px;
    border: 2px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
}

/* 防御状态 - 盾牌更大 */
.brawl-card.is-defending .brawl-avatar-container::after {
    content: '\f132';
    /* fa-shield */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 130px;
    color: rgba(100, 200, 255, 0.4);
    pointer-events: none;
    z-index: 2;
    animation: shield-pulse 2s infinite;
}

@keyframes shield-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.3;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.3;
    }
}

/* 资源进度槽 (替代小爱心和小星星) */
.brawl-bars-large {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
    padding: 0;
    flex-shrink: 0;
}

.resource-bar-wrapper {
    position: relative;
    width: 100%;
    height: clamp(14px, 2.5vh, 22px);
    background: #222;
    border: 1px solid #555;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.resource-bar-fill {
    height: 100%;
    transition: width 0.3s ease-out;
}

.hp-fill {
    background: linear-gradient(to right, #cc0000, #ff4d4d);
}

.eng-fill {
    background: linear-gradient(to right, #0088cc, #00d2ff);
}

/* 在条中间叠加刻度分段和数字指示 */
.resource-bar-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    -webkit-text-stroke: 1px #000; /* 替代 text-shadow */
    pointer-events: none;
    z-index: 2;
}

/* 能量槽分段线 - 使用重复渐变画出格栏 */
.eng-bar-segments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(to right,
            transparent,
            transparent calc(20% - 1px),
            rgba(255, 255, 255, 0.4) 20%);
    pointer-events: none;
    z-index: 1;
}

/* 操作按钮区 (大尺寸，双行网格排布以适应手指点击) */
.brawl-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    width: 100%;
    flex-shrink: 0;
    margin-bottom: 12px; /* 给绝对定位的遗物栏留点空间 */
}

.brawl-actions-grid button,
.btn-haunt {
    padding: clamp(4px, 1vh, 10px) 2px;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.1s;
    color: white;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.8); /* 替代 text-shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.brawl-actions-grid button:active,
.btn-haunt:active {
    transform: scale(0.96);
    border-bottom-width: 0 !important;
}

.brawl-actions-grid button:disabled,
.btn-haunt:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-charge {
    background: linear-gradient(to bottom, #4facfe 0%, #00f2fe 100%);
    border-bottom: 4px solid #0088aa;
}

.btn-defend {
    background: linear-gradient(to bottom, #a18cd1 0%, #fbc2eb 100%);
    border-bottom: 4px solid #8866aa;
    color: #ffd;
}

.btn-attack {
    background: linear-gradient(to bottom, #ff416c 0%, #ff4b2b 100%);
    border-bottom: 4px solid #aa2200;
}

.btn-ult {
    background: linear-gradient(to bottom, #f12711 0%, #f5af19 100%);
    border-bottom: 4px solid #aa4400;
    color: #fff;
}

/* 捣蛋按钮 */
.btn-haunt {
    background: linear-gradient(to bottom, #8e2de2 0%, #4a00e0 100%);
    border-bottom: 4px solid #330088;
    width: 100%;
    margin-top: 4px;
    min-height: 36px;
    margin-bottom: 12px;
}

/* 遗物栏改大 */
.brawl-relics {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: #333;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #555;
    z-index: 5;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.brawl-relics:active {
    background: #444;
    transform: translateX(-50%) scale(1.1);
}

.relic-icon {
    font-size: 1.2rem;
    color: #666;
    /* 更浅的暗色 */
}

.relic-icon.active {
    /* 移除 filter */
}

.relic-icon.active[data-relic="earth"] {
    color: #cd853f;
}

/* 大地 */
.relic-icon.active[data-relic="dragon"] {
    color: #ff4500;
}

/* 巨龙 */
.relic-icon.active[data-relic="wind"] {
    color: #00fa9a;
}

/* 疾风 */


/* ==== 幽灵状态 (阵亡) ==== */
.brawl-card.is-ghost .brawl-level-badge {
    opacity: 0.35;
}

.brawl-card.is-ghost {
    border-color: #555;
    background: #1a1a20;
}

.brawl-card.is-ghost .brawl-bars {
    opacity: 0.3;
}

.ghost-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(200, 200, 255, 0.6);
    pointer-events: none;
    z-index: 2;
}

/* ==== 瞄准模式 (Snipe Flow) ==== */
/* 当进入瞄准模式时，给 body 加个类，暗化背景或其他非目标元素 */
body.snipe-mode #brawl-grid {
    background: rgba(0, 0, 0, 0.5);
    /* 稍微变暗整个区域 */
}

.brawl-card.targetable {
    border-color: #ff4d4d;
    /* 移除阴影和脉冲动画，使用简单的背景色提示 */
    background: rgba(255, 77, 77, 0.2);
    cursor: crosshair;
}

.brawl-card.targetable:active {
    transform: scale(0.96);
    background: rgba(255, 77, 77, 0.4);
}

/* 发起瞄准的人高亮自身 */
.brawl-card.sniper {
    border-color: #00d2ff;
    /* 移除阴影 */
    background: rgba(0, 210, 255, 0.2);
    z-index: 10;
}

.snipe-cancel-hint {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2rem;
    z-index: 100;
    pointer-events: none;
    border: 1px solid #ff4d4d;
}

/* ==== 伤害特效 (调整变大) ==== */
.damage-text {
    position: absolute;
    font-size: 3.5rem;
    font-weight: 900;
    color: #ff3333;
    -webkit-text-stroke: 3px #000; /* 替代多重 text-shadow */
    pointer-events: none;
    z-index: 50;
    animation: dmg-float 1s ease-out forwards;
}

.damage-text.heal {
    color: #33ff33;
}

.damage-text.eng {
    color: #00d2ff;
}

@keyframes dmg-float {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }

    80% {
        transform: translateY(-40px) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-50px) scale(0.8);
        opacity: 0;
    }
}

/* 卡片受击闪烁 */
@keyframes card-hit {
    0% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-5px);
    }
    40% {
        transform: translateX(5px);
    }
    60% {
        transform: translateX(-3px);
    }
    80% {
        transform: translateX(3px);
    }
    100% {
        transform: translateX(0);
    }
}
/* 移除受击动画中的 filter 变化，仅保留位移 */

.brawl-card.take-damage {
    animation: card-hit 0.4s;
}

/* 大招全屏特效图层 */
#brawl-ult-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* ==== 遗物商店弹窗 ==== */
.relic-shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.relic-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.relic-item h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.relic-item p {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 10px;
    min-height: 40px;
}

.relic-level-pips {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.pip {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #666;
}

.pip.filled {
    background: #ffd700;
    border-color: #fff;
}

.relic-item button {
    width: 100%;
    padding: 8px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.relic-item button:disabled {
    background: #555;
    cursor: not-allowed;
}

.revive-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #444;
    text-align: center;
}

.btn-revive {
    background: #ff9800;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

.btn-revive:disabled {
    background: #555;
    cursor: not-allowed;
}

/* --- monopoly.css --- */
/* ================= 核心约束：极低性能开销、科技蓝主色系 ================= */
.monopoly-body {
    --bg-dark: #020617;
    --border-normal: #0284c7;
    --border-highlight: #38bdf8;
    --text-main: #e0f2fe;
    --text-dim: #7dd3fc;
    
    /* 事件标识色 */
    --color-treasure: #fbbf24; 
    --color-event: #a855f7;   
    --color-jump: #10b981;    
    --color-trap: #ef4444;    
    --color-start: #ffffff;   
}

/* 游戏总容器 */
#monopoly-game-container {
    position: relative;
    width: 100%;
    flex: 1; 
    background-color: var(--bg-dark); 
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

#monopoly-game-container * {
    box-sizing: border-box; 
    user-select: none; 
}

/* ========== 动态轨道层 (Perimeter Board) ========== */
#monopoly-game-container .board-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; 
}

#monopoly-game-container .board-cell {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(2, 132, 199, 0.4);
    background-color: rgba(2, 6, 23, 0.9);
    color: var(--border-highlight);
    pointer-events: auto;
    transition: transform 0.1s;
}
#monopoly-game-container .board-cell:active, 
#monopoly-game-container .board-cell.touch-active { transform: scale(0.92); }

#monopoly-game-container .board-cell::after {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 1px solid rgba(2, 132, 199, 0.2);
    pointer-events: none;
}

#monopoly-game-container .board-cell .cell-icon { font-size: clamp(20px, 3vmin, 32px); margin-bottom: 6px; z-index: 2; }
#monopoly-game-container .board-cell .cell-label {
    font-size: clamp(10px, 1.8vmin, 16px);
    font-weight: 900; z-index: 2; padding: 2px 6px;
    border-radius: 4px; background-color: rgba(0, 0, 0, 0.6);
    letter-spacing: 1px; display: none; 
}
#monopoly-game-container .board-cell.has-label .cell-label { display: block; }

/* 占领状态 */
#monopoly-game-container .board-cell.owned {
    border-color: var(--owner-color);
    background-color: var(--owner-bg-color); 
    color: var(--owner-color);
}
#monopoly-game-container .board-cell.owned::after { border-color: var(--owner-color); opacity: 0.5; }

#monopoly-game-container .board-cell.cell-type-start { border-color: rgba(255, 255, 255, 0.8); background-color: rgba(255, 255, 255, 0.2); color: #fff;}
#monopoly-game-container .board-cell.cell-type-start::after { border-color: rgba(255, 255, 255, 0.5); }

/* ========== 棋子层 (Pawns Layer) ========== */
#monopoly-game-container .pawns-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50;
}
#monopoly-game-container .pawn {
    position: absolute; top: 0; left: 0;
    font-size: clamp(28px, 5vmin, 44px); 
    color: var(--pawn-color);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-text-stroke: 2px #020617;
    z-index: 51;
}

/* ========== 中央指挥舱区 (Center Stage Hub) ========== */
#monopoly-game-container .center-stage {
    position: absolute; display: flex; flex-direction: column;
    background: radial-gradient(circle at center, rgba(2, 6, 23, 0.5) 0%, transparent 80%);
    padding: 4px;
}

#monopoly-game-container .hub-grid {
    display: grid; width: 100%; height: 100%; gap: 8px;
}
/* 只有在超过4组时才压缩到3列或4列 */
#monopoly-game-container .hub-grid.groups-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
#monopoly-game-container .hub-grid.groups-2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
#monopoly-game-container .hub-grid.groups-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-5 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-6 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-7 { grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-8 { grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }

/* 单人模式扩展布局 (9~20人) */
#monopoly-game-container .hub-grid.groups-9 { grid-template-columns: repeat(5, 1fr); grid-template-rows: 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-10 { grid-template-columns: repeat(5, 1fr); grid-template-rows: 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-11,
#monopoly-game-container .hub-grid.groups-12 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-13,
#monopoly-game-container .hub-grid.groups-14,
#monopoly-game-container .hub-grid.groups-15 { grid-template-columns: repeat(5, 1fr); grid-template-rows: 1fr 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-16 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); }
#monopoly-game-container .hub-grid.groups-17,
#monopoly-game-container .hub-grid.groups-18 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr 1fr; }
#monopoly-game-container .hub-grid.groups-19,
#monopoly-game-container .hub-grid.groups-20 { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(4, 1fr); }

#monopoly-game-container .hub-group {
    border: 2px solid transparent; background-color: rgba(2, 6, 23, 0.6);
    border-radius: 12px; display: flex; flex-direction: row; /* 左字右卡片 */
    overflow: hidden; position: relative;
}

#monopoly-game-container .hub-group-header {
    writing-mode: vertical-lr; /* 竖排文字 */
    text-orientation: upright;
    text-align: center;
    padding: 0 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: clamp(14px, 2vmin, 20px);
    border-right: 2px solid transparent; 
    letter-spacing: 2px; text-transform: uppercase;
    position: relative;
}

/* 单人模式：能量条更窄，无文字 */
#monopoly-game-container .hub-group-header.solo-bar {
    padding: 0 2px;
    min-width: 14px;
    max-width: 14px;
}

/* 单人模式：每组仅1人，卡片充满可用空间 */
#monopoly-game-container .hub-grid.solo-mode .student-card {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
}
#monopoly-game-container .hub-grid.solo-mode .students-grid {
    padding: 4px;
    gap: 4px;
}
#monopoly-game-container .hub-grid.solo-mode .student-card .name {
    font-size: clamp(12px, 2.5vmin, 18px);
}
#monopoly-game-container .hub-grid.solo-mode .student-card .avatar {
    flex: 0 0 40%;
}

#monopoly-game-container .battery-fill {
    position: absolute; bottom: 0; left: 0; right: 0; height: 0%; /* JS控制充能高度 */
    transition: height 0.3s ease-out; z-index: 0;
    background-color: rgba(255, 255, 255, 0.3); /* 被主色叠加 */
}
#monopoly-game-container .hub-group-header span { position: relative; z-index: 1; }

#monopoly-game-container .students-grid {
    flex: 1; display: flex;
    flex-direction: row; flex-wrap: wrap; /* 允许换行 */
    align-content: stretch; /* 多行填满高度 */
    justify-content: center; /* 居中分布，防止最后一行靠左太空旷 */
    gap: 8px; padding: 8px;
    overflow: hidden;
}

#monopoly-game-container .student-card {
    flex: 1 1 30%; /* 自动填满空间，通常每排2-3个 */
    min-width: 100px;
    max-width: 230px; /* 增加动态最大宽度约束，防止只有两个时无休止填满拉得过长 */
    position: relative; border: 2px solid transparent; background-color: transparent;
    border-radius: 8px; 
    display: flex; flex-direction: row; /* 左图右名 */
    align-items: center; justify-content: flex-start;
    padding: 8px;
    transition: transform 0.1s; overflow: hidden;
    box-sizing: border-box; /* 确保 JS 计算的高度包含 padding */
}
#monopoly-game-container .student-card:active, 
#monopoly-game-container .student-card.touch-active { transform: scale(0.95); }

#monopoly-game-container .progress-bg {
    position: absolute; left: 0; top: 0; bottom: 0; z-index: 0; transition: width 0.3s ease;
}

#monopoly-game-container .student-card .avatar {
    flex: 0 0 45%; height: 100%; 
    display: flex; align-items: center; justify-content: center;
    z-index: 1;
}
#monopoly-game-container .student-card .avatar img {
    max-width: 95%; max-height: 95%; object-fit: contain;
}

#monopoly-game-container .student-card .mono-level {
    color: rgba(255,255,255,0.82);
    font-size: clamp(13px, 2.4vmin, 22px);
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

#monopoly-game-container .student-card .info {
    flex: 1; z-index: 1; 
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    padding-left: 6px; overflow: hidden;
}
#monopoly-game-container .student-card .name {
    font-size: clamp(16px, 3.5vmin, 26px); /* 尽可能放大名字 */
    font-weight: 900; color: #fff; white-space: nowrap;
    width: 100%; overflow: hidden; text-overflow: ellipsis;
}

/* ========== 终端风格弹窗 (局限在 center-stage) ========== */
#monopoly-game-container .hud-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(2, 6, 23, 0.95); z-index: 100;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
    border-radius: 12px; border: 2px dashed var(--border-normal);
}
#monopoly-game-container .hud-overlay.show { opacity: 1; pointer-events: auto; }

#monopoly-game-container .hud-dialog {
    width: 90%; height: 90%; background-color: transparent; position: relative;
    padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px;
    text-align: center;
}

#monopoly-game-container .hud-title { 
    font-size: clamp(36px, 6vmin, 64px); font-weight: 900; color: var(--border-highlight); 
    letter-spacing: 4px; text-transform: uppercase;
}
#monopoly-game-container .hud-desc { 
    font-size: clamp(20px, 4vmin, 32px); color: var(--text-main); line-height: 1.4; max-width: 80%;
}

#monopoly-game-container .hud-main-content {
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: clamp(20px, 4vw, 60px);
    width: 100%; margin-top: 10px;
}
#monopoly-game-container .hud-text-content {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px;
}

#monopoly-game-container .hud-img {
    max-height: 38vh; max-width: 45%; object-fit: contain; border-radius: 10px; display: none;
}
#monopoly-game-container .hud-img.show { display: block; animation: pulse-scale-hud 2s infinite alternate; }

@keyframes pulse-scale-hud {
    0% { transform: scale(1); opacity: 0.85; }
    100% { transform: scale(1.05); opacity: 1; }
}

#monopoly-game-container .hud-action { 
    font-size: clamp(32px, 7vmin, 56px); font-weight: 900; color: var(--color-treasure); 
    -webkit-text-stroke: 1px var(--bg-dark); margin: 5px 0;
}

#monopoly-game-container .hud-buttons {
    display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; width: 100%; margin-top: 5px;
}

#monopoly-game-container .hud-btn {
    background-color: rgba(2, 132, 199, 0.2); border: 2px solid var(--border-normal); color: var(--text-main);
    font-size: clamp(20px, 4vmin, 32px); font-weight: 900; padding: 12px 36px;
    transition: transform 0.1s, background-color 0.2s, color 0.2s; border-radius: 8px;
}
#monopoly-game-container .hud-btn.excellent { border-color: var(--color-jump); color: var(--color-jump); }
#monopoly-game-container .hud-btn.normal { border-color: var(--color-treasure); color: var(--color-treasure); }
#monopoly-game-container .hud-btn.bad { border-color: var(--color-trap); color: var(--color-trap); }

#monopoly-game-container .hud-btn:active, 
#monopoly-game-container .hud-btn.touch-active { transform: scale(0.92); }
#monopoly-game-container .hud-btn.excellent:active { background-color: var(--color-jump); color: #fff; }
#monopoly-game-container .hud-btn.normal:active { background-color: var(--color-treasure); color: #fff; }
#monopoly-game-container .hud-btn.bad:active { background-color: var(--color-trap); color: #fff; }


/* =========================================
   黄金矿工正式迁移样式
   ========================================= */
   黄金矿工
   ========================================= */
#scene-game-miner {
    background:
        radial-gradient(circle at top, rgba(251, 191, 36, 0.14), transparent 28%),
        linear-gradient(180deg, #0f172a 0%, #172554 30%, #3f2a10 30.4%, #6b3a10 100%);
    overflow: hidden;
}

.miner-board {
    width: calc(100% - 60px);
    height: 100vh;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.miner-stage-shell,
.miner-console-stage {
    background: rgba(2, 6, 23, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
    min-height: 0;
}

.miner-stage-shell {
    flex: 0 0 68%;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
}

.miner-console-stage {
    flex: 1 1 32%;
    border-top: 4px solid rgba(251, 191, 36, 0.3);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    padding: 0;
    box-sizing: border-box;
}

.miner-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(125, 211, 252, 0.22) 0%, rgba(59, 130, 246, 0.08) 18%, rgba(15, 23, 42, 0.08) 24%, transparent 25%),
        linear-gradient(180deg, #1d4ed8 0%, #1e3a8a 28%, #69461a 28.4%, #7c3e12 100%);
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.miner-stage::before {
    content: "";
    position: absolute;
    inset: 27% 0 auto;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.miner-stage-surface {
    position: absolute;
    left: 0;
    right: 0;
    top: 26%;
    height: 36px;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.92), rgba(120, 53, 15, 0.92));
    border-top: 2px solid rgba(255, 255, 255, 0.18);
}

.miner-hook-system {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    transform-origin: top center;
    z-index: 8;
}

.miner-rope {
    position: absolute;
    left: -2px;
    top: 0;
    width: 4px;
    height: 64px;
    background: linear-gradient(180deg, #fde68a 0%, #d97706 100%);
    transform-origin: top center;
}

.miner-hook {
    position: absolute;
    left: 0;
    top: 64px;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border: 4px solid #f8fafc;
    border-top-color: #facc15;
    border-left-color: #facc15;
    border-right-color: rgba(248, 250, 252, 0.2);
    border-bottom-color: rgba(248, 250, 252, 0.2);
    border-radius: 50%;
    transform: rotate(45deg);
    background: rgba(255, 255, 255, 0.08);
}

.miner-item-layer {
    position: absolute;
    inset: 0;
}

.miner-item {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #0f172a;
    user-select: none;
    transition: transform 0.08s linear;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.miner-item .label {
    pointer-events: none;
    color: rgba(15, 23, 42, 0.78);
    font-size: 0.75rem;
}

.miner-item.gold {
    background: radial-gradient(circle at 30% 25%, #fde68a 0%, #f59e0b 68%, #b45309 100%);
    border-radius: 18px;
}

.miner-item.diamond {
    background: linear-gradient(135deg, #e0f2fe 0%, #38bdf8 60%, #0369a1 100%);
    transform: rotate(45deg);
    border-radius: 10px;
}

.miner-item.diamond .label {
    transform: rotate(-45deg);
}

.miner-item.rock {
    background: radial-gradient(circle at 30% 25%, #cbd5e1 0%, #64748b 70%, #334155 100%);
    border-radius: 50%;
}

.miner-item.trash {
    background: linear-gradient(180deg, #fecaca 0%, #f97316 100%);
    border-radius: 14px 14px 18px 18px;
}

.miner-item.caught {
    z-index: 11;
}

.miner-float-text {
    position: absolute;
    left: 50%;
    top: 34%;
    transform: translate(-50%, 0);
    font-size: 2rem;
    font-weight: 900;
    -webkit-text-stroke: 1px rgba(15, 23, 42, 0.92);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
    z-index: 12;
    white-space: nowrap;
}

.miner-float-text.show {
    opacity: 1;
    transform: translate(-50%, -18px);
}

.miner-float-text.positive { color: #fde68a; }
.miner-float-text.negative { color: #fecaca; }
.miner-float-text.info { color: #bfdbfe; }

.miner-control-panel {
    overflow: hidden;
    height: 100%;
    min-height: 0;
    padding: 4px 6px 6px;
    box-sizing: border-box;
}

.miner-control-panel.grouped-mode,
.miner-control-panel.miner-team-grid,
.miner-control-panel.miner-personal-groups {
    display: grid;
    gap: 2px;
}

.miner-control-panel.groups-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.miner-control-panel.groups-2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.miner-control-panel.groups-3,
.miner-control-panel.groups-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.miner-control-panel.groups-5,
.miner-control-panel.groups-6 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.miner-control-panel.groups-7,
.miner-control-panel.groups-8 { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; }
.miner-control-panel.groups-9,
.miner-control-panel.groups-10 { grid-template-columns: repeat(5, 1fr); grid-template-rows: 1fr 1fr; }
.miner-control-panel.groups-11,
.miner-control-panel.groups-12 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; }
.miner-control-panel.groups-13,
.miner-control-panel.groups-14,
.miner-control-panel.groups-15 { grid-template-columns: repeat(5, 1fr); grid-template-rows: 1fr 1fr 1fr; }
.miner-control-panel.groups-16 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); }

.miner-control-panel.ungrouped-mode {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 4), minmax(0, 1fr));
    grid-template-rows: repeat(var(--grid-rows, 2), minmax(0, 1fr));
    gap: 2px;
    padding: 4px 6px 6px;
}

.miner-charge-track {
    position: relative;
    height: 10px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.8);
    margin: 7px 0 6px;
    z-index: 1;
}

.miner-charge-track.large {
    height: 12px;
}

.miner-charge-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #facc15 0%, #fb7185 100%);
}

.miner-team-card,
.miner-player-group,
.miner-player-card,
.miner-empty {
    position: relative;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #eff6ff;
    min-width: 0;
}

.miner-team-card,
.miner-player-card {
    padding: 8px 10px;
}

.miner-team-card,
.miner-player-card {
    cursor: pointer;
    transition: transform 0.08s ease, border-color 0.2s ease, background 0.2s ease;
}

.miner-team-card:active,
.miner-player-card:active {
    transform: scale(0.985);
}

.miner-team-card.ready,
.miner-summary-card.ready,
.miner-player-card.ready {
    border-color: rgba(250, 204, 21, 0.58);
    background: rgba(120, 53, 15, 0.88);
}

.miner-team-card.selected,
.miner-player-card.current {
    border-color: rgba(96, 165, 250, 0.7);
    background: rgba(30, 64, 175, 0.78);
}

.miner-team-card-head,
.miner-player-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.miner-team-name,
.miner-player-name,
.miner-player-group-title {
    font-size: 1.02rem;
    font-weight: 900;
    color: #fff;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.miner-team-meta,
.miner-player-card-bottom,
.miner-member-line,
.miner-empty,
.miner-empty.compact {
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.84rem;
}

.miner-team-meta,
.miner-player-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.84rem;
    color: rgba(248, 250, 252, 0.88);
    position: relative;
    z-index: 1;
}

.miner-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    border-radius: 999px;
}

.miner-badge.ready {
    background: rgba(120, 53, 15, 0.9);
    color: #fde68a;
}

.miner-badge.queue {
    background: rgba(30, 64, 175, 0.9);
    color: #bfdbfe;
}

.miner-member-line {
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.miner-player-group {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    padding: 2px;
    gap: 2px;
    background: rgba(17, 24, 39, 0.72);
    border-color: rgba(255, 255, 255, 0.04);
}

.miner-player-group-title {
    flex: 0 0 34px;
    writing-mode: vertical-lr;
    text-orientation: upright;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
    font-weight: 900;
    color: #bfdbfe;
    padding: 4px 0;
    background: rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.miner-player-group-grid {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 2), minmax(0, 1fr));
    grid-template-rows: repeat(var(--grid-rows, 2), minmax(0, 1fr));
    gap: 2px;
    padding: 0;
}

.miner-player-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 12px;
    background:
        linear-gradient(90deg,
            rgba(250, 204, 21, 0.92) 0,
            rgba(251, 146, 60, 0.92) var(--charge-percent, 0%),
            rgba(15, 23, 42, 0.96) var(--charge-percent, 0%),
            rgba(15, 23, 42, 0.96) 100%);
}

.miner-player-name {
    font-size: 0.96rem;
    line-height: 1;
    width: 100%;
    text-align: center;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.7);
}

.miner-player-card.ready {
    border-color: rgba(250, 204, 21, 0.72);
}

.miner-player-card.current {
    border-color: rgba(96, 165, 250, 0.85);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.miner-player-card.ready .miner-player-name,
.miner-player-card.current .miner-player-name {
    color: #ffffff;
}

.miner-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    box-sizing: border-box;
}

.miner-empty.compact {
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.52);
}

@media (max-width: 1200px) {
    .miner-board {
        width: calc(100% - 60px);
        height: 100vh;
    }

    .miner-stage-shell {
        flex-basis: 66%;
    }

    .miner-team-card,
    .miner-player-group,
    .miner-player-card {
        padding: 7px 8px;
    }
}

/* Gold Miner full-board background v1.7.21 - keep this block last */
#scene-game-miner {
    --miner-surface-top: 29% !important;
    --miner-play-bottom: 66%;
    --miner-console-left: 2.2%;
    --miner-console-right: 3.1%;
    --miner-console-top: 67.2%;
    --miner-console-bottom: 4.7%;
}

#scene-game-miner .miner-board {
    padding: 0 !important;
    gap: 0 !important;
    display: block !important;
    position: absolute !important;
    background: url("../assets/game_miner/full_scene_background_v5.png") center center / 100% 100% no-repeat !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

#scene-game-miner .miner-stage-shell,
#scene-game-miner .miner-console-stage {
    position: absolute !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

#scene-game-miner .miner-stage-shell {
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: var(--miner-play-bottom) !important;
}

#scene-game-miner .miner-console-stage {
    left: var(--miner-console-left) !important;
    right: var(--miner-console-right) !important;
    top: var(--miner-console-top) !important;
    bottom: var(--miner-console-bottom) !important;
    height: auto !important;
    overflow: visible !important;
}

#scene-game-miner .miner-stage {
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

#scene-game-miner .miner-stage::before,
#scene-game-miner .miner-stage::after,
#scene-game-miner .miner-stage-shell::before,
#scene-game-miner .miner-stage-shell::after,
#scene-game-miner .miner-console-stage::before,
#scene-game-miner .miner-console-stage::after,
#scene-game-miner .miner-control-panel::before,
#scene-game-miner .miner-control-panel::after,
#scene-game-miner .miner-sky-art,
#scene-game-miner .miner-cave-art,
#scene-game-miner .miner-stage-surface,
#scene-game-miner .miner-objective-board,
#scene-game-miner .miner-status-hud,
#scene-game-miner .miner-turn-banner,
#scene-game-miner .miner-cloud,
#scene-game-miner .miner-bush,
#scene-game-miner .miner-sun,
#scene-game-miner .miner-cave-depth,
#scene-game-miner .miner-support,
#scene-game-miner .miner-lantern,
#scene-game-miner .miner-crystal,
#scene-game-miner .miner-prop,
#scene-game-miner .miner-rail-track {
    display: none !important;
    content: none !important;
    background: none !important;
    box-shadow: none !important;
}

#scene-game-miner .miner-hero {
    position: absolute !important;
    width: 160px !important;
    height: 142px !important;
    left: calc(50% - 80px) !important;
    top: calc(var(--miner-surface-top) - 118px) !important;
    z-index: 24 !important;
    filter: none !important;
    pointer-events: none !important;
    overflow: visible !important;
}

#scene-game-miner .miner-hero img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

#scene-game-miner .miner-hook-system {
    z-index: 23 !important;
}

#scene-game-miner .miner-control-panel {
    height: 100% !important;
    padding: 30px 36px 42px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

#scene-game-miner .miner-control-panel.miner-personal-groups,
#scene-game-miner .miner-control-panel.miner-team-grid,
#scene-game-miner .miner-control-panel.grouped-mode {
    gap: 18px !important;
}

#scene-game-miner .miner-player-group,
#scene-game-miner .miner-team-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

#scene-game-miner .miner-player-group {
    padding: 8px 10px 9px 58px !important;
    gap: 12px !important;
}

#scene-game-miner .miner-player-group-title,
#scene-game-miner .miner-team-ribbon {
    left: 10px !important;
    top: 9px !important;
    bottom: 9px !important;
    width: 38px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, #ffe66d 0%, #ffae3d 56%, #e8791b 100%) !important;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.48),
        inset 0 -3px 0 rgba(154, 52, 18, 0.46),
        0 3px 0 rgba(67, 20, 7, 0.52) !important;
    color: #5b2106 !important;
    text-shadow: 0 1px 0 rgba(255, 247, 237, 0.75) !important;
}

#scene-game-miner .miner-player-group-grid {
    gap: 12px !important;
}

#scene-game-miner .miner-player-card,
#scene-game-miner .miner-team-card {
    min-height: 0 !important;
    padding: 11px 13px 10px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background:
        radial-gradient(circle at 92% 78%, rgba(14, 165, 233, 0.17), transparent 17%),
        linear-gradient(180deg, rgba(17, 42, 72, 0.94), rgba(5, 17, 30, 0.96)) !important;
    box-shadow:
        inset 0 0 0 2px #facc15,
        inset 0 0 0 5px rgba(67, 20, 7, 0.78),
        0 4px 0 rgba(67, 20, 7, 0.5) !important;
    overflow: hidden !important;
}

#scene-game-miner .miner-player-card::before,
#scene-game-miner .miner-team-card::before {
    display: none !important;
    content: none !important;
}

#scene-game-miner .miner-player-card.ready,
#scene-game-miner .miner-team-card.ready {
    box-shadow:
        inset 0 0 0 2px #fde047,
        inset 0 0 0 5px rgba(146, 64, 14, 0.82),
        0 0 13px rgba(250, 204, 21, 0.42),
        0 4px 0 rgba(67, 20, 7, 0.5) !important;
}

#scene-game-miner .miner-player-card.current,
#scene-game-miner .miner-team-card.selected {
    box-shadow:
        inset 0 0 0 3px #facc15,
        inset 0 0 0 6px #854d0e,
        0 0 18px rgba(250, 204, 21, 0.68),
        0 4px 0 rgba(67, 20, 7, 0.5) !important;
}

#scene-game-miner .miner-player-topline,
#scene-game-miner .miner-team-card-head {
    height: 27px !important;
    gap: 8px !important;
}

#scene-game-miner .miner-card-gem {
    width: 23px !important;
    height: 23px !important;
}

#scene-game-miner .miner-player-name,
#scene-game-miner .miner-team-name {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#scene-game-miner .miner-player-charge,
#scene-game-miner .miner-charge-track {
    height: 12px !important;
}

@media (max-width: 1280px) {
    #scene-game-miner .miner-hero {
        width: 140px !important;
        height: 124px !important;
        left: calc(50% - 70px) !important;
        top: calc(var(--miner-surface-top) - 102px) !important;
    }

    #scene-game-miner .miner-control-panel {
        padding: 20px 24px 28px !important;
    }

    #scene-game-miner .miner-player-group {
        padding: 7px 8px 8px 50px !important;
        gap: 8px !important;
    }

    #scene-game-miner .miner-player-group-title,
    #scene-game-miner .miner-team-ribbon {
        left: 8px !important;
        top: 8px !important;
        bottom: 8px !important;
        width: 34px !important;
    }

    #scene-game-miner .miner-player-group-grid {
        gap: 8px !important;
    }

    #scene-game-miner .miner-player-card,
    #scene-game-miner .miner-team-card {
        padding: 9px 10px 8px !important;
    }
}

/* Gold Miner interaction polish v1.7.22 - keep this block last */
#scene-game-miner {
    --miner-surface-top: 29% !important;
}

#scene-game-miner .miner-control-panel {
    padding: 54px 58px 54px !important;
}

#scene-game-miner .miner-control-panel.miner-personal-groups,
#scene-game-miner .miner-control-panel.miner-team-grid,
#scene-game-miner .miner-control-panel.grouped-mode {
    gap: 22px !important;
}

#scene-game-miner .miner-player-group,
#scene-game-miner .miner-team-card {
    min-height: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

#scene-game-miner .miner-player-group {
    padding: 0 0 0 62px !important;
    gap: 14px !important;
}

#scene-game-miner .miner-player-group-title,
#scene-game-miner .miner-team-ribbon {
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 50px !important;
    border-radius: 12px !important;
    border: 2px solid #f6c45d !important;
    background:
        linear-gradient(90deg, rgba(120, 53, 15, 0.18), transparent 42%, rgba(67, 20, 7, 0.22)),
        linear-gradient(180deg, #b86925 0%, #8a3f16 48%, #5b260d 100%) !important;
    box-shadow:
        inset 0 2px 0 rgba(255, 245, 190, 0.38),
        inset 0 -4px 0 rgba(50, 18, 5, 0.38),
        0 4px 0 rgba(44, 18, 6, 0.52) !important;
    color: #fff3c4 !important;
    text-shadow: 0 2px 0 rgba(67, 20, 7, 0.92) !important;
    font-size: clamp(15px, 1.2vw, 22px) !important;
    line-height: 1 !important;
}

#scene-game-miner .miner-player-group-title span,
#scene-game-miner .miner-player-group-title strong {
    line-height: 1.05 !important;
}

#scene-game-miner .miner-player-group-grid {
    height: 100% !important;
    min-height: 0 !important;
    gap: 14px !important;
}

#scene-game-miner .miner-player-card,
#scene-game-miner .miner-team-card {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 18px 18px 16px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background:
        radial-gradient(circle at 94% 82%, rgba(14, 165, 233, 0.2), transparent 18%),
        linear-gradient(180deg, rgba(16, 42, 72, 0.96), rgba(4, 18, 33, 0.98)) !important;
    box-shadow:
        inset 0 0 0 2px #f6c23e,
        inset 0 0 0 5px rgba(66, 24, 7, 0.88),
        0 5px 0 rgba(53, 20, 6, 0.58) !important;
    overflow: hidden !important;
    transform: none !important;
}

#scene-game-miner .miner-player-card:active,
#scene-game-miner .miner-team-card:active {
    transform: none !important;
    filter: none !important;
}

#scene-game-miner .miner-player-card.ready,
#scene-game-miner .miner-team-card.ready,
#scene-game-miner .miner-player-card.current,
#scene-game-miner .miner-team-card.selected {
    box-shadow:
        inset 0 0 0 3px #fde047,
        inset 0 0 0 6px rgba(120, 53, 15, 0.92),
        0 0 16px rgba(250, 204, 21, 0.58),
        0 5px 0 rgba(53, 20, 6, 0.58) !important;
}

#scene-game-miner .miner-player-main,
#scene-game-miner .miner-team-body {
    width: 100% !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) 22px !important;
    align-items: center !important;
    gap: 12px !important;
}

#scene-game-miner .miner-player-topline,
#scene-game-miner .miner-team-card-head {
    height: auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
}

#scene-game-miner .miner-player-pick {
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
}

#scene-game-miner .miner-card-gem {
    width: 24px !important;
    height: 24px !important;
}

#scene-game-miner .miner-player-name,
#scene-game-miner .miner-team-name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    color: #fff7ed !important;
    font-size: clamp(24px, 1.35vw, 28px) !important;
    font-weight: 950 !important;
    line-height: 1.05 !important;
    text-align: left !important;
    letter-spacing: 0 !important;
    text-shadow:
        0 2px 0 rgba(67, 20, 7, 0.86),
        0 0 8px rgba(255, 255, 255, 0.16) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#scene-game-miner .miner-team-name {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

#scene-game-miner .miner-player-charge,
#scene-game-miner .miner-charge-track {
    width: 100% !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 4px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    background:
        linear-gradient(180deg, rgba(7, 12, 22, 0.96), rgba(18, 20, 28, 0.94)) !important;
    box-shadow:
        inset 0 0 0 3px rgba(117, 45, 12, 0.98),
        0 0 0 1px rgba(253, 224, 71, 0.6) !important;
}

#scene-game-miner .miner-player-charge span,
#scene-game-miner .miner-charge-fill {
    display: block !important;
    height: 100% !important;
    max-width: 100% !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #fff4a8 0%, #facc15 45%, #f59e0b 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.58),
        0 0 10px rgba(250, 204, 21, 0.45) !important;
}

#scene-game-miner .miner-badge,
#scene-game-miner .miner-team-meta,
#scene-game-miner .miner-member-line {
    display: none !important;
}

#scene-game-miner .miner-rope {
    left: -10px !important;
    width: 20px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: url("../assets/game_miner/rope_segment_v3.png") center top / 20px 46px repeat-y !important;
    box-shadow: none !important;
    transform-origin: top center !important;
}

#scene-game-miner .miner-hook {
    width: 74px !important;
    height: 74px !important;
    margin-left: -37px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: url("../assets/game_miner/hook_claw_v3.png") center / contain no-repeat !important;
    box-shadow: none !important;
    transform: translateY(-9px) !important;
}

#scene-game-miner .miner-hook::before,
#scene-game-miner .miner-hook::after {
    display: none !important;
    content: none !important;
}

#scene-game-miner .miner-item {
    z-index: 12 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
}

#scene-game-miner .miner-item-art {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    animation: none !important;
    transform: none !important;
}

#scene-game-miner .miner-item.gold .miner-item-art,
#scene-game-miner .miner-item.diamond .miner-item-art {
    filter: none !important;
}

#scene-game-miner .miner-item.caught {
    filter: none !important;
}

@media (max-width: 1280px) {
    #scene-game-miner .miner-control-panel {
        padding: 38px 34px 38px !important;
    }

    #scene-game-miner .miner-control-panel.miner-personal-groups,
    #scene-game-miner .miner-control-panel.miner-team-grid,
    #scene-game-miner .miner-control-panel.grouped-mode {
        gap: 14px !important;
    }

    #scene-game-miner .miner-player-group {
        padding-left: 48px !important;
        gap: 9px !important;
    }

    #scene-game-miner .miner-player-group-title,
    #scene-game-miner .miner-team-ribbon {
        width: 38px !important;
        font-size: 15px !important;
    }

    #scene-game-miner .miner-player-group-grid {
        gap: 8px !important;
    }

    #scene-game-miner .miner-player-card,
    #scene-game-miner .miner-team-card {
        padding: 12px 12px 11px !important;
    }

    #scene-game-miner .miner-player-main,
    #scene-game-miner .miner-team-body {
        grid-template-rows: minmax(0, 1fr) 18px !important;
        gap: 8px !important;
    }

    #scene-game-miner .miner-player-name,
    #scene-game-miner .miner-team-name {
        font-size: clamp(18px, 1.5vw, 20px) !important;
    }

    #scene-game-miner .miner-player-charge,
    #scene-game-miner .miner-charge-track {
        height: 18px !important;
        min-height: 18px !important;
        padding: 3px !important;
    }

    #scene-game-miner .miner-hook {
        width: 62px !important;
        height: 62px !important;
        margin-left: -31px !important;
    }
}

/* Gold Miner responsive card and mascot polish v1.7.23 - keep this block last */
#scene-game-miner {
    --miner-console-pad-x: clamp(34px, 2.85vw, 58px);
    --miner-console-pad-y: clamp(28px, 4.65vh, 54px);
    --miner-card-gap: clamp(12px, 1.9vh, 22px);
    --miner-card-pad-x: clamp(16px, 1.15vw, 24px);
    --miner-card-pad-y: clamp(12px, 1.65vh, 19px);
}

#scene-game-miner .miner-hero {
    width: clamp(152px, 10.2vw, 210px) !important;
    height: clamp(128px, 8.9vw, 184px) !important;
    left: calc(50% - clamp(76px, 5.1vw, 105px)) !important;
    top: calc(var(--miner-surface-top) - clamp(112px, 7.8vw, 154px)) !important;
}

#scene-game-miner .miner-hero img {
    object-fit: contain !important;
}

#scene-game-miner .miner-control-panel {
    padding: var(--miner-console-pad-y) var(--miner-console-pad-x) !important;
}

#scene-game-miner .miner-control-panel.miner-personal-groups,
#scene-game-miner .miner-control-panel.miner-team-grid,
#scene-game-miner .miner-control-panel.grouped-mode {
    gap: var(--miner-card-gap) !important;
}

#scene-game-miner .miner-player-group {
    padding-left: clamp(48px, 3vw, 64px) !important;
    gap: clamp(8px, 0.85vw, 14px) !important;
}

#scene-game-miner .miner-player-group-grid {
    gap: clamp(8px, 0.8vw, 14px) !important;
    align-items: stretch !important;
}

#scene-game-miner .miner-player-group-title,
#scene-game-miner .miner-team-ribbon {
    width: clamp(40px, 2.65vw, 54px) !important;
    background:
        linear-gradient(90deg, rgba(255, 230, 126, 0.36), transparent 32%, rgba(93, 36, 10, 0.35)),
        linear-gradient(180deg, #c77724 0%, #8f4315 52%, #5b260c 100%) !important;
    border-color: #ffd36b !important;
    color: #fff4c4 !important;
    box-shadow:
        inset 0 0 0 2px rgba(94, 38, 12, 0.7),
        0 4px 0 rgba(55, 22, 6, 0.55) !important;
}

#scene-game-miner .miner-player-card,
#scene-game-miner .miner-team-card {
    height: 100% !important;
    min-height: 0 !important;
    padding: var(--miner-card-pad-y) var(--miner-card-pad-x) !important;
    align-items: stretch !important;
    justify-content: stretch !important;
}

#scene-game-miner .miner-player-main,
#scene-game-miner .miner-team-body {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows: minmax(38px, 1fr) clamp(20px, 2.05vh, 24px) !important;
    align-content: center !important;
    align-items: stretch !important;
    gap: clamp(10px, 1.05vh, 14px) !important;
    overflow: visible !important;
}

#scene-game-miner .miner-player-topline,
#scene-game-miner .miner-team-card-head {
    width: 100% !important;
    min-width: 0 !important;
    min-height: clamp(36px, 3.7vh, 48px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: clamp(9px, 0.75vw, 14px) !important;
    overflow: visible !important;
}

#scene-game-miner .miner-player-pick,
#scene-game-miner .miner-card-gem {
    width: clamp(18px, 1.25vw, 24px) !important;
    height: clamp(18px, 1.25vw, 24px) !important;
    flex: 0 0 clamp(18px, 1.25vw, 24px) !important;
}

#scene-game-miner .miner-player-rank {
    width: clamp(30px, 1.85vw, 36px) !important;
    height: clamp(30px, 1.85vw, 36px) !important;
    flex: 0 0 clamp(30px, 1.85vw, 36px) !important;
    margin-right: clamp(8px, 0.55vw, 12px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    color: #fff7ed !important;
    font-size: clamp(14px, 0.86vw, 17px) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    border: 2px solid rgba(253, 230, 138, 0.92) !important;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.34), transparent 34%),
        linear-gradient(180deg, #f59e0b 0%, #b45309 100%) !important;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.28),
        0 3px 0 rgba(80, 32, 8, 0.58) !important;
    text-shadow: 0 1px 0 rgba(67, 20, 7, 0.86) !important;
}

#scene-game-miner .miner-player-name,
#scene-game-miner .miner-team-name {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: clamp(22px, 1.42vw, 28px) !important;
    font-weight: 950 !important;
    line-height: 1.28 !important;
    padding: 1px 0 4px !important;
    text-align: left !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#scene-game-miner .miner-player-charge,
#scene-game-miner .miner-charge-track {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: clamp(20px, 2.05vh, 24px) !important;
    min-height: clamp(20px, 2.05vh, 24px) !important;
    justify-self: stretch !important;
    align-self: end !important;
    margin: 0 !important;
    padding: 4px !important;
}

#scene-game-miner .miner-player-charge span,
#scene-game-miner .miner-charge-fill {
    min-width: 0 !important;
}

@media (max-width: 1280px) {
    #scene-game-miner {
        --miner-console-pad-x: clamp(22px, 2.65vw, 34px);
        --miner-console-pad-y: clamp(20px, 3.8vh, 38px);
        --miner-card-gap: clamp(10px, 1.55vh, 14px);
        --miner-card-pad-x: clamp(12px, 1.2vw, 16px);
        --miner-card-pad-y: clamp(10px, 1.35vh, 13px);
    }

    #scene-game-miner .miner-player-main,
    #scene-game-miner .miner-team-body {
        grid-template-rows: minmax(32px, 1fr) clamp(18px, 1.9vh, 20px) !important;
        gap: clamp(7px, 0.95vh, 10px) !important;
    }

    #scene-game-miner .miner-player-name,
    #scene-game-miner .miner-team-name {
        font-size: clamp(18px, 1.55vw, 21px) !important;
        line-height: 1.3 !important;
    }

    #scene-game-miner .miner-player-charge,
    #scene-game-miner .miner-charge-track {
        height: clamp(18px, 1.9vh, 20px) !important;
        min-height: clamp(18px, 1.9vh, 20px) !important;
        padding: 3px !important;
    }
}

/* Gold Miner 1080P readability and hook polish v1.7.24 - keep this block last */
#scene-game-miner {
    --miner-console-pad-x: clamp(20px, 1.35vw, 28px);
    --miner-console-pad-y: clamp(12px, 1.55vh, 18px);
    --miner-console-pad-top: 12px;
    --miner-console-pad-bottom: 14px;
    --miner-console-lift: 0px;
    --miner-console-pad-top: clamp(10px, 1.35vh, 16px);
    --miner-console-pad-bottom: clamp(10px, 1.45vh, 18px);
    --miner-console-lift: 0px;
    --miner-card-gap: clamp(8px, 0.95vh, 11px);
    --miner-group-gap: clamp(5px, 0.62vw, 8px);
    --miner-card-pad-x: clamp(9px, 0.65vw, 13px);
    --miner-card-pad-y: clamp(8px, 0.9vh, 12px);
    --miner-group-columns: 5;
    --miner-name-size: 26px;
    --miner-name-size-medium: 24px;
    --miner-name-size-long: 21px;
    --miner-name-size: clamp(19px, calc(0.92vw + 0.95vh), 30px);
    --miner-name-size-medium: clamp(17px, calc(0.82vw + 0.85vh), 26px);
    --miner-name-size-long: clamp(15px, calc(0.72vw + 0.75vh), 23px);
}

#scene-game-miner .miner-hero {
    width: clamp(148px, 8.8vw, 172px) !important;
    height: clamp(132px, 7.7vw, 150px) !important;
    left: calc(50% - clamp(74px, 4.4vw, 86px)) !important;
    top: calc(var(--miner-surface-top) - clamp(94px, 5.25vw, 108px)) !important;
}

#scene-game-miner .miner-control-panel {
    height: 100% !important;
    padding: var(--miner-console-pad-top) var(--miner-console-pad-x) var(--miner-console-pad-bottom) !important;
    transform: translateY(calc(-1 * var(--miner-console-lift))) !important;
    align-content: stretch !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

#scene-game-miner .miner-control-panel.miner-personal-groups,
#scene-game-miner .miner-control-panel.miner-team-grid,
#scene-game-miner .miner-control-panel.grouped-mode {
    gap: var(--miner-card-gap) !important;
}

#scene-game-miner .miner-control-panel.groups-3,
#scene-game-miner .miner-control-panel.groups-4,
#scene-game-miner .miner-control-panel.groups-5,
#scene-game-miner .miner-control-panel.groups-6,
#scene-game-miner .miner-control-panel.groups-7,
#scene-game-miner .miner-control-panel.groups-8,
#scene-game-miner .miner-control-panel.groups-9,
#scene-game-miner .miner-control-panel.groups-10,
#scene-game-miner .miner-control-panel.groups-11,
#scene-game-miner .miner-control-panel.groups-12 {
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
}

#scene-game-miner .miner-player-group {
    height: 100% !important;
    min-height: 0 !important;
    padding: clamp(4px, 0.55vh, 7px) 0 clamp(5px, 0.65vh, 8px) clamp(40px, 2.4vw, 48px) !important;
    gap: var(--miner-group-gap) !important;
}

#scene-game-miner .miner-player-group-grid {
    display: grid !important;
    --grid-rows: 1;
    --grid-cols: var(--miner-group-columns);
    grid-template-columns: repeat(var(--miner-group-columns), minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    align-content: stretch !important;
    align-items: stretch !important;
    height: 100% !important;
    min-height: 0 !important;
    gap: var(--miner-group-gap) !important;
}

#scene-game-miner .miner-player-group-title,
#scene-game-miner .miner-team-ribbon {
    left: clamp(4px, 0.45vw, 8px) !important;
    top: clamp(4px, 0.55vh, 7px) !important;
    bottom: clamp(5px, 0.65vh, 8px) !important;
    width: clamp(34px, 2.2vw, 42px) !important;
    font-size: clamp(15px, 0.98vw, 19px) !important;
}

#scene-game-miner .miner-player-group-title {
    cursor: pointer !important;
    touch-action: manipulation !important;
}

#scene-game-miner .miner-player-group-title:active {
    transform: translateY(2px) !important;
}

#scene-game-miner .miner-player-card:active {
    transform: translateY(2px) !important;
    filter: none !important;
}

#scene-game-miner .miner-player-card,
#scene-game-miner .miner-team-card {
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    padding: var(--miner-card-pad-y) var(--miner-card-pad-x) !important;
    align-self: stretch !important;
    justify-self: stretch !important;
}

#scene-game-miner .miner-player-main,
#scene-game-miner .miner-team-body {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
    box-sizing: border-box !important;
    justify-items: center !important;
    align-items: center !important;
    grid-template-rows:
        clamp(28px, 2.65vh, 36px)
        minmax(24px, 1fr)
        clamp(18px, 2.05vh, 24px) !important;
    align-content: stretch !important;
    gap: clamp(4px, 0.5vh, 7px) !important;
}

#scene-game-miner .miner-player-topline,
#scene-game-miner .miner-team-card-head {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: stretch !important;
    gap: 0 !important;
}

#scene-game-miner .miner-team-body {
    grid-template-rows: minmax(0, 1fr) clamp(18px, 2.05vh, 24px) !important;
}

#scene-game-miner .miner-player-pick,
#scene-game-miner .miner-card-gem {
    display: none !important;
}

#scene-game-miner .miner-player-rank {
    width: clamp(30px, 1.85vw, 36px) !important;
    height: clamp(30px, 1.85vw, 36px) !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    justify-self: center !important;
    align-self: center !important;
}

#scene-game-miner .miner-player-name {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    color: #fff7ed !important;
    font-size: 26px !important;
    font-size: var(--miner-name-size) !important;
    line-height: 1.22 !important;
    padding: 0 0 3px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-align: center !important;
}

#scene-game-miner .miner-player-name.name-len-medium {
    font-size: 24px !important;
    font-size: var(--miner-name-size-medium) !important;
}

#scene-game-miner .miner-player-name.name-len-long {
    font-size: 21px !important;
    font-size: var(--miner-name-size-long) !important;
}

#scene-game-miner .miner-team-name {
    font-size: 26px !important;
    font-size: var(--miner-name-size) !important;
    text-align: center !important;
}

#scene-game-miner .miner-player-charge,
#scene-game-miner .miner-charge-track {
    width: 80% !important;
    inline-size: 80% !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    height: clamp(18px, 2.05vh, 24px) !important;
    min-height: 0 !important;
    justify-self: center !important;
    align-self: end !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    padding: clamp(2px, 0.35vh, 3px) !important;
}

#scene-game-miner .miner-player-charge span,
#scene-game-miner .miner-charge-fill {
    display: block !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#scene-game-miner .miner-item {
    overflow: visible !important;
}

#scene-game-miner .miner-item .label {
    position: absolute !important;
    display: none !important;
    bottom: -24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 3px 9px !important;
    font-size: clamp(15px, 0.92vw, 18px) !important;
    line-height: 1.15 !important;
    z-index: 2 !important;
    box-shadow: 0 3px 0 rgba(44, 18, 6, 0.45) !important;
}

#scene-game-miner .miner-item.treasure {
    filter: none !important;
    --miner-label-text: #f8fafc;
    --miner-label-stroke: rgba(15, 23, 42, 0.86);
    --miner-label-border: rgba(203, 213, 225, 0.96);
    --miner-label-bg:
        linear-gradient(180deg, rgba(76, 86, 101, 0.96), rgba(31, 41, 55, 0.96));
    --miner-label-inset: rgba(255, 255, 255, 0.34);
    --miner-label-shadow: rgba(15, 23, 42, 0.58);
    --miner-label-glow: rgba(203, 213, 225, 0.2);
}

#scene-game-miner .miner-item.treasure .miner-item-art {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

#scene-game-miner .miner-item.treasure .label {
    display: block !important;
    top: auto !important;
    bottom: -27px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: 148px !important;
    padding: 4px 10px 5px !important;
    border: 2px solid var(--miner-label-border) !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: clamp(14px, 0.84vw, 17px) !important;
    font-weight: 950 !important;
    letter-spacing: 0 !important;
    -webkit-text-stroke: 0.4px var(--miner-label-stroke) !important;
    color: var(--miner-label-text) !important;
    background: var(--miner-label-bg) !important;
    box-shadow:
        inset 0 1px 0 var(--miner-label-inset),
        0 3px 0 var(--miner-label-shadow),
        0 0 10px var(--miner-label-glow) !important;
}

#scene-game-miner .miner-item.treasure.rarity-common {
    --miner-label-border: rgba(203, 213, 225, 0.96);
    --miner-label-bg:
        linear-gradient(180deg, rgba(90, 101, 116, 0.96), rgba(39, 50, 63, 0.96));
    --miner-label-glow: rgba(203, 213, 225, 0.22);
}

#scene-game-miner .miner-item.treasure.rarity-uncommon {
    --miner-label-border: rgba(103, 232, 249, 0.96);
    --miner-label-bg:
        linear-gradient(180deg, rgba(14, 165, 233, 0.96), rgba(8, 75, 120, 0.96));
    --miner-label-inset: rgba(224, 242, 254, 0.42);
    --miner-label-glow: rgba(34, 211, 238, 0.3);
}

#scene-game-miner .miner-item.treasure.rarity-rare {
    --miner-label-border: rgba(216, 180, 254, 0.96);
    --miner-label-bg:
        linear-gradient(180deg, rgba(168, 85, 247, 0.96), rgba(91, 33, 182, 0.96));
    --miner-label-inset: rgba(243, 232, 255, 0.42);
    --miner-label-glow: rgba(192, 132, 252, 0.34);
}

#scene-game-miner .miner-item.treasure.rarity-legendary {
    --miner-label-text: #fff7ed;
    --miner-label-stroke: rgba(75, 31, 7, 0.88);
    --miner-label-border: rgba(255, 213, 91, 0.96);
    --miner-label-bg:
        linear-gradient(180deg, rgba(217, 119, 6, 0.98), rgba(120, 53, 15, 0.98));
    --miner-label-inset: rgba(255, 244, 196, 0.5);
    --miner-label-shadow: rgba(44, 18, 6, 0.58);
    --miner-label-glow: rgba(250, 204, 21, 0.34);
}

#scene-game-miner .miner-item.treasure.rarity-legendary {
    filter: none !important;
}

#scene-game-miner .miner-rope {
    left: -7px !important;
    width: 14px !important;
    background: url("../assets/game_miner/rope_segment_v3.png") center top / 14px 34px repeat-y !important;
}

#scene-game-miner .miner-hook {
    width: 58px !important;
    height: 58px !important;
    margin-left: -29px !important;
    transform: translateY(-8px) !important;
}

/* Gold Miner shared navigation and seated miner polish v1.7.25 - keep this block last */
#scene-game-miner .game-header {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 60px !important;
    height: 100% !important;
    z-index: 100 !important;
    padding: 20px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 20px !important;
    background: rgba(15, 22, 35, 0.9) !important;
    border-left: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#scene-game-miner .game-header::before,
#scene-game-miner .game-header::after {
    display: none !important;
    content: none !important;
}

#scene-game-miner .game-header .btn-back {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: var(--accent) !important;
    color: #fff !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#scene-game-miner .game-header .game-title {
    max-width: none !important;
    margin: 20px 0 0 !important;
    color: #ffffff !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    line-height: normal !important;
    writing-mode: vertical-rl !important;
    text-orientation: upright !important;
    text-shadow: none !important;
    filter: none !important;
}

#scene-game-miner .game-header .game-title i {
    color: inherit !important;
    margin: 0 !important;
    filter: none !important;
}

#scene-game-miner .game-header .header-bottom-controls {
    width: auto !important;
    margin-top: auto !important;
    margin-bottom: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

#scene-game-miner .game-header .btn-game-icon {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#scene-game-miner .game-header .btn-game-icon i {
    color: inherit !important;
    font-size: inherit !important;
    text-shadow: none !important;
}

#scene-game-miner .game-header .btn-game-icon span {
    display: none !important;
}

body.bomb-mode #scene-game-miner .game-header .btn-bomb.active {
    color: #ff4444 !important;
    animation: bombPulse 0.6s ease-in-out infinite !important;
}

#scene-game-miner .miner-sky-art,
#scene-game-miner .miner-cave-art,
#scene-game-miner .miner-turn-banner,
#scene-game-miner .miner-hero::after {
    display: none !important;
    content: none !important;
}

#scene-game-miner .miner-hero {
    width: clamp(236px, 13.5vw, 268px) !important;
    height: clamp(210px, 12vw, 240px) !important;
    left: calc(50% - clamp(118px, 6.75vw, 134px)) !important;
    top: calc(var(--miner-surface-top) - clamp(140px, 7.45vw, 152px)) !important;
    z-index: 24 !important;
}

#scene-game-miner .miner-hero img {
    filter: none !important;
}

#scene-game-miner .miner-rope {
    left: -7px !important;
    width: 14px !important;
    top: 0 !important;
    background: url("../assets/game_miner/rope_segment_v3.png") center top / 14px 34px repeat-y !important;
}

#scene-game-miner .miner-hook {
    width: 56px !important;
    height: 56px !important;
    margin-left: -28px !important;
    transform: translateY(-7px) !important;
}

/* Gold Miner hook queue notice card v1.7.78 */
#scene-game-miner .miner-queue-board {
    position: absolute !important;
    left: clamp(28px, 2.45vw, 46px) !important;
    top: clamp(46px, 5.2vh, 72px) !important;
    width: clamp(246px, 16.4vw, 316px) !important;
    height: clamp(190px, 21vh, 226px) !important;
    z-index: 30 !important;
    padding: clamp(13px, 1.35vh, 17px) !important;
    box-sizing: border-box !important;
    border: 3px solid rgba(255, 193, 59, 0.94) !important;
    border-radius: 8px !important;
    background:
        linear-gradient(180deg, rgba(15, 50, 86, 0.98), rgba(6, 29, 55, 0.98)) !important;
    color: #fff7ed !important;
    pointer-events: none !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -5px 0 rgba(0, 0, 0, 0.16),
        0 4px 0 rgba(91, 45, 10, 0.78),
        0 10px 18px rgba(15, 23, 42, 0.28) !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.18s ease, transform 0.18s ease !important;
}

#scene-game-miner .miner-queue-board.is-empty {
    display: none !important;
    opacity: 0 !important;
    transform: translateY(-8px) !important;
}

#scene-game-miner .miner-queue-list {
    height: 100% !important;
    display: grid !important;
    grid-template-rows: repeat(3, minmax(42px, 1fr)) !important;
    gap: clamp(11px, 1.12vh, 14px) !important;
    margin-top: 0 !important;
    overflow: hidden !important;
}

#scene-game-miner .miner-queue-item {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: clamp(18px, 1.45vw, 25px) minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: clamp(4px, 0.45vw, 7px) !important;
    padding: 4px clamp(9px, 0.68vw, 12px) !important;
    border: 1.5px solid rgba(255, 213, 91, 0.72) !important;
    border-radius: 7px !important;
    background: rgba(5, 23, 43, 0.8) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

#scene-game-miner .miner-queue-rank {
    width: clamp(24px, 1.45vw, 28px) !important;
    height: clamp(24px, 1.45vw, 28px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: linear-gradient(180deg, #ffdf67, #c66a17) !important;
    color: #4a2108 !important;
    font-size: clamp(11px, 0.72vw, 14px) !important;
    font-weight: 950 !important;
}

#scene-game-miner .miner-queue-name {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #fffaf0 !important;
    font-size: clamp(15px, 0.92vw, 18px) !important;
    font-weight: 950 !important;
    line-height: 1.2 !important;
}

#scene-game-miner .miner-queue-meta {
    color: #ffe39a !important;
    font-size: clamp(11px, 0.66vw, 13px) !important;
    font-weight: 850 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

#scene-game-miner .miner-queue-empty {
    grid-row: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: rgba(255, 239, 198, 0.78) !important;
    font-size: clamp(14px, 0.85vw, 17px) !important;
    font-weight: 900 !important;
}

/* Gold Miner right-side toast polish v1.7.69 */
#scene-game-miner .miner-float-text {
    left: auto !important;
    right: clamp(78px, 6.2vw, 118px) !important;
    top: clamp(212px, 28.5vh, 278px) !important;
    width: clamp(190px, 15.8vw, 278px) !important;
    max-width: 278px !important;
    min-height: clamp(48px, 5.8vh, 64px) !important;
    padding: clamp(10px, 1.25vh, 14px) clamp(16px, 1.35vw, 22px) !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid var(--miner-toast-border, rgba(255, 225, 137, 0.94)) !important;
    border-radius: 14px !important;
    background:
        linear-gradient(180deg, rgba(124, 64, 20, 0.96), rgba(67, 31, 11, 0.96)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 239, 190, 0.45),
        0 4px 0 rgba(44, 18, 6, 0.58),
        0 10px 18px rgba(28, 12, 4, 0.3) !important;
    color: var(--miner-toast-color, #fff7ed) !important;
    font-size: clamp(18px, calc(0.95vw + 0.92vh), 28px) !important;
    line-height: 1.12 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    -webkit-text-stroke: 0.45px rgba(72, 31, 8, 0.88) !important;
    opacity: 0 !important;
    transform: translateX(24px) scale(0.96) !important;
    transition: transform 0.24s ease, opacity 0.24s ease !important;
    z-index: 32 !important;
}

#scene-game-miner .miner-float-text::before {
    content: "" !important;
    position: absolute !important;
    left: -10px !important;
    top: 50% !important;
    width: 18px !important;
    height: 18px !important;
    transform: translateY(-50%) rotate(45deg) !important;
    border-left: 2px solid var(--miner-toast-border, rgba(255, 225, 137, 0.94)) !important;
    border-bottom: 2px solid var(--miner-toast-border, rgba(255, 225, 137, 0.94)) !important;
    border-radius: 3px !important;
    background: rgba(67, 31, 11, 0.96) !important;
}

#scene-game-miner .miner-float-text.show {
    opacity: 1 !important;
    transform: translateX(0) scale(1) !important;
}

#scene-game-miner .miner-float-text.positive {
    --miner-toast-color: #fff4b8;
    --miner-toast-border: rgba(255, 214, 92, 0.96);
    background:
        linear-gradient(180deg, rgba(167, 92, 18, 0.96), rgba(90, 42, 12, 0.96)) !important;
}

#scene-game-miner .miner-float-text.negative {
    --miner-toast-color: #ffe4e6;
    --miner-toast-border: rgba(251, 113, 133, 0.96);
    background:
        linear-gradient(180deg, rgba(153, 27, 27, 0.96), rgba(76, 20, 20, 0.96)) !important;
    -webkit-text-stroke-color: rgba(69, 10, 10, 0.9) !important;
}

#scene-game-miner .miner-float-text.info {
    --miner-toast-color: #e0f2fe;
    --miner-toast-border: rgba(125, 211, 252, 0.96);
    background:
        linear-gradient(180deg, rgba(14, 116, 144, 0.96), rgba(18, 55, 73, 0.96)) !important;
    -webkit-text-stroke-color: rgba(8, 47, 73, 0.86) !important;
}

#miner-toast-container.miner-toast-dock {
    position: fixed !important;
    top: clamp(300px, 42vh, 372px) !important;
    right: clamp(78px, 6.2vw, 118px) !important;
    left: auto !important;
    transform: none !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    max-width: clamp(220px, 18vw, 320px) !important;
    gap: 8px !important;
}

#miner-toast-container.miner-toast-dock .toast-msg.miner-toast-msg {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    border: 2px solid rgba(255, 214, 92, 0.92) !important;
    border-radius: 14px !important;
    background:
        linear-gradient(180deg, rgba(124, 64, 20, 0.96), rgba(67, 31, 11, 0.96)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 239, 190, 0.45),
        0 4px 0 rgba(44, 18, 6, 0.55),
        0 10px 18px rgba(28, 12, 4, 0.24) !important;
    color: #fff7ed !important;
    font-size: clamp(15px, 0.86vw, 18px) !important;
    -webkit-text-stroke: 0.25px rgba(72, 31, 8, 0.8) !important;
}

#miner-toast-container.miner-toast-dock .toast-msg.miner-toast-msg .toast-name {
    max-width: 118px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#miner-toast-container.miner-toast-dock .toast-msg.miner-toast-msg .toast-reason {
    color: rgba(255, 239, 198, 0.78) !important;
    font-size: clamp(12px, 0.68vw, 14px) !important;
    font-weight: 750 !important;
}

#miner-toast-container.miner-toast-dock .toast-msg.miner-toast-msg .toast-xp {
    font-size: clamp(18px, 1.05vw, 24px) !important;
}

/* Gold Miner card-charge and restart layout polish v1.7.79 */
#scene-game-miner .miner-player-card,
#scene-game-miner .miner-team-card {
    border: 2px solid #f6c23e !important;
    box-sizing: border-box !important;
    background:
        linear-gradient(0deg,
            rgba(250, 204, 21, 0.82) 0%,
            rgba(251, 146, 60, 0.84) var(--charge-percent, 0%),
            rgba(10, 30, 52, 0.96) var(--charge-percent, 0%),
            rgba(4, 17, 31, 0.98) 100%),
        radial-gradient(circle at 92% 82%, rgba(14, 165, 233, 0.18), transparent 20%) !important;
    box-shadow:
        inset 0 0 0 3px rgba(66, 24, 7, 0.88),
        0 5px 0 rgba(53, 20, 6, 0.58) !important;
}

#scene-game-miner .miner-player-card.ready,
#scene-game-miner .miner-team-card.ready,
#scene-game-miner .miner-player-card.current,
#scene-game-miner .miner-team-card.selected {
    border-color: #fde047 !important;
    background:
        linear-gradient(0deg,
            rgba(255, 244, 168, 0.95) 0%,
            rgba(250, 204, 21, 0.96) var(--charge-percent, 100%),
            rgba(10, 30, 52, 0.96) var(--charge-percent, 100%),
            rgba(4, 17, 31, 0.98) 100%),
        radial-gradient(circle at 92% 82%, rgba(255, 255, 255, 0.22), transparent 20%) !important;
    box-shadow:
        inset 0 0 0 4px rgba(120, 53, 15, 0.92),
        0 0 16px rgba(250, 204, 21, 0.58),
        0 5px 0 rgba(53, 20, 6, 0.58) !important;
}

#scene-game-miner .miner-player-charge,
#scene-game-miner .miner-charge-track {
    display: none !important;
}

#scene-game-miner .miner-player-main,
#scene-game-miner .miner-team-body {
    grid-template-rows: clamp(28px, 3.15vh, 38px) minmax(24px, 1fr) !important;
    gap: clamp(4px, 0.7vh, 8px) !important;
    overflow: hidden !important;
}

#scene-game-miner .miner-player-group {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

#scene-game-miner .miner-player-group-grid {
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
}

#scene-game-miner .miner-player-group-title,
#scene-game-miner .miner-team-ribbon {
    top: 0 !important;
    bottom: 0 !important;
}

#scene-game-miner .miner-control-panel.miner-count-1,
#scene-game-miner .miner-control-panel.miner-count-2,
#scene-game-miner .miner-control-panel.miner-count-3,
#scene-game-miner .miner-control-panel.miner-count-4,
#scene-game-miner .miner-control-panel.miner-count-5,
#scene-game-miner .miner-control-panel.miner-count-6 {
    align-content: center !important;
    align-items: center !important;
}

#scene-game-miner .miner-control-panel.miner-team-grid.miner-count-1,
#scene-game-miner .miner-control-panel.miner-team-grid.miner-count-2,
#scene-game-miner .miner-control-panel.miner-team-grid.miner-count-3,
#scene-game-miner .miner-control-panel.miner-team-grid.miner-count-4,
#scene-game-miner .miner-control-panel.miner-team-grid.miner-count-5,
#scene-game-miner .miner-control-panel.miner-team-grid.miner-count-6,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-1,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-2,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-3,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-4,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-5,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-6 {
    grid-template-rows: minmax(118px, clamp(128px, 17.5vh, 174px)) !important;
    grid-auto-rows: minmax(118px, clamp(128px, 17.5vh, 174px)) !important;
}

#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-1 > .miner-player-card,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-2 > .miner-player-card,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-3 > .miner-player-card,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-4 > .miner-player-card,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-5 > .miner-player-card,
#scene-game-miner .miner-control-panel.miner-player-grid.miner-count-6 > .miner-player-card,
#scene-game-miner .miner-control-panel.miner-count-1 .miner-team-card,
#scene-game-miner .miner-control-panel.miner-count-2 .miner-team-card,
#scene-game-miner .miner-control-panel.miner-count-3 .miner-team-card,
#scene-game-miner .miner-control-panel.miner-count-4 .miner-team-card,
#scene-game-miner .miner-control-panel.miner-count-5 .miner-team-card,
#scene-game-miner .miner-control-panel.miner-count-6 .miner-team-card {
    height: clamp(128px, 17.5vh, 174px) !important;
    align-self: center !important;
}

#scene-game-miner .miner-control-panel.miner-personal-groups .miner-player-card {
    height: 100% !important;
    min-height: 0 !important;
    align-self: stretch !important;
    padding: clamp(4px, 0.65vh, 6px) clamp(6px, 0.55vw, 9px) !important;
}

#scene-game-miner .miner-control-panel.miner-personal-groups .miner-player-main {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: clamp(5px, 0.75vh, 8px) !important;
    overflow: visible !important;
    transform: translateY(clamp(5px, 0.9vh, 8px)) !important;
}

#scene-game-miner .miner-control-panel.miner-personal-groups .miner-player-rank {
    width: clamp(24px, 1.75vw, 30px) !important;
    height: clamp(24px, 1.75vw, 30px) !important;
    font-size: clamp(12px, 0.78vw, 15px) !important;
}

#scene-game-miner .miner-control-panel.miner-personal-groups .miner-player-name {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    font-size: clamp(17px, 2.45vh, 22px) !important;
    line-height: 1.16 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 0 3px !important;
    overflow: visible !important;
}

/* Gold Miner personal cast guard v1.7.17 */
#scene-game-miner .miner-control-panel.ungrouped-mode .miner-player-main,
#scene-game-miner .miner-control-panel.miner-player-grid:not(.miner-personal-groups) .miner-player-main {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: clamp(8px, 1.1vh, 13px) !important;
    overflow: visible !important;
    transform: none !important;
}

#scene-game-miner .miner-control-panel.ungrouped-mode .miner-player-name,
#scene-game-miner .miner-control-panel.miner-player-grid:not(.miner-personal-groups) .miner-player-name {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

#scene-game-miner .miner-player-drop-label {
    width: auto !important;
    height: auto !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    display: block !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #fffbeb !important;
    font-size: clamp(26px, 1.9vw, 36px) !important;
    font-weight: 950 !important;
    line-height: 1.08 !important;
    text-shadow: 0 2px 0 rgba(92, 32, 6, 0.78) !important;
    white-space: nowrap !important;
}

#scene-game-miner .miner-player-card.armed {
    border-color: #facc15 !important;
    background: #b45309 !important;
}

#scene-game-miner .miner-player-card.armed .miner-player-name {
    color: #fff7ed !important;
    font-weight: 950 !important;
}

/* 彩墨占地实验版 */
#scene-game-ink {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(20, 83, 45, 0.88)),
        radial-gradient(circle at 18% 20%, rgba(250, 204, 21, 0.18), transparent 28%),
        radial-gradient(circle at 82% 78%, rgba(56, 189, 248, 0.16), transparent 30%);
    color: #f8fafc;
}

#scene-game-ink .ink-game-shell {
    box-sizing: border-box;
    height: 100vh;
    margin-right: 60px;
    padding: clamp(10px, 1.2vw, 16px);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px minmax(320px, 34vw);
    grid-template-areas: "board swap controls";
    gap: clamp(7px, 0.8vw, 12px);
    overflow: hidden;
}

#scene-game-ink .ink-game-shell.layout-swapped {
    grid-template-columns: minmax(320px, 34vw) 20px minmax(0, 1fr);
    grid-template-areas: "controls swap board";
}

#scene-game-ink .ink-board-wrap,
#scene-game-ink .ink-control-panel {
    min-height: 0;
}

#scene-game-ink .ink-board-wrap {
    grid-area: board;
    --ink-board-w: 100%;
    --ink-board-h: auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
}

#scene-game-ink .ink-layout-toggle {
    grid-area: swap;
    align-self: center;
    justify-self: center;
    z-index: 6;
    width: 20px;
    height: 64px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(226, 232, 240, 0.24);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.42);
    color: rgba(226, 232, 240, 0.78);
}

#scene-game-ink .ink-layout-toggle:active {
    transform: scale(0.94);
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
}

#scene-game-ink .ink-score-strip {
    width: var(--ink-board-w);
    justify-self: end;
    display: grid;
    grid-template-columns: repeat(var(--ink-score-count, 4), minmax(0, 1fr));
    gap: 8px;
}

#scene-game-ink .ink-score-chip {
    min-height: 46px;
    padding: 6px 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border: 2px solid var(--ink-color);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    font-size: clamp(17px, 1.25vw, 24px);
    font-weight: 950;
}

#scene-game-ink .ink-score-chip strong {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.05;
}

#scene-game-ink .ink-score-meta {
    color: #cbd5e1;
    font-size: clamp(16px, 1.1vw, 21px);
    line-height: 1.05;
    white-space: nowrap;
}

#scene-game-ink .ink-score-dot {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--ink-color);
    box-shadow: none;
}

#scene-game-ink .ink-score-chip.leader {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    border-color: #facc15;
    background: rgba(113, 63, 18, 0.86);
    color: #fff7ed;
}

#scene-game-ink .ink-leader-crown,
#scene-game-ink .ink-group-crown {
    color: #facc15;
    -webkit-text-stroke: 1px rgba(120, 53, 15, 0.72);
    filter: none;
}

#scene-game-ink .ink-leader-crown {
    font-size: clamp(16px, 1.1vw, 21px);
}

#scene-game-ink .ink-score-chip.leader .ink-score-dot {
    background: #facc15;
    box-shadow: none;
}

#scene-game-ink .ink-score-chip.leader .ink-score-meta {
    color: #fde68a;
}

#scene-game-ink .ink-board {
    align-self: end;
    justify-self: end;
    width: var(--ink-board-w);
    height: var(--ink-board-h);
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(var(--ink-cols), 1fr);
    grid-template-rows: repeat(var(--ink-rows), 1fr);
    gap: clamp(3px, 0.45vw, 6px);
    padding: clamp(7px, 0.85vw, 12px);
    border: 2px solid rgba(226, 232, 240, 0.24);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: none;
}

#scene-game-ink .ink-cell {
    width: 100%;
    height: 100%;
    border: 2px solid rgba(226, 232, 240, 0.18);
    border-radius: 6px;
    background: rgba(226, 232, 240, 0.12);
    box-shadow: none;
    transition: transform 80ms ease;
}

#scene-game-ink .ink-cell:active {
    transform: scale(0.94);
}

#scene-game-ink .ink-cell.owned {
    border-color: var(--ink-color);
    background: var(--ink-color);
    box-shadow: none;
}

#scene-game-ink .ink-control-panel {
    grid-area: controls;
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
    gap: 7px;
    overflow: hidden;
}

#scene-game-ink .ink-group-card {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
    border: 2px solid var(--ink-color);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.76);
}

#scene-game-ink .ink-group-card.leader {
    border-color: #facc15;
    background: rgba(30, 41, 59, 0.86);
}

#scene-game-ink .ink-group-head {
    min-height: 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 3px 8px;
    border: 0;
    border-radius: 6px;
    background:
        linear-gradient(90deg, var(--ink-fill) 0, var(--ink-fill) var(--ink-energy-pct, 0%), transparent var(--ink-energy-pct, 0%), transparent 100%),
        rgba(15, 23, 42, 0.42);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.08);
    font-size: clamp(15px, 1.08vw, 18px);
    font-weight: 950;
    text-align: left;
    cursor: pointer;
}

#scene-game-ink .ink-group-card.leader .ink-group-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    box-shadow:
        inset 0 0 0 1px rgba(250, 204, 21, 0.32),
        0 0 0 1px rgba(250, 204, 21, 0.28);
}

#scene-game-ink .ink-group-crown {
    font-size: clamp(17px, 1.25vw, 22px);
}

#scene-game-ink .ink-group-head:active {
    transform: scale(0.985);
    background:
        linear-gradient(90deg, var(--ink-fill) 0, var(--ink-fill) var(--ink-energy-pct, 0%), transparent var(--ink-energy-pct, 0%), transparent 100%),
        rgba(15, 23, 42, 0.68);
}

#scene-game-ink .ink-group-head strong {
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#scene-game-ink .ink-participation-count {
    color: #ffffff;
    white-space: nowrap;
    font-size: clamp(16px, 1.2vw, 21px);
    font-weight: 950;
}

#scene-game-ink .ink-skill-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 4px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.36);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

#scene-game-ink .ink-skill-btn {
    min-height: 36px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid rgba(226, 232, 240, 0.18);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.58);
    color: #cbd5e1;
    font-size: clamp(13px, 0.92vw, 16px);
    font-weight: 900;
    opacity: 0.78;
}

#scene-game-ink .ink-skill-btn i {
    color: var(--ink-color);
    font-size: 15px;
}

#scene-game-ink .ink-skill-btn span,
#scene-game-ink .ink-skill-btn small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#scene-game-ink .ink-skill-btn small {
    color: #94a3b8;
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 900;
}

#scene-game-ink .ink-skill-btn.ready {
    border-color: var(--ink-color);
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    opacity: 1;
}

#scene-game-ink .ink-skill-btn.armed {
    background: var(--ink-color);
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
    opacity: 1;
}

#scene-game-ink .ink-skill-btn.armed i,
#scene-game-ink .ink-skill-btn.armed small {
    color: #ffffff;
}

#scene-game-ink .ink-member-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(var(--ink-member-cols, 3), minmax(0, 1fr));
    grid-template-rows: repeat(var(--ink-member-rows, 2), minmax(0, 1fr));
    gap: 6px;
    align-content: stretch;
    overflow: hidden;
    padding: 6px;
    border-radius: 7px;
    background: rgba(148, 163, 184, 0.08);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.08);
}

#scene-game-ink .ink-student-card {
    min-height: 42px;
    display: grid;
    grid-template-columns: clamp(22px, 1.65vw, 30px) minmax(0, 1fr);
    gap: 5px;
    align-items: center;
    justify-items: stretch;
    padding: 6px 8px;
    border: 1px solid rgba(226, 232, 240, 0.2);
    border-radius: 7px;
    background:
        linear-gradient(90deg, var(--ink-fill) 0, var(--ink-fill) var(--ink-student-pct, 0%), transparent var(--ink-student-pct, 0%), transparent 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        rgba(30, 41, 59, 0.9);
    color: #f8fafc;
}

#scene-game-ink .ink-student-index {
    width: clamp(22px, 1.65vw, 30px);
    height: clamp(22px, 1.65vw, 30px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.46);
    color: #ffffff;
    font-size: clamp(14px, 1vw, 18px);
    font-weight: 950;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.22);
}

#scene-game-ink .ink-student-card:active {
    transform: scale(0.97);
}

#scene-game-ink .ink-student-card.charge-1,
#scene-game-ink .ink-student-card.charge-2,
#scene-game-ink .ink-student-card.charge-3 {
    border-color: var(--ink-color);
    background:
        linear-gradient(90deg, var(--ink-fill) 0, var(--ink-fill) var(--ink-student-pct, 0%), transparent var(--ink-student-pct, 0%), transparent 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
        rgba(15, 23, 42, 0.72);
}

#scene-game-ink .ink-student-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    font-size: clamp(18px, 1.45vw, 24px);
    font-weight: 950;
    line-height: 1.05;
}

#scene-game-ink .ink-group-card.compact .ink-member-grid,
#scene-game-ink .ink-group-card.dense .ink-member-grid {
    gap: 4px;
}

#scene-game-ink .ink-group-card.dense .ink-student-card {
    min-height: 38px;
    grid-template-columns: clamp(20px, 1.35vw, 26px) minmax(0, 1fr);
    gap: 4px;
    padding: 4px 6px;
}

#scene-game-ink .ink-group-card.dense .ink-student-index {
    width: clamp(20px, 1.35vw, 26px);
    height: clamp(20px, 1.35vw, 26px);
    font-size: clamp(12px, 0.86vw, 16px);
}

#scene-game-ink .ink-group-card.dense .ink-student-name {
    font-size: clamp(16px, 1.18vw, 21px);
}

#scene-game-ink .ink-empty {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 1px solid rgba(226, 232, 240, 0.24);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.7);
    text-align: center;
    font-weight: 900;
}

#modal-ink-lottery .modal-ink-lottery-content {
    box-sizing: border-box;
    width: min(1360px, calc(100vw - 80px)) !important;
    height: min(780px, calc(100vh - 36px));
    max-width: none !important;
    max-height: calc(100vh - 36px);
    padding: 20px 22px;
    border: 2px solid rgba(250, 204, 21, 0.55);
    border-radius: 12px;
    background: #0f172a;
    color: #f8fafc;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
    text-align: left;
}

#modal-ink-lottery .ink-lottery-header {
    text-align: center;
}

#modal-ink-lottery .ink-lottery-title-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

#modal-ink-lottery .ink-lottery-title-row h2 {
    margin: 0;
    color: #facc15;
    font-size: clamp(30px, 2.4vw, 42px);
    font-weight: 950;
    text-align: center;
}

#modal-ink-lottery .ink-lottery-countdown,
#modal-ink-lottery #ink-lottery-progress {
    margin: 0;
    padding: 8px 16px;
    border: 2px solid rgba(250, 204, 21, 0.45);
    border-radius: 8px;
    color: #fde68a;
    font-size: clamp(18px, 1.28vw, 24px);
    font-weight: 950;
    line-height: 1;
    white-space: nowrap;
}

#modal-ink-lottery .ink-lottery-countdown {
    justify-self: start;
    min-width: 82px;
    text-align: center;
}

#modal-ink-lottery .ink-lottery-countdown.is-warning {
    border-color: rgba(239, 68, 68, 0.62);
    background: rgba(127, 29, 29, 0.42);
    color: #fecaca;
}

#modal-ink-lottery #ink-lottery-progress {
    justify-self: end;
}

#modal-ink-lottery .ink-lottery-current {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
}

#modal-ink-lottery .ink-lottery-group-head {
    min-height: 50px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 8px 14px;
    border: 2px solid var(--ink-color);
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.08);
}

#modal-ink-lottery .ink-lottery-group-head strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(22px, 1.65vw, 30px);
    font-weight: 950;
}

#modal-ink-lottery .ink-lottery-group-head span {
    color: #fde68a;
    font-size: clamp(17px, 1.15vw, 22px);
    font-weight: 950;
    white-space: nowrap;
}

#modal-ink-lottery .ink-lottery-student-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-height: 0;
}

#modal-ink-lottery .ink-lottery-student {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, 0.18);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.9);
    min-width: 0;
    min-height: 152px;
}

#modal-ink-lottery .ink-lottery-student.picked {
    border-color: rgba(250, 204, 21, 0.58);
}

#modal-ink-lottery .ink-lottery-student-name {
    min-width: 0;
    min-height: 34px;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

#modal-ink-lottery .ink-lottery-student-name strong {
    min-width: 0;
    height: 36px;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(22px, 1.45vw, 30px);
    font-weight: 950;
    line-height: 1;
}

#modal-ink-lottery .ink-lottery-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
    min-height: 94px;
}

#modal-ink-lottery .ink-lottery-card {
    min-width: 0;
    min-height: 94px;
    display: grid;
    place-items: center;
    gap: 5px;
    padding: 7px;
    border: 3px solid #d97706;
    border-radius: 9px;
    background: #f59e0b;
    color: #ffffff;
    font-size: clamp(24px, 1.8vw, 34px);
    font-weight: 950;
    line-height: 1;
}

#modal-ink-lottery .ink-lottery-card.badge {
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: center;
    padding: 8px 5px 10px;
}

#modal-ink-lottery .ink-lottery-card:active {
    transform: scale(0.96);
}

#modal-ink-lottery .ink-lottery-card.revealed {
    border-color: #64748b;
    background: #475569;
}

#modal-ink-lottery .ink-lottery-card.selected.xp {
    border-color: #22c55e;
    background: #16a34a;
}

#modal-ink-lottery .ink-lottery-card.selected.badge {
    border-color: #facc15;
    background: #b45309;
}

#modal-ink-lottery .ink-lottery-card span {
    font-size: clamp(13px, 0.95vw, 17px);
    line-height: 1;
    text-align: center;
}

#modal-ink-lottery .ink-lottery-card .ink-badge-icon {
    width: 88px;
    height: 88px;
    align-self: end;
    border-radius: 0;
}

#modal-ink-lottery .ink-lottery-card.badge span:not(.ink-badge-icon) {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-ink-lottery .ink-lottery-card strong {
    font-size: clamp(30px, 2.25vw, 42px);
    line-height: 1;
}

#modal-ink-lottery .ink-lottery-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
}

#modal-ink-lottery .ink-lottery-footer .btn-rect {
    min-width: 116px;
    min-height: 38px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 950;
}

#modal-ink-lottery .ink-lottery-footer .btn-rect.disabled {
    opacity: 0.45;
}

@media (max-width: 980px) {
    #scene-game-ink .ink-game-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(190px, 32vh);
    }

    #scene-game-ink .ink-control-panel {
        grid-auto-flow: column;
        grid-auto-columns: minmax(260px, 1fr);
        overflow-x: auto;
    }

    #scene-game-ink .ink-layout-toggle {
        display: none;
    }
}
