/* ===== ODDS EMPIRE デザインシステム(骨格チーム所有)=====
   ネオンサイバー調。CSS変数と共通部品クラスは全画面で使用する。 */
:root {
  --bg: #070b18;
  --bg-panel: rgba(20, 27, 52, 0.82);
  --bg-panel-2: rgba(31, 40, 74, 0.9);
  --border: rgba(99, 125, 200, 0.28);
  --border-glow: rgba(80, 170, 255, 0.45);
  --text: #eef2ff;
  --text-dim: #94a0c4;
  --accent: #4da3ff;
  --accent-2: #8b5cf6;
  --cyan: #22d3ee;
  --magenta: #ff3d9a;
  --green: #34d399;
  --red: #ff4d6d;
  --yellow: #ffc14d;
  --orange: #fb923c;
  --yes: #22d3ee;
  --no: #ff3d7a;
  /* カテゴリカラー */
  --cat-weather: #38bdf8;
  --cat-market: #a78bfa;
  --cat-sports: #fb923c;
  --cat-politics: #60a5fa;
  --cat-local: #f472b6;
  --cat-trend: #ff5c7a;
  --nav-h: 62px;
  --topbar-h: 92px;
  --grad-cta: linear-gradient(95deg, #22d3ee 0%, #4da3ff 45%, #8b5cf6 100%);
  --grad-hot: linear-gradient(95deg, #ff3d9a, #ff7a3d);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  touch-action: manipulation; /* ダブルタップズーム抑止(ピンチズームは許可) */
}

body::before {
  /* 背景のネオングロー(画像 bg-city.png があれば assets.js が body.has-bg を付与) */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 38% at 50% -5%, rgba(77, 91, 255, 0.32), transparent 70%),
    radial-gradient(45% 30% at 88% 12%, rgba(255, 61, 154, 0.13), transparent 70%),
    radial-gradient(50% 32% at 8% 18%, rgba(34, 211, 238, 0.12), transparent 70%),
    var(--bg);
}
#bg-city {
  position: fixed; inset: auto 0 0 0; z-index: -1; width: 100%;
  opacity: 0.16; pointer-events: none; display: none;
}
#bg-city.loaded { display: block; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }

/* ===== ヘッダー ===== */
#topbar {
  position: sticky; top: 0; z-index: 50;
  padding: calc(8px + var(--safe-top)) 14px 8px;
  background: linear-gradient(180deg, rgba(7, 11, 24, 0.96) 70%, rgba(7, 11, 24, 0.7));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-row { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, #4da3ff, #8b5cf6);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.55);
}
.player-meta { flex: 1; min-width: 0; }
.player-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-level-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.level-chip {
  font-size: 9.5px; font-weight: 900; padding: 1px 7px; border-radius: 999px;
  background: var(--grad-cta); color: #04101c; letter-spacing: 0.04em;
}
.xp-bar { flex: 1; height: 5px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.xp-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--grad-cta); transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.wallet { display: flex; gap: 6px; margin-top: 8px; }
.wallet-chip {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: rgba(15, 21, 44, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 5px 4px;
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.wallet-chip .ic { font-size: 13px; }

/* 通貨アイコン(COIN/MEDAL画像)。assetImg由来の .asset に付与。文字サイズに追従してインライン表示 */
.cur-ic { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.26em; flex: none; }
.cur-ic img, .cur-ic .asset-fallback { width: 100%; height: 100%; object-fit: contain; display: block; }
.cur-ic .asset-fallback { font-size: 0.85em; line-height: 1.2em; text-align: center; }
/* ヘッダー残高チップは少し大きめに */
.wallet-chip .cur-ic { width: 1.5em; height: 1.5em; vertical-align: -0.4em; }
/* バトル結果の報酬チップ(大きめ固定) */
.bt-rw-ic.cur-ic, .bt-rw-ic .cur-ic { width: 26px; height: 26px; vertical-align: middle; }
.w-life { color: #5af0b0; } .w-coin { color: var(--yellow); } .w-medal { color: #74b6ff; }
.wallet-chip.w-stamina {
  min-width: 70px;
  flex-direction: column;
  gap: 3px;
  color: var(--yellow);
}
.w-stamina-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}
.w-stamina-track {
  display: block;
  width: calc(100% - 8px);
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
}
.w-stamina-track > i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffc14d, #22d3ee);
  box-shadow: 0 0 6px rgba(34, 211, 238, .65);
  transition: width 1s linear;
}

/* ===== メイン/ナビ ===== */
#view { padding: 14px 14px calc(var(--nav-h) + var(--safe-bottom) + 64px); animation: view-in 0.28s ease-out; }

/* バトル(ライブ画面)中はヘッダー/フッターを隠して全画面化 */
body.battle-immersive #topbar,
body.battle-immersive #bottom-nav { display: none; }
body.battle-immersive #view { padding: var(--safe-top, 0px) 8px var(--safe-bottom, 0px); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

#bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(9, 13, 28, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 50;
}
#bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-dim); text-decoration: none; font-size: 10px; font-weight: 800;
  position: relative; transition: color 0.15s;
}
.nav-icon { font-size: 20px; line-height: 1; filter: grayscale(0.7) opacity(0.75); transition: all 0.15s; }
#bottom-nav a.active { color: var(--cyan); }
#bottom-nav a.active .nav-icon { filter: none; transform: translateY(-2px) scale(1.12); }
#bottom-nav a.active::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--grad-cta); box-shadow: 0 2px 10px var(--cyan);
}

