/* ===================== 战斗地图 — 大厅与联机 ===================== */

.battlemap-lobby {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.battlemap-lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(200, 160, 90, 0.12);
}

.battlemap-lobby-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 20px;
}

.battlemap-lobby-card {
    max-width: 640px;
    margin: 0 auto;
    background: rgba(18, 12, 6, 0.78);
    border: 1px solid rgba(200, 160, 90, 0.22);
    border-radius: 16px;
    padding: 22px 20px;
    backdrop-filter: blur(8px);
}

.battlemap-lobby-card.hidden {
    display: none;
}

/* ---- 选择模式 / 进入房间 ---- */
.battlemap-mode-panel,
.battlemap-room-panel {
    max-width: min(860px, 100%);
    padding: 0;
    overflow: hidden;
    border-color: rgba(224, 100, 82, 0.28);
    background:
        radial-gradient(ellipse at 8% -10%, rgba(224, 100, 82, 0.22), transparent 42%),
        radial-gradient(ellipse at 92% 110%, rgba(201, 160, 106, 0.14), transparent 45%),
        linear-gradient(165deg, rgba(36, 20, 18, 0.96), rgba(8, 6, 10, 0.98));
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 180, 140, 0.1);
}

.battlemap-mode-hero {
    padding: 24px 22px 16px;
    border-bottom: 1px solid rgba(224, 100, 82, 0.16);
    background:
        radial-gradient(ellipse at 10% 0%, rgba(224, 100, 82, 0.18), transparent 55%),
        radial-gradient(ellipse at 90% 30%, rgba(201, 160, 106, 0.1), transparent 40%);
}

.battlemap-mode-hero--compact {
    padding: 18px 20px 14px;
}

.battlemap-mode-kicker {
    margin: 0 0 4px;
    font-family: "Cormorant Garamond", "Noto Serif SC", serif;
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 170, 140, 0.62);
}

.battlemap-mode-title {
    margin: 0 0 8px;
    font-family: "Noto Serif SC", "Source Han Serif SC", serif;
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #ffe8d8;
    text-shadow: 0 0 24px rgba(224, 100, 82, 0.2);
}

.battlemap-mode-hero .battlemap-lobby-hint {
    max-width: 36em;
    color: rgba(255, 220, 200, 0.55);
}

.battlemap-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px 18px 8px;
}

.battlemap-mode-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.battlemap-mode-grid--duel-sub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .battlemap-mode-grid--3,
    .battlemap-mode-grid--duel-sub {
        grid-template-columns: 1fr;
    }
}

.battlemap-mode-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 188px;
    padding: 22px 18px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 170, 140, 0.18);
    background:
        linear-gradient(155deg, rgba(224, 100, 82, 0.14), transparent 46%),
        rgba(0, 0, 0, 0.32);
    color: #fff4ec;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.2s, transform 0.18s, box-shadow 0.2s, background 0.2s;
    overflow: hidden;
}

.battlemap-mode-card-glow {
    position: absolute;
    inset: auto -20% -40% auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 100, 82, 0.28), transparent 68%);
    pointer-events: none;
}

.battlemap-mode-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #ff8a72, #e06452);
    opacity: 0.55;
}

.battlemap-mode-card:hover {
    border-color: rgba(255, 160, 120, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(80, 24, 16, 0.32);
}

.battlemap-mode-card--online {
    background:
        linear-gradient(155deg, rgba(201, 160, 106, 0.14), transparent 48%),
        rgba(0, 0, 0, 0.32);
}

.battlemap-mode-card--online::before {
    background: linear-gradient(180deg, #ffd090, #c9a06a);
}

.battlemap-mode-card--online .battlemap-mode-card-glow {
    background: radial-gradient(circle, rgba(201, 160, 106, 0.28), transparent 68%);
}

.battlemap-mode-card-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 180, 150, 0.28);
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 55%),
        rgba(224, 100, 82, 0.2);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
    color: #ffc8b4;
    font-size: 1.15rem;
    line-height: 1;
}

.battlemap-mode-card--online .battlemap-mode-card-mark {
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 55%),
        rgba(201, 160, 106, 0.22);
    border-color: rgba(255, 210, 150, 0.3);
    color: #ffe0b0;
}

.battlemap-mode-card-label {
    font-family: "Noto Serif SC", serif;
    font-size: 1.22rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #fff4ec;
}

.battlemap-mode-card-desc {
    font-size: 0.8rem;
    line-height: 1.6;
    color: rgba(255, 220, 200, 0.55);
    flex: 1;
}

