/* ============ スタンプ帳ページ ============ */

.tab-wrap {
  display: flex;
  background: #EAF2F7;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
  border: none;
}

.tab-btn {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #8FA9BB;
  border: none;
  background: none;
  border-radius: 999px;
  margin: 0;
  width: auto;
  box-shadow: none;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, .5);
}

.tab-btn.active {
  color: #4FA8D8;
  background: #fff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(90, 160, 210, .15);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ---- 達成状況 ---- */
.achievement {
  background: #F7FBFE;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.achievement-title {
  font-size: 13px;
  font-weight: 700;
  color: #8FA9BB;
  margin-bottom: 4px;
}

.achievement-count {
  font-size: 26px;
  font-weight: 800;
  color: #4FA8D8;
}

.achievement-rate {
  font-size: 13px;
  font-weight: 700;
  color: #7CB342;
  margin-top: 4px;
}

.progress-bar-wrap {
  background: #EAF2F7;
  border-radius: 999px;
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-bar {
  background: #A6D46B;
  height: 100%;
  border-radius: 999px;
  transition: width .5s ease;
}

/* ---- スタンプグリッド ---- */
.stamps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stamp-card {
  background: #fff;
  border-radius: 18px;
  padding: 14px 8px 12px;
  text-align: center;
  border: none;
  box-shadow: 0 2px 8px rgba(90, 160, 210, .08);
  transition: all .2s;
}

.stamp-card:not(.stamped) {
  opacity: .75;
}

.stamp-card.stamped {
  cursor: pointer;
}

.stamp-view-modal {
  position: fixed;
  inset: 0;
  background: rgba(62, 92, 112, .6);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.stamp-view-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
}

.stamp-view-image {
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  background: #F7FBFE;
}

.stamp-view-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stamp-view-name {
  font-size: 16px;
  font-weight: 800;
  color: #3E5C70;
  margin-bottom: 20px;
}

.stamp-view-card button {
  margin-bottom: 10px;
}

.stamp-view-card button:last-child {
  margin-bottom: 0;
}

/* 獲得済み: ご当地印風の丸スタンプ */
.stamp-icon-large {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 3px solid #6EC2EE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transform: rotate(-5deg);
  overflow: hidden;
}

.stamp-icon-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.stamp-card:nth-child(4n+2) .stamp-icon-large {
  border-color: #F48FB1;
  transform: rotate(4deg);
}

.stamp-card:nth-child(4n+3) .stamp-icon-large {
  border-color: #A6D46B;
  transform: rotate(-2deg);
}

.stamp-card:nth-child(4n) .stamp-icon-large {
  border-color: #F6C26B;
  transform: rotate(5deg);
}

/* 未獲得: 点線の空き枠 */
.not-stamped {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 2.5px dashed #C9DCE9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 1;
  color: #C9DCE9;
}

.stamp-spot-name {
  font-size: 11px;
  font-weight: 700;
  color: #9AB2C2;
  line-height: 1.3;
}

.stamp-card.stamped .stamp-spot-name {
  color: #3E5C70;
  font-weight: 800;
}

.stamp-date {
  font-size: 10px;
  color: #C9DCE9;
  font-weight: 700;
  margin-top: 4px;
}

.stamp-card.stamped .stamp-date {
  color: #7CB342;
}

.no-spots {
  text-align: center;
  color: #8FA9BB;
  font-size: 14px;
  font-weight: 700;
  padding: 20px 16px;
}

/* ---- セクションヘッダー ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: #4A6B80;
}

/* ---- 参加中のラリー ---- */
.rally-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rally-loading {
  font-size: 13px;
  color: #8FA9BB;
  text-align: center;
  padding: 16px;
}

.rally-item {
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 10px rgba(90,160,210,.1);
  cursor: pointer;
  transition: transform .15s;
}

.rally-item:hover {
  transform: translateY(-1px);
}

.rally-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex: none;
}

.rally-info {
  flex: 1;
  min-width: 0;
}

.rally-name {
  font-size: 14px;
  font-weight: 800;
  color: #3E5C70;
  margin-bottom: 6px;
}

.rally-bar-wrap {
  background: #EEF5FA;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.rally-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .5s ease;
}

.rally-count {
  font-size: 18px;
  font-weight: 800;
  flex: none;
}

.rally-count span {
  font-size: 12px;
  font-weight: 700;
  color: #8FA9BB;
}