/* ======================================
   料金シミュレーター スタイルシート
====================================== */

/* === フォント定義 === */
@font-face {
  font-family: '新レトロ丸ゴシック';
  src: url('assets/fonts/ShinRetroMaruGothic-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'LINE Seed JP';
  src: url('assets/fonts/LINESeedJP_A_OTF_Eb.otf') format('opentype');
  font-weight: 800;
}
@font-face {
  font-family: '07にくまるフォント';
  src: url('assets/fonts/07にくまるフォント.otf') format('opentype');
}
@font-face {
  font-family: 'ふんわりラウンド';
  src: url('assets/fonts/funwari-round.otf') format('opentype');
}

/* === リセット・ベース === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-title:   '新レトロ丸ゴシック', 'Hiragino Maru Gothic Pro', sans-serif;
  --font-en:      'LINE Seed JP', system-ui, sans-serif;
  --font-niku:    '07にくまるフォント', 'Hiragino Maru Gothic Pro', sans-serif;
  --font-funwari: 'ふんわりラウンド', 'Hiragino Maru Gothic Pro', sans-serif;

  --color-bg:      #FFFAFF;
  --color-works:   #FFEEF4;
  --color-sidebar: #F8D8E8;
  --color-border:  #EAB5C5;
  --color-accent:  #D4879A;
  --color-btn:     #D4879A;
}

html, body {
  min-height: 100%;
  font-family: var(--font-title);
  background-color: var(--color-works);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 40px,
      color-mix(in srgb, var(--color-border) 10%, transparent) 40px,
      color-mix(in srgb, var(--color-border) 10%, transparent) 80px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0px, transparent 40px,
      color-mix(in srgb, var(--color-border) 10%, transparent) 40px,
      color-mix(in srgb, var(--color-border) 10%, transparent) 80px
    );
  color: #4a2a3a;
  transition: background-color 0.6s ease;
}

body {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.6s ease, filter 0.6s ease;
}
body.is-loaded { opacity: 1; filter: none; }

/* === カスタムカーソル === */
*, *::before, *::after { cursor: none !important; }
#custom-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 20px;
  pointer-events: none;
  z-index: 99999;
  transition: width 0.18s ease;
  will-change: left, top;
}
#custom-cursor img { width: 100%; height: auto; display: block; }
#custom-cursor.is-large { width: 30px; }

/* === ヘッダー === */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
  gap: 26px;
  background: transparent;
  position: relative;
  transition: background 0.6s ease;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px max(28px, calc((100% - 760px) / 2)) 10px;
  gap: 10px;
  background: rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(74,42,58,0.15);
}

/* タイトルゾーン */
.sim-title-zone {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 16px;
  position: relative;
  background:
    radial-gradient(circle at 50% 100%, rgba(255,255,255,0.85) 40px, transparent 30px)
      top / 69px 40px repeat-x,
    linear-gradient(to bottom, transparent 40px, rgba(255,255,255,0.85) 40px);
}
.sim-title-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 100%, transparent 37px, var(--color-sidebar) 37px, var(--color-sidebar) 40px, transparent 41px)
      top / 69px 40px repeat-x;
  transition: background 0.6s ease;
}

/* 料金シミュレータータイトル */
.sim-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 100px 0 4px;
  position: relative;
}
.sim-page-title {
  font-family: var(--font-title);
  font-size: 40px;
  color: var(--color-accent);
  letter-spacing: 0.06em;
  line-height: 1;
  transition: color 0.6s ease;
}
.sim-sparkle {
  font-size: 18px;
  color: var(--color-accent);
  opacity: 0.7;
  animation: sparkle 2.8s ease-in-out infinite;
  transition: color 0.6s ease;
}
.sim-sparkle:last-child { animation-delay: 1.4s; }

/* タイトル周囲の散らばり✦ */
.sim-deco {
  position: absolute;
  color: var(--color-accent);
  padding: 100px 0 4px;
  pointer-events: none;
  animation: sparkle 2.8s ease-in-out infinite;
  transition: color 0.6s ease;
}
.sim-deco.d1 { top: -14px; left:  40px; font-size: 10px; opacity: 0.55; animation-delay: 0.4s; }
.sim-deco.d2 { top:  -6px; left:  80px; font-size:  7px; opacity: 0.40; animation-delay: 1.2s; }
.sim-deco.d3 { top: -16px; right: 40px; font-size: 10px; opacity: 0.55; animation-delay: 0.9s; }
.sim-deco.d4 { top:  -4px; right: 80px; font-size:  7px; opacity: 0.40; animation-delay: 1.9s; }
.sim-deco.d5 { bottom: -10px; left: 60px;  font-size: 8px; opacity: 0.35; animation-delay: 2.3s; }
.sim-deco.d6 { bottom:  -8px; right: 60px; font-size: 6px; opacity: 0.30; animation-delay: 0.7s; }

