/* ============================================================
 * ビジネスタイクーン · ダークテーマ
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg0: #fdeef4;
  --bg1: #fffdf8;
  --bg2: #fff3f8;
  --bg3: #ffe7f0;
  --line: #f3cfdd;
  --text: #6d4a5c;
  --text-dim: #a58496;
  --gold: #e89a2a;
  --gold-dark: #c97d10;
  --green: #3aa76d;
  --red: #ef6f8e;
  --accent: #f77fb0;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
          "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(247, 127, 176, 0.12), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(126, 220, 190, 0.14), transparent 60%),
    var(--bg0);
  color: var(--text);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  color: var(--text);
  background: var(--bg3);
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
}
button:not(:disabled):hover { filter: brightness(1.15); }
button:not(:disabled):active { transform: scale(0.96); }
button:disabled { cursor: not-allowed; opacity: 0.45; }

/* ============ 画面シェイクアニメーション ============ */
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(3px, 3px); }
}
body.shake { animation: shake 0.4s ease; }

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}
.shake-x { animation: shakeX 0.32s ease; }

/* ============ エフェクトレイヤー ============ */
#fx-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}
.fx-coin {
  position: fixed;
  font-size: 20px;
  transition: left 0.6s cubic-bezier(0.35, -0.2, 0.4, 1),
              top 0.6s cubic-bezier(0.35, -0.2, 0.4, 1),
              opacity 0.6s ease, transform 0.6s ease;
  will-change: left, top;
  z-index: 301;
}
@keyframes gainFloat {
  0% { opacity: 0; transform: translateY(6px); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-26px); }
}
.fx-gain {
  position: fixed;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(255,255,255,0.85);
  animation: gainFloat 0.9s ease forwards;
  z-index: 301;
}

/* ============ Toast ============ */
#toast-container {
  position: fixed;
  top: 76px; left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(255, 250, 245, 0.96);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(214, 116, 156, 0.22);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 640px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-gold { border-color: var(--gold-dark); color: var(--gold); box-shadow: 0 8px 24px rgba(185, 138, 30, 0.25); }
.toast-red { border-color: var(--red); color: var(--red); }

/* ============ HUD ============ */
#hud {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(255,250,245,0.92), rgba(255,238,246,0.94));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  position: relative;
  z-index: 10;
}
.hud-left { display: flex; align-items: center; gap: 14px; min-width: 280px; }
.logo { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.brand-chip {
  background: rgba(245, 196, 81, 0.1);
  border: 1px solid rgba(245, 196, 81, 0.35);
  color: var(--gold);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.hud-center { text-align: center; }
#cash-display {
  font-size: 30px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(245, 196, 81, 0.25);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  transition: transform 0.15s ease;
}
#cash-display.pulse { transform: scale(1.07); }
#income-display { font-size: 12.5px; color: var(--green); font-weight: 600; }
.hud-right { display: flex; gap: 8px; min-width: 280px; justify-content: flex-end; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 17px;
  background: var(--bg3);
  border: 1px solid var(--line);
}

/* ============ 初心者ヒントバー ============ */
#hint-bar {
  height: 0;
  overflow: hidden;
  text-align: center;
  font-size: 13.5px;
  color: var(--gold);
  background: linear-gradient(90deg, transparent, rgba(245,196,81,0.09), transparent);
  transition: height 0.25s ease, padding 0.25s ease;
  line-height: 30px;
  position: relative;
  z-index: 9;
}
#hint-bar.visible { height: 30px; }

/* ============ メインレイアウト ============ */
#layout {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  height: calc(100vh - 64px - 30px);
}
#hint-bar:not(.visible) + #layout { height: calc(100vh - 64px); }

/* ---------- 事業リスト ---------- */
#industries-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#industries-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px;
}
.toolbar-title { font-size: 15px; font-weight: 700; color: var(--text-dim); }
#buy-mode {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.buy-mode-btn {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  color: var(--text-dim);
}
.buy-mode-btn.active { background: var(--accent); color: #fff; }

#industries-list {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 12px;
  align-content: start;
  padding-right: 4px;
  padding-bottom: 12px;
}

