:root {
  --cream: #FFF8EE;
  --warm-bg: #FFF3E0;
  --panel-bg: #FFFBF5;
  --brown: #6D4C35;
  --soft-brown: #A07850;
  --border-brown: #D4A875;
  --pink-light: #FFE4EC;
  --peach: #FFCCAA;
  --purple-light: #EDE7F6;
  --blue-light: #E3F2FD;
  --green-light: #E8F5E9;
  --gray-light: #F5F5F5;
  --yellow-light: #ffea4d;
  --shadow: rgba(109, 76, 53, 0.12);
}

html,
body {
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 20px 20px, #FFD4E855 3px, transparent 3px),
    radial-gradient(circle at 60px 60px, #B3E5FC44 3px, transparent 3px),
    radial-gradient(circle at 100px 20px, #C8E6C944 3px, transparent 3px);
  background-size: 12vh 8vh;
  color: var(--brown);
  overflow: hidden;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Hiragino Maru Gothic ProN", "Rounded Mplus 1c", sans-serif;
}

/* ── Header ── */
header {
  background: linear-gradient(135deg, #FFD6D6, #FFE8CC, #FFD6F0);
  border-bottom: 0.3vh solid var(--border-brown);
  text-align: center;
  padding: 1.6vh 2vh 1.2vh;
  position: relative;
  overflow: hidden;
}

header::before,
header::after {
  content: '🐾';
  position: absolute;
  font-size: 7vh;
  opacity: 0.1;
  top: -0.5vh;
}

header::before {
  left: 2vh;
  transform:
    rotate(-15deg);
}

header::after {
  right: 2vh;
  transform:
    rotate(15deg);
}

.game-logo {
  font-size: 4vh;
  font-weight: 900;
  letter-spacing: 0.6vh;
  background: linear-gradient(90deg, #FF6B6B, #FF9F43, #6BCB77, #4ECDC4, #A855F7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0.2vh 0 rgba(0, 0, 0, 0.06));
  line-height: 1.2;
}

.game-sub {
  font-size: 1.5vh;
  font-weight: 700;
  color: var(--soft-brown);
  margin-top: 0.4vh;
  letter-spacing: 0.3vh;
}

/* =========================
   背景
========================= */

.game-wrapper {
  width: 100vw;
  height: 100vh;
  position: relative;
  /* overflow: hidden; */
}

.bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: saturate(1.05);
}

/* 少し白を被せてUIを見やすく */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
}

/* =========================
   UI全体
========================= */

.ui-layer {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding: 2vh;
  display: flex;
  justify-content: space-between;
}

/* =========================
   左UI
========================= */

.left-ui {
  width: 36vh;
  display: flex;
  flex-direction: column;
  gap: 1vh;
}

/* 共通カード */
.panel {
  background: rgba(255, 255, 255, 0.78);
  border: 0.5vh solid #ffd2e1;
  border-radius: 28px;
  backdrop-filter: blur(6px);
  box-shadow:
    0 8px 20px rgba(255, 170, 190, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  padding: 1.5vh;
}

/* ガチャボタン */
.gacha-btn {
  width: 100%;
  height: 9vh;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb5cc, #ff89b0);
  color: white;
  font-size: 2vh;
  font-weight: 900;
  cursor: pointer;
  transition: 0.15s;
  box-shadow:
    0 10px 18px rgba(255, 120, 170, 0.35),
    inset 0 3px 0 rgba(255, 255, 255, 0.6);
}

.gacha-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.gacha-btn:active {
  transform: translateY(2px) scale(0.98);
}

/* BGMトグル */
.bgm-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  border: 0.5vh solid #ffd2e1;
  border-radius: 28px;
  backdrop-filter: blur(6px);
  box-shadow:
    0 8px 20px rgba(255, 170, 190, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  padding: 1.5vh;
  gap: 1vh;
  margin-top: 1vh;
}

.bgm-label {
  color: var(--yellow-light);
  font-weight: 700;
  font-size: 3vh;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch {
  position: relative;
  width: 5vh;
  height: 2.6vh;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #999;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.25s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 2.2vh;
  height: 2.2vh;
  left: 0.2vh;
  top: 0.2vh;
  background: white;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked+.slider {
  background:
    linear-gradient(135deg,
      #ff7eb3,
      #ff4f8b);
}

.toggle-switch input:checked+.slider::before {
  transform: translateX(2.5vh);
}

.credit-card {
  background: rgba(255, 255, 255, 0.78);
  border: 0.5vh solid #ffd2e1;
  border-radius: 28px;
  backdrop-filter: blur(6px);
  padding: 1.5vh;
  box-shadow:
    0 8px 20px rgba(255, 170, 190, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
}
/* =========================
   排出率
========================= */

.rate-title {
  font-size: 3vh;
  color: #ff8fb2;
  margin-bottom: 1vh;
  font-weight: 800;
}

.rate-list {
  display: flex;
  flex-direction: column;
  gap: 1vh;
}

.rate-item {
  display: flex;
  justify-content: space-between;
  padding: 1vh 1.5vh;
  border-radius: 16px;
  background: #fff7fb;
  font-weight: 700;
  color: #a96d7e;
}

.rarity-stars {
  font-size: 1.8vh;
  flex: 1;
  padding-left: 1.5vh;
}

.rarity-input {
  width: 60px;
  padding: 0.5vh;
  border-radius: 8px;
  border: none;
  text-align: center;
  font-weight: bold;
  font-size: 1.5vh;
}

/* =========================
   右UI（コレクション）
========================= */

.right-ui {
  width: 36vh;
  height: 48vh;
  display: flex;
}

.stat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 3vh;
  color: #ff8fb2;
  font-weight: 900;
  margin-bottom: 1.4vh;
}

.stat-grid {
  display: grid;
  gap: 1vh;
}

/* カード */
.stat-card {
  font-size: 2vh;
  width: 32vh;
  height: 8vh;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff8fc, #ffeef5);
  border: 0.5vh solid #ffd7e6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(255, 170, 190, 0.15);
  gap: 0.4vh;
}

.stat-label {
  font-size: 2.1vh;
  color: var(--soft-brown);
  font-weight: 700;
  letter-spacing: 0.1vh;
}

.stat-value {
  font-size: 3vh;
  font-weight: 900;
  color: var(--brown);
  line-height: 1.2;
}

/* =========================
   中央UI
========================= */

.center-ui {
  width: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2vh;
  margin-top: 0%;
  margin-left: auto;
  margin-right: auto;
}

/* ガチャ表示エリア */
.home-display {
  position: relative;
  width: 65vh;
  height: 65vh;

  border-radius: 4vh;

  background:
    linear-gradient(145deg,
      rgba(255, 255, 255, 0.88),
      rgba(255, 240, 245, 0.82));

  border: 0.5vh solid #ffd6e5;

  box-shadow:
    0 1vh 3vh rgba(255, 170, 190, 0.25),
    inset 0 0.2vh 0 rgba(255, 255, 255, 0.9);

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(8px);
}

/* 画像 */
#home-image {
  width: 85%;
  height: 85%;
  object-fit: contain;
  z-index: 2;
  animation: floatCat 2.5s ease-in-out infinite;
}

/* ふわふわ */
@keyframes floatCat {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-1vh);
  }

  100% {
    transform: translateY(0px);
  }
}

/* Canvas */
#effectCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ボタン群 */
.image-buttons {
  display: flex;
  gap: 1vh;
}

/* ボタン */
.image-buttons button {
  border: none;
  padding: 1.2vh 2vh;
  border-radius: 999px;
  background:
    linear-gradient(180deg,
      #ffb5cc,
      #ff89b0);

  color: white;
  font-size: 1.8vh;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 0.5vh 1.5vh rgba(255, 120, 170, 0.25);

  transition: 0.15s;
}

.image-buttons button:hover {
  transform: translateY(-0.2vh) scale(1.03);
}

/* =========================
   下部メニュー
========================= */

.bottom-bar {
  position: absolute;
  left: 50%;
  bottom: 1vh;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 10;
}

.menu-btn {
  background: rgba(255, 255, 255, 0.82);
  border: 3px solid #ffd6e5;
  border-radius: 999px;
  padding: 1.3vh 2vh;
  color: #ff8fb2;
  font-weight: 800;
  font-size: 1.5vh;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(255, 170, 190, 0.18);
}

/* =========================
   SP対応
========================= */

@media(max-width:1100px) {

  body {
    overflow: auto;
  }

  .ui-layer {
    flex-direction: column;
    gap: 16px;
    height: auto;
  }

  .left-ui,
  .right-ui {
    width: 100%;
  }

  .collection-section {
    width: 100% !important;
    margin: auto;
  }

  .bottom-bar {
    position: fixed;
  }

  .center-ui {
    width: 30vh;
  }
}

/* =========================
   ガチャUI
========================= */
.gacha-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto;
  gap: 1.4vh;
}

.machine-wrap {
  background: linear-gradient(160deg, var(--pink-light), var(--warm-bg));
  border-radius: 2.5vh;
  border: 0.25vh solid var(--border-brown);
  padding: 1.6vh 1.8vh 1.8vh;
  box-shadow: 0 0.6vh 2.4vh var(--shadow);
  text-align: center;
  width: 100%;
}

#gachaCanvas {
  display: block;
  margin: 0 auto;
  cursor: pointer;
  border-radius: 1.6vh;
  transition: transform 0.15s;
  max-width: 100%;
}

#gachaCanvas:hover {
  transform: scale(1.01);
}

/* Result area */
.result-area {
  min-height: 9vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1vh;
  flex-wrap: wrap;
  padding: 0.4vh 0;
}

.result-hint {
  font-size: 1.5vh;
  color: var(--soft-brown);
  font-weight: 700;
}

.result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4vh;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
}

