:root {
  --bg: #11151c;
  --panel: #1b2230;
  --panel2: #232c3d;
  --text: #e6ebf2;
  --muted: #8a97aa;
  --primary: #4f8cff;
  --primary-d: #3a6fd0;
  --green: #56c476;
  --red: #e0556a;
  --border: #2c3850;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
}
/* 最下部に配置(非固定・通常フロー) */
.app-header-bottom {
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.app-header h1 { font-size: 0.95rem; margin: 0; font-weight: 700; }
.badge {
  font-size: 0.7rem;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }

.lead { color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }

/* ---- ボタン ---- */
.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--panel2);
  color: var(--text);
  margin: 4px 4px 4px 0;
  transition: opacity 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-sub { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-danger { background: var(--red); color: #fff; }
.btn-big { display: block; width: 100%; padding: 16px; font-size: 1.05rem; margin: 16px 0; }

/* ---- データ状態 ---- */
.data-status {
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.data-status.error { color: var(--red); }

.notice {
  font-size: 0.85rem;
  color: #ffd28a;
  background: rgba(255, 180, 80, 0.08);
  border: 1px solid rgba(255, 180, 80, 0.25);
  border-radius: var(--radius);
  padding: 10px 12px;
}

/* =====================================================
   探索画面: スマホ一画面完結のflex縦並び
   ===================================================== */
.explore-screen {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* ヘッダー分を差し引いて画面に収める */
  height: calc(100dvh - 52px);
  padding: 10px 12px 12px;
}

/* 1. 最寄りスポット(最上部・2行表示) */
.nearest-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 10px 16px;
  flex: 0 0 auto;
}
.nearest-label { font-size: 0.78rem; color: var(--muted); }
.nearest-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.nearest-name {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  /* 長い名前は折り返して最大2行。超過は…で省略 */
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
/* 名前が長い(全角9文字以上を目安)ときはさらに縮小する補助クラス */
.nearest-name.is-long { font-size: 1.15rem; }
.nearest-name.is-xlong { font-size: 0.98rem; }
.nearest-dist {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-left: auto;
}

/* 2. 判定行 + 敵出現 */
.judge-line { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
.judge {
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--panel2);
  font-size: 0.85rem;
}
.judge-detail { font-size: 0.82rem; color: var(--muted); }
.error-text { color: var(--red); font-size: 0.82rem; margin: 0; flex: 0 0 auto; }

.enemy-area {
  background: linear-gradient(135deg, #2a1f2f, #2f2436);
  border: 1px solid #5a3a55;
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: center;
  flex: 0 0 auto;
}
.enemy-area h3 { color: #ff9ecb; margin-bottom: 4px; }
.enemy-area p { margin: 4px 0 8px; }
.enemy-area .btn { margin: 0; }

/* 3. 地図(大きく・残りの高さを占有) */
.map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
}
.map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--panel2);
  z-index: 0;
}
.leaflet-container { background: var(--panel2); }
/* 現在地に戻るボタン(地図右下にフローティング) */
.map-recenter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 500;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.map-recenter:active { transform: scale(0.97); }

/* 4. 座標などの詳細(下部・折りたたみ) */
.coords-box {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 6px 12px;
  flex: 0 0 auto;
}
.coords-box summary { font-size: 0.82rem; color: var(--muted); cursor: pointer; }
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}
.info-table th, .info-table td {
  text-align: left;
  padding: 4px 6px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}
.info-table th { color: var(--muted); width: 38%; font-weight: 500; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }

.btn-stop { margin: 0; align-self: flex-start; padding: 6px 14px; font-size: 0.82rem; flex: 0 0 auto; }

/* ---- 戦闘 ---- */
.battle-enemy { text-align: center; margin-bottom: 16px; }
.enemy-img {
  width: min(44vw, 176px);
  height: min(44vw, 176px);
  object-fit: contain;
  image-rendering: auto;
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 10px 14px rgba(15, 23, 42, 0.22));
}
.enemy-name { font-size: 1.1rem; font-weight: 700; margin: 4px 0; }

