/* ========== ベース設定 ========== */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', 'Yu Gothic UI', 'Yu Gothic', sans-serif;
  background: #FCFAFA;
  margin: 0;
  padding: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 900px;
  box-sizing: border-box;
}

/* ========== ヘッダー部分 ========== */
.simulator-heading {
  text-align: center;
  padding: 5px 0;
  color: #7E99A3;
  font-weight: bold;
}

.simulator-heading .edition-box {
  display: inline-block;
  padding: 4px 15px;
  border: 2px solid #CF7788;
  border-radius: 8px;
  background: #CF7788;
  font-size: 14px;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-bottom: 8px;
　margin-top: 1px;
  }

/* ========== レイアウトセクション ========== */
section {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  box-sizing: border-box;
}

.form-container {
  background: #cde2e9;
  border: 1px solid #ffe8c0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin: -20px auto 3px;
  display: block;
  max-width: 900px;
  width: 100%;
  box-sizing: border-box;
}

/* ========== カテゴリーグリッド ========== */
.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: -35px;
}

.input-pair {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto -13px;
  flex-wrap: wrap;
}

/* ========== 入力項目 ========== */
.input-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1px;
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 300px;
  background: #f9f9f9;
  padding: 12px;
  border-radius: 8px;
  min-width: 300px;
  box-sizing: border-box;
  }

.label-with-icon {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-weight: 600;
  font-size: 18px;
  color: #4f5a66;
  width: 150px;
  margin-right: 5px;
}

.category-icon {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background-color: #FFFBDE;
  padding: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.input-with-unit {
  flex: 0 0 auto;
  width: 180px;
  position: relative;
}
.amount-input {
  width: 100%;
  padding-right: 35px;
  font-size: 20px;
  border-radius: 6px;
  border: 1px solid #ccc;
  height: 40px;
  box-sizing: border-box;
  text-align: right;
  margin-left: 85px;
  }

.yen {
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: #888;
  pointer-events: none;
}

/* ========== 吹き出し（ポイントタイトル） ========== */
.speech-bubble {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f7808e;
  color: white;
  height: 36px;
  line-height: 36px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  max-width: 400px;
  width: fit-content;
  margin: 70px auto 0;
  box-sizing: border-box;
  word-break: break-word;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0 10px;
  border-style: solid;
  border-color: #f7808e transparent transparent transparent;
}

/* ========== ポイント表示 ========== */
.points-wrapper {
  background-color: #fef6f2;
  border: 1px solid #f4cfc4;
  border-radius: 10px;
  padding: 30px 20px 20px;
  margin: 5px auto 30px;
  box-shadow: 0 4px 8px rgba(247, 128, 142, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  width: 100%;
  box-sizing: border-box;
}

.points-sub-text {
  font-size: 10px;
  color: #666;
  margin-top: 10px;
  text-align: left;
}

.points-box {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background-color: #FDFAF6;
  border-radius: 8px;
  margin: 5px 0 20px;
  padding: 5px 0;
  font-size: 35px;
  font-weight: 700;
  color: #f7808e;
  height: 75px;
  width: 100%;         /* ← 横幅いっぱいに広げる */
  max-width: 500px;    /* ← 必要に応じて最大幅を制限 */
  box-sizing: border-box;
  box-shadow: 0 4px 8px rgba(200, 200, 200, 0.3);
  margin-left: 22%;  /* ← これで右寄せ */
  margin-right: auto;    /* 右のマージンを0に */
}

/* ========== 結果表示 ========== */
#result {
  width: 100%;
  max-width: 900px;
  min-height: 600px;
  padding: 40px 20px;
  background: #FDFAF6;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: auto;
  margin: 0 auto 40px;
  box-sizing: border-box;
}

.result-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.summary-container,
.details-container {
  width: 100%;
  max-width: 600px;
  text-align: center;
  box-sizing: border-box;
}

.category-name {
  flex: 1;
  text-align: left;
}

.point-value {
  flex: 1;
  text-align: right;
  font-weight: 600;
  color: #444;
}

.details-title {
  font-size: 16px;
  font-weight: 600;
  color: #606160;
  margin-bottom: 8px;
  text-align: center;
  width: 100%;
}

/* ========== トップボタン ========== */
#scrollTopBtn.top-button {
  padding: 4px 6px;
  font-size: 14px;
  font-weight: 600;
}

/* ========== レスポンシブ対応（スマホ・タブレット） ========== */
@media (max-width: 768px) {
body {
max-width: 100%;
}

section,
.form-container,
#result {
max-width: 100%;
padding: 15px 10px;
}

.categories-grid {
flex-wrap: wrap;
justify-content: center;
gap: 8px;
}

.input-pair {
flex-direction: column;
gap: 8px;
max-width: 100%;
margin: 0 auto;
}

.input-item {
flex-basis: auto !important;
min-width: auto !important;
width: 100%;
padding: 5px;
justify-content: space-between; /* ← 左右に分ける */
}

.label-with-icon {
width: 150px;
font-size: 18px;
margin-right: 10px;
}

.category-icon {
width: 40px;
height: 40px;
padding: 3px;
}

.yen {
position: absolute;
right: 10px; /* 画面に依存しないような相対的距離に */
font-size: 14px;
font-weight: 600;
pointer-events: none;
}

.amount-input {
width: 100%;
max-width: 60%; /* 固定幅180pxをやめる */
padding-right: 25px;
font-size: 18px;
height: 40px;
text-align: right;
box-sizing: border-box;
margin-left: auto;
display: block; 
	
}


.speech-bubble {
font-size: 18px;
max-width: 90vw;
margin: 50px auto 0;
height: auto;
line-height: 1.2;
padding: 8px 15px;
}

.points-wrapper {
max-width: 100%;
padding: 20px 15px 15px;
margin: 10px auto 20px;
}

.points-box {
max-width: 100%;
width: 85%;
font-size: 32px;
height: 60px;
margin-left: auto;
margin-right: auto;
}

.summary-container,
.details-container {
max-width: 100%;
}

.details-title {
font-size: 14px;
}

#scrollTopBtn.top-button {
font-size: 12px;
padding: 3px 5px;
}
}