/* ===== YADOMEN GAME - Mobile-first Game UI ===== */
@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@500;700;900&display=swap');

:root {
  /* 暖色ダイナーテーマ（旧グレー基調はコントラスト不足のため刷新） */
  --bg-deep:    #221914;
  --bg-card:    #2e2318;
  --bg-nav:     #362a1b;
  --accent:     #f0b429;
  --accent2:    #e2711d;
  --text:       #f7eedd;
  --text-muted: #d9c9ae;
  --border:     #57452e;
  --success:    #6fcf6f;
  --danger:     #ff7b6e;
  --nav-h:      60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.game-body {
  background:
    radial-gradient(ellipse at 50% -10%, #3a2c1c 0%, transparent 55%),
    var(--bg-deep);
  color: var(--text);
  font-family: 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  font-weight: 500;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

/* スマホのタップ遅延・ダブルタップズームを防いでサクサクに */
a, button, input, select, label, .nav-item, .btn, .town-building, .fly, .burger-layer {
  touch-action: manipulation;
}
button, .btn { -webkit-user-select: none; user-select: none; }

/* ===== 視認性の根本修正 =====
   Bootstrapの .text-muted / .text-secondary は暗灰色のままでダークテーマだと読めない */
.text-muted, .text-secondary, .form-text {
  color: var(--text-muted) !important;
}
/* セレクトの選択肢が黒背景×黒文字になる端末対策 */
select, option, optgroup {
  background-color: #2e2318;
  color: var(--text);
}
input::placeholder { color: #a08e74 !important; opacity: 1; }
.table-dark { color: var(--text); }
.table-dark td, .table-dark th { color: inherit; }

.game-container {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(var(--nav-h) + 16px);
  min-height: 100vh;
}

/* ===== ヘッダー ===== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-nav);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 8px;
}

.header-name { font-weight: bold; font-size: 0.95rem; }
.header-area { color: var(--text-muted); font-size: 0.75rem; }
.stat-gold   { font-weight: bold; color: var(--accent); font-size: 0.9rem; white-space: nowrap; }
.stat-star   { color: #ffd700; font-size: 0.85rem; text-align: right; }

/* ===== カード ===== */
.game-card {
  background: linear-gradient(170deg, #342818 0%, var(--bg-card) 40%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

/* ===== ボタン ===== */
.btn-game {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  border: none;
  font-weight: bold;
  border-radius: 8px;
  padding: 8px 16px;
}
.btn-game:hover, .btn-game:focus { background: linear-gradient(135deg, #c04800, #c48000); color: #fff; }
.btn-game:disabled { opacity: 0.5; }

.btn-game-big {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  border: none;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(230, 168, 23, 0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn-game-big:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(230, 168, 23, 0.4); color: #fff; }
.btn-game-big:active { transform: translateY(1px); }

.btn-ing {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  padding: 4px 8px;
  transition: border-color 0.15s;
}
.btn-ing:hover { border-color: var(--accent); color: var(--accent); }

/* ===== タイトル画面 ===== */
.title-screen {
  text-align: center;
  padding: 40px 20px 20px;
}
.title-logo { font-size: 5rem; line-height: 1; }
.title-text {
  font-size: 1.8rem;
  font-weight: bold;
  margin: 12px 0 4px;
  line-height: 1.2;
}
.title-text span { font-size: 1rem; color: var(--accent); display: block; }
.title-sub { color: var(--text-muted); font-size: 0.9rem; }

/* ===== ナビゲーション ===== */
.game-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
}
.game-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  gap: 2px;
  transition: color 0.15s;
}
.game-nav .nav-item span { font-size: 0.65rem; }
.game-nav .nav-item.active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(240,180,41,0.14), transparent);
  border-top: 2px solid var(--accent);
  margin-top: -1px;
}
.game-nav .nav-item:hover  { color: var(--text); }

/* ===== ステータス表示 ===== */
.result-card {
  background: #33291b;
  border: 1px solid #6b5636;
  border-radius: 10px;
  padding: 14px;
}
.result-title { font-weight: bold; margin-bottom: 8px; color: var(--success); }
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.result-row:last-child { border-bottom: none; }

.result-detail .result-row { font-size: 0.9rem; }

/* ===== バーガービルダー ===== */
.burger-visual {
  min-height: 80px;
  background: var(--bg-deep);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.burger-empty { color: var(--text-muted); font-size: 0.85rem; padding: 20px; }
.burger-layer {
  width: 90%;
  max-width: 280px;
  padding: 5px 10px;
  border-radius: 4px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  transition: opacity 0.15s;
}
.burger-layer:hover { opacity: 0.8; }

/* ===== 3D料理ビューア ===== */
.food3d-box {
  position: relative;
  height: 230px;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #4a3826 0%, #2a1f14 70%);
  border: 1px solid var(--border);
}
.food3d-box canvas { display: block; width: 100% !important; height: 100% !important; }
.food3d-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
.layer-chip { font-size: 0.72rem; padding: 2px 8px; }

/* 3D非対応端末用の2D積み上げ表示 */
.food2d-stack {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding: 14px 0 8px;
  overflow-y: auto;
}
.food2d-plate { font-size: 1.6rem; line-height: 1; margin-top: 2px; }

.dish3d-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 3, 0.8);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dish3d-panel {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.7);
  animation: fadeIn 0.25s ease-out;
}
.dish3d-panel .food3d-box { height: 300px; }

/* SVGフードレイヤー */
.food-layer {
  position: relative;
  width: 92%;
  max-width: 300px;
  margin-top: -6px; /* 層を少し重ねて一体感 */
  cursor: pointer;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.35));
  transition: transform 0.12s;
}
.food-layer:first-child { margin-top: 0; }
.food-layer:hover { transform: scale(1.03); }
.food-layer svg { width: 100%; display: block; }
.food-layer-name {
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%) translateX(100%);
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
  display: none;
}
.food-layer:hover .food-layer-name { display: block; }

.recipe-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.recipe-item:last-child { border-bottom: none; }

/* ===== ガチャ ===== */
.gacha-box {
  font-size: 6rem;
  display: inline-block;
  transition: transform 0.3s;
}
.gacha-spin {
  animation: spin 0.6s ease-in-out;
}
@keyframes spin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.3); }
  100% { transform: rotate(360deg) scale(1); }
}
.gacha-prize-name { font-size: 1.4rem; font-weight: bold; color: var(--accent); }
.gacha-prize-reveal { animation: fadeIn 0.4s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

/* ===== 営業アニメーション ===== */
.business-anim {
  font-size: 4rem;
  animation: bounce 0.8s infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

/* ===== レポート サマリー ===== */
.summary-box {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.s-label { font-size: 0.75rem; color: var(--text-muted); }
.s-val   { font-size: 1.15rem; font-weight: bold; margin-top: 2px; }

/* ===== stat boxes ===== */
.stat-label { font-size: 0.75rem; color: var(--text-muted); }
.stat-val   { font-size: 1.2rem; font-weight: bold; color: var(--text); }

/* ===== Bootstrapオーバーライド ===== */
.form-control, .form-select {
  background-color: var(--bg-deep);
  border-color: var(--border);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  background-color: var(--bg-deep);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(230,168,23,0.2);
}
.form-control::placeholder { color: var(--text-muted); }

/* ===== 業種選択カード ===== */
.shop-type-option { cursor: pointer; }
.shop-type-option input { display: none; }
.shop-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  background: var(--bg-deep);
  border: 2px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.shop-type-option input:checked + .shop-type-card {
  border-color: var(--accent);
  background: rgba(230, 168, 23, 0.1);
}
.shop-type-emoji { font-size: 1.8rem; line-height: 1; }
.shop-type-label { font-size: 0.72rem; color: var(--text); white-space: nowrap; }

/* ===== クイックリンク ===== */
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.2rem;
  transition: border-color 0.15s;
}
.quick-link:hover { border-color: var(--accent); color: var(--accent); }
.quick-link span { font-size: 0.65rem; color: var(--text-muted); }

/* ===== 対話イベント ===== */
.event-overlay-card {
  background: #1f1a2e;
  border: 2px solid #6f42c1;
  border-radius: 12px;
  padding: 18px;
  animation: fadeIn 0.3s ease-in;
}
.event-overlay-card .event-emoji { font-size: 3.5rem; text-align: center; }
.btn-event-choice {
  display: block;
  width: 100%;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid #6f42c1;
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  text-align: left;
  transition: background 0.15s;
}
.btn-event-choice:hover { background: #2a2340; color: #fff; }
.btn-event-choice .choice-hint { font-size: 0.72rem; color: var(--text-muted); display: block; }

/* ハエ叩きミニゲーム */
.fly-arena {
  position: relative;
  height: 260px;
  background: #10141a;
  border: 1px dashed var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}
.fly {
  position: absolute;
  font-size: 1.9rem;
  cursor: pointer;
  user-select: none;
  transition: top 0.7s linear, left 0.7s linear;
  z-index: 5;
}
.fly-swatted { animation: swat 0.3s forwards; pointer-events: none; }
@keyframes swat {
  to { transform: scale(0) rotate(180deg); opacity: 0; }
}
.fly-timer { font-size: 1.3rem; font-weight: bold; color: var(--danger); }

/* ===== 開業プラン選択 ===== */
.plan-option { cursor: pointer; }
.plan-option input { display: none; }
.plan-card {
  display: block;
  padding: 8px 12px;
  background: var(--bg-deep);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.plan-option input:checked + .plan-card {
  border-color: var(--accent);
  background: rgba(230, 168, 23, 0.08);
}
.capital-calc {
  background: var(--bg-deep);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.calc-row { display: flex; justify-content: space-between; font-size: 0.88rem; padding: 2px 0; }

/* ===== オープニング ===== */
.opening-stage { padding: 24px 20px; min-height: 90vh; }
.opening-sky {
  position: relative;
  height: 140px;
  background: linear-gradient(#1a2a4a, #4a3520);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
}
.opening-sun { font-size: 3rem; margin-top: 12px; animation: sunrise 4s ease-out forwards; }
@keyframes sunrise { from { transform: translateY(60px); opacity: 0.3; } to { transform: translateY(0); opacity: 1; } }
.opening-town { font-size: 1.8rem; letter-spacing: 4px; position: absolute; bottom: 4px; width: 100%; }
.opening-shop-emoji {
  text-align: center;
  font-size: 4rem;
  margin: 16px 0 4px;
  opacity: 0.15;
  transition: opacity 1s, transform 1s;
}
.opening-shop-appear { opacity: 1 !important; transform: scale(1.15); }
.opening-text {
  min-height: 90px;
  white-space: pre-line;
  text-align: center;
  font-size: 1rem;
  line-height: 1.8;
  margin-top: 10px;
  color: var(--text);
}

/* ===== BGMボタン ===== */
.bgm-btn {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  right: calc(50% - 240px + 12px);
  z-index: 300;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-nav);
  font-size: 1.1rem;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
@media (max-width: 500px) { .bgm-btn { right: 12px; } }

/* ===== 本部からの手紙 ===== */
.letter-card {
  border: 1px solid var(--accent);
  background: linear-gradient(170deg, #3d2f16 0%, var(--bg-card) 60%);
  animation: fadeIn 0.4s ease-out;
}

/* ===== 経営成績表 ===== */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 900;
  border: 3px solid var(--accent);
  background: var(--bg-deep);
  color: var(--accent);
  box-shadow: 0 0 18px rgba(240, 180, 41, 0.35);
}

/* ===== 紹介プログラム ===== */
.referral-code {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--accent);
  text-shadow: 0 2px 10px rgba(240, 180, 41, 0.4);
  margin: 4px 0;
}

/* ===== 経営分析シミュレーター ===== */
.sim-verdict {
  border-color: var(--accent);
  background: linear-gradient(170deg, #3d2c14 0%, var(--bg-card) 55%);
}
.sim-diff {
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(240, 180, 41, 0.35);
}
.sim-real { border-color: #b3271e; }

/* ===== おしゃれ2Dタウン (SVGイラスト) ===== */
.town-illust {
  position: relative;
  margin: 12px;
  /* 判定ズレ防止: 縦横比は絵(400:460)と完全一致させる */
  aspect-ratio: 400 / 460;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.town-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.town-scene text { font-family: 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', sans-serif; }

.town-spot {
  position: absolute;
  z-index: 3;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, box-shadow 0.15s;
}
.town-spot:hover {
  background: rgba(240, 180, 41, 0.12);
  box-shadow: inset 0 0 0 2px rgba(240, 180, 41, 0.55);
}

/* ベクターシェフ */
.chef {
  position: absolute;
  width: 44px;
  margin-left: -22px;
  margin-top: -50px;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25));
}
.chef svg { width: 100%; display: block; }
.chef.face-left svg { transform: scaleX(-1); }
.chef .leg-l, .chef .leg-r, .chef .arm-l, .chef .arm-r {
  transform-box: fill-box;
  transform-origin: top center;
}
.chef.walking .leg-l { animation: chef-swing 0.36s ease-in-out infinite alternate; }
.chef.walking .leg-r { animation: chef-swing 0.36s ease-in-out infinite alternate-reverse; }
.chef.walking .arm-l { animation: chef-swing 0.36s ease-in-out infinite alternate-reverse; }
.chef.walking .arm-r { animation: chef-swing 0.36s ease-in-out infinite alternate; }
.chef.walking { animation: chef-bob 0.36s ease-in-out infinite alternate; }
@keyframes chef-swing {
  from { transform: rotate(24deg); }
  to   { transform: rotate(-24deg); }
}
@keyframes chef-bob {
  from { margin-top: -50px; }
  to   { margin-top: -53px; }
}

/* ===== 3Dタウン ===== */
.town3d-wrap { position: relative; margin: 12px; }
.town3d-box {
  height: 430px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #6b7684;
}
.town3d-box canvas { display: block; }
.town3d-wrap .town-popup { position: absolute; }

/* ===== 町マップ ===== */
.town-map {
  position: relative;
  margin: 12px;
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(#2a3d5c 0%, #3d5273 14%, #d9885a 17%, #7a9455 20%, #5d7442 55%, #4d6136 100%);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* 通り(道路) */
.town-map::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 47%;
  height: 13%;
  background: #57534e;
  border-top: 3px solid #6d675f;
  border-bottom: 3px solid #6d675f;
  z-index: 1;
}
.town-map::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: calc(47% + 6.5% - 2px);
  height: 3px;
  background: repeating-linear-gradient(90deg, #e8dcc0 0 18px, transparent 18px 34px);
  z-index: 1;
}
/* 天気による空の変化 */
.town-map.town-wx-cloudy  { background: linear-gradient(#5a6672 0%, #6a7480 14%, #b8825a 17%, #6d8450 20%, #556a3e 55%, #475932 100%); }
.town-map.town-wx-rain    { background: linear-gradient(#3d4652 0%, #4a545e 14%, #8a6648 17%, #5a7044 20%, #4a5c38 55%, #3d4c2e 100%); }
.town-map.town-wx-typhoon { background: linear-gradient(#262c34 0%, #333a42 14%, #6a4e3a 17%, #48583a 20%, #3a4a30 55%, #303e28 100%); }

/* 雨エフェクト（CSSのみ・全端末対応） */
.town-rain {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    75deg,
    transparent 0 6px,
    rgba(180, 205, 235, 0.35) 6px 7px,
    transparent 7px 14px
  );
  background-size: 200% 200%;
  animation: rain-fall 0.5s linear infinite;
  opacity: 0.65;
}
.town-rain-heavy {
  animation-duration: 0.28s;
  opacity: 0.9;
  background-image: repeating-linear-gradient(
    65deg,
    transparent 0 4px,
    rgba(180, 205, 235, 0.5) 4px 5.5px,
    transparent 5.5px 9px
  );
}
@keyframes rain-fall {
  from { background-position: 0 0; }
  to   { background-position: -60px 120px; }
}

/* 行き先マーカー */
.tap-marker {
  position: absolute;
  width: 22px;
  height: 12px;
  margin-left: -11px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
  animation: marker-pulse 0.7s ease-in-out infinite alternate;
}
@keyframes marker-pulse {
  from { transform: scale(1);   opacity: 0.9; }
  to   { transform: scale(1.4); opacity: 0.4; }
}

.town-sky { position: absolute; top: 0; left: 0; right: 0; height: 18%; }
.town-weather { position: absolute; right: 10px; top: 8px; font-size: 1.6rem; }
.town-cloud { position: absolute; top: 10px; font-size: 1.2rem; animation: cloud-drift 20s linear infinite; opacity: 0.8; }
@keyframes cloud-drift { from { transform: translateX(-20px); } to { transform: translateX(320px); } }

.town-building {
  position: absolute;
  text-align: center;
  z-index: 3;
  transition: transform 0.15s;
}
.town-building:hover { transform: scale(1.08); }
/* 建物: 壁+屋根オーニング+窓 をCSSで描画 */
.town-building .b-emoji {
  position: relative;
  width: 62px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  background: linear-gradient(#8a6a45 0%, #6b4e30 55%, #57402a 100%);
  border: 2px solid #33241a;
  border-radius: 6px 6px 4px 4px;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,0.25), 0 5px 8px rgba(0,0,0,0.45);
}
.town-building .b-emoji::before {
  /* 赤白ストライプのオーニング(ひさし) */
  content: '';
  position: absolute;
  top: -9px;
  left: -6px;
  right: -6px;
  height: 13px;
  border-radius: 7px 7px 3px 3px;
  background: repeating-linear-gradient(90deg, #c0392b 0 9px, #f5efe0 9px 18px);
  border: 1px solid #33241a;
  box-shadow: 0 2px 3px rgba(0,0,0,0.4);
}
.town-building .b-emoji::after {
  /* あたたかい窓明かり */
  content: '';
  position: absolute;
  bottom: 5px;
  left: 7px;
  width: 12px;
  height: 10px;
  background: linear-gradient(#ffd97a, #e8a83a);
  border: 1px solid #33241a;
  border-radius: 2px;
  box-shadow: 34px 0 0 -1px #f7c85e;
}
.town-building .b-label {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.62rem;
  font-weight: bold;
  color: #f7eedd;
  background: rgba(20, 12, 6, 0.75);
  border: 1px solid rgba(240, 180, 41, 0.4);
  padding: 1px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.town-player {
  position: absolute;
  font-size: 2.1rem;
  z-index: 5;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.6));
  pointer-events: none;
}
.town-player::after {
  /* 足元の影 */
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 26px;
  height: 7px;
  background: rgba(0,0,0,0.35);
  border-radius: 50%;
}
.town-player.walking { animation: walk-bob 0.35s infinite alternate; }
@keyframes walk-bob { from { margin-top: 0; } to { margin-top: -5px; } }

.town-popup {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: 86%;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.nav-tabs { border-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-muted); border-color: transparent; }
.nav-tabs .nav-link.active { background: var(--bg-card); border-color: var(--border) var(--border) transparent; color: var(--accent); }

.table-dark { --bs-table-bg: transparent; --bs-table-border-color: var(--border); }
.alert-info    { background: #1d2a3d; border-color: #3d5a80; color: #a8cdf5; }
.alert-warning { background: #33270c; border-color: #6b5300; color: #f0c94a; }
.alert-success { background: #16301a; border-color: #2f6b3a; color: #8fe08f; }
.alert-danger  { background: #3a1712; border-color: #7a3328; color: #ffa196; }

/* ===== ボタンを「押せるもの」と一目で分かるように（2026-07-12） =====
   ネットに不慣れな人でも迷わないよう、主要ボタンに立体の縁・押し込みアニメ・▶マークを付ける */
.btn-game,
.btn-game-big {
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 0 #7a4b0e, 0 6px 14px rgba(0, 0, 0, 0.35);
  transform: translateY(0);
  transition: transform 0.06s, box-shadow 0.06s;
}
.btn-game:active,
.btn-game-big:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #7a4b0e, 0 2px 6px rgba(0, 0, 0, 0.3);
}
/* リンク型のボタンには「進む」マークを自動で付ける */
a.btn-game::after,
a.btn-game-big::after {
  content: " ▶";
  font-size: 0.75em;
  opacity: 0.9;
}
/* 枠だけのボタンも立体感を持たせて「押せる」と分かるように */
.btn-outline-light,
.btn-outline-warning {
  border-width: 2px !important;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}
.btn-outline-light:active,
.btn-outline-warning:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
/* プルダウンにも枠を強めて「触れるもの」感を出す */
select.form-select {
  border-width: 2px;
}