.battlemap-mode-card-cta {
    margin-top: 4px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 180, 150, 0.72);
}

.battlemap-mode-card--online .battlemap-mode-card-cta {
    color: rgba(255, 210, 150, 0.75);
}

.battlemap-mode-card--duel {
    background:
        linear-gradient(155deg, rgba(160, 70, 90, 0.2), transparent 48%),
        rgba(0, 0, 0, 0.32);
}

.battlemap-mode-card--duel::before {
    background: linear-gradient(180deg, #e8a0b0, #a0465a);
}

.battlemap-mode-card--duel .battlemap-mode-card-glow {
    background: radial-gradient(circle, rgba(200, 90, 110, 0.3), transparent 68%);
}

.battlemap-mode-card--duel .battlemap-mode-card-mark {
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 55%),
        rgba(160, 70, 90, 0.28);
    border-color: rgba(255, 180, 190, 0.32);
    color: #ffd0d8;
}

.battlemap-mode-card--duel .battlemap-mode-card-cta {
    color: rgba(255, 190, 200, 0.78);
}

.battlemap-duel-panel {
    border-color: rgba(160, 70, 90, 0.32);
}

.battlemap-room-item--duel .battlemap-room-item-code {
    color: #ffd0d8;
}

.battlemap-room-item-badge.is-duel {
    border-color: rgba(200, 100, 120, 0.45);
    color: #ffc8d0;
    background: rgba(120, 40, 55, 0.35);
}

.battlemap-mode-radar {
    margin: 12px 16px 18px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(224, 100, 82, 0.18);
    background:
        linear-gradient(180deg, rgba(224, 100, 82, 0.06), transparent 40%),
        rgba(0, 0, 0, 0.28);
}

.battlemap-room-panel > .battlemap-lobby-row {
    padding: 0 16px;
}

.battlemap-room-list-section {
    margin: 16px 16px 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(224, 100, 82, 0.14);
    background: rgba(0, 0, 0, 0.22);
}

.battlemap-room-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.battlemap-room-list-title {
    margin: 0;
    font-family: "Noto Serif SC", serif;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: #ffd8c8;
}

.battlemap-room-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(40vh, 320px);
    overflow: auto;
    scrollbar-width: thin;
}

.battlemap-room-list-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.battlemap-room-item {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.battlemap-room-item-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 170, 140, 0.14);
    background:
        linear-gradient(105deg, rgba(224, 100, 82, 0.08), transparent 48%),
        rgba(255, 255, 255, 0.03);
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, background 0.2s;
}

.battlemap-room-item-main:hover {
    border-color: rgba(255, 160, 120, 0.45);
    transform: translateY(-1px);
    background:
        linear-gradient(105deg, rgba(224, 100, 82, 0.18), transparent 50%),
        rgba(255, 255, 255, 0.04);
}

.battlemap-room-item-close {
    flex-shrink: 0;
    align-self: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(224, 100, 82, 0.4);
    background: rgba(224, 100, 82, 0.14);
    color: #ffb8a8;
    font-size: 12px;
    letter-spacing: 0.06em;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.battlemap-room-item-close:hover {
    background: rgba(224, 100, 82, 0.28);
    border-color: rgba(255, 140, 120, 0.55);
    color: #ffe0d8;
}

.battlemap-room-item-code {
    font-family: ui-monospace, monospace;
    font-size: 1.05rem;
    letter-spacing: 0.14em;
    color: #ffd8a8;
    font-weight: 700;
}

.battlemap-room-item-meta {
    margin-top: 4px;
    font-size: 0.75rem;
    color: rgba(255, 220, 200, 0.5);
    line-height: 1.4;
}

.battlemap-room-item-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.06em;
    border: 1px solid rgba(255, 180, 140, 0.28);
    color: #ffc8b4;
    background: rgba(224, 100, 82, 0.14);
}

.battlemap-room-item-badge.is-lobby {
    border-color: rgba(201, 160, 106, 0.35);
    color: #ffe0b0;
    background: rgba(201, 160, 106, 0.12);
}

.battlemap-room-list-empty {
    margin: 0;
    padding: 18px 10px;
    text-align: center;
    color: rgba(255, 220, 200, 0.42);
    font-size: 0.82rem;
}

@media (max-width: 560px) {
    .battlemap-mode-grid {
        grid-template-columns: 1fr;
    }

    .battlemap-mode-title {
        font-size: 1.3rem;
    }
}

