/* 英検5級モンスター単語ゲーム — 子供向け・オレンジ基調・スマホ縦向き */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: linear-gradient(165deg, #fff3e8 0%, #ffd4a3 42%, #ff9d4d 100%);
  --orange: #ff8a2e;
  --orange-deep: #e85d04;
  --orange-dark: #c2410c;
  --amber: #f59e0b;
  --amber-deep: #d97706;
  --burnt: #b45309;
  --cream: #fff7ed;
  --cream-deep: #ffedd5;
  --accent-warm: #ea580c;
  --text: #3d2918;
  --text-soft: #7c4a32;
  --white: #fffaf5;
  --shadow: 0 6px 0 rgba(100, 45, 12, 0.2);
  --radius: 999px;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}

html {
  font-size: clamp(15px, 3.8vw, 18px);
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
}

.app {
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 1rem env(safe-area-inset-bottom);
  position: relative;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 0.75rem 0 1rem;
  animation: fadeIn 0.35s ease;
}

.screen--active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* スタート */
.monster-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 140, 60, 0.45) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(234, 88, 12, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 50% 90%, rgba(245, 158, 11, 0.4) 0%, transparent 38%);
  pointer-events: none;
  z-index: 0;
}

.start-header,
.start-buttons,
.stats-bar,
.master-badge {
  position: relative;
  z-index: 1;
}

.class-name {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--burnt);
}

.class-name--result {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.start-header {
  text-align: center;
  padding: 1.5rem 0.5rem 1rem;
}

.title {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.35;
  font-weight: 800;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--cream), 0 0 18px rgba(255, 245, 235, 0.9);
}

.subtitle {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* トップ・結果：ちびキャラ（SVG） */
.mascots {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.65rem, 4.5vw, 1.35rem);
  position: relative;
  z-index: 1;
}

.mascots--start {
  margin: 0.85rem 0 0.35rem;
}

.mascots--result {
  margin: 0.1rem auto 0.45rem;
}

.mascot {
  width: clamp(4.1rem, 25vw, 6rem);
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 5px 0 rgba(120, 55, 20, 0.2));
  animation: mascotFloat 2.9s ease-in-out infinite;
}

.mascot--girl {
  animation-delay: -1.45s;
}

.mascot--bounce {
  animation-name: mascotCelebrate;
  animation-duration: 2.4s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.mascot--bounce.mascot--girl {
  animation-delay: -1.2s;
}

@keyframes mascotFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(1.2deg);
  }
}

@keyframes mascotCelebrate {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-10px) scale(1.04) rotate(-2deg);
  }
  70% {
    transform: translateY(-5px) scale(1.06) rotate(2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot {
    animation: none;
  }
}

.start-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  padding: 1rem 0.25rem;
}

.btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn--round {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 3.25rem;
}

.btn--primary {
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #fff;
}

.btn--secondary {
  background: linear-gradient(180deg, var(--amber) 0%, var(--amber-deep) 100%);
  color: #422006;
}

.btn--accent {
  background: linear-gradient(180deg, var(--accent-warm) 0%, var(--orange-dark) 100%);
  color: #fff;
}

.btn--hidden {
  display: none !important;
}

.stats-bar {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding: 1rem;
  background: rgba(255, 247, 237, 0.72);
  border: 2px solid rgba(194, 65, 12, 0.2);
  border-radius: 1rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.stats-bar strong {
  color: var(--text);
  font-size: 1.1rem;
}

.master-badge {
  margin-top: 0.75rem;
  text-align: center;
  padding: 0.6rem 1rem;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 0.95rem;
  color: #713f12;
  box-shadow: var(--shadow);
}

.master-badge--hidden {
  display: none;
}

/* クイズヘッダー */
.quiz-header,
.cards-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0 0.75rem;
}

.btn--back {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: var(--shadow);
  font-size: 1.25rem;
  color: var(--text);
  border: 2px solid rgba(194, 65, 12, 0.15);
}