/* 戻るリンク群 */
.back-nav {
  display: flex;
  padding: 30px 0 4px;
  align-items: center;
  flex-wrap: wrap;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-niku);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 5px 14px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.6s ease;
}
.back-link:hover { background: var(--color-accent); color: #fff; }

/* 右側アイコン群 */
.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav-home {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--color-accent);
  opacity: 0.75;
  transition: opacity 0.2s;
}
.header-nav-home:hover { opacity: 1; }

.header-nav-home-text {
  font-family: var(--font-niku);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  transition: color 0.6s ease;
}

.header-nav-sep {
  color: rgba(74,42,58,0.3);
  font-size: 14px;
  line-height: 1;
  user-select: none;
}

.header-top-divider {
  display: block;
  width: 1px;
  height: 22px;
  background: rgba(74,42,58,0.2);
  flex-shrink: 0;
}

.header-icon-img {
  width: 30px; height: 30px;
  object-fit: contain;
  display: block;
  opacity: 0.75;
}
.header-icon-img:hover { opacity: 1; }

.header-icon-svg {
  width: 30px; height: 30px;
  display: block;
  opacity: 0.75;
  color: var(--color-accent);
}
.header-icon-svg:hover { opacity: 1; }

/* === メインコンテンツ === */
.sim-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 50px 100px 180px;
  background-color: rgba(255,255,255,0.85);
}

.sim-desc {
  text-align: center;
  font-size: 13px;
  color: rgba(74,42,58,0.5);
  margin-bottom: 32px;
  font-family: var(--font-title);
  letter-spacing: 0.04em;
}

/* === 説明文ラッパー（ウサギ絶対配置の基準） === */
.sim-hero-wrapper {
  position: relative;
  margin-bottom: 50px;
}
/* === 説明文ボックス === */
.sim-hero-desc {
  display: flex;
  align-items: center;
  gap: 30px;
  background: var(--color-works);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 14px 100px 14px 18px;
}
.sim-hero-deco {
  flex-shrink: 0;
  display: flex;
  align-self: flex-start;
  margin-top: 0px;
  margin-left: -10px;
}
.sim-hero-deco svg {
  transform: rotate(-15deg);
  transform-origin: top left;
}
.sim-hero-text {
  flex: 1;
  font-family: var(--font-title);
  font-size: 13px;
  line-height: 1.9;
  color: rgba(74,42,58,0.72);
  letter-spacing: 0.04em;
}
.sim-hero-rabbit {
  position: absolute;
  right: 150px;
  bottom: 5px;
  display: flex;
  align-items: flex-end;
}
.sim-hero-rabbit .rabbit-svg {
  transform-origin: bottom center;
  transform-box: fill-box;
  animation: ear-pico 1.6s ease-in-out infinite;
}
@keyframes ear-pico {
  0%, 100%  { transform: scaleY(1)    translateY(0); }
  45%, 55%  { transform: scaleY(0.88) translateY(4px); }
}

/* === ウサギのハート === */
.rheart {
  position: absolute;
  bottom: 20px;
  opacity: 0;
  animation: heart-float 2.6s ease-in-out infinite;
  color: var(--color-accent);
  font-size: 22px;
  line-height: 1;
}
.rheart::after {
  content: '♥';
  opacity: 0.85;
}
/* 左側3個 */
.rh1 { left: -50px; animation-delay: 0s; }
.rh2 { left: -64px; animation-delay: 0.85s;  font-size: 16px; }
.rh3 { left: -38px; animation-delay: 1.7s;   font-size: 13px; }
/* 右側3個 */
.rh4 { right: -50px; animation-delay: 0.42s; }
.rh5 { right: -64px; animation-delay: 1.28s; font-size: 16px; }
.rh6 { right: -38px; animation-delay: 2.1s;  font-size: 13px; }

@keyframes heart-float {
  0%   { transform: translateY(0)    scale(0.4); opacity: 0; }
  12%  { opacity: 1; }
  80%  { opacity: 0.3; }
  100% { transform: translateY(-52px) scale(1.0); opacity: 0; }
}