.result-cat-face {
  width: 6.5vh;
  height: 6.5vh;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2vh;
  border: 0.3vh solid white;
  box-shadow: 0 0.3vh 1vh rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.result-cat-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 画像を円にトリミング */
  object-position: center center;
  /* 中央を表示 */
  border-radius: 50%;
}

.result-card .rarity-badge {
  font-size: 1vh;
  font-weight: 800;
  padding: 0.2vh 0.8vh;
  border-radius: 2vh;
  letter-spacing: 0.1vh;
}

.result-card .cat-name {
  font-size: 1vh;
  font-weight: 700;
  color: var(--brown);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Buttons */
.btn-group {
  display: flex;
  gap: 1.2vh;
  flex-wrap: wrap;
  justify-content: center;
}

.gacha-btn {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 800;
  font-size: 1.8vh;
  padding: 1.3vh 3.2vh;
  border: none;
  border-radius: 5vh;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
  letter-spacing: 0.2vh;
}

.btn-single {
  background: linear-gradient(135deg, #FF8A80, #FF5252);
  color: white;
  box-shadow: 0 0.6vh 0 #C62828, 0 0.9vh 1.6vh rgba(255, 82, 82, 0.3);
}

.btn-single:hover {
  filter: brightness(1.05);
}

.btn-single:active {
  transform: translateY(0.5vh);
  box-shadow: 0 0.1vh 0 #C62828;
}

.btn-ten {
  background: linear-gradient(135deg, #CE93D8, #9C27B0);
  color: white;
  box-shadow: 0 0.6vh 0 #6A1B9A, 0 0.9vh 1.6vh rgba(156, 39, 176, 0.3);
}

.btn-ten:hover {
  filter: brightness(1.05);
}

.btn-ten:active {
  transform: translateY(0.5vh);
  box-shadow: 0 0.1vh 0 #6A1B9A;
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================
   コレクションUI
========================= */
.collection-section {
  width: 100vh;
  height: 90vh;
  background: rgba(255, 255, 255, 0.78);
  border: 0.5vh solid #ffd2e1;
  border-radius: 28px;
  backdrop-filter: blur(6px);
  box-shadow:
    0 8px 20px rgba(255, 170, 190, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  margin: 0 auto 2.5vh;
  padding: 0 1.8vh;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1vh;
  margin-top: 1.2vh;
  margin-bottom: 1.2vh;
  padding-bottom: 1vh;
  border-bottom: 0.2vh dashed var(--border-brown);
}

.section-header h2 {
  font-size: 1.7vh;
  font-weight: 800;
  letter-spacing: 0.2vh;
  color: var(--brown);
}

.count-badge {
  background: var(--peach);
  border: 0.15vh solid var(--border-brown);
  border-radius: 2vh;
  font-size: 1.1vh;
  font-weight: 800;
  padding: 0.3vh 1vh;
  color: var(--brown);
}

.filter-pills {
  display: flex;
  gap: 0.8vh;
  flex-wrap: wrap;
  margin-bottom: 1.2vh;
}

.pill {
  font-family: inherit;
  font-size: 1.1vh;
  font-weight: 800;
  padding: 0.5vh 1.4vh;
  border-radius: 2vh;
  border: 0.2vh solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.1vh;
}

.pill-all {
  background: var(--peach);
  color: var(--brown);
  border-color: var(--border-brown);
}

.pill-ssr {
  background: #FFF9C4;
  color: #6D4800;
  border-color: #F9A825;
}

.pill-sr {
  background: var(--purple-light);
  color: #4A148C;
  border-color: #CE93D8;
}

.pill-r {
  background: var(--blue-light);
  color: #0D47A1;
  border-color: #90CAF9;
}

.pill-np {
  background: var(--green-light);
  color: #1B5E20;
  border-color: #A5D6A7;
}

.pill-n {
  background: var(--gray-light);
  color: #424242;
  border-color: #BDBDBD;
}

.pill.active,
.pill:hover {
  filter: brightness(0.93);
  transform: translateY(-0.15vh);
}

.collection-grid {
  display: grid;
  /* 自動で横並び */
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  /* 高さ制限 */
  max-height: 70vh;
  /* はみ出したらスクロール */
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 4vh 2vh;
  color: var(--soft-brown);
}

.empty-icon {
  font-size: 4vh;
  display: block;
  margin-bottom: 1vh;
}

.empty-state p {
  font-size: 1.3vh;
  font-weight: 700;
}

/* Cat Cards */
.cat-card {
  background: var(--panel-bg);
  border-radius: 1.8vh;
  padding: 1.2vh 0.8vh 1vh;
  text-align: center;
  border: 0.25vh solid;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: fadeSlide 0.35s ease both;
}

.cat-card:hover {
  transform: translateY(-0.5vh);
  box-shadow: 0 0.9vh 2vh var(--shadow);
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(1.6vh) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cat-face-wrap {
  width: 7vh;
  height: 7vh;
  border-radius: 50%;
  margin: 0 auto 0.7vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5vh;
  position: relative;
  overflow: hidden;
}

.cat-face-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 画像を円にトリミング */
  object-position: center center;
  /* 中央を表示 */
  border-radius: 50%;
}

.cat-card .rarity-badge {
  font-size: 1vh;
  font-weight: 900;
  padding: 0.2vh 0.8vh;
  border-radius: 2vh;
  letter-spacing: 0.05vh;
  display: inline-block;
  margin-bottom: 0.3vh;
}

.cat-card .cat-name {
  font-size: 1.1vh;
  font-weight: 800;
  color: var(--brown);
  display: block;
  margin-bottom: 0.2vh;
}

.cat-card .cat-stars {
  font-size: 0.95vh;
}

.cat-card .count-tag {
  position: absolute;
  top: 0.6vh;
  right: 0.6vh;
  background: var(--brown);
  color: white;
  font-size: 0.85vh;
  font-weight: 800;
  width: 2.2vh;
  height: 2.2vh;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-ssr {
  border-color: #F9A825;
  background: linear-gradient(160deg, #FFFDE7, #FFF8E1);
}

.card-sr {
  border-color: #CE93D8;
  background: linear-gradient(160deg, #F3E5F5, #EDE7F6);
}

.card-r {
  border-color: #90CAF9;
  background: linear-gradient(160deg, #E3F2FD, #E1F5FE);
}

.card-np {
  border-color: #A5D6A7;
  background: linear-gradient(160deg, #E8F5E9, #F1F8E9);
}

.card-n {
  border-color: #E0E0E0;
  background: linear-gradient(160deg, #FAFAFA, #F5F5F5);
}

.card-ssr .cat-face-wrap::after {
  content: '';
  position: absolute;
  inset: -0.35vh;
  border-radius: 50%;
  background: conic-gradient(#FF6B6B, #FFD93D, #6BCB77, #4ECDC4, #A855F7, #FF6B6B);
  z-index: -1;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.new-badge {
  position: absolute;
  top: -0.4vh;
  left: -0.4vh;
  background: #FF5252;
  color: white;
  font-size: 0.8vh;
  font-weight: 900;
  padding: 0.2vh 0.5vh;
  border-radius: 0.6vh;
  letter-spacing: 0.1vh;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.7
  }
}

/* Sparkle overlay */
/* .sparkle-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
} */
/* =========================
   SRエフェクトCanvas
========================= */
.sparkle-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* Rarity rows */
.rarity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9vh 1vh;
  border-radius: 1.2vh;
  margin-bottom: 0.6vh;
  gap: 0.8vh;
}

.rarity-row:last-child {
  margin-bottom: 0;
}

.rarity-badge {
  font-size: 1.2vh;
  font-weight: 900;
  padding: 0.3vh 0.9vh;
  border-radius: 2vh;
  min-width: 4.5vh;
  text-align: center;
  letter-spacing: 0.1vh;
}

.rarity-stars {
  font-size: 1.2vh;
  flex: 1;
  padding-left: 0.5vh;
}

.rarity-pct {
  font-size: 1.3vh;
  font-weight: 800;
}

.r-ssr {
  background: linear-gradient(135deg, #FFF9C4, #FFF3C4);
  border: 0.15vh solid #F9A825;
}

.r-ssr .rarity-badge {
  background: linear-gradient(135deg, #FFD54F, #F9A825);
  color: #4E2D00;
}

.r-ssr .rarity-pct {
  color: #F57F17;
}

.r-sr {
  background: linear-gradient(135deg, var(--purple-light), #F3E5F5);
  border: 0.15vh solid #CE93D8;
}

.r-sr .rarity-badge {
  background: linear-gradient(135deg, #CE93D8, #9C27B0);
  color: white;
}

.r-sr .rarity-pct {
  color: #7B1FA2;
}

.r-r {
  background: linear-gradient(135deg, var(--blue-light), #E1F5FE);
  border: 0.15vh solid #90CAF9;
}

.r-r .rarity-badge {
  background: linear-gradient(135deg, #64B5F6, #1976D2);
  color: white;
}

.r-r .rarity-pct {
  color: #1565C0;
}

.r-np {
  background: linear-gradient(135deg, var(--green-light), #F1F8E9);
  border: 0.15vh solid #A5D6A7;
}

.r-np .rarity-badge {
  background: linear-gradient(135deg, #81C784, #388E3C);
  color: white;
}

.r-np .rarity-pct {
  color: #2E7D32;
}

.r-n {
  background: linear-gradient(135deg, var(--gray-light), #FAFAFA);
  border: 0.15vh solid #E0E0E0;
}

.r-n .rarity-badge {
  background: linear-gradient(135deg, #BDBDBD, #757575);
  color: white;
}

.r-n .rarity-pct {
  color: #616161;
}

.pity-note {
  margin-top: 1.2vh;
  padding: 0.9vh;
  background: var(--warm-bg);
  border-radius: 1.2vh;
  border: 0.15vh dashed var(--border-brown);
  font-size: 1.1vh;
  font-weight: 700;
  color: var(--soft-brown);
  text-align: center;
  line-height: 1.7;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1vh;
}

.stat-box {
  background: var(--warm-bg);
  border-radius: 1.2vh;
  border: 0.15vh solid var(--border-brown);
  padding: 1vh 0.8vh;
  text-align: center;
}

/* =========================
   画像プレビューモーダル
========================= */
#cat-image-modal {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 201;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 2.8vh;
  border: 0.5vh solid #ffd2e1;
  padding: 3.5vh 4.5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6vh;
  box-shadow:
    0 12px 40px rgba(255, 120, 170, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  min-width: 28vh;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-close {
  position: absolute;
  top: 1vh;
  right: 1vh;
  background: #ffb5cc;
  border: none;
  border-radius: 50%;
  width: 3.6vh;
  height: 3.6vh;
  font-size: 1.5vh;
  color: white;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  line-height: 1;
}

.modal-close:hover {
  transform: scale(1.12);
}

.modal-cat-face {
  width: 22vh;
  height: 22vh;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10vh;
  border: 0.5vh solid white;
  box-shadow: 0 0.6vh 2.4vh rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.modal-cat-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
}

.modal-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6vh;
}

.modal-rarity {
  font-size: 1.4vh !important;
  font-weight: 900 !important;
  padding: 0.4vh 1.2vh !important;
  border-radius: 2vh;
  letter-spacing: 0.1vh;
}

.modal-name {
  font-size: 2.6vh;
  font-weight: 900;
  color: var(--brown);
}

.modal-stars {
  font-size: 1.8vh;
}

.modal-download-btn {
  background: linear-gradient(135deg, #6BCB77, #388E3C);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 1.2vh 3.2vh;
  font-size: 1.8vh;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.1vh;
  box-shadow:
    0 0.5vh 0 #1B5E20,
    0 0.8vh 1.6vh rgba(56, 142, 60, 0.3);
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
}

.modal-download-btn:hover {
  filter: brightness(1.06);
}

.modal-download-btn:active {
  transform: translateY(0.5vh);
  box-shadow: 0 0.1vh 0 #1B5E20;
}

.modal-displayHome-btn {
  background: linear-gradient(135deg, #ffd630, #edbf02);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 1.2vh 3.2vh;
  font-size: 1.8vh;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.1vh;
  box-shadow:
    0 0.5vh 0 #b59c1b,
    0 0.8vh 1.6vh rgba(56, 142, 60, 0.3);
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
}

.modal-displayHome-btn:hover {
  filter: brightness(1.06);
}

.modal-displayHome-btn:active {
  transform: translateY(0.5vh);
  box-shadow: 0 0.1vh 0 #b59c1b;
}