/* ---------- 事業カード ---------- */
.ind-card {
  display: flex;
  gap: 12px;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ind-card:hover { border-color: #3b4859; }
.ind-card.flash {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(245, 196, 81, 0.35);
}
.ind-card.locked { opacity: 0.78; }

.ind-card.mystery > * { visibility: hidden; }
.ind-card.mystery { min-height: 118px; }
.ind-card.mystery::after {
  content: '🔍 ？？？ 前の事業を発展させると判明';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 2px;
}

.ind-icon {
  width: 78px; height: 94px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 4px 10px rgba(214, 116, 156, 0.2);
  position: relative;
}
.ind-icon.clickable { cursor: pointer; }
.ind-icon.clickable::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 14px;
  border: 2px solid rgba(245, 196, 81, 0.55);
  animation: ringPulse 1.4s ease infinite;
  pointer-events: none;
}
@keyframes ringPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.9; }
}
.ind-icon.pop { transform: scale(1.12); }
.ind-emoji { font-size: 34px; filter: drop-shadow(0 2px 4px rgba(214, 116, 156, 0.35)); }
.ind-count {
  font-size: 13px;
  font-weight: 800;
  background: rgba(247, 127, 176, 0.85);
  border-radius: 999px;
  padding: 1px 10px;
  font-variant-numeric: tabular-nums;
}

.ind-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ind-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ind-name { font-size: 15.5px; font-weight: 700; }
.ind-rev {
  font-size: 13px; font-weight: 700; color: var(--green);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.prog-wrap {
  height: 20px;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2f7fd4, #5aa2e8);
  border-radius: 999px;
  transition: width 0.08s linear;
}
.prog-fill.glow {
  background: linear-gradient(90deg, #d4a72f, var(--gold));
  animation: glowPulse 1s ease infinite;
}
@keyframes glowPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}
.prog-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #8a5670;
  text-shadow: 0 1px 2px rgba(255,255,255,0.9);
  pointer-events: none;
}

.ms-wrap {
  height: 14px;
  background: var(--bg0);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(245, 196, 81, 0.25);
}
.ms-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.25s ease;
}
.ms-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 1px 2px rgba(255,255,255,0.9);
  pointer-events: none;
  letter-spacing: 0.5px;
}

