/* ============================================================
   KaroEarth WorldMap — Map-app style UI (direction C)
   Light-first, dark auto. No external fonts / icon fonts.
   ============================================================ */

:root {
    --bg: #e9e5db;              /* 未探索エリア(地図の下地) */
    --surface: #ffffff;
    --surface2: #f1f3f8;
    --text: #23283a;
    --muted: #6b7280;
    --line: rgba(20, 30, 60, 0.12);
    --accent: #2f6bd8;
    --accent-soft: rgba(47, 107, 216, 0.10);
    --good: #1f8a3d;
    --good-soft: rgba(31, 138, 61, 0.12);
    --bad: #c4364f;
    --bad-soft: rgba(196, 54, 79, 0.12);
    --warn: #b06414;
    --shadow: 0 2px 10px rgba(25, 35, 60, 0.18);
    --shadow-lg: 0 8px 28px rgba(25, 35, 60, 0.24);
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Noto Sans Mono", monospace;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #10131d;
        --surface: #1b2030;
        --surface2: #232a3d;
        --text: #d6dcef;
        --muted: #8b93ad;
        --line: rgba(255, 255, 255, 0.10);
        --accent: #7ea6f5;
        --accent-soft: rgba(126, 166, 245, 0.14);
        --good: #7fd08c;
        --good-soft: rgba(127, 208, 140, 0.14);
        --bad: #ef7f97;
        --bad-soft: rgba(239, 127, 151, 0.14);
        --warn: #e8a768;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.6);
    }
}
:root[data-theme="light"] {
    --bg: #e9e5db; --surface: #ffffff; --surface2: #f1f3f8; --text: #23283a; --muted: #6b7280;
    --line: rgba(20, 30, 60, 0.12); --accent: #2f6bd8; --accent-soft: rgba(47, 107, 216, 0.10);
    --good: #1f8a3d; --good-soft: rgba(31, 138, 61, 0.12); --bad: #c4364f; --bad-soft: rgba(196, 54, 79, 0.12);
    --warn: #b06414;
    --shadow: 0 2px 10px rgba(25, 35, 60, 0.18); --shadow-lg: 0 8px 28px rgba(25, 35, 60, 0.24);
}
:root[data-theme="dark"] {
    --bg: #10131d; --surface: #1b2030; --surface2: #232a3d; --text: #d6dcef; --muted: #8b93ad;
    --line: rgba(255, 255, 255, 0.10); --accent: #7ea6f5; --accent-soft: rgba(126, 166, 245, 0.14);
    --good: #7fd08c; --good-soft: rgba(127, 208, 140, 0.14); --bad: #ef7f97; --bad-soft: rgba(239, 127, 151, 0.14);
    --warn: #e8a768;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.5); --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden属性を確実に効かせる (display:flex等の指定がhiddenを上書きして
   設定・通信ログが常時表示になっていたバグの修正) */
[hidden] { display: none !important; }

/* 細スクロールバー (太いOSスクロールバーが出て邪魔なのを抑止) */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* パネル内はスクロールバー自体を非表示 (アプリ風・デザイン統一。
   ホイール/スワイプでのスクロールはそのまま効く) */
#sheet-content, #search-results, #api-logs, #settings-pop, #log-panel {
    scrollbar-width: none;
}
#sheet-content::-webkit-scrollbar,
#search-results::-webkit-scrollbar,
#api-logs::-webkit-scrollbar,
#settings-pop::-webkit-scrollbar,
#log-panel::-webkit-scrollbar { display: none; }

body, html {
    margin: 0; padding: 0;
    height: 100%; width: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    overflow: hidden;
    overscroll-behavior: none;
}

#map { height: 100%; width: 100%; z-index: 1; background: var(--bg); }

/* ---------- loading ---------- */
#loading-screen {
    position: fixed; inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.4s ease;
}
.loader { text-align: center; }
.loader p { margin-top: 14px; color: var(--muted); letter-spacing: 0.14em; font-size: 0.82rem; font-weight: 600; }
.loader-mark {
    width: 40px; height: 40px; margin: 0 auto;
    border-radius: 12px;
    background: var(--accent);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.82); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) {
    .loader-mark { animation: none; }
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

#ui-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1000; }
#ui-layer > * { pointer-events: auto; }

/* ---------- icons ---------- */
[data-icon] { display: inline-flex; width: 18px; height: 18px; flex: none; }
[data-icon] svg { width: 100%; height: 100%; display: block; }

.icon-btn {
    background: transparent; border: none; padding: 6px;
    color: var(--muted); cursor: pointer; border-radius: 8px;
    display: inline-flex; align-items: center;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- topbar: search + chips ---------- */
#topbar {
    position: absolute; top: 12px; left: 12px;
    width: min(400px, calc(100vw - 84px));
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
    z-index: 1150;
}
#topbar > * { pointer-events: auto; }

#search-pill {
    display: flex; align-items: center; gap: 9px;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow);
    padding: 4px 8px 4px 15px;
    min-height: 46px;
    border: 1px solid var(--line);
}
.pill-icon { color: var(--muted); }
#search-input {
    flex: 1; min-width: 0;
    border: none; background: transparent; outline: none;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.95rem;
}
#search-input::placeholder { color: var(--muted); }