/* ---- 棋子库编队面板 ---- */
.battlemap-roster-panel {
    max-width: min(760px, 100%);
    padding: 0;
    overflow: hidden;
    border-color: rgba(224, 100, 82, 0.22);
    background:
        linear-gradient(165deg, rgba(36, 20, 18, 0.94), rgba(10, 8, 10, 0.96)),
        rgba(8, 6, 8, 0.9);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 180, 140, 0.08);
}

.battlemap-roster-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px 18px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid rgba(224, 100, 82, 0.16);
    background:
        radial-gradient(ellipse at 12% 0%, rgba(224, 100, 82, 0.16), transparent 55%),
        radial-gradient(ellipse at 88% 20%, rgba(201, 160, 106, 0.1), transparent 42%);
}

.battlemap-roster-kicker {
    margin: 0 0 4px;
    font-family: "Cormorant Garamond", "Noto Serif SC", serif;
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 170, 140, 0.62);
}

.battlemap-roster-title {
    margin: 0 0 6px;
    font-family: "Noto Serif SC", "Source Han Serif SC", serif;
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #ffe8d8;
    text-shadow: 0 0 24px rgba(224, 100, 82, 0.2);
}

.battlemap-roster-hero .battlemap-lobby-hint {
    max-width: 34em;
    color: rgba(255, 220, 200, 0.55);
}

.battlemap-roster-room-chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201, 160, 106, 0.28);
    background: rgba(0, 0, 0, 0.35);
}

.battlemap-roster-room-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    color: rgba(255, 210, 170, 0.5);
}

.battlemap-roster-copy-btn {
    border: none;
    background: rgba(224, 100, 82, 0.18);
    color: #ffc8b4;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
}

.battlemap-roster-copy-btn:hover {
    background: rgba(224, 100, 82, 0.32);
    color: #fff0e8;
}

.battlemap-roster-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 180, 140, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

.battlemap-roster-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.battlemap-roster-selected-count {
    font-size: 12px;
    letter-spacing: 0.06em;
    color: rgba(255, 200, 170, 0.72);
    font-variant-numeric: tabular-nums;
}

.battlemap-roster-select-all {
    border-color: rgba(224, 100, 82, 0.4) !important;
    color: #ffc2ae !important;
    background: rgba(224, 100, 82, 0.1) !important;
    min-height: 34px;
}

.battlemap-roster-select-all.is-active {
    background: rgba(224, 100, 82, 0.22) !important;
    color: #ffe0d4 !important;
}

.battlemap-roster-participants {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.8rem;
    color: rgba(255, 230, 210, 0.62);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.battlemap-roster-party-label {
    color: rgba(255, 180, 140, 0.55);
    letter-spacing: 0.08em;
    font-size: 11px;
}

.battlemap-roster-party-sep {
    margin: 0 4px;
    opacity: 0.35;
}

.battlemap-roster-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 14px 16px;
    max-height: min(52vh, 460px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(224, 100, 82, 0.35) transparent;
}

.battlemap-roster-empty {
    padding: 36px 16px;
    text-align: center;
    border: 1px dashed rgba(224, 100, 82, 0.22);
    border-radius: 14px;
    background: rgba(255, 120, 90, 0.04);
}

.battlemap-roster-empty-title {
    margin: 0 0 8px;
    font-family: "Noto Serif SC", serif;
    font-size: 1.05rem;
    color: #ffd8c8;
}

.battlemap-roster-card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 12px 14px;
    min-height: 76px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 170, 140, 0.14);
    background:
        linear-gradient(105deg, rgba(224, 100, 82, 0.06), transparent 42%),
        rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
    position: relative;
}

.battlemap-roster-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
    transition: background 0.2s;
}

