body {
    /* 背景（ロケーション別）: layouts側で --location-bg をセットする前提 */
    --location-bg: none;

    background-color: #000;
    background-image: var(--location-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    color: #fff;
    font-family: 'メイリオ', sans-serif;

    /* 既存は margin:20px だったが、前作寄せのため中央パネルで余白を持たせる */
    margin: 0;
    padding: 24px 0;

    min-height: 100vh;
    position: relative;
}

/* 背景の暗幕（前作の“重さ”） */
body::before {
    content: "";
    position: fixed;
    inset: 0;

    /* ここが効く：画像が明るくても文字が死なない */
    background: rgba(0, 0, 0, 0.10);

    pointer-events: none;
    z-index: 0;
}

a, button {
    color: #fff;

    /* ボタン軽さを抑えて前作寄せ */
    background: rgba(40, 40, 40, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);

    padding: 6px 12px;
    margin: 4px;

    text-decoration: none;
    display: inline-block;
    border-radius: 4px;
    cursor: pointer;

    font-size: 14px;
}

a:hover, button:hover {
    background: rgba(60, 60, 60, 0.90);
}

/* 見出し：薄線＋少し締める */
h2, h3 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.40);
    padding-bottom: 6px;
    margin-top: 18px;

    font-weight: 600;
    letter-spacing: 1px;
}

/* 既存: .container は最大幅だけだったが、前作寄せで中央パネル化 */
.container {
    max-width: 860px;
    margin: 0 auto;

    /* 既存ビューが container 内に直で要素を置く前提なので、ここに余白を持たせる */
    padding: 18px 18px 26px;

    /* ガラスっぽい半透明パネル */
    background: rgba(20, 20, 20, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;

    /* 中央だけ少し浮かせる */
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.60);

    /* 暗幕＋背景に対して前作っぽい質感（対応ブラウザのみ） */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    position: relative;
    z-index: 1;
}

nav {
    margin-bottom: 10px;
}

nav a {
    margin-right: 6px;
    font-weight: bold;
}

/* HUDの直下（現在地行など）の色：前作寄せで少し落とす */
nav + div {
    color: #cfcfcf;
    font-size: 14px;
}

button.nav-button {
    color: #fff;

    background: rgba(40, 40, 40, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);

    padding: 6px 12px;
    margin: 4px 4px 4px 0;

    text-decoration: none;
    display: inline-block;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;

    font-size: 14px;
}

button.nav-button:hover {
    background: rgba(60, 60, 60, 0.90);
}

/* input */
.rh-input {
    background: #111;
    color: #fff;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 10px;
}

.rh-input:disabled {
    opacity: 0.6;
}

/* =========================================================
   Result Card (inventory/dashboard etc.)
   ========================================================= */

.rh-card {
    border: 1px solid rgba(255, 255, 255, 0.18);

    /* “ベタ黒箱”をやめて半透明に（前作寄せ） */
    background: rgba(10, 10, 10, 0.75);

    color: #eaeaea;
    padding: 12px 14px;
    margin: 10px 0 14px;
    border-radius: 4px;
}

.rh-card--narrow {
    max-width: 760px;
}

.rh-card__header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: baseline;
}

.rh-card__title {
    font-weight: 700;
}

.rh-muted {
    color: rgba(255, 255, 255, 0.75);
}

.rh-muted-sm {
    color: rgba(255, 255, 255, 0.60);
    font-size: 12px;
}

.rh-line {
    margin-top: 8px;
    line-height: 1.6;
}

.rh-good {
    color: #8ef18e;
    font-weight: 700;
}

.rh-mp {
    color: #8fc7ff;
    font-weight: 700;
}

.rh-warn {
    color: #ff6b6b;
    font-weight: 700;
}

.rh-details summary {
    cursor: pointer;
    color: #eaeaea;
}

.rh-details {
    margin-top: 10px;
}

.rh-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
}

/* =========================================================
   Battle
   ========================================================= */

.battle-log-table {
    width: 100%;
    border-collapse: collapse;
}

.battle-log-table th,
.battle-log-table td {
    border: 1px solid #666;
    padding: 8px;
    vertical-align: top;
}

.battle-log-table th {
    background: #111;
}

/* ===== Battle Log (shared) ===== */

.log-card {
    border: 1px solid #666;
    background: #000;
    padding: 10px 12px;
    max-width: 100%;
}

.log-card ul {
    margin: 0;
    padding-left: 18px;
}

.log-card li {
    margin: 4px 0;
    line-height: 1.4;
}

.log-muted { color: #bbb; }
.log-good  { color: #4caf50; font-weight: bold; }
.log-bad   { color: #ff6b6b; font-weight: bold; }

.rh-pre {
    background: rgba(10, 10, 10, 0.75);
    color: #eaeaea;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px;
    margin-top: 8px;
    white-space: pre-wrap;
    overflow: auto;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 4px;
}

/* =========================================================
   Dashboard (old-style panels)
   ========================================================= */

/* 既存で .rh-panel が複数回定義されていたので、最終形をここで揃える */
.rh-panel {
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10) inset;
    border-radius: 4px;
}

.rh-badge {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #eaeaea;
    background: rgba(10, 10, 10, 0.75);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.4;
}

.rh-badge--warn {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.rh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rh-table th,
.rh-table td {
    border: 1px solid #444;
    padding: 6px 8px;
}

.rh-table th {
    background: #111;
}

/* =========================================================
   Header HUD line (前作風)
   ========================================================= */

.rh-hudline {
    margin-top: 8px;
    margin-bottom: 10px;
    padding: 6px 0;

    font-size: 16px;
    color: #ffffff;

    /* なるべく1行で見せる */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    box-sizing: border-box;
}
/* =========================
   Top Header (前作風)
   ========================= */
.rh-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 6px 4px 12px;
    margin-bottom: 10px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.rh-brand {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
}

.rh-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* topbar内は余白を詰める */
.rh-topbar .nav-button,
.rh-topbar a,
.rh-topbar button {
    margin: 0;
}

/* 画面が狭い時は折り返し */
@media (max-width: 520px) {
    .rh-topbar {
        flex-wrap: wrap;
    }
}