#search-results {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    max-height: min(46vh, 380px);
    overflow-y: auto;
    padding: 6px;
}
.sr-group {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--muted);
    padding: 8px 10px 4px;
}
.sr-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none; background: transparent;
    border-radius: 9px;
    cursor: pointer;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    text-align: left;
}
.sr-item:hover, .sr-item:focus-visible { background: var(--surface2); }
.sr-item .sub { margin-left: auto; color: var(--muted); font-size: 0.76rem; white-space: nowrap; }
.sr-empty { padding: 14px; color: var(--muted); font-size: 0.85rem; text-align: center; }

#chip-row {
    display: flex; gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
#chip-row::-webkit-scrollbar { display: none; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
    padding: 6px 13px;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    cursor: pointer;
    white-space: nowrap;
    min-height: 34px;
}
.chip:hover { background: var(--surface2); }
.chip b { font-weight: 700; }
.chip [data-icon] { width: 14px; height: 14px; color: var(--muted); }
.chip-war { color: var(--bad); }
.chip-war [data-icon] { color: var(--bad); }
a.chip { text-decoration: none; }
.chip-site { color: var(--accent); font-weight: 600; }
.chip-site [data-icon] { color: var(--accent); }

/* ---------- FABs ---------- */
#fabs {
    position: absolute; top: 12px; right: 12px;
    display: flex; flex-direction: column; gap: 9px;
}
.fab {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    display: grid; place-items: center;
    cursor: pointer;
}
.fab:hover { background: var(--surface2); }
.fab [data-icon] { width: 19px; height: 19px; }

/* ---------- settings popover ---------- */
#settings-pop {
    position: absolute; top: 12px; right: 66px;
    z-index: 1150;
    width: min(300px, calc(100vw - 90px));
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 14px;
    display: flex; flex-direction: column; gap: 4px;
}
#settings-pop h3 {
    margin: 0;
    font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--muted);
}
.pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.log-head-btns { display: flex; gap: 2px; }
.switch-row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 9px 4px;
    cursor: pointer;
    font-size: 0.88rem;
}
.switch-row input { display: none; }
.switch-row .toggle {
    width: 40px; height: 22px; flex: none;
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 99px;
    position: relative;
    transition: background 0.2s;
}
.switch-row .toggle::after {
    content: ''; position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border-radius: 50%;
    transition: transform 0.2s;
}
.switch-row input:checked + .toggle { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked + .toggle::after { transform: translateX(18px); background: #fff; }
.dev-row { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 11px; }

.seg-row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 9px 4px;
    font-size: 0.88rem;
}
.seg {
    display: flex;
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 2px;
    gap: 2px;
}
.seg button {
    border: none; background: transparent;
    color: var(--muted);
    font-size: 0.76rem;
    font-family: var(--font-ui);
    border-radius: 7px;
    padding: 4px 10px;
    cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }

/* ---------- log panel ---------- */
#log-panel {
    position: absolute; right: 66px; top: 66px;
    z-index: 1150;
    width: min(320px, calc(100vw - 90px));
    max-height: 44vh;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.log-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 12px;
    font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
#api-logs {
    overflow-y: auto;
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    display: flex; flex-direction: column; gap: 3px;
}
.log-entry {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 7px;
    align-items: center;
    padding: 4px 7px;
    background: var(--surface2);
    border-radius: 6px;
    border-left: 3px solid var(--good);
}
.log-entry.error { border-left-color: var(--bad); }
.log-url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-info { display: flex; gap: 6px; color: var(--muted); }
.status-ok { color: var(--good); }
.status-err { color: var(--bad); }

/* ---------- bottom sheet / place card ---------- */
#sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-radius: 18px 18px 0 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    border-bottom: none;
    display: flex; flex-direction: column;
    height: 48vh;
    height: 48dvh;
    transition: height 0.22s ease, transform 0.22s ease;
    touch-action: none;
    z-index: 1100;
}
#sheet.dragging { transition: none; }
#sheet[data-snap="peek"] { height: 132px; }
#sheet[data-snap="half"] { height: 48vh; height: 48dvh; }
#sheet.hidden { transform: translateY(105%); pointer-events: none; }