.quiz-progress {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.quiz-progress span {
  display: block;
}

.quiz-score-mini {
  min-width: 3.5rem;
  text-align: right;
  font-weight: 800;
}

.quiz-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.word-card {
  background: var(--white);
  border-radius: 1.5rem;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 3px solid rgba(232, 93, 4, 0.45);
}

.word-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.word-en {
  margin: 0.5rem 0 1rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.btn--speak {
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff7ed 0%, #fed7aa 100%);
  color: var(--text);
  font-size: 0.95rem;
  box-shadow: 0 3px 0 rgba(120, 50, 15, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.25);
}

.choices-label {
  margin: 1.25rem 0 0.75rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.choice-btn {
  padding: 1.1rem 1rem;
  border-radius: 1.25rem;
  border: 3px solid transparent;
  background: linear-gradient(180deg, #fffefb 0%, #ffedd5 100%);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s, border-color 0.15s;
}

.choice-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.choice-btn:disabled {
  cursor: default;
  opacity: 0.95;
}

.choice-btn--correct {
  border-color: #15803d;
  background: linear-gradient(180deg, #dcfce7 0%, #86efac 100%);
}

.choice-btn--wrong {
  border-color: #dc2626;
  background: linear-gradient(180deg, #fef2f2 0%, #fecaca 100%);
}

/* 星アニメーション */
.star-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.star-burst span {
  position: absolute;
  font-size: 2rem;
  animation: starPop 0.85s ease forwards;
  opacity: 0;
}

@keyframes starPop {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0);
  }
  40% {
    opacity: 1;
    transform: translate(var(--tx), var(--ty)) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--tx) * 1.5), calc(var(--ty) * 1.5)) scale(0.6);
  }
}

/* 結果 */
#screen-result {
  justify-content: center;
  align-items: center;
}

.result-inner {
  text-align: center;
  width: 100%;
  padding: 1.5rem;
  background: rgba(255, 247, 237, 0.88);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  border: 2px solid rgba(194, 65, 12, 0.22);
}

.result-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.result-score {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.result-rate {
  margin: 0.75rem 0 1.5rem;
  font-size: 1.15rem;
  color: var(--text-soft);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* カード一覧 */
.cards-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 1.2rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0 1rem;
  flex: 1;
  overflow-y: auto;
}

.card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #fffefb 0%, #ffedd5 100%);
  border: 3px solid var(--orange-deep);
  box-shadow: var(--shadow);
  min-height: 5rem;
}

.card--locked {
  background: linear-gradient(135deg, #e8e4df 0%, #d4cec8 100%);
  border-color: #a8a29e;
  color: var(--text-soft);
}

.card__num {
  font-weight: 800;
  font-size: 1.1rem;
  min-width: 2rem;
}

.card__art {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7ed 0%, var(--amber) 50%, var(--amber-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.card--locked .card__art {
  background: #a8a29e;
  font-size: 1.5rem;
}

.card__info {
  flex: 1;
  text-align: left;
}

.card__name-en {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.card__name-jp {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.card--popup {
  flex-direction: column;
  text-align: center;
  margin: 0.5rem auto;
  max-width: 16rem;
}

.cards-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0;
  padding-bottom: 0.5rem;
}

/* ポップアップ */
.popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(60, 30, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.25s ease;
}

.popup--hidden {
  display: none;
}

.popup__inner {
  background: var(--white);
  border-radius: 1.5rem;
  padding: 1.5rem 1.25rem;
  max-width: 20rem;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(60, 25, 8, 0.28);
  border: 4px solid var(--orange-deep);
  animation: popBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popBounce {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.popup__emoji {
  font-size: 3rem;
  margin: 0;
}

.popup__title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--orange-dark);
}

/* 音をONにするボタン */
.btn--sound {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  color: #fff;
  font-size: 1.1rem;
  animation: soundPulse 2s ease-in-out infinite;
}

.btn--sound-active {
  background: linear-gradient(180deg, #86efac 0%, #4ade80 100%);
  color: #166534;
  animation: none;
  opacity: 0.7;
}

@keyframes soundPulse {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow); }
  50% { transform: scale(1.03); box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4); }
}

/* リセットボタン */
.btn--reset {
  background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
  color: #334155;
  font-size: 0.9rem;
  padding: 0.7rem 1.2rem;
}

/* 正解・不正解フィードバック */
.answer-feedback {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: feedbackIn 0.3s ease;
}

.answer-feedback--hidden {
  display: none;
}

.answer-feedback__icon {
  font-size: min(40vw, 10rem);
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.2));
  animation: feedbackPop 1.2s ease forwards;
}

