/**
 * プロジェクトセレクタースタイル
 * プロジェクト選択UIのスタイル定義
 */

.project-hotbar-hidden-select {
  display: none;
}

.project-hotbar {
  position: relative;
  display: inline-block;
  width: 185px; /* 元selectと同じサイズ */
  height: 30px; /* 元selectと同じ高さ */
  max-width: 100%;
  overflow: visible; /* 展開時は下に伸びる */
  box-sizing: border-box;
  /* 🎨テーマではなく「固定カテゴリの色」に追従（--inline-accent は game-base.css で供給） */
  --hotbar-accent: var(--inline-accent, #0ea5e9);
  /* 眩しさを抑えた“落ち着いたクリーム”（面はカテゴリ色を混ぜない） */
  --hotbar-cream: rgba(249, 244, 232, 0.98);
  --hotbar-cream-ink: rgba(17, 24, 39, 0.08);
}

/* “変身”する同一ボックス（常時このDOMが存在する） */
.project-hotbar-shell {
  position: absolute;
  inset: 0 auto auto 0; /* top-left */
  width: 100%;
  max-height: 30px; /* 閉じてる時は1行だけ */
  border-radius: 10px;
  /* クリーム統一（面はカテゴリ色を混ぜない） */
  border: 2px solid color-mix(in srgb, var(--hotbar-accent) 18%, rgba(243, 236, 220, 1)); /* 外枠だけカテゴリ色 */
  background: var(--hotbar-cream);
  box-shadow:
    0 10px 18px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(17, 24, 39, 0.06);
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  transition: max-height 220ms ease, box-shadow 140ms ease, border-color 140ms ease;
  z-index: 1000; /* モーダル（mmx-modal-root, z-index: 200000）より下にして悪目立ち防止 */
  /* border分で外形が増えないように（185×30を厳守） */
  box-sizing: border-box;
}

.project-hotbar-shell::after {
  content: "";
  position: absolute;
  inset: -40%;
  /* ふんわり質感（カテゴリ色は混ぜない） */
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), transparent 60%);
  opacity: 0.55;
  pointer-events: none;
}

.project-hotbar-shellHeader {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  /* ボタン自体をエンボス（盛り上げ）加工 */
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #ffffff 45%, var(--hotbar-cream)) 0%,
    var(--hotbar-cream) 55%,
    color-mix(in srgb, #111827 6%, var(--hotbar-cream)) 100%
  );
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid color-mix(in srgb, #111827 10%, var(--hotbar-cream));
  position: relative;
  z-index: 1;
  border-radius: 10px;
  /* 二重線はやめて、段差（エンボス）で“ボタン感”を出す */
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 6px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -2px 0 rgba(17, 24, 39, 0.06);
}

.project-hotbar-shellHeader:hover {
  filter: brightness(0.99);
}

.project-hotbar-shell.isOpen .project-hotbar-shellHeader {
  /* 展開中はほんの少しだけ“押し込み”に寄せる */
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 6px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 0 rgba(17, 24, 39, 0.10);
}

.project-hotbar-shellHeaderLabel {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.project-hotbar-shell.isOpen {
  max-height: 360px;
  border-color: color-mix(in srgb, var(--hotbar-accent) 24%, rgba(243, 236, 220, 1));
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.16),
    0 0 0 3px color-mix(in srgb, var(--hotbar-accent) 8%, transparent), /* 外周だけカテゴリ色 */
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(17, 24, 39, 0.06);
}

.project-hotbar.isShiftHold .project-hotbar-shell {
  border-color: color-mix(in srgb, var(--hotbar-accent) 28%, rgba(243, 236, 220, 1));
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.18),
    0 0 0 3px color-mix(in srgb, var(--hotbar-accent) 10%, transparent), /* 外周だけカテゴリ色 */
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 -1px 0 rgba(17, 24, 39, 0.06);
}

.project-hotbar-overlayListWrap {
  position: relative;
  padding: 8px;
  /* 展開面もクリームで統一（透けて暗くならない） */
  background: var(--hotbar-cream);
}

.project-hotbar-overlayList {
  position: relative;
  display: grid;
  grid-template-rows: repeat(7, 34px);
  gap: 0;
}

.project-hotbar-overlayItem {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.34);
}

.project-hotbar-overlayItem.isEmpty {
  opacity: 0.35;
  cursor: default;
}

.project-hotbar-overlayItem:hover:not(.isEmpty) {
  /* 面にはカテゴリ色を混ぜない（クリーム統一） */
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(17, 24, 39, 0.12);
}

.project-hotbar-overlaySlot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  color: rgba(17, 24, 39, 0.78);
  /* 番号バッジを“丁寧に塗る”（クリーム塗り + ハイライト + 陰影） */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(244, 236, 222, 0.92) 100%);
  border: 1px solid rgba(17, 24, 39, 0.16);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(17, 24, 39, 0.06);
  flex: 0 0 auto;
}

.project-hotbar-overlayCursor {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 34px;
  border-radius: 10px;
  /* 選択行だけ：面を“薄っすらカテゴリ色”で均一に塗る */
  background: color-mix(in srgb, var(--hotbar-accent) 12%, var(--hotbar-cream));
  /* 選択行は濃いカテゴリ色で囲う（分かりやすさ優先） */
  border: 2px solid color-mix(in srgb, var(--hotbar-accent) 82%, rgba(17, 24, 39, 0.18));
  box-shadow:
    0 3px 8px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(17, 24, 39, 0.06);
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  will-change: transform;
}

/* 左の番号バッジに対する“塗り演出/アニメーション”は不要なので入れない */

.project-selector-container {
  position: relative;
  display: inline-block;
}

.project-selector-toggle {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.project-selector-toggle:hover {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.project-selector-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.project-selector-option {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f1f5f9;
}

.project-selector-option:last-child {
  border-bottom: none;
}

.project-selector-option:hover {
  background: #f8fafc;
}

.project-selector-option.selected {
  background: #eff6ff;
  color: #0ea5e9;
  font-weight: 600;
}

/* NOTE:
  以前は :root[data-theme="mimosa/sakura/green"] のテーマ上書きで色を変えていたが、
  「固定カテゴリの色（data-active-category-index）」で統一するため削除した。
*/