#sheet-handle {
    padding: 9px 0 5px;
    cursor: grab;
    flex: none;
}
.grip {
    width: 38px; height: 4px;
    border-radius: 99px;
    background: var(--line);
    margin: 0 auto;
}
#sheet-close {
    position: absolute; top: 10px; right: 10px;
    background: var(--surface2);
    border-radius: 50%;
    z-index: 2;
}
#sheet-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 16px 34px;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
#sheet-content.swap { animation: cardIn 0.22s ease; }
@keyframes cardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
/* 下端フェード: スクロールバー非表示でも「続きがある」ことが分かるように */
#sheet::after {
    content: '';
    position: absolute;
    left: 1px; right: 1px; bottom: 0;
    height: 26px;
    background: linear-gradient(to bottom, transparent, var(--surface));
    border-radius: 0 0 18px 18px;
    pointer-events: none;
}
/* 長い名前・長文でも横スクロールバーを出さない */
.pc-title h2, .pc-title .lore, .list-box, .sheet-title { overflow-wrap: anywhere; }
.sheet-list li { min-width: 0; }

/* place card内 */
.pc-head { display: flex; gap: 13px; align-items: flex-start; padding-right: 34px; }
.pc-banner {
    width: 42px; height: 84px; flex: none;
    border-radius: 6px;
    background: var(--surface2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    image-rendering: pixelated;
}
.pc-skin { width: 52px; height: 52px; flex: none; border-radius: 12px; background: var(--surface2); }
.pc-title h2 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.pc-title .lore { color: var(--muted); font-size: 0.82rem; font-style: italic; margin: 3px 0 0; white-space: pre-wrap; }
.pc-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.badge {
    font-size: 0.72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
    background: var(--surface2); color: var(--muted);
}
.badge.peace { background: var(--good-soft); color: var(--good); }
.badge.war { background: var(--bad-soft); color: var(--bad); }

.pc-actions { display: flex; gap: 8px; margin: 13px 0 4px; flex-wrap: wrap; }
.act-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: none;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.84rem;
    font-family: var(--font-ui);
    border-radius: 999px;
    padding: 9px 16px;
    cursor: pointer;
    min-height: 38px;
}
.act-btn:hover { filter: brightness(0.96); }
.act-btn.on { background: var(--accent); color: #fff; }
.act-btn [data-icon] { width: 15px; height: 15px; }

.pc-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px;
    margin-top: 12px;
}
.stat {
    background: var(--surface2);
    border-radius: 10px;
    padding: 8px 11px;
}
.stat .k { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: block; overflow-wrap: anywhere; }
.stat .v { font-size: 0.95rem; font-weight: 700; overflow-wrap: anywhere; }
/* 単位は塊のまま改行 (「657チャン/ク」と割れないように)。数字より控えめに */
.stat .unit { display: inline-block; font-size: 0.72em; font-weight: 600; color: var(--muted); margin-left: 1px; }