.answer-feedback--correct .answer-feedback__icon {
  color: #16a34a;
}

.answer-feedback--wrong .answer-feedback__icon {
  color: #dc2626;
}

@keyframes feedbackIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes feedbackPop {
  0% { transform: scale(0.3); opacity: 0; }
  20% { transform: scale(1.15); opacity: 1; }
  35% { transform: scale(0.95); opacity: 1; }
  50% { transform: scale(1); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.1); opacity: 0; }
}

/* カード：取得済みカードをクリック可能に */
.card--unlocked {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card--unlocked:active {
  transform: scale(0.97);
}

.card__tap-hint {
  font-size: 0.7rem;
  color: var(--text-soft);
  opacity: 0.7;
  white-space: nowrap;
}

/* モンスター詳細モーダル */
.popup__inner--monster {
  max-width: 22rem;
}

.monster-detail__art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.monster-detail__emoji {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7ed 0%, var(--amber) 50%, var(--amber-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12), 0 4px 12px rgba(100, 45, 12, 0.2);
}

.monster-detail__name-jp {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.monster-detail__name {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--orange-dark);
}

.monster-detail__desc {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  text-align: left;
  padding: 0.75rem;
  background: rgba(255, 237, 213, 0.5);
  border-radius: 0.75rem;
}

/* ===== コンプリート演出 ===== */

/* くす玉 */
.kusudama {
  position: fixed;
  top: 8vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 310;
  pointer-events: none;
}

.kusudama--hidden {
  display: none;
}

.kusudama__ball {
  font-size: 5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.kusudama--animate .kusudama__ball {
  animation: kusudamaDrop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.kusudama--burst .kusudama__ball {
  animation: kusudamaBurst 0.5s ease forwards;
}

@keyframes kusudamaDrop {
  0% { transform: translateY(-120px) scale(0.3); opacity: 0; }
  60% { transform: translateY(10px) scale(1.1); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes kusudamaBurst {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* 紙吹雪 */
.confetti-container {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall linear forwards;
}

.confetti--circle {
  border-radius: 50%;
}

.confetti--star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  border-radius: 0;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* コンプリートモーダル本体 */
.popup__inner--complete {
  max-width: 24rem;
  max-height: 85vh;
  overflow-y: auto;
  border: 4px solid #fbbf24;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 40%, #fde68a 100%);
  box-shadow: 0 0 60px rgba(251, 191, 36, 0.4), 0 12px 40px rgba(60, 25, 8, 0.28);
  animation: completePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes completePop {
  0% { transform: scale(0.5) rotate(-3deg); opacity: 0; }
  60% { transform: scale(1.05) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.complete__congrats {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #b45309;
  animation: congratsGlow 1.5s ease-in-out infinite alternate;
}

@keyframes congratsGlow {
  0% { text-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
  100% { text-shadow: 0 0 20px rgba(251, 191, 36, 1), 0 0 40px rgba(245, 158, 11, 0.5); }
}

.complete__title {
  margin: 0.3rem 0 0.25rem;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--orange-dark);
}

.complete__sub {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.complete__trophy {
  font-size: 3.5rem;
  margin: 0.25rem 0;
  animation: trophyBounce 1.2s ease-in-out infinite;
}

@keyframes trophyBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(0deg); }
  75% { transform: scale(1.1) rotate(5deg); }
}

.complete__cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  padding: 0.5rem;
  margin: 0.5rem 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  border: 2px solid rgba(251, 191, 36, 0.4);
}

.complete__card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  animation: cardReveal 0.4s ease backwards;
}

.complete__card-item:nth-child(1)  { animation-delay: 0.1s; }
.complete__card-item:nth-child(2)  { animation-delay: 0.2s; }
.complete__card-item:nth-child(3)  { animation-delay: 0.3s; }
.complete__card-item:nth-child(4)  { animation-delay: 0.4s; }
.complete__card-item:nth-child(5)  { animation-delay: 0.5s; }
.complete__card-item:nth-child(6)  { animation-delay: 0.6s; }
.complete__card-item:nth-child(7)  { animation-delay: 0.7s; }
.complete__card-item:nth-child(8)  { animation-delay: 0.8s; }
.complete__card-item:nth-child(9)  { animation-delay: 0.9s; }
.complete__card-item:nth-child(10) { animation-delay: 1.0s; }

@keyframes cardReveal {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.complete__card-emoji {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7ed 0%, var(--amber) 50%, var(--amber-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12), 0 2px 6px rgba(100, 45, 12, 0.2);
}

.complete__card-name {
  margin: 0;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.2;
  word-break: keep-all;
}

.complete__msg {
  margin: 0.5rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--orange-dark);
}

/* ===== レアカード ===== */

/* レアカード共通グロー */
.rare-card__art-glow {
  background: radial-gradient(circle at 30% 30%, #fffde4 0%, #fbbf24 40%, #f59e0b 70%, #d97706 100%) !important;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12), 0 0 16px rgba(251, 191, 36, 0.6), 0 0 32px rgba(245, 158, 11, 0.3) !important;
  animation: rareGlow 2s ease-in-out infinite alternate;
}

@keyframes rareGlow {
  0% { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12), 0 0 12px rgba(251, 191, 36, 0.5); }
  100% { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12), 0 0 24px rgba(251, 191, 36, 0.9), 0 0 48px rgba(245, 158, 11, 0.4); }
}

/* レアバッジ */
.rare-card__badge {
  font-size: 0.85rem;
  font-weight: 800;
  color: #92400e;
  background: linear-gradient(90deg, #fde68a, #fbbf24, #fde68a);
  background-size: 200% 100%;
  animation: shimmerBadge 2s linear infinite;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
  display: inline-block;
}

.rare-card__badge--sm {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  margin: 0.25rem 0 0;
}

.rare-card__badge--mini {
  font-size: 0.75rem;
  font-weight: 800;
  color: #92400e;
  background: linear-gradient(90deg, #fde68a, #fbbf24);
  padding: 0.1rem 0.4rem;
  border-radius: 0.4rem;
  min-width: 2rem;
  text-align: center;
}

@keyframes shimmerBadge {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* カード一覧でのレアカード */
.card--rare {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%);
  border: 3px solid #f59e0b;
  position: relative;
  overflow: hidden;
}

.card--rare::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.5) 45%, transparent 50%);
  background-size: 250% 100%;
  animation: cardShimmer 3s ease-in-out infinite;
  pointer-events: none;
  border-radius: inherit;
}

@keyframes cardShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* レアカード一覧セクションヘッダー */
.cards-section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem;
  margin-top: 0.25rem;
  background: linear-gradient(90deg, #fef3c7, #fde68a, #fef3c7);
  border-radius: 0.75rem;
  font-weight: 800;
  font-size: 1rem;
  color: #92400e;
}

.cards-section-header__icon {
  font-size: 1.2rem;
}

.cards-section-header__count {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* レアカードポップアップ */
.popup__inner--rare {
  max-width: 22rem;
  border: 4px solid #f59e0b;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  box-shadow: 0 0 60px rgba(251, 191, 36, 0.5), 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: rarePop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes rarePop {
  0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  50% { transform: scale(1.1) rotate(2deg); opacity: 1; }
  70% { transform: scale(0.95) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.rare-popup__flash {
  margin: 0 0 0.3rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.8), 0 0 30px rgba(245, 158, 11, 0.5);
  animation: rareFlash 0.8s ease-in-out infinite alternate;
}

@keyframes rareFlash {
  0% { opacity: 0.7; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1.03); }
}

.rare-popup__title {
  color: #fef3c7 !important;
}

.card--rare-popup {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fef3c7;
  flex-direction: column;
  text-align: center;
  padding: 1rem;
}

.card--rare-popup .card__name-en {
  color: #fbbf24;
  font-size: 1.15rem;
}

.card--rare-popup .card__name-jp {
  color: #fde68a;
}

.btn--rare {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
  font-weight: 800;
}

@media (min-width: 400px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}