.battlemap-roster-card:hover {
    border-color: rgba(255, 160, 120, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.battlemap-roster-card.is-selected {
    border-color: rgba(224, 100, 82, 0.55);
    background:
        linear-gradient(105deg, rgba(224, 100, 82, 0.18), transparent 50%),
        rgba(30, 16, 14, 0.55);
    box-shadow: 0 0 0 1px rgba(224, 100, 82, 0.12), 0 10px 24px rgba(120, 40, 24, 0.2);
}

.battlemap-roster-card.is-selected::before {
    background: linear-gradient(180deg, #ff8a72, #e06452);
}

.battlemap-roster-check-wrap {
    position: relative;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.battlemap-roster-check {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.battlemap-roster-check-ui {
    display: block;
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1.5px solid rgba(255, 190, 160, 0.35);
    background: rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.battlemap-roster-check-ui::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid #1a0c0a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
}

.battlemap-roster-card.is-selected .battlemap-roster-check-ui,
.battlemap-roster-check:checked + .battlemap-roster-check-ui {
    border-color: #ff8a72;
    background: linear-gradient(160deg, #ff8a72, #e06452);
    box-shadow: 0 0 12px rgba(224, 100, 82, 0.35);
}

.battlemap-roster-card.is-selected .battlemap-roster-check-ui::after,
.battlemap-roster-check:checked + .battlemap-roster-check-ui::after {
    transform: rotate(45deg) scale(1);
}

.battlemap-roster-preview {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 2px solid var(--roster-accent, #e06452);
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.12), transparent 45%),
        rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.3);
}

.battlemap-roster-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.battlemap-roster-preview-fallback {
    font-size: 1.35rem;
    color: rgba(255, 220, 200, 0.75);
}

.battlemap-roster-main {
    min-width: 0;
}

.battlemap-roster-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.battlemap-roster-name {
    font-family: "Noto Serif SC", serif;
    font-weight: 600;
    font-size: 1.02rem;
    color: #fff4ec;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.battlemap-roster-type {
    flex-shrink: 0;
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 180, 140, 0.28);
    color: rgba(255, 200, 170, 0.7);
    background: rgba(0, 0, 0, 0.25);
}

.battlemap-roster-stats-row {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 0;
    font-size: 0.75rem;
    color: rgba(255, 220, 200, 0.52);
}

.battlemap-roster-stat-sep {
    width: 3px;
    height: 3px;
    margin: 0 8px;
    border-radius: 50%;
    background: rgba(255, 160, 120, 0.4);
}

.battlemap-roster-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(224, 100, 82, 0.14);
    background: rgba(0, 0, 0, 0.22);
}

.battlemap-roster-actions-secondary,
.battlemap-roster-actions-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.battlemap-roster-actions .battlemap-btn-ghost {
    background: transparent;
    border-color: rgba(255, 180, 150, 0.2);
    color: rgba(255, 220, 200, 0.7);
}

.battlemap-roster-start-btn {
    min-width: 132px;
    min-height: 42px;
    font-weight: 600;
    letter-spacing: 0.08em;
    box-shadow: 0 8px 22px rgba(224, 100, 82, 0.28);
}

.battlemap-roster-start-btn:disabled {
    opacity: 0.45;
    box-shadow: none;
}

@media (max-width: 640px) {
    .battlemap-roster-hero {
        padding: 18px 14px 14px;
    }

    .battlemap-roster-title {
        font-size: 1.3rem;
    }

    .battlemap-roster-toolbar,
    .battlemap-roster-list,
    .battlemap-roster-actions {
        padding-left: 12px;
        padding-right: 12px;
    }

    .battlemap-roster-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .battlemap-roster-actions-secondary,
    .battlemap-roster-actions-primary {
        width: 100%;
    }

    .battlemap-roster-actions-primary {
        justify-content: stretch;
    }

    .battlemap-roster-start-btn,
    .battlemap-roster-actions-primary .battlemap-btn {
        flex: 1;
    }

    .battlemap-roster-card {
        grid-template-columns: auto auto minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
    }

    .battlemap-roster-preview {
        width: 48px;
        height: 48px;
    }
}

.battlemap-lobby-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffe8b8;
}

.battlemap-lobby-hint {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 240, 210, 0.48);
    line-height: 1.5;
}

.battlemap-lobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.battlemap-lobby-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 14px;
    border-radius: 14px;
    border: 1px solid rgba(220, 180, 100, 0.28);
    background: rgba(255, 255, 255, 0.03);
    color: #fff0d8;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    text-align: center;
}

.battlemap-lobby-option:hover {
    border-color: rgba(255, 210, 120, 0.55);
    background: rgba(220, 160, 60, 0.08);
    transform: translateY(-1px);
}

.battlemap-lobby-option-icon {
    font-size: 1.8rem;
}

.battlemap-lobby-option-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.battlemap-lobby-option-desc {
    font-size: 0.72rem;
    line-height: 1.45;
    color: rgba(255, 240, 210, 0.48);
}

.battlemap-lobby-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
}

.battlemap-lobby-input {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(200, 160, 90, 0.28);
    background: rgba(0, 0, 0, 0.32);
    color: #fff0d8;
    font-size: 0.9rem;
}

.battlemap-lobby-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.battlemap-lobby-room-code {
    font-family: ui-monospace, monospace;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: #ffd878;
}