.pc-sec { margin-top: 15px; }
.pc-sec h4 { margin: 0 0 6px; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pc-sec .list-box {
    background: var(--surface2);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.85rem;
    line-height: 1.6;
    word-break: break-word;
    /* max-height廃止: シート全体の1スクロールに統一 (ネストスクロール排除) */
}
.pc-sec .list-box.allies { color: var(--good); }
.pc-sec .list-box.enemies { color: var(--bad); }

/* リスト表示 (国家一覧 / プレイヤー一覧) */
.sheet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.sheet-list li {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 12px;
    background: var(--surface2);
    border-radius: 11px;
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 46px;
}
.sheet-list li:hover { filter: brightness(0.97); }
.sheet-list .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.sheet-list .meta { margin-left: auto; color: var(--muted); font-size: 0.76rem; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.sheet-list .player-head { width: 30px; height: 30px; border-radius: 8px; background: var(--surface2); flex: none; }
.sheet-list .mini-war { font-size: 0.68rem; font-weight: 700; color: var(--bad); background: var(--bad-soft); border-radius: 99px; padding: 2px 8px; }
.player-invisible { opacity: 0.5; filter: grayscale(1); pointer-events: auto; }
.sheet-title { font-size: 1.02rem; font-weight: 800; margin: 4px 0 10px; }

/* ---------- coord box ---------- */
#coord-box {
    position: absolute; bottom: 14px; left: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 8px 15px;
    border-radius: 999px;
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.1s;
    z-index: 1050;
}
#coord-box:active { transform: scale(0.95); }
#coord-box [data-icon] { width: 13px; height: 13px; color: var(--accent); }

/* ---------- toast ---------- */
#toast-container {
    position: absolute; bottom: 90px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
    z-index: 1200;
}
.toast {
    background: var(--text);
    color: var(--bg);
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: fadeUp 0.25s ease;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- player marker ---------- */
.player-marker-icon { display: flex; flex-direction: column; align-items: center; }
.player-marker-img {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2.5px solid var(--surface);
    box-shadow: 0 3px 9px rgba(0,0,0,0.4);
    background: var(--surface2);
}
.player-marker-name {
    position: absolute; top: -24px;
    background: var(--surface);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px; font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0; transition: opacity 0.2s;
    pointer-events: none;
}
.player-marker-icon:hover .player-marker-name { opacity: 1; }
.map-show-names .player-marker-name { opacity: 1 !important; }

/* leafletコントロールは使わない(自前FAB) */
.leaflet-control-zoom { display: none; }
.leaflet-control-attribution { display: none; }

/* ---------- desktop: sheet becomes floating panel ---------- */
@media (min-width: 768px) {
    #sheet {
        left: 16px; right: auto; bottom: 16px;
        width: 500px;
        border-radius: 20px;
        border-bottom: 1px solid var(--line);
        height: auto !important;
        max-height: min(80vh, 800px);
    }
    #sheet.hidden { transform: translateY(calc(100% + 24px)); }
    #sheet-handle { display: none; }
    #sheet-content { padding: 22px 24px 28px; }
    #sheet-close { top: 14px; right: 14px; }
    #coord-box { left: auto; right: 12px; bottom: 14px; }

    /* デスクトップは国カードを大きく見せる */
    .pc-head { gap: 16px; }
    .pc-banner { width: 58px; height: 116px; border-radius: 8px; }
    .pc-skin { width: 66px; height: 66px; border-radius: 16px; }
    .pc-title h2 { font-size: 1.5rem; }
    .pc-title .lore { font-size: 0.94rem; margin-top: 5px; }
    .pc-badges { margin-top: 9px; }
    .badge { font-size: 0.78rem; padding: 4px 12px; }
    .pc-actions { margin: 16px 0 6px; gap: 9px; }
    .act-btn { font-size: 0.9rem; padding: 10px 19px; min-height: 42px; }
    .pc-stats { gap: 10px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
    .stat { padding: 11px 14px; border-radius: 12px; }
    .stat .k { font-size: 0.7rem; }
    .stat .v { font-size: 1.08rem; }
    .pc-sec { margin-top: 18px; }
    .pc-sec h4 { font-size: 0.76rem; margin-bottom: 8px; }
    .pc-sec .list-box { font-size: 0.92rem; padding: 11px 14px; border-radius: 12px; }
    .sheet-title { font-size: 1.15rem; }
    .sheet-list li { font-size: 0.95rem; padding: 12px 14px; }
}
@media (max-width: 767px) {
    /* 検索・チップは右端まで使う (チップがFABの下に潜って切れていた問題の修正) */
    #topbar { width: calc(100vw - 24px); }
    #chip-row { padding-right: 4px; }
    #coord-box {
        bottom: auto; top: 112px;
    }
    /* FABはチップ行より下の右側へ (被り防止) */
    #fabs { top: 158px; }

    /* 設定・通信ログは上部ポップオーバーではなく下からのシートにする
       (地図やチップの上に被さって邪魔だったのを修正) */
    #settings-pop, #log-panel {
        top: auto; right: 0; left: 0; bottom: 0;
        width: 100%;
        max-height: 72vh;
        max-height: 72dvh;
        border-radius: 18px 18px 0 0;
        border-bottom: none;
        overflow-y: auto;
        z-index: 1300;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        box-shadow: var(--shadow-lg);
    }
    #log-panel { max-height: 58vh; max-height: 58dvh; }
}

/* ── 国の ID と並び替え ─────────────────────────────
   /spawn で行くのに ID が要るので、一覧・カード・検索のどこでも見えるようにする。
   並びの既定は ID 順。早い番号を取った人の利点が見えるようにするため。 */
.sheet-list .cid {
    flex: none;
    font-variant-numeric: tabular-nums;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface2);
    border-radius: 5px;
    padding: 1px 6px;
}
.pc-title h2 .cid-lg {
    font-size: 0.62em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    vertical-align: middle;
    margin-left: 4px;
}
.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: var(--muted);
}
.sort-bar select {
    flex: 1;
    min-width: 0;
    font: inherit;
    color: var(--text);
    background: var(--surface2);
    border: 1px solid var(--line, rgba(128,128,128,.25));
    border-radius: 7px;
    padding: 5px 8px;
    cursor: pointer;
}
.sort-bar select:focus-visible { outline: 2px solid var(--accent, #4a9); outline-offset: 1px; }

/* 透明化中のプレイヤーマーカー */
.player-marker-invisible {
    opacity: 0.5;
}