/* === 合計カード右エリア（ボタン＋電卓） === */
.sim-total-top-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 28px;
}
.sim-calc-svg {
  width: 72px;
  height: auto;
  display: block;
  transform: rotate(15deg);
  transform-origin: center;
}

/* === 追加キャラクター（カードヘッダー内） === */
.sim-extra-char-wrap {
  margin-left: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.sim-extra-char-label {
  font-family: var(--font-title);
  font-size: 11px;
  color: var(--color-accent);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.sim-extra-char-price {
  font-size: 11px;
  color: rgba(74,42,58,0.45);
  white-space: nowrap;
}

/* === タブ === */
.sim-tabs {
  position: sticky;
  top: 8px;
  z-index: 200;
  width: min(400px, 92vw);
  margin: 0 auto 32px;
  background: var(--color-sidebar);
  padding: 8px 12px;
  box-shadow: 0 4px 12px rgba(74,42,58,0.08);
  border-radius: 999px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  transition: background 0.6s ease;
}

.sim-tab {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 10px;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(74,42,58,0.55);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.sim-tab.is-active {
  background: #fff;
  color: var(--color-accent);
  box-shadow: 0 4px 14px rgba(74,42,58,0.12);
}

/* === セクション切り替え === */
.sim-section { display: none; }
.sim-section.is-active { display: block; }

/* === ベースタイプタブ === */
.sim-base-type-tabs {
  display: flex;
  gap: 8px;
  width: 76%;
  margin: 0 auto 14px;
}

.sim-base-type-tab {
  flex: 1;                          /* コンテナいっぱいに広がる */
  border: 1.5px solid var(--color-border);
  background: transparent;
  border-radius: 10px;
  padding: 12px 6px 10px;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(74,42,58,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s,
              transform 0.22s ease-out, box-shadow 0.22s ease-out;
}
.sim-base-type-tab:hover {
  border-color: var(--color-accent);
  background: var(--color-works);
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(74,42,58,0.1);
}
.sim-base-type-tab.is-active {
  background: var(--color-works);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 4px 14px rgba(74,42,58,0.1);
}

/* タブボタン内のサムネイル画像 */
.base-type-thumb {
  display: block;
  width: 44px;
  height: 68px;
  object-fit: contain;
  object-position: top center;
}

/* 画像ボックス（クロップ用） */
.sim-pose-img-box {
  width: 44px;
  height: 68px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.sim-pose-img-box img {
  width: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
/* 等身クロップ（高さで縦トリミング） */
.crop-bust  img { height: 296px; } /* top 23% ≒ 胸上 */
.crop-waist img { height: 189px; } /* top 36% ≒ 腰上 */
.crop-thigh img { height: 133px; } /* top 51% ≒ 太もも */
.crop-full  img { height:  68px; } /* full */
/* SD比率 */
.crop-sd img {
  height: 68px;
  width: 100%;
  object-fit: contain;
  object-position: center;
}

/* === ポーズ選択グリッド === */
.sim-pose-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
#pose-sd { grid-template-columns: repeat(4, 1fr); }

.sim-pose-card {
  cursor: pointer;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  position: relative;
  transition: border-color 0.15s, background 0.15s,
              transform 0.22s ease-out, box-shadow 0.22s ease-out;
}
.sim-pose-card input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.sim-pose-card:not(:has(input:checked)):hover {
  border-color: var(--color-accent);
  background: var(--color-works);
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(74,42,58,0.1);
}
.sim-pose-card:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-works);
}
/* 選択チェック：丸枠 */
.sim-pose-card:has(input:checked)::before {
  content: '';
  position: absolute;
  top: 5px; right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: #fff;
  box-shadow: 0 1px 4px rgba(74,42,58,0.15);
  animation: checkPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
/* 選択チェック：チェックマーク */
.sim-pose-card:has(input:checked)::after {
  content: '';
  position: absolute;
  top: 10px; right: 11px;
  width: 6px;
  height: 4px;
  border-left: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: rotate(-45deg);
  animation: checkDraw 0.3s 0.25s both;
}
.sim-pose-svg {
  width: 38px;
  height: auto;
  color: var(--color-accent);
  opacity: 0.55;
  transition: opacity 0.15s;
}
.sim-pose-card:has(input:checked) .sim-pose-svg,
.sim-pose-card:hover .sim-pose-svg { opacity: 0.9; }

.sim-pose-name {
  font-size: 10px;
  color: rgba(74,42,58,0.7);
  line-height: 1.35;
}

/* SD頭身の説明文 */
.sim-pose-desc {
  font-size: 9.5px;
  color: rgba(74,42,58,0.5);
  line-height: 1.5;
  text-align: center;
  display: none;
}
.sim-pose-card:has(input:checked) .sim-pose-desc {
  display: block;
}
.sim-pose-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent);
}

@media (max-width: 560px) {
  #pose-normal { grid-template-columns: repeat(2, 1fr); }
  #pose-sd     { grid-template-columns: repeat(2, 1fr); }
  .sim-base-type-tabs { width: 100%; }
}
@media (max-width: 360px) {
  .sim-pose-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === カード === */
.sim-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(74,42,58,0.06);
  border: 1px solid rgba(234,181,197,0.3);
}

.sim-card h2 {
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
  color: rgba(74,42,58,0.45);
}

/* === カードセクションヘッダー（番号バッジ＋英語サブタイトル） === */
.sim-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.sim-card-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.6s ease;
}
.sim-card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sim-card-title-en {
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(74,42,58,0.28);
  font-weight: 800;
  line-height: 1.2;
}
.sim-card-header h2 {
  margin: 0;
  font-size: 13px;
  color: rgba(74,42,58,0.6);
}

/* === 選択肢（カードグリッド型） === */
.sim-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.sim-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  cursor: pointer;
  padding: 14px 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  position: relative;
  text-align: center;
  box-shadow: 0 2px 8px rgba(74,42,58,0.05);
  transition: border-color 0.15s, background 0.15s,
              transform 0.22s ease-out, box-shadow 0.22s ease-out;
}

.sim-option-inline-note {
  display: none;
  width: 100%;
  font-size: 11px;
  color: rgba(74,42,58,0.55);
  line-height: 1.7;
  padding-top: 4px;
  text-align: left;
}
.sim-option-inline-note--warning {
  color: #9a3a3a;
  background: #fdf0f0;
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 2px;
}
.sim-option:hover .sim-option-inline-note,
.sim-option:has(input:checked) .sim-option-inline-note {
  display: block;
}
.sim-option:hover {
  border-color: var(--color-accent);
  background: var(--color-works);
}
.sim-option:not(:has(input:checked)):hover {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(74,42,58,0.12);
}
.sim-option:active {
  transform: scale(0.97);
  transition: transform 0.06s ease;
}
.sim-option:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-works);
  box-shadow: 0 4px 14px rgba(74,42,58,0.1);
}
/* 選択チェック：丸枠 */
.sim-option:has(input:checked)::before {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: #fff;
  box-shadow: 0 1px 4px rgba(74,42,58,0.15);
  animation: checkPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
/* 選択チェック：チェックマーク */
.sim-option:has(input:checked)::after {
  content: '';
  position: absolute;
  top: 13px; right: 12px;
  width: 8px;
  height: 5px;
  border-left: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: rotate(-45deg);
  animation: checkDraw 0.3s 0.25s both;
}

/* 応相談マーク */
.price-consult {
  font-size: 10.5px;
  color: var(--color-accent);
  letter-spacing: 0.04em;
}

/* 入力を視覚的に非表示（機能・アクセシビリティは維持） */
.sim-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.sim-option-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}
.sim-option-name {
  font-size: 12.5px;
  text-align: center;
  line-height: 1.4;
}
.sim-option-price {
  font-size: 11px;
  color: rgba(74,42,58,0.5);
  text-align: center;
}