/* ===== パネル/カード ===== */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
}
.neon-card {
  position: relative;
  background: linear-gradient(160deg, rgba(26, 34, 66, 0.92), rgba(15, 20, 42, 0.94));
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 18px rgba(57, 112, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card-title { font-size: 14px; font-weight: 900; margin-bottom: 10px; letter-spacing: 0.02em; }
.section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 900; color: var(--text);
  margin: 18px 0 10px; letter-spacing: 0.05em;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-glow), transparent); }

/* カテゴリ色付け: .cat-XXX を付けたカードは左ボーダー+グロー */
.cat-WEATHER { --cat: var(--cat-weather); }
.cat-MARKET { --cat: var(--cat-market); }
.cat-SPORTS { --cat: var(--cat-sports); }
.cat-POLITICS { --cat: var(--cat-politics); }
.cat-LOCAL { --cat: var(--cat-local); }
.cat-TREND { --cat: var(--cat-trend); }
.cat-stripe { border-left: 3px solid var(--cat, var(--accent)); }
.cat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 900; padding: 3px 9px; border-radius: 999px;
  color: var(--cat, var(--accent));
  background: color-mix(in srgb, var(--cat, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat, var(--accent)) 45%, transparent);
}

/* ===== ボタン ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border);
  border-radius: 13px; padding: 11px 16px;
  font-size: 14px; font-weight: 800; cursor: pointer; color: #fff;
  background: var(--bg-panel-2);
  transition: transform 0.06s, opacity 0.15s, box-shadow 0.2s;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary, .cta-btn {
  background: var(--grad-cta); border: none; color: #04101c;
  box-shadow: 0 4px 18px rgba(46, 144, 255, 0.42);
  position: relative; overflow: hidden;
}
.cta-btn { font-size: 15.5px; font-weight: 900; padding: 14px 18px; border-radius: 15px; letter-spacing: 0.03em; }
.cta-btn::after {
  content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shine 2.6s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -70%; } 100% { left: 130%; } }
.btn-hot { background: var(--grad-hot); border: none; box-shadow: 0 4px 16px rgba(255, 61, 122, 0.4); }
.btn-success { background: linear-gradient(95deg, #34d399, #22d3ee); color: #04241a; border: none; box-shadow: 0 4px 14px rgba(52, 211, 153, 0.35); }
.btn-danger { background: linear-gradient(95deg, #ff4d6d, #ff3d9a); color: #fff; border: none; }
.btn-block { display: flex; width: 100%; align-items: center; justify-content: center; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 10px; }
.btn-ghost { background: transparent; }

/* YES/NO */
.yes-text { color: var(--yes); font-weight: 900; }
.no-text { color: var(--no); font-weight: 900; }
.btn-yes { background: linear-gradient(160deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.06)); border: 1.5px solid var(--yes); color: var(--yes); font-weight: 900; }
.btn-yes.selected { background: linear-gradient(95deg, #22d3ee, #4da3ff); color: #04101c; box-shadow: 0 0 16px rgba(34, 211, 238, 0.55); }
.btn-no { background: linear-gradient(160deg, rgba(255, 61, 122, 0.2), rgba(255, 61, 122, 0.06)); border: 1.5px solid var(--no); color: var(--no); font-weight: 900; }
.btn-no.selected { background: linear-gradient(95deg, #ff3d7a, #ff7a3d); color: #fff; box-shadow: 0 0 16px rgba(255, 61, 122, 0.55); }

/* ===== 比率バー / HPバー / ゲージ ===== */
.ratio-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,0.07); }
.ratio-bar .r-yes { background: linear-gradient(90deg, #22d3ee, #4da3ff); height: 100%; transition: width 0.5s; box-shadow: 0 0 8px rgba(34,211,238,0.6); }
.ratio-bar .r-no { background: linear-gradient(90deg, #ff7a3d, #ff3d7a); height: 100%; transition: width 0.5s; }

.hp-bar { height: 12px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.hp-bar > i { display: block; height: 100%; border-radius: 99px; transition: width 0.25s; background: linear-gradient(90deg, #34d399, #22d3ee); box-shadow: 0 0 10px rgba(52, 211, 153, 0.6); }
.hp-bar.hp-enemy > i { background: linear-gradient(90deg, #ff3d7a, #ff7a3d); box-shadow: 0 0 10px rgba(255, 61, 122, 0.6); }
/* 敵の市役所HPゲージは左右反転(ミラー)。自分のゲージと対称に表示する。 */
.hp-bar.hp-enemy { transform: scaleX(-1); }
.hp-bar.hp-low > i { background: linear-gradient(90deg, #ff4d6d, #ffc14d); animation: hp-flash 0.8s infinite; }
@keyframes hp-flash { 50% { filter: brightness(1.5); } }

/* ===== Reference mock visual pass ===== */
:root {
  --bg: #020715;
  --bg-panel: rgba(5, 15, 38, 0.92);
  --bg-panel-2: rgba(9, 24, 57, 0.96);
  --border: rgba(75, 145, 255, 0.4);
  --border-glow: rgba(54, 201, 255, 0.78);
  --topbar-h: 105px;
}

html, body {
  background: #020715;
  font-family: "Arial Narrow", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}

body::before {
  background:
    linear-gradient(180deg, rgba(1, 5, 18, 0.3), #020715 78%),
    radial-gradient(70% 42% at 15% 18%, rgba(0, 139, 255, 0.2), transparent 70%),
    radial-gradient(70% 42% at 85% 20%, rgba(226, 39, 255, 0.18), transparent 70%),
    #020715;
}

#bg-city {
  inset: 0;
  height: 100%;
  object-fit: cover;
  opacity: 0.24;
  filter: saturate(1.25) contrast(1.12);
}

#app {
  width: min(100%, 460px);
  border-left: 1px solid rgba(48, 180, 255, 0.16);
  border-right: 1px solid rgba(206, 55, 255, 0.14);
  box-shadow: -30px 0 80px rgba(0, 117, 255, 0.08), 30px 0 80px rgba(211, 44, 255, 0.08);
}

#topbar {
  padding: calc(10px + var(--safe-top)) 12px 8px;
  background: linear-gradient(180deg, rgba(2, 7, 21, 0.99), rgba(3, 10, 27, 0.95));
  border-bottom: 1px solid rgba(71, 177, 255, 0.44);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.42), 0 1px 14px rgba(28, 157, 255, 0.14);
}
.topbar-row { gap: 9px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid rgba(102, 205, 255, 0.85);
  background: linear-gradient(145deg, #182f69, #7147d8);
  box-shadow: 0 0 0 2px rgba(7, 14, 36, 0.95), 0 0 18px rgba(54, 191, 255, 0.5);
}
.player-name-row { display: flex; align-items: center; gap: 6px; }
.player-name { max-width: 116px; font-size: 12px; letter-spacing: 0.02em; }
.player-level-row { margin-top: 5px; }
.level-chip {
  padding: 1px 6px; font-size: 8px; color: #c8f8ff;
  background: rgba(0, 142, 255, 0.2); border: 1px solid rgba(60, 198, 255, 0.6);
}
.xp-bar { height: 4px; background: #101a34; border: 1px solid rgba(255,255,255,.05); }
.brand {
  margin-left: auto; flex: none; line-height: .9; font-style: italic; text-align: right;
  font-weight: 1000; letter-spacing: -.04em; transform: skewX(-7deg);
}
.brand span {
  display: block; font-size: 15px; color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,.25);
}
.brand small {
  display: block; margin-top: 5px; font-size: 9px; letter-spacing: .04em;
  background: linear-gradient(90deg, #22d3ee, #a855f7, #ff3d9a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hud-menu {
  width: 32px; height: 32px; padding: 0; border-radius: 9px;
  color: #dce8ff; background: rgba(12, 25, 55, .9);
  border: 1px solid rgba(102, 143, 215, .35); font-size: 17px;
  cursor: pointer; transition: transform .08s, border-color .15s;
}
.hud-menu:active { transform: scale(.9); }

/* ===== 設定メニュー(ドロワー) ===== */
.mn-overlay {
  position: fixed; inset: 0; z-index: 350;
  background: rgba(4, 7, 16, 0); backdrop-filter: blur(0px);
  display: flex; justify-content: flex-end;
  transition: background .22s ease, backdrop-filter .22s ease;
}
.mn-overlay.is-open { background: rgba(4, 7, 16, .62); backdrop-filter: blur(5px); }
.mn-overlay.is-closing { background: rgba(4, 7, 16, 0); backdrop-filter: blur(0px); }
.mn-panel-wrap {
  width: min(380px, 88vw); height: 100dvh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  padding: calc(10px + var(--safe-top)) 14px calc(28px + var(--safe-bottom));
  background: linear-gradient(160deg, rgba(18, 26, 52, .98), rgba(9, 14, 32, .99));
  border-left: 1px solid var(--border-glow);
  box-shadow: -16px 0 40px rgba(0, 0, 0, .5);
}
.mn-panel-wrap.is-open { transform: translateX(0); }
.mn-panel-wrap.is-closing { transform: translateX(100%); }

.mn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mn-title { font-size: 18px; font-weight: 900; }
.mn-close {
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
  background: rgba(12, 25, 55, .9); color: var(--text-dim);
  border: 1px solid var(--border); font-size: 15px;
}
.mn-section {
  background: rgba(13, 19, 40, .7); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 13px; margin-bottom: 12px;
}
.mn-section-title { font-size: 12.5px; font-weight: 900; color: var(--text-dim); letter-spacing: .04em; margin-bottom: 10px; }

.mn-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.mn-row + .mn-row { border-top: 1px solid rgba(99, 125, 200, .14); }
.mn-row-text { flex: 1; min-width: 0; }
.mn-row-label { font-size: 14px; font-weight: 800; }
.mn-row-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.mn-switch {
  flex: none; width: 46px; height: 27px; border-radius: 99px; position: relative; cursor: pointer;
  background: rgba(60, 72, 110, .8); border: 1px solid var(--border); transition: background .18s;
}
.mn-switch.is-on { background: linear-gradient(90deg, #22d3ee, #4da3ff); border-color: transparent; }
.mn-switch-knob {
  position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); transition: transform .18s;
}
.mn-switch.is-on .mn-switch-knob { transform: translateX(19px); }

.mn-field-label { font-size: 11px; font-weight: 800; color: var(--text-dim); margin-bottom: 5px; }
.mn-inline { display: flex; gap: 7px; align-items: center; }
.mn-inline input { flex: 1; }
.mn-inline .btn { flex: none; }
.mn-id {
  flex: 1; font-size: 11.5px; color: var(--cyan); background: rgba(8, 13, 30, .9);
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace;
}
.mn-note { font-size: 10.5px; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }

.mn-howto { display: flex; flex-direction: column; gap: 11px; }
.mn-howto-title { font-size: 13px; font-weight: 800; margin-bottom: 2px; }
.mn-howto-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.55; }

.mn-link-list { display: flex; flex-direction: column; gap: 8px; }
.mn-link-card {
  display: block;
  padding: 10px 11px;
  border: 1px solid rgba(99, 125, 200, .24);
  border-radius: 10px;
  background: rgba(8, 13, 30, .74);
  color: var(--text);
  text-decoration: none;
}
.mn-link-card b { display: block; font-size: 13px; margin-bottom: 3px; }
.mn-link-card span { display: block; color: var(--text-dim); font-size: 11px; line-height: 1.45; }
.mn-link-card:active { transform: scale(.985); }

.mn-credits { text-align: center; color: var(--text-dim); font-size: 11px; margin-top: 18px; line-height: 1.7; }
.mn-credits-logo {
  font-weight: 900; font-style: italic; font-size: 13px;
  background: linear-gradient(90deg, #fff, #22d3ee, #ff3d9a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mn-credits-sub { font-size: 10px; opacity: .8; margin-top: 3px; }

/* ===== 法務ページ ===== */
.legal-page { display: flex; flex-direction: column; gap: 12px; }
.legal-back {
  display: inline-flex;
  align-self: flex-start;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}
.legal-hero h1 { font-size: 22px; line-height: 1.25; margin: 6px 0 9px; }
.legal-hero p { color: var(--text-dim); font-size: 13px; line-height: 1.65; }
.legal-eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}
.legal-updated {
  margin-top: 12px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 800;
}
.legal-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
}
.legal-switch a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px;
  border-radius: 9px;
  color: var(--text-dim);
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}
.legal-switch a.active {
  background: var(--grad-cta);
  color: #04101c;
  box-shadow: 0 0 14px rgba(34, 211, 238, .25);
}
.legal-body { padding: 16px 15px; }
.legal-section + .legal-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(99, 125, 200, .18);
}
.legal-section h2 {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
.legal-section p {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.8;
}
.legal-section p + p { margin-top: 8px; }
.wallet { gap: 7px; margin-top: 9px; }
.wallet-chip {
  position: relative; padding: 6px 5px; border-radius: 7px;
  background: linear-gradient(180deg, rgba(11, 27, 61, .98), rgba(5, 13, 34, .98));
  border-color: rgba(92, 142, 225, .3); box-shadow: inset 0 1px rgba(255,255,255,.04);
}

#view { padding: 12px 12px calc(var(--nav-h) + var(--safe-bottom) + 48px); }

.card, .neon-card {
  border-radius: 11px;
  border-color: rgba(63, 139, 246, .42);
  background: linear-gradient(145deg, rgba(7, 22, 54, .96), rgba(4, 11, 29, .97));
  box-shadow: inset 0 0 20px rgba(20, 94, 190, .07), 0 0 14px rgba(0, 92, 255, .08);
}
.neon-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(110deg, rgba(92, 211, 255, .1), transparent 30%, transparent 72%, rgba(218, 69, 255, .07));
}
.section-title {
  margin: 15px 0 8px; font-size: 13px; text-transform: uppercase;
  text-shadow: 0 0 10px rgba(91, 189, 255, .35);
}

.btn, .cta-btn {
  border-radius: 8px;
  text-transform: uppercase;
  box-shadow: inset 0 0 10px rgba(255,255,255,.09), 0 0 16px rgba(28, 148, 255, .22);
}

#bottom-nav {
  height: calc(66px + var(--safe-bottom));
  background: rgba(2, 7, 20, .97);
  border-top-color: rgba(72, 150, 255, .38);
  box-shadow: 0 -8px 26px rgba(0,0,0,.5), 0 -1px 13px rgba(27, 126, 255, .12);
}
#bottom-nav a { font-size: 9px; letter-spacing: .04em; }
.nav-icon { font-size: 21px; }
#bottom-nav a.active { color: #fff; text-shadow: 0 0 9px var(--cyan); }
#bottom-nav a.active::before { width: 38px; height: 2px; }

/* セグメント式エネルギーゲージ */
.seg-gauge { display: flex; gap: 3px; }
.seg-gauge .seg {
  flex: 1; height: 14px; border-radius: 4px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s;
}
.seg-gauge .seg.on {
  background: linear-gradient(180deg, #6ef7ff, #22a6ee);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.7);
}
.seg-gauge .seg.charging { animation: seg-pulse 1s infinite; }
@keyframes seg-pulse { 50% { background: rgba(34, 211, 238, 0.35); } }

/* ===== VS 演出 ===== */
.vs-badge {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-style: italic; font-size: 15px; color: #fff;
  background: conic-gradient(from 200deg, #22d3ee, #8b5cf6, #ff3d9a, #22d3ee);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.7);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ===== バッジ/チップ ===== */
.badge {
  display: inline-block; padding: 2.5px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 900;
  background: var(--bg-panel-2); color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge-open { color: var(--green); border-color: var(--green); background: rgba(52, 211, 153, 0.12); }
.badge-locked { color: var(--yellow); border-color: var(--yellow); background: rgba(255, 193, 77, 0.1); }
.badge-resolved { color: var(--cyan); border-color: var(--cyan); background: rgba(34, 211, 238, 0.1); }
.badge-void { color: var(--red); border-color: var(--red); background: rgba(255, 77, 109, 0.1); }
/* 確定タブ: 報酬の受取状況。受取済み=落ち着いた緑 / 未受取=目立つ金 / はずれ=淡色 */
.claim-done { color: var(--green); border-color: var(--green); background: rgba(52, 211, 153, 0.12); }
.claim-pending { color: #ffcf4d; border-color: #ffcf4d; background: rgba(255, 193, 77, 0.16); }
.claim-lose { color: var(--text-dim); border-color: var(--border); background: var(--bg-panel-2); }

.countdown { font-variant-numeric: tabular-nums; font-weight: 900; color: var(--yellow); }
.countdown.urgent { color: var(--red); animation: hp-flash 1s infinite; }

.muted { color: var(--text-dim); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.num { font-variant-numeric: tabular-nums; }

input[type="text"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%;
  background: rgba(12, 17, 36, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px; color: var(--text);
  padding: 11px 12px; font-size: 15px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: -1px; }

/* ===== トースト ===== */
#toast-container {
  position: fixed; top: calc(14px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  width: min(440px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  padding: 12px 15px; border-radius: 14px; font-size: 13.5px; font-weight: 800;
  background: rgba(17, 24, 48, 0.96);
  border: 1px solid var(--border-glow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 14px rgba(77, 163, 255, 0.18);
  animation: toast-in 0.25s cubic-bezier(.2,.9,.3,1.3);
}
.toast-success { border-color: var(--green); box-shadow: 0 10px 30px rgba(0,0,0,0.55), 0 0 16px rgba(52, 211, 153, 0.3); }
.toast-error { border-color: var(--red); box-shadow: 0 10px 30px rgba(0,0,0,0.55), 0 0 16px rgba(255, 77, 109, 0.3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ===== 報酬モーダル ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 16, 0.78); backdrop-filter: blur(6px);
  animation: fade-in 0.2s;
}
@keyframes fade-in { from { opacity: 0; } }
.reward-modal {
  width: min(340px, calc(100vw - 48px));
  text-align: center; padding: 26px 20px 20px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(30, 40, 80, 0.97), rgba(14, 19, 40, 0.98));
  border: 1.5px solid var(--border-glow);
  box-shadow: 0 0 50px rgba(77, 163, 255, 0.3);
  animation: pop-in 0.35s cubic-bezier(.2,1.2,.3,1);
}
@keyframes pop-in { from { opacity: 0; transform: scale(0.7); } }
.reward-modal .rm-emoji { font-size: 52px; line-height: 1; animation: bounce 0.7s cubic-bezier(.3,1.6,.4,1); display: block; }
@keyframes bounce { 0% { transform: scale(0) rotate(-20deg); } 60% { transform: scale(1.25); } }
.reward-modal .rm-title {
  font-size: 19px; font-weight: 900; margin: 10px 0 4px;
  background: var(--grad-cta); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.reward-modal .rm-lines { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.reward-modal .rm-line {
  display: flex; justify-content: center; gap: 8px; font-weight: 900; font-size: 15px;
  animation: view-in 0.4s both;
}
.reward-modal .rm-line:nth-child(2) { animation-delay: 0.12s; }
.reward-modal .rm-line:nth-child(3) { animation-delay: 0.24s; }
.reward-modal .rm-line:nth-child(4) { animation-delay: 0.36s; }

/* ===== 8×8グリッド(街/対戦共通)===== */
.city-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; aspect-ratio: 1; }
.city-cell {
  border-radius: 9px;
  background: rgba(25, 33, 64, 0.75);
  border: 1px solid rgba(99, 125, 200, 0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 9px; position: relative; overflow: hidden; user-select: none;
}
.city-cell .cell-icon { font-size: 17px; line-height: 1.2; }
.city-cell .cell-label { font-size: 8.5px; color: var(--text-dim); transform: scale(0.9); white-space: nowrap; }
.cell-road {
  background:
    linear-gradient(rgba(5, 13, 32, .08), rgba(5, 13, 32, .08)),
    url('/assets/img/generated/road-cross-v1.png') center / 116% 116% no-repeat,
    #101b36;
  border-color: #4a5680;
}
.cell-townhall { background: linear-gradient(160deg, #6d3fc0, #4a2b86); border-color: #a78bfa; box-shadow: inset 0 0 12px rgba(167, 139, 250, 0.5); }
.cell-police { background: linear-gradient(160deg, #1d5fa8, #14406f); border-color: #4da3ff; }
.cell-hospital { background: linear-gradient(160deg, #a04458, #6f2e3e); border-color: #ff8aa1; }
.cell-power { background: linear-gradient(160deg, #a08524, #6f5c18); border-color: #ffc14d; }
.cell-shopping { background: linear-gradient(160deg, #1f7c5e, #145341); border-color: #34d399; }
.cell-station { background: linear-gradient(160deg, #2d639c, #1e4269); border-color: #74b6ff; }
.cell-tv { background: linear-gradient(160deg, #8444a0, #5b2e6f); border-color: #d08aff; }
.cell-port { background: linear-gradient(160deg, #1f6e7c, #144a53); border-color: #5eead4; }
.cell-entry { outline: 2px dashed var(--cyan); outline-offset: -2px; }

.bt-building-art {
  position: absolute;
  inset: -10% -8% 2%;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.bt-building-art img,
.bt-building-art .asset-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .75));
}
.bt-building-art .asset-fallback {
  display: grid;
  place-items: center;
  font-size: 19px;
}
.bt-grid-mini .bt-building-art {
  inset: -15% -12% 0;
}
.bt-grid-mini .bt-building-art .asset-fallback {
  font-size: 12px;
}

.loading { text-align: center; color: var(--text-dim); padding: 48px 0; }
.loading::after { content: ""; display: block; width: 28px; height: 28px; margin: 12px auto 0; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--cyan); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 管理画面互換(旧トーン要素) */
.brand {
  font-weight: 900; letter-spacing: 0.04em; font-style: italic;
  background: linear-gradient(90deg, #fff 20%, var(--cyan) 55%, var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