.ind-actions { display: flex; align-items: center; gap: 8px; }
.btn-buy {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 9px;
  background: var(--bg3);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
.btn-buy.can-buy {
  background: linear-gradient(180deg, #ff9cc0, #f069a0);
  border-color: #f77fb0;
}
.btn-buy.can-buy { color: #fff; } .btn-buy.can-buy .buy-cost { color: #ffe9f3; }
.buy-cost { font-variant-numeric: tabular-nums; color: var(--text-dim); font-weight: 600; }
.mgr-flag {
  font-size: 11.5px;
  color: var(--gold);
  background: rgba(245, 196, 81, 0.1);
  border: 1px solid rgba(245, 196, 81, 0.3);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* ---------- サイドバー ---------- */
#side-col {
  width: 372px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
#side-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.tab-btn {
  padding: 11px 2px;
  font-size: 12.5px;
  font-weight: 700;
  background: transparent;
  color: var(--text-dim);
  position: relative;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--gold);
  background: var(--bg1);
  box-shadow: inset 0 -2px 0 var(--gold);
}
.tab-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
#side-content { flex: 1; overflow-y: auto; padding: 12px; }
.side-panel { display: none; }
.side-panel.active { display: block; }

.panel-tip { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 10px; }
.panel-tip.small { font-size: 11.5px; margin-top: 10px; margin-bottom: 0; }

.panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
}
.panel-row.done { opacity: 0.55; }
.row-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid rgba(214, 116, 156, 0.25);
}
.row-icon-flat { background: var(--bg3); }
.row-main { flex: 1; min-width: 0; }
.row-name { font-size: 13.5px; font-weight: 700; }
.row-desc { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.btn-small {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(180deg, #ff9cc0, #f069a0);
  border: 1px solid #f77fb0;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-small:disabled { background: #f0e2e8; border-color: var(--line); color: var(--text-dim); }

/* ---------- 実績 ---------- */
.ach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  margin-bottom: 6px;
  opacity: 0.6;
}
.ach-row.ach-done {
  opacity: 1;
  border-color: rgba(245, 196, 81, 0.4);
  background: linear-gradient(90deg, rgba(245,196,81,0.08), var(--bg2));
}
.ach-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.ach-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ach-name { font-size: 13px; font-weight: 700; }
.ach-desc { font-size: 11px; color: var(--text-dim); }
.ach-mark { color: var(--gold); font-weight: 800; font-size: 15px; }

/* ---------- 名声 / 統計 ---------- */
.prestige-card h3 { font-size: 16px; margin-bottom: 8px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.stat-row span { color: var(--text-dim); }
.stat-row b { font-variant-numeric: tabular-nums; }
.gold-text { color: var(--gold); }

/* ---------- ボタン ---------- */
.btn-big {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 800;
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--text);
  margin-top: 10px;
}
.btn-big.gold {
  background: linear-gradient(180deg, #f5c451, #d69e2e);
  border-color: #f7d788;
  color: #2a1d05;
  box-shadow: 0 4px 18px rgba(245, 196, 81, 0.3);
}
.btn-big.danger {
  background: linear-gradient(180deg, #f2788f, #e05270);
  border-color: #ef6f8e;
  color: #fff;
}

/* ---------- 設定 ---------- */
.settings-h { font-size: 13px; color: var(--text-dim); margin: 16px 0 6px; }
#save-area {
  width: 100%;
  height: 90px;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 11px;
  padding: 8px;
  resize: vertical;
  font-family: monospace;
  user-select: text;
  -webkit-user-select: text;
}
.settings-btns { display: flex; gap: 8px; margin-top: 8px; }
.settings-btns .btn-small { flex: 1; }
.settings-btns .btn-big { flex: 1; margin-top: 0; }

/* ============ タイトル画面 ============ */
#screen-title {
  position: fixed; inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(90, 162, 232, 0.16), transparent 65%),
    radial-gradient(700px 400px at 85% 100%, rgba(138, 79, 158, 0.14), transparent 60%),
    var(--bg0);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#screen-title.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.title-inner {
  max-width: 620px;
  width: 92%;
  text-align: center;
  max-height: 94vh;
  overflow-y: auto;
  padding: 10px;
}
@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.title-logo { font-size: 64px; animation: floatLogo 3.2s ease-in-out infinite; }
.title-inner h1 {
  font-size: 46px;
  letter-spacing: 10px;
  background: linear-gradient(180deg, #ffe9b0, var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 4px 0 6px;
}
.title-sub { color: var(--text-dim); font-size: 15px; letter-spacing: 3px; margin-bottom: 18px; }
.title-help {
  text-align: left;
  background: rgba(255, 240, 247, 0.8);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.title-help h3 { font-size: 14px; color: var(--gold); margin-bottom: 8px; }
.title-help ul { list-style: none; }
.title-help li { font-size: 13px; color: var(--text); line-height: 1.9; }
.title-keys { font-size: 12px; color: var(--text-dim); margin-top: 8px; text-align: center; }
#screen-title .btn-big { max-width: 320px; margin: 0 auto; font-size: 17px; padding: 14px; }
#title-save-note { font-size: 12.5px; color: var(--text-dim); margin-top: 12px; }

/* ============ モーダル ============ */
.overlay {
  position: fixed; inset: 0;
  z-index: 450;
  background: rgba(5, 8, 12, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.overlay.open { opacity: 1; visibility: visible; }
.modal-box {
  width: min(460px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 24px 64px rgba(214, 116, 156, 0.35);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.25s ease;
}
.overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-box h2 { font-size: 20px; margin-bottom: 10px; text-align: center; }
.victory-box { border-color: rgba(245, 196, 81, 0.5); box-shadow: 0 0 60px rgba(232, 154, 42, 0.25), 0 24px 64px rgba(214, 116, 156, 0.35); }
.detail-list { margin: 8px 0; }
.offline-sum {
  text-align: center;
  font-size: 15px;
  margin-top: 12px;
  color: var(--text-dim);
}
.offline-sum b { font-size: 22px; margin-left: 6px; }

/* ============ スクロールバー ============ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #33404f; }

/* ============ レスポンシブ ============ */
@media (max-width: 1080px) {
  #side-col { width: 320px; }
  .hud-left, .hud-right { min-width: 0; }
  .brand-chip { display: none; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  #layout { flex-direction: column; height: auto; }
  #hint-bar:not(.visible) + #layout { height: auto; }
  #industries-list { grid-template-columns: 1fr; overflow: visible; }
  #side-col { width: 100%; }
  #side-content { max-height: 420px; }
  #cash-display { font-size: 22px; }
  .logo { display: none; }
}

/* ---------- KanaWorks_AI クレジット ---------- */
.kw-credit {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 16px; padding: 6px 16px 6px 8px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: #93a1b3; font-size: 12.5px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.kw-credit img { width: 28px; height: 28px; display: block; }
.kw-credit b { color: var(--gold); }
.kw-credit:hover {
  transform: translateY(-2px);
  border-color: var(--gold-dark);
  box-shadow: 0 6px 18px rgba(214, 116, 156, 0.25);
}

/* ---------- i18n: ミステリーカードの文言 ---------- */
html[lang="en"] .ind-card.mystery::after { content: '🔍 ??? Revealed once the previous business grows'; }
html[lang="zh-CN"] .ind-card.mystery::after { content: '🔍 ？？？ 发展前一个事业后揭晓'; }

/* ============================================================
 * けもみみ看板娘テーマ（生成アート）
 * ============================================================ */
/* タイトル画面：キーアート背景＋クリームカード */
#screen-title {
  background:
    linear-gradient(rgba(255, 245, 250, .30), rgba(255, 238, 246, .55)),
    url('art/title-keyart.jpg') center / cover no-repeat;
}
.title-inner {
  background: rgba(255, 253, 248, .88);
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(214, 116, 156, .3);
  backdrop-filter: blur(6px);
  padding: 18px !important;
}
.hidden-emoji { display: none; }

/* マスコット（ステッカー風＋ぷかぷかアニメ） */
.title-mascot {
  width: 150px; height: 225px;
  margin: 0 auto 6px;
  background: url('art/mascot.jpg') center / cover no-repeat;
  border-radius: 22px;
  border: 4px solid #fff;
  box-shadow: 0 10px 26px rgba(214, 116, 156, .35);
  animation: mascotBob 3s ease-in-out infinite;
}
@keyframes mascotBob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-9px) rotate(1.2deg); }
}

/* HUD：パステル空の帯 */
#hud {
  background:
    linear-gradient(180deg, rgba(255, 250, 245, .55), rgba(255, 240, 247, .75)),
    url('art/header-bg.jpg') center / cover no-repeat;
}

/* 事業アイコン（生成アート版） */
.ind-art {
  position: absolute; inset: 3px;
  border-radius: 12px;
  background-color: #fff6ee;
}
.ind-icon { position: relative; overflow: hidden; }
.ind-icon:hover .ind-art { animation: iconWiggle .5s ease; }
@keyframes iconWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-5deg) scale(1.06); }
  70% { transform: rotate(4deg) scale(1.04); }
}