/* === カウンター === */
.sim-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  font-size: 13.5px;
}
.sim-counter + .sim-counter { margin-top: 8px; }
.sim-counter-label { flex: 1; }
.sim-counter-price {
  font-size: 12px;
  color: rgba(74,42,58,0.5);
  margin-right: 14px;
}
.sim-counter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sim-counter-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.sim-counter-btn:hover {
  background: var(--color-works);
  border-color: var(--color-accent);
}
.sim-counter-num {
  min-width: 24px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

/* === 注意書き === */
.sim-note {
  font-size: 11.5px;
  color: rgba(74,42,58,0.45);
  margin-top: 10px;
  line-height: 1.7;
}

/* === 区切り線 === */
.sim-divider {
  height: 1px;
  background: var(--color-border);
  opacity: 0.3;
  margin: 14px 0;
}

/* === タグ === */
.sim-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.sim-tag--discount  { background: #eaf5ea; color: #3a7a3a; }
.sim-tag--surcharge { background: #fdf0f0; color: #9a3a3a; }
.sim-tag--info      { background: #eef3fd; color: #3a5a9a; }

/* === 上部合計エリア === */
.sim-total-top-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 14px;
  padding: 28px 20px 40px 36px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(74,42,58,0.06);
  border: 1px solid rgba(234,181,197,0.3);
  position: relative;
  transition: background 0.6s ease, border-color 0.6s ease,
              margin-bottom 0s, box-shadow 0s 0.4s;
}
.sim-total-top-card:has(+ .sim-breakdown-panel.is-open) {
  margin-bottom: -15px;
  box-shadow: none;
  transition: background 0.6s ease, border-color 0.6s ease,
              margin-bottom 0s, box-shadow 0s;
}
/* 閉じ始めた瞬間に余白を即戻し */
.sim-total-top-card:has(+ .sim-breakdown-panel .receipt-wrapper.is-closing) {
  margin-bottom: 20px;
  transition: margin-bottom 0s;
}
.sim-total-top-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sim-total-top-label {
  font-family: var(--font-title);
  font-size: 11px;
  color: rgba(74,42,58,0.5);
  letter-spacing: 0.08em;
}
.sim-total-top-card::before {
  content: '✦';
  position: absolute;
  left: 170px; top: 10px;
  font-size: 11px;
  color: var(--color-accent);
  animation: sparkle 2.4s ease-in-out infinite;
  pointer-events: none;
}
.sim-total-top-card::after {
  content: '✦';
  position: absolute;
  left: 148px; bottom: 10px;
  font-size: 7px;
  color: var(--color-accent);
  animation: sparkle 2.4s ease-in-out 0.9s infinite;
  pointer-events: none;
}
.sim-total-top-amount::before {
  content: '✦';
  position: absolute;
  left: -18px; top: 4px;
  font-size: 9px;
  color: var(--color-accent);
  animation: sparkle 2.4s ease-in-out 0.45s infinite;
  pointer-events: none;
}
@keyframes sparkle {
  0%, 100% { opacity: 0.25; transform: scale(0.75) rotate(0deg); }
  50%       { opacity: 0.9;  transform: scale(1.15) rotate(20deg); }
}
.sim-total-top-amount {
  position: relative;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-accent);
  transition: color 0.6s ease;
}
.sim-total-top-amount span {
  font-size: 14px;
  font-weight: 400;
  margin-left: 3px;
  color: rgba(74,42,58,0.45);
}
.sim-breakdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--color-border);
  background: transparent;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: var(--font-title);
  font-size: 12px;
  color: var(--color-accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sim-breakdown-toggle:hover {
  background: var(--color-works);
}
.breakdown-arrow {
  width: 18px; height: 18px;
  transition: transform 0.2s ease;
}
.sim-breakdown-toggle[aria-expanded="true"] .breakdown-arrow {
  transform: rotate(180deg);
}
/* レジからウィーンと出てくるアニメーション */
.sim-breakdown-panel {
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  max-height: 0;
  margin-bottom: 0;
  transition: max-height 0s, margin-bottom 0s;
}
.sim-breakdown-panel.is-open {
  max-height: 1200px;
  margin-bottom: 20px;
  /* 開くとき：高さをすぐ確保して、clip-pathが主役 */
  transition: max-height 0s, margin-bottom 0.4s ease;
}

/* プリンターから出てくる紙：上からスライドして収まる */
.receipt-wrapper {
  border-radius: 14px;
  overflow: hidden;
}
.sim-breakdown-panel.is-open .receipt-wrapper {
  animation: printAction 0.5s ease-out forwards;
}

@keyframes printAction {
  0%   { transform: translateY(-100%); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(0);    opacity: 1; }
}
@keyframes printClose {
  0%   { transform: translateY(0);    opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}
.sim-breakdown-panel .receipt-wrapper.is-closing {
  animation: printClose 0.35s ease-in forwards;
}

/* バーはカードに揃える */
.receipt-bar {
  height: 12px;
  background: var(--color-accent);
  border-radius: 14px 14px 0 0;
  margin: 0 50px;
  transition: background 0.6s ease;
  position: relative;
  z-index: 1;
}
.sim-breakdown-panel.is-closing .receipt-card {
  border: none;
}

.receipt-body {
  opacity: 1;
  transition: transform 0.4s ease-in;
}

.sim-breakdown-panel.is-closing .receipt-body {
  transform: translateY(var(--body-close-y, -94px));
}


/* === 合計バー（固定） === */
.sim-total-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--color-border);
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  transition: border-color 0.6s ease;
}

/* 価格更新グロー */
@keyframes priceGlow {
  0%   { text-shadow: 0 0 0px transparent; }
  35%  { text-shadow: 0 0 18px var(--color-accent); }
  100% { text-shadow: 0 0 0px transparent; }
}

/* バーストパーティクル */
.price-particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform, opacity;
}
.sim-total-label {
  font-family: var(--font-title);
  font-size: 12px;
  color: rgba(74,42,58,0.5);
  letter-spacing: 0.08em;
}
.sim-total-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-accent);
  transition: color 0.6s ease;
}
.sim-total-amount span {
  font-size: 14px;
  font-weight: 400;
  margin-left: 3px;
  color: rgba(74,42,58,0.45);
}
.sim-total-selected {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2px;
}
.sim-total-selected:empty { display: none; }