.battlemap-lobby-sync-badge {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(200, 160, 90, 0.3);
    color: rgba(255, 240, 210, 0.7);
    cursor: pointer;
    user-select: none;
}

.battlemap-lobby-sync-badge.battlemap-sync--online {
    border-color: rgba(80, 200, 120, 0.45);
    color: #8fd4a8;
}

.battlemap-lobby-sync-badge.battlemap-sync--local {
    border-color: rgba(255, 180, 80, 0.4);
    color: #ffc878;
}

.battlemap-roster-room-chip .battlemap-lobby-room-code {
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    color: #ffd8a8;
}

.battlemap-editor-screen {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.battlemap-editor-screen.hidden {
    display: none;
}

.battlemap-lobby.hidden {
    display: none;
}

#battlemap-view > #battlemap-piece-modal {
    z-index: 300;
}

.battlemap-online-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: rgba(255, 240, 210, 0.65);
}

.battlemap-online-bar.hidden {
    display: none;
}

.battlemap-online-room-code {
    font-family: ui-monospace, monospace;
    letter-spacing: 0.1em;
    color: #ffd878;
}

.battlemap-online-sync-badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(200, 160, 90, 0.3);
    cursor: pointer;
    user-select: none;
}

.battlemap-online-sync-badge.battlemap-sync--online {
    border-color: rgba(80, 200, 120, 0.45);
    color: #8fd4a8;
}

.battlemap-online-sync-badge.battlemap-sync--local {
    border-color: rgba(255, 180, 80, 0.4);
    color: #ffc878;
}

.battlemap-charsheet-picker {
    position: fixed;
    inset: 0;
    z-index: 100040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: auto;
}

.battlemap-charsheet-picker.hidden {
    display: none;
}

.battlemap-charsheet-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.battlemap-charsheet-picker-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(80vh, 680px);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1px solid rgba(200, 170, 110, 0.35);
    background: linear-gradient(165deg, rgba(28, 24, 18, 0.98), rgba(12, 10, 8, 0.98));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    padding: 0;
}

.battlemap-charsheet-picker-header,
.battlemap-charsheet-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(200, 170, 110, 0.18);
}

.battlemap-charsheet-picker-footer {
    border-bottom: none;
    border-top: 1px solid rgba(200, 170, 110, 0.18);
    justify-content: flex-end;
}

.battlemap-charsheet-picker-kicker {
    margin: 0 0 2px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 220, 160, 0.55);
}

.battlemap-charsheet-picker-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #ffe7b0;
}

.battlemap-charsheet-picker-dialog > .battlemap-lobby-hint {
    margin: 0;
    padding: 0 16px 10px;
}

.battlemap-charsheet-picker-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 4px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.battlemap-charsheet-picker-item-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 200, 170, 0.12);
}

.battlemap-charsheet-picker-item-wrap.is-selected .battlemap-charsheet-picker-item {
    border-color: rgba(140, 220, 170, 0.55);
    background: rgba(80, 140, 100, 0.22);
}

.battlemap-charsheet-picker-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(200, 170, 110, 0.22);
    background: rgba(255, 220, 150, 0.05);
    color: #f6ebda;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.battlemap-charsheet-check {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #c9a24a;
    cursor: pointer;
}

.battlemap-charsheet-picker-item:hover,
.battlemap-charsheet-picker-item:focus-within {
    outline: none;
    border-color: rgba(255, 210, 120, 0.55);
    background: rgba(255, 200, 100, 0.1);
    transform: translateY(-1px);
}

.battlemap-charsheet-picker-avatar {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 210, 140, 0.35);
    background: rgba(40, 28, 12, 0.55);
}

.battlemap-charsheet-picker-avatar.is-empty {
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 200, 120, 0.08),
            rgba(255, 200, 120, 0.08) 6px,
            rgba(40, 28, 12, 0.35) 6px,
            rgba(40, 28, 12, 0.35) 12px
        );
}

.battlemap-charsheet-picker-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.battlemap-charsheet-picker-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.battlemap-charsheet-picker-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ffe7b0;
}

.battlemap-charsheet-picker-meta {
    font-size: 0.82rem;
    color: rgba(255, 230, 190, 0.72);
}

.battlemap-charsheet-picker-time {
    font-size: 0.72rem;
    color: rgba(255, 220, 160, 0.45);
}

.battlemap-view.battlemap-lobby-active .battlemap-topbar,
.battlemap-view.battlemap-lobby-active .battlemap-shell {
    display: none;
}