/* 看板娘（人材タブ） */
.row-icon.girl-art {
  width: 52px; height: 52px;
  border-radius: 14px;
  border: 2px solid #fff;
  background-color: #fff6ee;
  box-shadow: 0 4px 10px rgba(214, 116, 156, .25);
  transition: transform .18s ease;
}
.panel-row:hover .row-icon.girl-art { transform: scale(1.12) rotate(-2deg); }

/* ============================================================
 * モバイル対応強化
 * ============================================================ */
button, .ind-icon, .tab-btn { touch-action: manipulation; }
@media (max-width: 860px) {
  #hud { height: auto; min-height: 56px; padding: 6px 12px; flex-wrap: wrap; gap: 4px; }
  .hud-center { order: -1; width: 100%; text-align: center; }
  #cash-display { font-size: 24px; }
  #income-display { font-size: 12px; }
  .icon-btn { width: 42px; height: 42px; }
  #side-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #side-tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; padding: 10px 14px; font-size: 13px; }
  #side-content { max-height: none; }
  .btn-buy { min-height: 46px; font-size: 14px; }
  .btn-small { padding: 10px 14px; font-size: 13px; min-height: 40px; }
  .btn-big { min-height: 48px; }
  .ind-icon { width: 74px; height: 74px; }
}
@media (max-width: 480px) {
  #layout { padding: 8px 10px; gap: 10px; }
  .ind-icon { width: 64px; height: 64px; }
  .ind-name { font-size: 15px; }
  .title-mascot { width: 110px; height: 165px; }
  #screen-title h1 { font-size: 26px; }
  .title-help li { font-size: 12px; line-height: 1.7; }
  .buy-mode-btn { padding: 8px 10px; }
  .row-icon.girl-art { width: 46px; height: 46px; }
  .kw-credit { flex-wrap: wrap; justify-content: center; }
}

/* ============================================================
 * イベント＆演出（ラッキースター / フィーバー / 看板娘 / お祝い）
 * ============================================================ */