/* 下部バーのタグリストはデフォルト非表示、ボタンで展開 */
.sim-total-bar .sim-total-selected {
  display: none;
}
.sim-total-bar .sim-total-selected.is-open {
  display: flex;
}
.sim-total-selected-tag {
  font-size: 13px;
  background: var(--color-works);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 4px 14px;
  color: var(--color-accent);
  white-space: nowrap;
}
/* === 合計バー下部レイアウト === */
.sim-total-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sim-total-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sim-total-amount-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.sim-total-note-box {
  max-width: 65%;
}

/* === 相談するボタン === */
.sim-consult {
  position: relative;
}
.sim-consult-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(74,42,58,0.22);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s, background 0.6s ease;
}
.sim-consult-btn svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.sim-consult-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(74,42,58,0.3);
}
.sim-consult-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 6px 24px rgba(74,42,58,0.14);
  min-width: 160px;
  flex-direction: column;
  gap: 4px;
  z-index: 400;
}
.sim-consult-popup.is-open {
  display: flex;
}
.sim-consult-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(74,42,58,0.8);
  font-size: 13px;
  font-family: var(--font-niku);
  transition: background 0.15s;
}
.sim-consult-item:hover {
  background: var(--color-works);
  color: var(--color-accent);
}
.sim-consult-icon-svg {
  width: 22px; height: 22px;
  color: var(--color-accent);
  flex-shrink: 0;
}
.sim-consult-icon-img {
  width: 22px; height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

/* === page top + マスコットエリア === */
#mascot-area {
  position: fixed;
  right: 20px;
  bottom: 185px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  z-index: 310;
  pointer-events: none;
}
#mascot-wrap {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}
/* マスコットのリンク（ページトップ） */
#mascot-wrap a {
  pointer-events: auto;
  display: block;
}