.hp-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; margin: 6px 0;
}
.hp-row > span:first-child { width: 44px; color: var(--muted); }
.hp-row > span:last-child { width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.hp-bar-bg { flex: 1; height: 14px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.hp-bar { height: 100%; transition: width 0.25s; border-radius: 999px; }
.hp-bar.enemy { background: var(--red); }
.hp-bar.player { background: var(--green); }
.battle-player { margin-bottom: 12px; }

.battle-result { text-align: center; font-size: 1.4rem; font-weight: 800; margin: 12px 0; }
.battle-result.win { color: var(--green); }
.battle-result.lose { color: var(--red); }
.battle-result.flee { color: #fcd34d; }
.battle-reward {
  text-align: center;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 10px;
  color: #ffe08a;
  font-size: 0.9rem;
}

.battle-log {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
  max-height: 150px;
  overflow-y: auto;
  margin: 12px 0;
}
.battle-log div { padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,0.05); }

/* ---- 所持アイテム ---- */
.items-box { margin-top: 24px; background: var(--panel); border-radius: var(--radius); padding: 12px 16px; }
.items-list { list-style: none; padding: 0; margin: 8px 0 0; }
.items-list li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.items-list li:last-child { border-bottom: none; }

/* ---- デバッグパネル ---- */
.debug-toggle {
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}
.debug-panel {
  max-width: 560px;
  margin: 8px auto 0;
  background: #161d2a;
  border: 1px dashed #3a4a66;
  border-radius: var(--radius);
  padding: 14px 16px;
}
.debug-panel h2 { font-size: 0.95rem; color: #9ec1ff; }
.debug-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0; }
.debug-grid label { font-size: 0.75rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.debug-grid input, #spot-jump {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.9rem;
  width: 100%;
}
.debug-row { margin: 8px 0; }
.debug-status { font-size: 0.8rem; color: #9ec1ff; min-height: 1.2em; }
.checkbox-label { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input { width: auto; }

.app-footer { text-align: center; padding: 14px; }

.hidden { display: none !important; }

@media (max-width: 400px) {
  .debug-grid { grid-template-columns: 1fr; }
  .battle-enemy { margin-bottom: 12px; }
  .enemy-img {
    width: min(52vw, 160px);
    height: min(52vw, 160px);
    margin-bottom: 6px;
  }
  .enemy-name { font-size: 1rem; }
  .hp-row {
    gap: 6px;
    font-size: 0.8rem;
  }
  .hp-row > span:first-child { width: 38px; }
  .hp-row > span:last-child { width: 62px; }
}

/* ---- 探索画面下部のアクション ---- */
.explore-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.explore-actions .btn { margin: 0; }
.btn-stop { align-self: auto; }

/* ---- スポット一覧モーダル ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000;
}
.modal-card {
  background: var(--panel);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  border-radius: 16px 16px 0 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-close {
  background: var(--panel2);
  border: none;
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
}
.explore-result-card { gap: 0.55rem; text-align: center; }
.explore-result-main { margin: 0; color: var(--muted); font-size: 0.9rem; }
.explore-result-spot { margin: 0; color: #fcd34d; font-size: 1.15rem; font-weight: 800; }
.explore-result-distance { margin: 0 0 0.35rem; }
.explore-result-distance strong { color: #86efac; font-size: 1.1rem; }
.spot-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  overflow-y: auto;
}
.spot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.spot-item:last-child { border-bottom: none; }
.spot-item-name { font-weight: 700; font-size: 0.95rem; overflow-wrap: anywhere; }
.spot-item-meta {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.spot-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.spot-badge.defeated { background: #3a4a66; color: #9ec1ff; }
.spot-badge.penalty { background: #5a2a32; color: #ffb3bf; }

@media (min-width: 480px) {
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: 16px; }
}

/* ===== 認証(ログイン/登録)オーバーレイ ===== */
.header-right { display: flex; align-items: center; gap: 0.4rem; }
.auth-status { font-size: 0.8rem; color: #cbd5e1; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-logout { font-size: 0.72rem; padding: 0.25rem 0.5rem; border: 0; border-radius: 6px; background: #475569; color: #fff; cursor: pointer; }
.auth-logout:hover { background: #334155; }

.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.auth-overlay.hidden { display: none; }
.auth-card {
  background: #fff; color: #1e293b; width: 100%; max-width: 360px;
  border-radius: 12px; padding: 1.2rem 1.3rem; box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.auth-card h2 { font-size: 1.05rem; margin: 0 0 0.8rem; }
.auth-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.9rem; }
.auth-tab {
  flex: 1; padding: 0.5rem; border: 1px solid #cbd5e1; background: #f1f5f9;
  border-radius: 8px; cursor: pointer; font-size: 0.85rem; color: #475569;
}
.auth-tab.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.auth-form { display: flex; flex-direction: column; gap: 0.5rem; }
.auth-form.hidden { display: none; }
.auth-form label { font-size: 0.78rem; color: #475569; display: flex; flex-direction: column; gap: 0.2rem; }
.auth-form input, .auth-form select {
  padding: 0.5rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.95rem;
}
.auth-avatar-picker { display: grid; grid-template-columns: 60px 1fr; gap: 0.6rem; align-items: end; }
.auth-avatar-preview { width: 52px; height: 52px; object-fit: contain; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; padding: 4px; }
.auth-avatar-note { grid-column: 2; margin-top: -0.35rem; font-size: 0.68rem; color: #64748b; }
.auth-form .btn { margin-top: 0.4rem; }
.auth-msg { font-size: 0.8rem; color: #dc2626; min-height: 1.2rem; margin: 0.6rem 0 0; }

/* ===== 宿屋・回復アイテムUI(#1) ===== */
.inn-area {
  background: #ecfdf5; border: 1px solid #6ee7b7; border-radius: 10px;
  padding: 0.7rem 0.9rem; margin: 0.5rem 0;
}
.inn-area h3 { margin: 0 0 0.3rem; font-size: 0.95rem; color: #047857; }
.inn-area.hidden { display: none; }
#inn-msg { margin: 0.4rem 0 0; }
.item-use-btn {
  font-size: 0.72rem; padding: 0.15rem 0.5rem; margin-left: 0.3rem;
  border: 0; border-radius: 5px; background: #10b981; color: #fff; cursor: pointer;
}
.item-use-btn:hover { background: #059669; }
.item-use-btn:disabled { background: #9ca3af; cursor: default; }
#items-msg { margin: 0.4rem 0 0; color: #047857; }

/* ===== 戦闘中アイテム使用(Phase B) ===== */
#btn-use-item { margin-top: 0.4rem; }
.battle-item-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.battle-item-list.hidden { display: none; }
.battle-item-btn { font-size: 0.8rem; padding: 0.4rem 0.7rem; border: 0; border-radius: 6px; background: #10b981; color: #fff; cursor: pointer; }
.battle-item-btn:hover { background: #059669; }

/* ===== 戦闘不能オーバーレイ / トースト / 道具屋(Phase D/E) ===== */
.downed-overlay { position: fixed; inset: 0; z-index: 1100; background: rgba(15,23,42,0.82); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.downed-overlay.hidden { display: none; }
.downed-card { background: #fff; color: #1e293b; border-radius: 12px; padding: 1.4rem 1.6rem; text-align: center; max-width: 340px; }
.downed-card h2 { margin: 0 0 0.5rem; color: #dc2626; }
.downed-count { font-weight: bold; font-size: 1.1rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 1200; background: #0f172a; color: #fff; padding: 0.6rem 1rem; border-radius: 8px; font-size: 0.9rem; box-shadow: 0 4px 16px rgba(0,0,0,0.3); max-width: min(92vw, 420px); text-align: center; }
.toast.hidden { display: none; }
.toast-event {
  bottom: 16%;
  width: max-content;
  max-width: 96vw;
  white-space: nowrap;
  padding: 0.9rem 1.25rem;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 2px rgba(0,0,0,0.45);
  animation: titleToastPop 0.38s ease-out;
}
.toast-level {
  background: linear-gradient(135deg, #1d4ed8, #7c3aed 48%, #facc15);
  color: #fff7cc;
  border: 2px solid #fde68a;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.38), 0 8px 32px rgba(124,58,237,0.55), 0 0 30px rgba(250,204,21,0.5);
}
.toast-poison {
  background: linear-gradient(135deg, #3b0764, #7e22ce 50%, #a3e635);
  color: #f5f3ff;
  border: 2px solid #c084fc;
  box-shadow: 0 0 0 3px rgba(126,34,206,0.35), 0 8px 32px rgba(88,28,135,0.6), 0 0 28px rgba(163,230,53,0.42);
}
.toast-cure {
  background: linear-gradient(135deg, #065f46, #059669 50%, #67e8f9);
  color: #ecfeff;
  border: 2px solid #a7f3d0;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.35), 0 8px 32px rgba(5,150,105,0.52), 0 0 28px rgba(103,232,249,0.42);
}
.toast-title {
  bottom: 18%;
  width: max-content;
  max-width: 96vw;
  white-space: nowrap;
  background: linear-gradient(135deg, #7c2d12, #a16207 45%, #facc15);
  color: #fff7cc;
  border: 2px solid #fde68a;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 2px rgba(0,0,0,0.45);
  box-shadow: 0 0 0 3px rgba(120,53,15,0.45), 0 8px 28px rgba(250,204,21,0.45), 0 10px 30px rgba(0,0,0,0.45);
  animation: titleToastPop 0.35s ease-out;
}
@keyframes titleToastPop {
  0% { transform: translateX(-50%) translateY(10px) scale(0.9); opacity: 0; }
  70% { transform: translateX(-50%) translateY(0) scale(1.04); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}
.shop-area { background: #eff6ff; border: 1px solid #93c5fd; border-radius: 10px; padding: 0.7rem 0.9rem; margin: 0.5rem 0; }
.shop-area.hidden { display: none; }
.shop-area h3 { margin: 0 0 0.4rem; font-size: 0.95rem; color: #1d4ed8; }
.shop-cols { display: flex; gap: 0.8rem; }
.shop-col { flex: 1; min-width: 0; }
.shop-col h4 { margin: 0 0 0.3rem; font-size: 0.82rem; color: #334155; }
.shop-list { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; }
.shop-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; padding: 0.15rem 0; }
.shop-buy-btn, .shop-sell-btn { font-size: 0.72rem; padding: 0.2rem 0.5rem; border: 0; border-radius: 5px; color: #fff; cursor: pointer; }
.shop-buy-btn { background: #2563eb; }
.shop-sell-btn { background: #6b7280; }
.shop-buy-btn:disabled { background: #64748b; opacity: 0.7; cursor: not-allowed; }
.shop-wallet { margin: 0 0 0.45rem; color: #fcd34d; font-weight: 700; font-size: 0.9rem; }

/* ===== POIアイコン / 凡例 / 道具屋モーダル ===== */
.poi-icon { background: transparent; border: 0; }
.poi-pin { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; border: 3px solid #888; box-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.poi-popup { text-align: center; min-width: 110px; }
.poi-popup .poi-btn { margin-top: 6px; padding: 0.35rem 0.9rem; border: 0; border-radius: 6px; background: #2563eb; color: #fff; cursor: pointer; font-size: 0.85rem; }
.poi-popup .poi-wallet { margin-top: 4px; color: #92400e; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.poi-legend { display: flex; gap: 0.8rem; align-items: center; font-size: 0.8rem; color: #f1f5f9; margin: 0.3rem 0; }
.poi-legend .muted, .poi-legend .small { color: #cbd5e1 !important; }
.poi-legend .lg-item { display: inline-flex; align-items: center; gap: 0.2rem; }
.shop-modal { position: fixed; inset: 0; z-index: 1100; background: rgba(15,23,42,0.6); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.shop-modal.hidden { display: none; }
.shop-modal-card { background: #fff; color: #1e293b; width: 100%; max-width: 420px; border-radius: 12px; padding: 1rem 1.1rem; max-height: 80vh; overflow-y: auto; }
.shop-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.shop-modal-head h3 { margin: 0; font-size: 1rem; color: #1d4ed8; }
.shop-close { border: 0; background: #e2e8f0; border-radius: 6px; width: 28px; height: 28px; font-size: 1.1rem; cursor: pointer; }

/* ===== ステータスHUD(地図右上・DQ風) ===== */
.map-wrap { position: relative; }
.status-hud {
  position: absolute; top: 8px; right: 8px; z-index: 500;
  background: rgba(15,23,42,0.45); color: #fff;
  border: 2px solid rgba(255,255,255,0.85); border-radius: 8px;
  padding: 5px 8px; font-size: 0.72rem; min-width: 156px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  pointer-events: auto; cursor: pointer;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 7px;
}
.status-hud.hidden { display: none; }
.status-hud .hud-avatar {
  width: 32px; height: 32px; flex: none;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.75));
}
.status-hud .hud-main { flex: 1; min-width: 0; }
.status-hud .hud-row { display: flex; align-items: center; gap: 5px; line-height: 1.5; }
.status-hud .hud-name { font-weight: bold; font-size: 0.8rem; margin-bottom: 2px; }
.status-hud .hud-lv { color: #fcd34d; }
.status-hud .hud-poison { background: #7c3aed; color: #fff; padding: 0 5px; border-radius: 4px; font-size: 0.66rem; font-weight: bold; border: 1px solid rgba(255,255,255,0.7); }
.status-hud .hud-label { width: 16px; color: #cbd5e1; flex: none; }
.status-hud .hud-bar { flex: 1; height: 8px; background: #334155; border-radius: 4px; overflow: hidden; }
.status-hud .hud-bar-fill { display: block; height: 100%; background: #22c55e; }
.status-hud .hud-gold { color: #fcd34d; }


/* 凡例のピン見本 */
.poi-legend .lg-pin { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; font-size: 13px; border: 2px solid #888; margin-right: 3px; vertical-align: middle; }
.poi-legend .lg-pin.inn { border-color: #16a34a; }
.poi-legend .lg-pin.shop { border-color: #2563eb; }
.poi-legend .lg-item { display: inline-flex; align-items: center; }

.player-map-icon {
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.75));
}

/* ===== DQ風 コマンドメニュー ===== */
.menu-overlay { position: fixed; inset: 0; z-index: 1150; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.menu-overlay.hidden { display: none; }
.dq-window { background: #0a1230; color: #fff; border: 3px solid #fff; border-radius: 6px; padding: 0.7rem 0.9rem; min-width: 240px; max-width: 92vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 4px 22px rgba(0,0,0,0.55); }
.dq-title { font-weight: bold; border-bottom: 1px solid rgba(255,255,255,0.4); padding-bottom: 4px; margin-bottom: 6px; }
.dq-list { list-style: none; margin: 0 0 4px; padding: 0; }
.dq-list li { padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.dq-list li::before { content: "\25B8 "; color: #fcd34d; }
.dq-list li:hover { background: rgba(255,255,255,0.15); }
.dq-list li.dq-dim, .dq-list li.dq-empty { color: #94a3b8; cursor: default; }
.dq-list li.dq-dim::before, .dq-list li.dq-empty::before { content: ""; }
.dq-qty { color: #cbd5e1; font-size: 0.85em; }
.dq-eff { color: #86efac; font-size: 0.85em; }
.dq-stats div { padding: 2px 0; }
.dq-wallet { color: #fcd34d; font-weight: 700; margin: 2px 0 6px; font-size: 0.9rem; }
.market-fee-row {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 0.9rem;
}
.market-fee-row label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
}
.market-fee-row input[type="radio"] {
  width: auto;
  margin: 0;
}
.dq-titles { padding-left: 0.7rem; color: #fcd34d; }
.dq-msg { margin: 6px 0 0; color: #fcd34d; min-height: 1.2em; font-size: 0.85rem; }

/* ===== 道具屋 確認ダイアログ ===== */
.shop-modal-card { position: relative; }
.shop-confirm { position: absolute; inset: 0; background: rgba(10,18,48,0.94); color: #fff; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.2rem; text-align: center; }
.shop-confirm.hidden { display: none; }
#shop-confirm-msg { font-size: 1rem; margin: 0; }
.shop-confirm-btns { display: flex; gap: 1rem; }

/* なかま/情報行(選択不可) */
.dq-list li.dq-flat { cursor: default; }
.dq-list li.dq-flat::before { content: ""; }

/* 撃破済みなど 丸囲みなしの強色アイコン */
.poi-plain { background: transparent; border: 0; }
.poi-plain-mark { display: inline-block; font-size: 22px; font-weight: bold; line-height: 26px; text-align: center; width: 26px; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }

/* POIポップアップ: 非活性ボタン + 範囲外ヒント */
.poi-popup .poi-btn-disabled { background: #9ca3af !important; opacity: 0.75; }
.poi-popup .poi-hint { margin-top: 6px; color: #dc2626; font-size: 0.78rem; font-weight: bold; min-height: 1em; }
.poi-popup .poi-hint.flash { animation: poihintflash 0.45s ease; }
@keyframes poihintflash { 0% { transform: scale(1.2); } 100% { transform: scale(1); } }