/* ラッキースター（画面を横切る） */
#lucky-star {
  position: fixed; z-index: 900;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid #fff;
  background-color: #fff6ee;
  box-shadow: 0 0 24px rgba(255, 200, 60, .8), 0 6px 16px rgba(214, 116, 156, .35);
  cursor: pointer;
  animation: starPulse .8s ease-in-out infinite alternate;
}
#lucky-star.hidden { display: none; }
@keyframes starPulse { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.12) rotate(6deg); } }

/* フィーバー中のHUDチップ */
#fever-chip {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 800;
  padding: 6px 18px; border-radius: 999px;
  background: linear-gradient(90deg, #ffb347, #ff7fb0, #b98aff);
  color: #fff; font-weight: 900; font-size: 14px;
  box-shadow: 0 6px 20px rgba(255, 127, 176, .5);
  animation: feverGlow 1s ease-in-out infinite alternate;
}
#fever-chip.hidden { display: none; }
@keyframes feverGlow { from { box-shadow: 0 6px 20px rgba(255,127,176,.5); } to { box-shadow: 0 6px 32px rgba(255,179,71,.8); } }

/* ラッシュアワー中の事業カード */
.ind-card.rush {
  border-color: #ffb347;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, .45), 0 8px 24px rgba(255, 179, 71, .35);
  animation: rushGlow 1s ease-in-out infinite alternate;
}
@keyframes rushGlow { from { box-shadow: 0 0 0 3px rgba(255,179,71,.35); } to { box-shadow: 0 0 0 5px rgba(255,179,71,.6); } }
.rush-tag {
  position: absolute; top: -10px; right: 12px;
  padding: 3px 12px; border-radius: 999px;
  background: linear-gradient(90deg, #ffb347, #ff8a5c);
  color: #fff; font-size: 11.5px; font-weight: 900;
  box-shadow: 0 4px 10px rgba(255, 150, 60, .5);
}
.ind-card { position: relative; }

/* 看板娘アバター（事業カード上） */
.ind-girl {
  position: absolute; top: -12px; left: -10px;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid #fff;
  background-color: #fff6ee;
  box-shadow: 0 4px 12px rgba(214, 116, 156, .35);
  cursor: pointer; z-index: 3;
  transition: transform .15s ease;
}
.ind-girl:hover { transform: scale(1.15) rotate(-4deg); }
.girl-bubble {
  position: absolute; top: -14px; left: 46px;
  max-width: 240px;
  padding: 8px 14px;
  background: #fff;
  border: 2px solid #ffc3d9;
  border-radius: 16px 16px 16px 4px;
  color: #6d4a5c; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(214, 116, 156, .3);
  z-index: 4; pointer-events: none;
  animation: bubblePop .25s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes bubblePop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* お祝いオーバーレイ */
#celebrate {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 240, 247, .55);
  backdrop-filter: blur(3px);
  pointer-events: none;
}
#celebrate.hidden { display: none; }
.celebrate-card {
  background: #fffdf8;
  border: 3px solid #ffc3d9;
  border-radius: 26px;
  padding: 20px 34px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(214, 116, 156, .45);
  animation: celebIn .5s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes celebIn { from { transform: scale(.4) rotate(-6deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.celebrate-girl {
  width: 150px; height: 150px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 4px solid #ffd9e8;
  background-color: #fff6ee;
  box-shadow: 0 8px 22px rgba(214, 116, 156, .35);
  animation: celebGirlBounce .6s ease-in-out infinite alternate;
}
@keyframes celebGirlBounce { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-8px) rotate(2deg); } }
.celebrate-title { font-size: 20px; font-weight: 900; color: #e8557f; margin-bottom: 4px; }
.celebrate-sub { font-size: 13.5px; color: var(--text-dim); font-weight: 700; }
/* 紙吹雪 */
.confetti {
  position: fixed; top: -14px;
  width: 10px; height: 14px;
  border-radius: 3px;
  z-index: 940; pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .7; }
}
/* ハート粒子 */
.heart-pop {
  position: fixed;
  font-size: 18px;
  z-index: 940; pointer-events: none;
  animation: heartUp 1s ease-out forwards;
}
@keyframes heartUp {
  from { transform: translateY(0) scale(.6); opacity: 1; }
  to { transform: translateY(-70px) scale(1.3); opacity: 0; }
}

/* ============================================================
 * 修正1-5 追加スタイル
 * ============================================================ */
/* BGM音量 */
.bgm-vol-row {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 4px; padding: 8px 12px;
  background: rgba(255, 240, 247, .8);
  border: 1px solid var(--line);
  border-radius: 12px; font-size: 13px; color: var(--text);
}
.bgm-vol-row b { min-width: 28px; text-align: right; color: var(--gold); }
.bgm-vol-row input[type="range"] { flex: 1; accent-color: #f77fb0; cursor: pointer; }

/* 社長のお手伝いエフェクト */
.ind-icon.boss-help { animation: bossHelp .22s ease; }
@keyframes bossHelp {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232,154,42,.6); }
  50% { transform: scale(1.14); box-shadow: 0 0 0 8px rgba(232,154,42,0); }
  100% { transform: scale(1); }
}
.float-up {
  position: fixed; z-index: 930; pointer-events: none;
  font-weight: 900; font-size: 15px;
  text-shadow: 0 1px 3px rgba(255,255,255,.9);
  animation: floatUp 1s ease-out forwards;
}
@keyframes floatUp {
  from { transform: translate(-50%, 0) scale(.8); opacity: 1; }
  to { transform: translate(-50%, -54px) scale(1.1); opacity: 0; }
}

/* 看板娘ごきげん / ふきげん */
.ind-girl.mood-happy {
  box-shadow: 0 0 0 3px #ffd166, 0 4px 16px rgba(255,180,60,.6);
  animation: happyBounce 1.4s ease-in-out infinite;
}
@keyframes happyBounce { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-4px);} }
.ind-girl.mood-grumpy {
  box-shadow: 0 0 0 3px #9aa7c7, 0 4px 12px rgba(90,100,140,.5);
  filter: saturate(.6) brightness(.92);
}
.ind-girl.shake { animation: girlShake .4s ease; }
@keyframes girlShake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-4px) rotate(-4deg);} 75%{transform:translateX(4px) rotate(4deg);} }
.mood-face {
  position: absolute; top: -10px; right: -8px;
  font-size: 18px; z-index: 5;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

/* ============================================================
 * 看板娘ランク（新人→中堅→ベテラン→伝説）・修正5
 * ============================================================ */
/* 人材パネルのアバターにランク枠 */
.row-icon.girl-art { position: relative; }
.row-icon.girl-art.rank-a0 { border-color: #c9a06a; }                 /* 銅 */
.row-icon.girl-art.rank-a1 { border-color: #b9c6da; }                 /* 銀 */
.row-icon.girl-art.rank-a2 { border-color: #ffcf5c; box-shadow: 0 0 0 2px rgba(255,207,92,.35), 0 4px 10px rgba(214,116,156,.25); } /* 金 */
.row-icon.girl-art.rank-a3 {                                          /* 虹（伝説） */
  border-color: #ff8ad1;
  box-shadow: 0 0 0 2px rgba(255,138,209,.5), 0 0 14px rgba(183,138,255,.7);
  animation: rankGlow 1.6s ease-in-out infinite alternate;
}
@keyframes rankGlow {
  from { box-shadow: 0 0 0 2px rgba(255,138,209,.5), 0 0 10px rgba(183,138,255,.55); }
  to   { box-shadow: 0 0 0 2px rgba(255,207,92,.6), 0 0 18px rgba(255,138,209,.85); }
}
/* アバター上の星／王冠バッジ */
.rank-star {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  padding: 1px 6px; border-radius: 999px;
  background: #fffdf8; border: 1.5px solid #ffc3d9;
  font-size: 10px; line-height: 1.3; white-space: nowrap;
  color: #e8557f; font-weight: 900;
  box-shadow: 0 2px 5px rgba(214,116,156,.3);
}
/* ランク表示行（名前の下） */
.rank-line { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.rank-tag {
  padding: 1px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 900; color: #fff;
  background: #c9a06a;
}
.rank-tag.rank-a0 { background: #c9a06a; }
.rank-tag.rank-a1 { background: #93a6c0; }
.rank-tag.rank-a2 { background: #eab53a; }
.rank-tag.rank-a3 { background: linear-gradient(90deg, #ff9cc0, #b98aff, #ffcf5c); }
.rank-mult { font-size: 11.5px; font-weight: 800; color: var(--gold); }
/* 事業カードの看板娘に付く小さなランクピップ */
.ind-girl .rank-pip {
  position: absolute; bottom: -6px; right: -6px; z-index: 6;
  padding: 0 5px; border-radius: 999px;
  background: #fffdf8; border: 1.5px solid #ffc3d9;
  font-size: 10px; font-weight: 900; color: #e8557f;
  box-shadow: 0 2px 5px rgba(214,116,156,.35);
}
.ind-girl .rank-pip.rank-a3 { border-color: #ffcf5c; }

/* ============================================================
 * 統計パネルのグループ見出し・修正4
 * ============================================================ */
.stats-head {
  margin: 14px 0 6px; padding: 4px 10px;
  font-size: 13px; font-weight: 900; color: #e8557f;
  background: linear-gradient(90deg, rgba(255,195,217,.35), rgba(255,195,217,0));
  border-left: 4px solid #ffc3d9; border-radius: 6px;
}
.stats-head:first-child { margin-top: 2px; }

/* おねだりバブル */
.need-bubble {
  position: absolute; top: -14px; left: 44px; z-index: 6;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: linear-gradient(180deg, #fff, #fff2f8);
  border: 2px solid #ffb3d1;
  border-radius: 16px 16px 16px 4px;
  color: #6d4a5c; font-size: 12.5px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(214,116,156,.35);
  cursor: pointer; white-space: nowrap;
  animation: needPop .3s cubic-bezier(.2,1.5,.4,1), needWobble 1.6s ease-in-out .3s infinite;
}
.need-bubble:hover { transform: scale(1.06); }
.need-bubble .need-heart { color: #ff5a8a; font-size: 15px; animation: heartBeat .8s ease-in-out infinite; }
@keyframes needPop { from{transform:scale(.3);opacity:0;} to{transform:scale(1);opacity:1;} }
@keyframes needWobble { 0%,100%{transform:rotate(-1.5deg);} 50%{transform:rotate(1.5deg);} }
@keyframes heartBeat { 0%,100%{transform:scale(1);} 50%{transform:scale(1.3);} }

/* ============================================================
 * チュートリアル
 * ============================================================ */
#tutorial {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(60, 30, 45, .55);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 16px 32px;
}
#tutorial.hidden { display: none; }
.tut-spotlight {
  position: fixed; display: none;
  border: 3px solid #ffd166; border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(60,30,45,.55), 0 0 20px rgba(255,209,102,.9);
  pointer-events: none; z-index: 1001;
  transition: all .25s ease;
}
.tut-card {
  position: relative; z-index: 1002;
  width: 100%; max-width: 460px;
  background: #fffdf8;
  border: 3px solid #ffc3d9;
  border-radius: 24px;
  padding: 18px 22px 18px 130px;
  min-height: 132px;
  box-shadow: 0 20px 50px rgba(214,116,156,.5);
  animation: tutIn .4s cubic-bezier(.2,1.4,.4,1);
}
@keyframes tutIn { from{transform:translateY(40px);opacity:0;} to{transform:translateY(0);opacity:1;} }
.tut-girl {
  position: absolute; left: -10px; bottom: 0;
  width: 132px; height: 176px;
  background-color: transparent;
  background-size: cover; background-position: center top;
  filter: drop-shadow(0 6px 12px rgba(214,116,156,.4));
  animation: tutGirlBob 2.6s ease-in-out infinite;
}
@keyframes tutGirlBob { 0%,100%{transform:translateY(0) rotate(-1deg);} 50%{transform:translateY(-6px) rotate(1deg);} }
.tut-title { font-size: 17px; font-weight: 900; color: #e8557f; margin-bottom: 6px; }
.tut-body { font-size: 13.5px; line-height: 1.65; color: var(--text); }
.tut-dots { display: flex; gap: 6px; margin: 12px 0 10px; }
.tut-dot { width: 8px; height: 8px; border-radius: 50%; background: #f0d0dd; transition: all .2s; }
.tut-dot.on { background: #f77fb0; transform: scale(1.3); }
.tut-btns { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tut-btn-skip {
  background: none; border: none; color: var(--text-dim);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.tut-btn-next {
  padding: 10px 24px; border-radius: 999px;
  background: linear-gradient(180deg, #ff9cc0, #f069a0);
  color: #fff; font-size: 14.5px; font-weight: 900; cursor: pointer;
  box-shadow: 0 6px 16px rgba(240,105,160,.5);
}
.tut-btn-next:active { transform: translateY(1px); }
@media (max-width: 480px) {
  .tut-card { padding-left: 110px; min-height: 120px; }
  .tut-girl { width: 108px; height: 146px; }
  .tut-title { font-size: 15px; }
  .tut-body { font-size: 12.5px; }
}

/* ============================================================
 * 常駐メイド管家「リリィ」
 * ============================================================ */
#butler {
  position: fixed; right: 14px; bottom: 16px; z-index: 850;
  width: 92px; height: 92px;
}
#butler.hidden { display: none; }
#butler-avatar {
  width: 92px; height: 92px; border-radius: 50%;
  background-image: url('art/butler.jpg');
  background-size: 235% auto;
  background-position: 50% 1%;
  background-color: #fff6ee;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(214, 116, 156, .4);
  cursor: pointer;
  animation: butlerBob 3.4s ease-in-out infinite;
  transition: transform .15s ease;
}
#butler-avatar:hover { transform: scale(1.08); }
#butler-avatar.talking { animation: butlerTalk .5s ease-in-out infinite; }
@keyframes butlerBob { 0%,100%{transform:translateY(0) rotate(-1.5deg);} 50%{transform:translateY(-5px) rotate(1.5deg);} }
@keyframes butlerTalk { 0%,100%{transform:translateY(0) scale(1);} 50%{transform:translateY(-3px) scale(1.03);} }
/* お知らせマーク */
#butler-avatar::after {
  content: '？'; position: absolute; top: -4px; right: -4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #f77fb0; color: #fff; font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(214,116,156,.4);
}
#butler-bubble {
  position: absolute; bottom: 102px; right: 0;
  width: 240px; max-width: 74vw;
  padding: 12px 16px;
  background: #fffdf8;
  border: 2px solid #ffc3d9;
  border-radius: 16px 16px 4px 16px;
  color: #6d4a5c; font-size: 13px; font-weight: 700; line-height: 1.6;
  box-shadow: 0 8px 22px rgba(214, 116, 156, .35);
  cursor: pointer;
  animation: bubblePop .3s cubic-bezier(.2,1.4,.4,1);
}
#butler-bubble.hidden { display: none; }
#butler-bubble::after {
  content: ''; position: absolute; right: 26px; bottom: -9px;
  border: 9px solid transparent; border-top-color: #ffc3d9; border-bottom: 0;
}

/* リリィのご案内パネル */
#butler-guide {
  position: fixed; inset: 0; z-index: 980;
  background: rgba(60, 30, 45, .5);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#butler-guide.hidden { display: none; }
.bg-card {
  position: relative;
  width: 100%; max-width: 480px;
  max-height: 86vh; overflow-y: auto;
  background: #fffdf8;
  border: 3px solid #ffc3d9;
  border-radius: 24px;
  padding: 20px 24px 22px 132px;
  box-shadow: 0 24px 60px rgba(214, 116, 156, .5);
  animation: tutIn .4s cubic-bezier(.2,1.4,.4,1);
}
.bg-portrait {
  position: absolute; left: -4px; bottom: 0;
  width: 140px; height: 218px;
  background-image: url('art/butler-cut.png');   /* 透過切り抜き（白背景を除去） */
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
  filter: drop-shadow(0 6px 12px rgba(214,116,156,.35));
  /* 立ち絵は静止（アニメーションで排版が揺れるのを防ぐ） */
}
.bg-title {
  font-size: 18px; font-weight: 900; color: #e8557f;
  margin-bottom: 10px;
}
.bg-body { font-size: 13px; line-height: 1.7; color: var(--text); }
.bg-body p { margin-bottom: 10px; }
.bg-body b { color: #e8557f; }
.bg-close {
  position: absolute; top: 12px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(247,127,176,.15); border: none;
  color: #e8557f; font-size: 15px; font-weight: 900; cursor: pointer;
}
.bg-ok {
  display: block; width: 100%; margin-top: 14px;
  padding: 12px; border-radius: 999px;
  background: linear-gradient(180deg, #ff9cc0, #f069a0);
  color: #fff; font-size: 14.5px; font-weight: 900; cursor: pointer;
  box-shadow: 0 6px 16px rgba(240,105,160,.5);
}
@media (max-width: 480px) {
  #butler { width: 74px; height: 74px; right: 10px; bottom: 12px; }
  #butler-avatar { width: 74px; height: 74px; }
  #butler-bubble { bottom: 84px; width: 200px; }
  .bg-card { padding-left: 108px; }
  .bg-portrait { width: 112px; height: 168px; }
}