.sim-total-note-box {
  width: 100%;
  background: var(--color-works);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: rgba(74,42,58,0.65);
  line-height: 1.9;
  transition: background 0.6s ease;
}

/* === 言語・通貨コントロール === */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(74,42,58,0.4);
}
.lang-sep { font-size: 10px; }
.lang-btn {
  border: 1px solid var(--color-border);
  background: transparent;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(74,42,58,0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lang-btn.is-active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.currency-select {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: rgba(74,42,58,0.7);
  cursor: pointer;
  outline: none;
}

/* === 常在マスコット（固定・右下） === */
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}

#mascot-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

#mascot-bubble {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 12px 12px 4px 12px;
  padding: 10px 13px;
  width: 240px;
  font-family: var(--font-title);
  font-size: 11.5px;
  color: rgba(74,42,58,0.7);
  line-height: 1.75;
  box-shadow: 0 3px 14px rgba(74,42,58,0.09);
  pointer-events: auto;
  transition: border-color 0.6s ease;
}
#mascot-bubble-text {
  white-space: pre-line;
}
/* 吹き出しのしっぽ（下向き：ボーダー） */
#mascot-bubble::before {
  content: '';
  position: absolute;
  bottom: -11px;
  right: 19px;
  border: 10px solid transparent;
  border-top-color: var(--color-border);
  border-bottom-width: 0;
}
/* 吹き出しのしっぽ（下向き：白塗り） */
#mascot-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 21px;
  border: 8px solid transparent;
  border-top-color: #fff;
  border-bottom-width: 0;
  z-index: 1;
}

#chara-mascot {
  width: 160px;
  display: block;
  margin-left: auto;
  animation: mascotFloat 3.2s ease-in-out infinite;
}

/* 吹き出しメッセージ切り替えのポップアニメーション */
@keyframes bubblePop {
  from { transform: scale(0.9); opacity: 0.6; }
  65%  { transform: scale(1.05); }
  to   { transform: scale(1);   opacity: 1; }
}
#mascot-bubble.bubble-pop {
  animation: bubblePop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* スマホでは非表示 */
@media (max-width: 768px) {
  #mascot-area { display: none; }
}

/* === キャラクター・メッセージエリア（将来用予約） === */
.sim-chara-message {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 16px 20px;
  background: var(--color-works);
  border-radius: 14px;
  border: 1.5px solid var(--color-border);
  margin-bottom: 14px;
  transition: background 0.6s ease, border-color 0.6s ease;
}
.sim-chara-message-text {
  font-family: var(--font-niku);
  font-size: 13px;
  color: rgba(74,42,58,0.75);
  line-height: 1.9;
  padding-bottom: 4px;
}

/* === レスポンシブ === */
@media (max-width: 768px) {
  *, *::before, *::after { cursor: auto !important; }
  #custom-cursor { display: none !important; }

  .site-header {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  .header-left { gap: 10px; }
  .main-title { font-size: 26px; }
  .header-nav {
    width: 100%;
    justify-content: flex-start;
    gap: px;
    padding-top: 4px;
    border-top: 1px solid var(--color-border);
    order: -1;
  }
  .back-nav { gap: 6px; }
  .back-link { font-size: 12px; padding: 4px 10px; }
}

@media (max-width: 480px) {
  .sim-card { padding: 16px; }
  .sim-total-amount { font-size: 22px; }
}

/* === CSSアニメーション === */

/* タブ切り替え時：カードのスタガー登場 */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.sim-card.card-enter {
  animation: cardEnter 0.3s ease both;
}

/* カウンターボタン押下のフィードバック */
.sim-counter-btn:active {
  transform: scale(0.85);
  transition: transform 0.08s ease;
}

/* ゼロ時に − ボタンと数字を隠す */
.sim-counter-controls .sim-counter-btn--minus,
.sim-counter-controls .sim-counter-num {
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sim-counter-controls.is-zero .sim-counter-btn--minus,
.sim-counter-controls.is-zero .sim-counter-num {
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

/* 数字のスプリングアニメーション */
@keyframes numEnterUp {
  from { transform: translateY(12px); opacity: 0; }
  65%  { transform: translateY(-4px); opacity: 1; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes numEnterDown {
  from { transform: translateY(-12px); opacity: 0; }
  65%  { transform: translateY(4px);   opacity: 1; }
  to   { transform: translateY(0);     opacity: 1; }
}
.sim-counter-num.anim-up {
  animation: numEnterUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.sim-counter-num.anim-down {
  animation: numEnterDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* 合計金額の更新パルス */
@keyframes pricePulse {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.sim-total-amount.is-updated {
  animation: pricePulse 0.28s ease, priceGlow 0.6s ease;
}

/* 選択タグのポップイン */
@keyframes tagPop {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
.sim-total-selected-tag {
  animation: tagPop 0.18s ease both;
}

/* === 補足ノートカード（シャッター展開） === */
.sim-note-accordion {
  display: none;
  width: 100%;
  overflow: hidden;
}

/* シャッター展開：上端を軸にscaleYで弾んで開く */
@keyframes shutterOpen {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.sim-option:has(input:checked) .sim-note-accordion {
  display: block;
  transform-origin: top center;
  animation: shutterOpen 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  border-top: 1px solid var(--color-border);
  margin-top: 6px;
  padding-top: 2px;
}

.sim-note-accordion-body {
  display: block;
  padding: 8px 4px;
  font-size: 13px;
  color: rgba(74,42,58,0.75);
  line-height: 1.8;
}

/* strong強調 */
.sim-note-accordion-body strong {
  font-weight: 700;
  color: rgba(74,42,58,0.9);
}
.sim-note-accordion--warning .sim-note-accordion-body strong {
  color: #5a1a1a;
}

/* 警告スタイル */
.sim-note-accordion--warning.sim-option:has(input:checked) .sim-note-accordion {
  border-top-color: #e8c0c0;
}
.sim-note-accordion--warning .sim-note-accordion-body { color: #7a3030; }

/* === 選択不可オプション（Live2D時の短縮・最短納期など） === */
.sim-option.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.4);
}

/* === Live2D用：全幅独立カード === */
.sim-option--live2d {
  width: 100%;
  margin-top: 8px;
}

/* === 使用用途アイコン === */
.usage-icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
  opacity: 0.6;
  display: block;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.sim-option:hover .usage-icon,
.sim-option:has(input:checked) .usage-icon {
  opacity: 1;
}

/* === タイプ未選択ヒント（浮遊アニメーション） === */
@keyframes hintFloat {
  0%, 100% { transform: translateY(0);   opacity: 0.45; }
  50%       { transform: translateY(-6px); opacity: 0.88; }
}
.base-type-hint {
  text-align: center;
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(74,42,58,0.55);
  letter-spacing: 0.1em;
  padding: 10px 0 2px;
  animation: hintFloat 2.6s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

/* === B案：折りたたみバッジ === */
.sim-base-type-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1.5px solid var(--color-accent);
  background: var(--color-works);
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 14px;
  font-family: var(--font-title);
  color: var(--color-accent);
  transition: box-shadow 0.22s ease-out, transform 0.22s ease-out;
}
.sim-base-type-badge:hover {
  box-shadow: 0 4px 14px rgba(74,42,58,0.12);
  transform: scale(1.01);
}
.base-badge-thumb {
  display: block;
  width: 28px;
  height: 44px;
  object-fit: contain;
  object-position: top center;
}
.base-badge-label {
  font-size: 14px;
  letter-spacing: 0.06em;
}
.base-badge-change {
  font-size: 11px;
  opacity: 0.6;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px 8px;
  transition: background 0.15s;
}
.sim-base-type-badge:hover .base-badge-change {
  background: rgba(74,42,58,0.06);
}

@keyframes badgeIn {
  from { opacity: 0; transform: scaleX(0.85) translateY(-4px); }
  65%  { transform: scaleX(1.04) translateY(2px); }
  to   { opacity: 1; transform: none; }
}
.sim-base-type-badge.badge-enter {
  animation: badgeIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* === レシート内訳パネル === */

/* 下ギザギザ（レシートの切り取り線） */
.receipt-zigzag-bottom {
  height: 12px;
  margin: 0 50px;
  background-image:
    linear-gradient( 45deg, var(--color-bg) 33%, transparent 33%),
    linear-gradient(-45deg, var(--color-bg) 33%, transparent 33%);
  background-size: 12px 12px;
  background-repeat: repeat-x;
  background-color: var(--color-border);
  background-position: 0 bottom;
  transition: background-color 0.6s ease;
}

.receipt-card {
  font-family: var(--font-title);
  background: #fff;
  padding: 8px 24px 12px;
  margin: 0 50px;
  border: 2px solid var(--color-border);
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 0.6s ease;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
}
/* 隣り合う行の間だけ区切り線 */
.receipt-item + .receipt-item {
  border-top: 1px dashed var(--color-border);
  transition: border-color 0.6s ease;
}

.receipt-item-name {
  flex: 1;
  color: rgba(74,42,58,0.8);
  font-family: var(--font-title);
  font-size: 13px;
  padding-right: 8px;
}
.receipt-item-price {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  color: rgba(74,42,58,0.75);
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.receipt-item--free .receipt-item-name { color: rgba(74,42,58,0.45); }
.receipt-item--free .receipt-item-price {
  font-weight: 400;
  color: rgba(74,42,58,0.35);
  font-size: 11px;
}
.receipt-item--surcharge .receipt-item-name  { color: #9a3030; }
.receipt-item--surcharge .receipt-item-price { color: #9a3030; font-weight: 700; }
.receipt-item--discount  .receipt-item-name  { color: #2a6a3a; }
.receipt-item--discount  .receipt-item-price { color: #2a6a3a; font-weight: 700; }

/* 点線区切り（合計手前） */
.receipt-divider {
  border: none;
  border-top: 2px dashed var(--color-border);
  transition: border-color 0.6s ease;
  margin: 4px 0 4px;
}

/* 合計行 */
.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0;
}
.receipt-total-label {
  font-family: var(--font-title);
  font-size: 11px;
  color: rgba(74,42,58,0.45);
  letter-spacing: 0.1em;
}
.receipt-total-price {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.01em;
  transition: color 0.6s ease;
}
.receipt-total-price span {
  font-size: 13px;
  font-weight: 400;
  margin-left: 2px;
  color: rgba(74,42,58,0.4);
}


/* チェックマークアニメーション */
@keyframes checkPop {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes checkDraw {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* === 等身/SDカードのスプリング登場アニメーション === */
@keyframes cardSpringIn {
  from { opacity: 0; transform: scale(0.65) translateY(8px); }
  65%  { opacity: 1; transform: scale(1.07) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.sim-pose-card.spring-enter {
  animation: cardSpringIn 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
