:root {
  color-scheme: dark;
  --bg: #120719;
  --panel: rgba(31, 15, 42, 0.78);
  --panel-strong: rgba(43, 18, 58, 0.95);
  --line: rgba(255, 209, 102, 0.24);
  --gold: #ffdf8e;
  --gold-strong: #ffb703;
  --pink: #ff5fa2;
  --violet: #8c5cff;
  --text: #fff7e8;
  --muted: #cbb7d8;
  --danger: #ff7a90;
  --ok: #7df5c8;
  --font-body: "Kosugi Maru", "Noto Sans JP", sans-serif;
  --font-display: "Zen Maru Gothic", sans-serif;
  --font-number: "Fredoka", sans-serif;
  --shadow-1: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 18px 40px rgba(0, 0, 0, 0.45);
  --glow-gold: 0 0 24px rgba(255, 223, 142, 0.45);
  --glow-pink: 0 0 24px rgba(255, 95, 162, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 95, 162, 0.24), transparent 30rem),
    radial-gradient(circle at 78% 12%, rgba(140, 92, 255, 0.28), transparent 34rem),
    linear-gradient(160deg, #13071b 0%, #24103a 52%, #0b0711 100%);
}

button {
  border: 0;
  font: inherit;
  transition: transform 120ms ease;
}

button:active:not(:disabled) {
  transform: scale(0.96);
}

.app-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 14px 44px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 22px;
  align-items: center;
  min-height: 210px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 100%;
  margin-bottom: 14px;
  font-size: clamp(2.45rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-family: var(--font-display);
}

h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
  font-family: var(--font-display);
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.hero-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 0.72;
  justify-self: end;
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.08), transparent 40%),
    linear-gradient(160deg, #421068, #190826);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42), inset 0 0 0 8px rgba(255, 209, 102, 0.07);
  transform: rotate(6deg);
}

.hero-card span {
  position: relative;
  color: var(--gold);
  font-size: 3.2rem;
  font-weight: 900;
}

.hero-card-glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: rgba(255, 184, 3, 0.4);
  filter: blur(26px);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  min-width: 0;
}

.play-panel,
.stats-card,
.collection-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.play-panel {
  padding: 22px;
  overflow: hidden;
  position: relative;
}

.panel-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header.compact {
  margin-bottom: 14px;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
  font-weight: 700;
}

.pill.accent {
  color: #221105;
  background: linear-gradient(135deg, var(--gold), #ff8fab);
}

.message {
  min-height: 48px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 209, 102, 0.08);
  line-height: 1.45;
  transition:
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.message[data-mode="success"] {
  border-color: rgba(255, 209, 102, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.22), rgba(255, 95, 162, 0.12)),
    rgba(255, 209, 102, 0.08);
  box-shadow: 0 0 28px rgba(255, 184, 3, 0.18);
  animation: successMessage 560ms ease both;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: min(540px, 70vh);
  margin: 0 auto;
  touch-action: none;
}

.memory-card {
  position: relative;
  aspect-ratio: 9 / 16;
  min-width: 0;
  border-radius: 14px;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.memory-card button {
  position: absolute;
  inset: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  transform-style: preserve-3d;
  transform-origin: center;
  will-change: transform, filter;
  transition:
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 220ms ease,
    box-shadow 220ms ease;
  touch-action: none;
}

.memory-card button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px) rotateX(2deg);
}

/* タップ/クリックした瞬間に「押した感」を即時表示するため、
   transformのtransitionだけ短くオーバーライド（めくり680msとは独立させる） */
.memory-card button:active {
  transition: transform 80ms ease-out, filter 120ms ease, box-shadow 220ms ease;
  transform: translateY(1px) scale(0.97);
  filter: brightness(0.96);
}

.memory-card.is-flipped button,
.memory-card.is-matched button {
  transform: translateY(-3px) rotateZ(0.001deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition:
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 680ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card-back {
  border: 1px solid rgba(255, 209, 102, 0.5);
  background:
    linear-gradient(rgba(10, 5, 18, 0.04), rgba(10, 5, 18, 0.18)),
    url("./assets/cards/forlove-card-back.webp") center / 116% auto;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  -webkit-transform: rotateY(0deg) translateZ(1px);
  transform: rotateY(0deg) translateZ(1px);
  opacity: 1;
}

.memory-card.is-flipped .card-back,
.memory-card.is-matched .card-back {
  filter: brightness(0.82);
  -webkit-transform: rotateY(-180.01deg) translateZ(1px);
  transform: rotateY(-180.01deg) translateZ(1px);
}

.card-front {
  padding: 0;
  border: 1px solid var(--rarity-border, rgba(255, 209, 102, 0.5));
  background: #090512;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 26px rgba(0, 0, 0, 0.38);
  -webkit-transform: rotateY(180.01deg) translateZ(1px);
  transform: rotateY(180.01deg) translateZ(1px);
  opacity: 0;
}

.memory-card.is-flipped .card-front,
.memory-card.is-matched .card-front {
  -webkit-transform: rotateY(0deg) translateZ(1px);
  transform: rotateY(0deg) translateZ(1px);
  opacity: 1;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 22px var(--rarity-glow, transparent);
}

/* 盤面カードのホロ反射スイープ（めくり成立時に一度だけ走る） */
.card-front .card-sweep {
  position: absolute;
  inset: -20% -60%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(75deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%);
  mix-blend-mode: color-dodge;
}

.memory-card.is-flipped .card-front .card-sweep,
.memory-card.is-matched .card-front .card-sweep {
  animation: cardSweep 900ms ease-out;
}

[data-rarity="SR"] .card-front .card-sweep,
[data-rarity="SSR"] .card-front .card-sweep,
[data-rarity="UR"] .card-front .card-sweep {
  background: linear-gradient(75deg, transparent 32%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 209, 102, 0.55) 62%, transparent 72%);
}

@keyframes cardSweep {
  0% {
    opacity: 0;
    transform: translateX(-120%) rotate(10deg);
  }
  18% {
    opacity: 1;
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(120%) rotate(10deg);
  }
}

.card-art,
.collection-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-art {
  position: absolute;
  inset: 0;
}

.card-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(4, 2, 10, 0.78));
  pointer-events: none;
}

.card-meta {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 8px;
}

.card-name {
  display: block;
  max-width: calc(100% - 34px);
  overflow: hidden;
  color: white;
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.card-rarity,
.rarity-badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: #210c06;
  background: linear-gradient(135deg, #fff1a8, #ff9f1c);
  font-size: 0.72rem;
  font-weight: 900;
  font-family: var(--font-number);
}

.card-meta .card-rarity {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  font-size: 0.65rem;
}

.memory-card.is-matched {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 400ms ease, visibility 400ms ease;
}

.memory-card.is-new-match {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2;
  animation: matchedCardPop 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.memory-card.is-new-match .card-front {
  border-color: rgba(255, 229, 139, 0.95);
  box-shadow:
    0 0 0 2px rgba(255, 209, 102, 0.42),
    0 0 34px rgba(255, 184, 3, 0.48),
    0 18px 46px rgba(0, 0, 0, 0.48);
}

.match-burst {
  position: absolute;
  inset: -28%;
  z-index: 2;
  background:
    radial-gradient(circle, rgba(255, 241, 168, 0.74), transparent 22%),
    conic-gradient(
      from 10deg,
      transparent,
      rgba(255, 209, 102, 0.72),
      transparent,
      rgba(255, 95, 162, 0.42),
      transparent
    );
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: matchBurst 900ms ease-out both;
}

.match-label {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 50%;
  padding: 5px 10px;
  border-radius: 999px;
  color: #210c06;
  background: linear-gradient(135deg, #fff1a8, #ff9f1c);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.04em;
  transform: translateX(-50%);
  animation: matchLabel 980ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.primary-button {
  color: #210c06;
  background: linear-gradient(135deg, var(--gold), #ff8fab);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(0, 0, 0, 0.14),
    0 3px 0 rgba(196, 138, 33, 0.55),
    var(--shadow-2);
}

.secondary-button {
  color: var(--text);
  border: 1px solid rgba(255, 209, 102, 0.42);
  background: rgba(255, 209, 102, 0.11);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 0 rgba(0, 0, 0, 0.25),
    var(--shadow-1);
}

.ghost-button {
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 0 rgba(0, 0, 0, 0.2);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.ghost-button:active:not(:disabled) {
  transform: translateY(2px) scale(0.97);
  filter: brightness(0.96);
}

.primary-button:active:not(:disabled) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(0, 0, 0, 0.14),
    0 1px 0 rgba(196, 138, 33, 0.55);
}

.secondary-button:active:not(:disabled) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 rgba(0, 0, 0, 0.25);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.memory-card button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.memory-card.is-flipped button:disabled {
  opacity: 1;
}

.side-panel {
  display: grid;
  gap: 20px;
}

.stats-card,
.collection-panel {
  padding: 18px;
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.stats-row:last-child {
  border-bottom: 0;
}

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

.collection {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.collection-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  border: 1px solid rgba(255, 209, 102, 0.24);
  border-radius: 12px;
  cursor: pointer;
  background: var(--card-gradient);
  transform-style: preserve-3d;
  transition: transform 180ms, box-shadow 180ms;
}

.collection-item:hover {
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  transform: rotateX(8deg) rotateY(-10deg) translateY(-3px);
}

.collection-item.is-locked {
  cursor: default;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.collection-item.is-locked::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.34);
  font-size: 2rem;
  font-weight: 900;
}

.collection-item .mini-name {
  position: absolute;
  z-index: 1;
  right: 7px;
  bottom: 7px;
  left: 7px;
  color: white;
  font-size: 0.68rem;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.card-dialog {
  width: min(860px, calc(100% - 28px));
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 22px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.card-dialog::backdrop {
  background: rgba(6, 2, 10, 0.72);
  backdrop-filter: blur(10px);
}

.dialog-layout {
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: center;
  padding: 18px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.4rem;
  z-index: 10;
}

.detail-card {
  position: relative;
  min-height: 360px;
  aspect-ratio: 9 / 16;
  padding: 0;
  border: 1px solid rgba(255, 209, 102, 0.6);
  border-radius: 20px;
  overflow: hidden;
  background: var(--card-gradient);
  transform-style: preserve-3d;
  animation: floatCard 4s ease-in-out infinite;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
  will-change: transform;
}

.detail-card.is-interacting {
  animation: none;
  transition: transform 0.08s linear;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(255, 209, 102, 0.25);
}

.detail-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgba(5, 2, 10, 0.82));
  pointer-events: none;
}

.card-shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.15;
  mix-blend-mode: color-dodge;
  transition: opacity 0.3s ease;
  background: 
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.45) 0%, transparent 60%),
    linear-gradient(135deg, rgba(255, 95, 162, 0.1), rgba(140, 92, 255, 0.1));
}

.detail-card.is-interacting .card-shine {
  opacity: 0.65;
}

/* 高レアリティ（SR / UR / LEG / SSR）の特殊ホログラム効果 */
[data-rarity="SR"] .card-shine,
[data-rarity="UR"] .card-shine,
[data-rarity="SSR"] .card-shine {
  background: 
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.1) 40%, transparent 70%),
    linear-gradient(var(--angle, 135deg), rgba(255, 95, 162, 0.3), rgba(140, 92, 255, 0.3), rgba(255, 209, 102, 0.3), rgba(255, 95, 162, 0.3));
  opacity: 0.3;
}

.detail-card.is-interacting[data-rarity="SR"] .card-shine,
.detail-card.is-interacting[data-rarity="UR"] .card-shine,
.detail-card.is-interacting[data-rarity="SSR"] .card-shine {
  opacity: 0.85;
}

.detail-card .card-rarity,
.detail-card .card-title {
  z-index: 1;
  position: relative;
}

.detail-card .card-rarity {
  position: absolute;
  top: 14px;
  right: 14px;
}

.detail-card .card-title {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  color: white;
  font-size: 1.4rem;
  font-weight: 900;
}

.dialog-copy p {
  color: var(--muted);
  line-height: 1.8;
}

.video-box {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.play-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #210c06;
  background: var(--gold);
  font-weight: 900;
}

.wide {
  width: 100%;
}

[data-rarity="R"] {
  --card-gradient: linear-gradient(145deg, #285c76, #6c3fb2);
  --rarity-border: rgba(108, 156, 255, 0.6);
  --rarity-glow: rgba(108, 156, 255, 0.4);
}

[data-rarity="SR"] {
  --card-gradient: linear-gradient(145deg, #8b2f7f, #2e1f72 50%, #d6942c);
  --rarity-border: rgba(255, 183, 3, 0.7);
  --rarity-glow: rgba(255, 183, 3, 0.45);
}

[data-rarity="SSR"] {
  --card-gradient: linear-gradient(135deg, #270b45, #af347d 38%, #ffcb47 72%, #6f2cff);
  --rarity-border: rgba(255, 143, 171, 0.8);
  --rarity-glow: rgba(255, 95, 162, 0.5);
}

[data-rarity="UR"] {
  --card-gradient:
    linear-gradient(115deg, rgba(255, 255, 255, 0.35), transparent 28%, rgba(255, 255, 255, 0.28) 48%, transparent 66%),
    linear-gradient(135deg, #111827, #6d28d9 28%, #db2777 58%, #facc15);
  --rarity-border: rgba(250, 204, 21, 0.9);
  --rarity-glow: rgba(124, 77, 255, 0.6);
}

[data-rarity="N"] {
  --card-gradient: linear-gradient(145deg, #3b1b5d, #7d2f77);
  --rarity-border: rgba(203, 183, 216, 0.4);
  --rarity-glow: rgba(203, 183, 216, 0.2);
}

@keyframes floatCard {
  0%,
  100% {
    transform: rotateX(0deg) rotateY(-4deg) translateY(0);
  }
  50% {
    transform: rotateX(5deg) rotateY(7deg) translateY(-8px);
  }
}

@keyframes shine {
  0%,
  35% {
    transform: translateX(-55%) rotate(8deg);
  }
  70%,
  100% {
    transform: translateX(55%) rotate(8deg);
  }
}

@keyframes matchedCardPop {
  0% {
    transform: scale(1);
  }
  32% {
    transform: scale(1.08) translateY(-5px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

@keyframes matchBurst {
  0% {
    opacity: 0;
    transform: scale(0.6) rotate(0deg);
  }
  34% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: scale(1.22) rotate(24deg);
  }
}

@keyframes matchLabel {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.72);
  }
  28% {
    opacity: 1;
    transform: translate(-50%, -3px) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -18px) scale(0.96);
  }
}

@keyframes successMessage {
  0% {
    transform: scale(0.985);
  }
  58% {
    transform: scale(1.012);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 900px) {
  .hero {
    display: none;
  }

  .main-grid,
  .dialog-layout {
    grid-template-columns: 1fr;
  }

  .hero-card {
    display: none;
  }

  .main-grid {
    gap: 14px;
  }

  .dialog-layout {
    padding-top: 44px;
  }

  .detail-card {
    width: min(260px, 100%);
    min-height: 360px;
    margin: 0 auto;
  }

  .board {
    max-width: min(460px, 64vh);
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: 100%;
    max-width: 390px;
    margin: 0;
    padding: 18px 8px 34px;
  }

  .play-panel {
    padding: 12px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 2.2rem;
    line-height: 1.08;
  }

  .status-pills {
    justify-content: flex-start;
  }

  .board {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: min(310px, 46vh);
  }

  .memory-card {
    width: 100%;
    border-radius: 10px;
  }

  .card-face {
    border-radius: 10px;
  }

  .card-front {
    padding: 0;
  }

  .card-name {
    display: none;
  }

  .collection {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   追加スタイル: 親密度 (推しとの絆) / 動画解放 / ボイス / 全めくり演出
   ========================================================================== */

/* 推しとの絆パネル */
.bonds-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.bonds-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.bond-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 200ms ease, border-color 200ms ease;
}

.bond-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 209, 102, 0.15);
}

.bond-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.bond-icon {
  font-size: 1.1rem;
}

.bond-name {
  font-weight: 800;
  color: var(--text);
}

.bond-level {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 99px;
  margin-left: 2px;
}

.bond-pts {
  margin-left: auto;
  font-weight: 800;
  color: var(--gold);
  font-size: 0.8rem;
}

.bond-progress-wrap {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
}

.bond-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--pink), var(--gold));
  box-shadow: 0 0 8px var(--pink);
  transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* 動画ギャラリーパネル */
.video-gallery-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.video-item {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.video-item:not(.is-locked):hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(255, 209, 102, 0.12);
}

.video-item.is-locked {
  cursor: not-allowed;
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.02);
}

.video-thumbnail {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1f0b2a, #0d0412);
  display: grid;
  place-items: center;
  position: relative;
}

.video-item:not(.is-locked) .video-thumbnail::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 95, 162, 0.15), transparent 70%);
}

.play-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #210c06;
  font-size: 0.74rem;
  font-weight: 900;
  padding-left: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.lock-icon {
  font-size: 1.1rem;
  color: var(--muted);
}

.video-info {
  padding: 8px;
}

.video-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.video-tag {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
}

/* アルバム詳細ダイアログのレイアウト＆下部プレート */
.dialog-plate-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.album-plate {
  position: relative;
  background: rgba(14, 5, 22, 0.65);
  border-radius: 12px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  font-family: "Courier New", Courier, monospace, "Noto Sans JP", sans-serif;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  font-size: 0.88rem;
  line-height: 1.7;
  color: #ffebd3;
  text-align: left;
}

.plate-divider {
  color: rgba(255, 209, 102, 0.45);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 2px 0;
}

.plate-name-line {
  font-size: 1.05rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.plate-situation {
  font-weight: 700;
  margin: 2px 0;
}

.plate-rarity {
  font-weight: 800;
  color: var(--pink);
  margin: 2px 0;
}

.plate-date {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  margin: 2px 0;
}

.plate-quote {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold);
  margin: 6px 0 4px 0;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.dialog-description {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* ボイスプレイヤーとビジュアライザー */
.voice-player-container {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.voice-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  color: #210c06;
  background: linear-gradient(135deg, var(--gold), #ffb703);
  box-shadow: 0 4px 12px rgba(255, 209, 102, 0.24);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.voice-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 209, 102, 0.32);
}

.voice-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
  width: 40px;
}

.voice-visualizer .bar {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background-color: var(--pink);
  box-shadow: 0 0 6px var(--pink);
  transition: height 150ms ease;
}

.voice-visualizer.is-playing .bar {
  animation: visualizerBar 800ms ease infinite alternate;
}

.voice-visualizer.is-playing .bar:nth-child(1) { animation-delay: 0.1s; }
.voice-visualizer.is-playing .bar:nth-child(2) { animation-delay: 0.3s; }
.voice-visualizer.is-playing .bar:nth-child(3) { animation-delay: 0.0s; }
.voice-visualizer.is-playing .bar:nth-child(4) { animation-delay: 0.4s; }
.voice-visualizer.is-playing .bar:nth-child(5) { animation-delay: 0.2s; }

@keyframes visualizerBar {
  0% { height: 4px; }
  100% { height: 20px; }
}

/* 動画再生シミュレーターダイアログ */
.video-dialog {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: #000;
  padding: 0;
  overflow: hidden;
  width: min(340px, 95vw);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85);
}

.video-dialog-content {
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
}

.mock-video-player {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 20%, transparent 80%), #14051d;
  overflow: hidden;
}

.video-glow {
  position: absolute;
  inset: 20%;
  background: radial-gradient(circle, var(--pink) 0%, var(--violet) 50%, transparent 100%);
  opacity: 0.35;
  filter: blur(40px);
  animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.25; }
  100% { transform: scale(1.2); opacity: 0.45; }
}

.video-loading-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.video-loading-bars span {
  width: 8px;
  height: 35px;
  border-radius: 99px;
  background: var(--gold);
  animation: loadingBarPulse 1s ease-in-out infinite alternate;
}

.video-loading-bars span:nth-child(1) { animation-delay: 0.2s; }
.video-loading-bars span:nth-child(2) { animation-delay: 0.4s; }
.video-loading-bars span:nth-child(3) { animation-delay: 0s; }

@keyframes loadingBarPulse {
  0% { transform: scaleY(0.4); opacity: 0.3; }
  100% { transform: scaleY(1.2); opacity: 0.9; }
}

.video-overlay {
  padding: 20px;
  z-index: 2;
}

.video-overlay h3 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.video-overlay p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.video-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 24px;
  z-index: 2;
}

.control-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar-wrap {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--pink);
  box-shadow: 0 0 6px var(--pink);
  transition: width 100ms linear;
}

.video-time {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: monospace;
}

/* ご褒美ムービー（LEGカード特別ムービー）解放ボタン */
.leg-movie-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  color: #2a0f04;
  border: none;
  background: linear-gradient(135deg, var(--gold-strong), var(--pink), var(--violet), var(--gold-strong));
  background-size: 300% 300%;
  animation: legMovieGlow 4s ease-in-out infinite;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 3px 0 rgba(140, 92, 255, 0.45),
    0 0 18px rgba(255, 95, 162, 0.45);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  margin-top: 10px;
}

.leg-movie-button:active {
  transform: translateY(2px) scale(0.97);
  filter: brightness(0.96);
}

@keyframes legMovieGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ご褒美ムービー再生ダイアログ */
.leg-movie-dialog {
  border: none;
  border-radius: 16px;
  background: #000;
  padding: 0;
  overflow: hidden;
  width: min(900px, 96vw);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85), 0 0 40px rgba(255, 95, 162, 0.3);
}

.leg-movie-dialog::backdrop {
  background: rgba(8, 2, 14, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.leg-movie-dialog-content {
  position: relative;
  width: 100%;
}

.leg-movie-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.leg-movie-dialog .close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

/* 全めくりボーナス演出オーバーレイ */
.perfect-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(14, 5, 22, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
  backdrop-filter: blur(12px);
}

.perfect-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.perfect-content {
  text-align: center;
  max-width: min(760px, 95vw);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  margin: auto 0;
  transform: scale(0.9);
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.perfect-overlay.is-visible .perfect-content {
  transform: scale(1);
}

.perfect-ribbon {
  font-size: 2.2rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fff3b0, #ca9e5a, #fff3b0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  text-shadow: 0 0 30px rgba(255, 209, 102, 0.35);
  animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.04); filter: brightness(1.15); }
}

.perfect-character-box {
  width: 170px;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--gold);
  position: relative;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 183, 3, 0.25);
  margin-bottom: 20px;
}

.perfect-character-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.perfect-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 20px rgba(255, 209, 102, 0.6);
  pointer-events: none;
}

.perfect-content h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 14px 0;
}

.perfect-speech-bubble {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.perfect-speech-bubble::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent rgba(255, 255, 255, 0.07) transparent;
}

.perfect-speech-bubble p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 800;
  color: var(--gold);
}

.perfect-reward {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255, 95, 162, 0.15), rgba(140, 92, 255, 0.15));
  border: 1px solid rgba(255, 95, 162, 0.3);
  padding: 8px 18px;
  border-radius: 99px;
  margin-bottom: 28px;
  box-shadow: 0 0 15px rgba(255, 95, 162, 0.15);
}

.reward-icon {
  font-size: 1.2rem;
  animation: heartPulse 1s infinite alternate;
}

@keyframes heartPulse {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.2); }
}

.reward-text {
  font-size: 0.84rem;
  font-weight: 900;
  color: #ff8fab;
}

.perfect-btn {
  width: 220px;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(255, 95, 162, 0.35);
}

.sparkles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background: 
    radial-gradient(circle, #fff 10%, transparent 11%),
    radial-gradient(circle, #fff 10%, transparent 11%),
    radial-gradient(circle, #fff 10%, transparent 11%);
  background-size: 40px 40px, 60px 60px, 50px 50px;
  background-position: 0 0, 15px 15px, 25px 5px;
  opacity: 0.15;
}

/* ==========================================================================
   追加スタイル: ガチャ風リザルト＆SNSシェア
   ========================================================================== */
.perfect-layout-container {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  margin-bottom: 24px;
}

.perfect-left-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 200px;
}

.perfect-right-panel {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.result-section-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #a29bfe;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-left: 3px solid var(--pink);
  padding-left: 8px;
}

.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2px;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--gold);
}

.result-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.result-card-item {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.result-card-item:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 20px rgba(255, 209, 102, 0.25);
  border-color: var(--gold);
}

.result-card-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-card-rarity {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  z-index: 2;
}

/* Rarity border styles for result cards */
.result-card-item[data-rarity="N"] { border-color: rgba(255,255,255,0.2); }
.result-card-item[data-rarity="R"] { border-color: #4ea8de; }
.result-card-item[data-rarity="SR"] { border-color: #8c5cff; }
.result-card-item[data-rarity="SSR"] { border-color: #ffb703; }
.result-card-item[data-rarity="UR"] { border-color: #ff5fa2; }
.result-card-item[data-rarity="LEG"] { border-color: var(--gold); box-shadow: 0 0 8px rgba(255,209,102,0.3); }

.result-card-rarity[data-rarity="N"] { background: rgba(100,100,100,0.85); }
.result-card-rarity[data-rarity="R"] { background: rgba(78,168,222,0.85); }
.result-card-rarity[data-rarity="SR"] { background: rgba(140,92,255,0.85); }
.result-card-rarity[data-rarity="SSR"] { background: rgba(255,183,3,0.85); }
.result-card-rarity[data-rarity="UR"] { background: rgba(255,95,162,0.85); }
.result-card-rarity[data-rarity="LEG"] { background: linear-gradient(135deg, #ca9e5a, #fff3b0); color: #000; font-weight: 1000; }

/* Seasonal event neon banner */
.seasonal-event-banner {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ffb3d9;
  padding: 4px 0 10px;
  animation: seasonalNeonPulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes seasonalNeonPulse {
  0%, 100% {
    text-shadow:
      0 0 4px #ff69b4,
      0 0 10px #ff69b4,
      0 0 20px rgba(255, 105, 180, 0.6);
  }
  50% {
    text-shadow:
      0 0 8px #ff69b4,
      0 0 20px #ff69b4,
      0 0 40px rgba(255, 105, 180, 0.8),
      0 0 60px rgba(255, 105, 180, 0.3);
  }
}

/* Blinking [NEW!] badge */
.new-badge-blinking {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ff3366;
  color: #fff;
  font-size: 0.5rem;
  font-weight: 1000;
  padding: 1px 3px;
  border-radius: 3px;
  z-index: 2;
  box-shadow: 0 0 6px #ff3366;
  animation: newBadgeBlink 800ms ease-in-out infinite alternate;
}

@keyframes newBadgeBlink {
  0% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* Share actions styles */
.share-actions-section {
  display: flex;
  gap: 12px;
  width: 100%;
}

.share-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
  backdrop-filter: blur(8px);
}

.share-button:active {
  transform: scale(0.97);
}

.x-share-btn {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

.x-share-btn:hover {
  background: rgba(20, 20, 20, 0.7);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.line-share-btn {
  background: rgba(6, 199, 85, 0.2);
  border-color: rgba(6, 199, 85, 0.4);
}

.line-share-btn:hover {
  background: rgba(6, 199, 85, 0.45);
  box-shadow: 0 0 15px rgba(6, 199, 85, 0.4);
  transform: translateY(-2px);
}

.share-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}

.share-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .perfect-content {
    max-width: min(450px, 95vw);
  }
  .perfect-layout-container {
    flex-direction: column;
    gap: 16px;
  }
  .perfect-left-panel {
    width: 100%;
  }
  .perfect-right-panel {
    width: 100%;
    padding: 16px;
  }
  .result-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
}

@media (max-width: 440px) {
  .share-actions-section {
    flex-direction: column;
    gap: 8px;
  }
}

/* メディアクエリ対応調整 */
@media (max-width: 900px) {
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

/* ダブり枚数バッジ */
.duplicate-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: white;
  font-size: 0.68rem;
  font-weight: 900;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1.5px solid #fff;
  box-shadow: 0 0 10px rgba(255, 95, 162, 0.6);
  z-index: 2;
  animation: badgePop 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   追加スタイル: 思い出アルバムモード (MVP)
   ========================================================================== */

/* ビュー切替トグルのスタイル */
.mode-navigation {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
  background: rgba(31, 15, 42, 0.45);
  border: 1px solid var(--line);
  padding: 6px;
  border-radius: 99px;
  backdrop-filter: blur(12px);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  z-index: 100;
  position: relative;
}

.mode-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 99px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-nav-btn .icon {
  display: inline-flex;
  width: 1.2em;
  height: 1.2em;
}

.mode-nav-btn .icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.heart-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.15em;
}

.heart-icon svg {
  width: 1em;
  height: 1em;
}

.mode-nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.mode-nav-btn.is-active {
  color: #210c06;
  background: linear-gradient(135deg, var(--gold), #ff8fab);
  box-shadow: var(--glow-gold);
}

/* ビューパネルの切り替え */
.view-panel {
  display: none;
  opacity: 0;
  transition: opacity 300ms ease;
}

.view-panel.active {
  display: block;
  opacity: 1;
}

/* アルバムパネル全体 */
.album-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

/* メンバー選択タブ */
.album-character-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.char-tab-btn {
  padding: 10px 18px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 250ms ease;
}

.char-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.char-tab-btn.is-active {
  color: #fff;
  border-color: var(--char-theme-color, var(--gold));
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 0 12px var(--char-theme-color, var(--gold)),
    inset 0 0 8px rgba(255, 255, 255, 0.05);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

/* アルバムコンテンツレイアウト */
.album-content-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

/* 左側：プロフィールカード */
.album-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.profile-avatar-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  z-index: 2;
}

.profile-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  filter: blur(20px);
  z-index: -1;
  opacity: 0.7;
}

.profile-icon {
  font-size: 3rem;
  line-height: 1;
}

.album-profile-card h2 {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 6px;
  z-index: 2;
}

.profile-theme {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 209, 102, 0.12);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
  z-index: 2;
}

.profile-bonds-card {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 2;
}

.bonds-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.bonds-header strong {
  margin-left: auto;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.bond-progress-wrap {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
  margin-bottom: 6px;
}

.bond-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--pink), var(--gold));
  box-shadow: 0 0 8px var(--pink);
  transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bonds-pts-sub {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

/* 右側：メインコンテンツ */
.album-main-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.album-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.album-section-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  border-left: 3px solid var(--pink);
  padding-left: 10px;
  margin: 0;
}

.album-empty-message {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  font-size: 0.9rem;
}

/* ポラロイド状の思い出カードグリッド */
.album-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
}

.polaroid-card {
  position: relative;
  background: #fff;
  padding: 10px 10px 14px;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  border: none;
  display: flex;
  flex-direction: column;
  transition: transform 250ms ease, box-shadow 250ms ease;
  transform: rotate(var(--polaroid-angle, 0deg));
}

.polaroid-card:nth-child(even) {
  --polaroid-angle: 2deg;
}
.polaroid-card:nth-child(odd) {
  --polaroid-angle: -2deg;
}
.polaroid-card:nth-child(3n) {
  --polaroid-angle: 1.5deg;
}

.polaroid-card:not(.is-locked):hover {
  transform: scale(1.04) rotate(0deg) translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.polaroid-card.is-locked {
  cursor: default;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.polaroid-image-wrap {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 2px;
  overflow: hidden;
  background: #090512;
  position: relative;
}

.polaroid-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.polaroid-image-wrap.silhouette {
  background: #191221;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
}

.lock-overlay .lock-icon {
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.6);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.polaroid-caption {
  margin-top: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.polaroid-title {
  color: #2b1238;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.polaroid-rarity {
  align-self: flex-start;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 99px;
  color: #fff;
  background: #ff5fa2;
}

.polaroid-card.is-locked .polaroid-title {
  color: #8c7696;
}
.polaroid-card.is-locked .polaroid-rarity {
  background: #8c7696;
}

/* シアター動画グリッド */
.album-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.album-video-item {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  padding: 0;
  text-align: left;
  width: 100%;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.album-video-item:not(.is-locked):hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(255, 209, 102, 0.12);
}

.album-video-item.is-locked {
  cursor: not-allowed;
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.02);
}

/* モバイルレスポンシブ対応 */
@media (max-width: 900px) {
  .album-content-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 520px) {
  .album-panel {
    padding: 16px;
  }
  .album-collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }
  .polaroid-card {
    padding: 8px 8px 10px;
  }
}

/* ハート・ダイヤ表示関連のスタイル */
.heart-stat-pill,
.diamond-stat-pill {
  transition: all 0.3s ease;
}

.heart-stat-pill.is-zero,
.diamond-stat-pill.is-zero {
  opacity: 0.5;
  filter: grayscale(1);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.animate-pop {
  animation: creditPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes creditPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--gold); }
  100% { transform: scale(1); }
}

/* ======================================
   運命ゲージ
   ====================================== */
.fate-gauge-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px;
  padding: 0 2px;
}
.fate-gauge-label {
  font-size: 0.78rem;
  color: var(--pink);
  white-space: nowrap;
  font-weight: bold;
}
.fate-gauge-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(255,182,218,0.3);
}
.fate-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6ec7, #ffd700, #a78bfa);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.fate-gauge-count {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  min-width: 44px;
  text-align: right;
}

/* ======================================
   運命の日 オーバーレイ
   ====================================== */
.fateday-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(167,139,250,0.85) 0%, rgba(20,10,40,0.97) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
  backdrop-filter: blur(10px);
}
.fateday-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}
.fateday-content {
  position: relative;
  text-align: center;
  padding: 40px 28px;
  max-width: 360px;
  width: 90%;
  animation: fateDayEntrance 600ms cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes fateDayEntrance {
  from { transform: translateY(30px) scale(0.92); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.fateday-envelope {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
  animation: envelopePulse 2s ease-in-out infinite;
}
@keyframes envelopePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.fateday-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  margin: 0 0 6px;
  text-shadow: 0 0 20px rgba(255,182,218,0.8);
}
.fateday-subtitle {
  font-size: 1rem;
  color: #ffd6f0;
  margin: 0 0 16px;
}
.fateday-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin-bottom: 28px;
}
.fateday-start-btn {
  font-size: 1.05rem;
  padding: 12px 28px;
  background: linear-gradient(135deg, #ff6ec7, #a78bfa);
  border: none;
  border-radius: 30px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(167,139,250,0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}
.fateday-start-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 36px rgba(167,139,250,0.75);
}

/* ======================================
   LEG獲得 虹演出オーバーレイ
   ====================================== */
.leg-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
  overflow: hidden;
}
.leg-reveal-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}
.leg-rainbow-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255,0,128,0.88) 0%,
    rgba(255,165,0,0.88) 20%,
    rgba(255,255,0,0.82) 40%,
    rgba(0,200,100,0.85) 60%,
    rgba(50,100,255,0.88) 80%,
    rgba(150,0,255,0.88) 100%);
  animation: rainbowShift 3s linear infinite;
  backdrop-filter: blur(8px);
}
@keyframes rainbowShift {
  0%   { filter: hue-rotate(0deg) brightness(0.9); }
  50%  { filter: hue-rotate(60deg) brightness(1.05); }
  100% { filter: hue-rotate(0deg) brightness(0.9); }
}
.leg-reveal-content {
  position: relative;
  text-align: center;
  padding: 32px 24px;
  max-width: 340px;
  width: 90%;
  animation: legRevealEntrance 700ms cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes legRevealEntrance {
  from { transform: scale(0.8) rotateY(30deg); opacity: 0; }
  to   { transform: scale(1) rotateY(0deg); opacity: 1; }
}
.leg-reveal-badge {
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  color: #fff;
  text-shadow: 0 0 12px rgba(255,255,255,0.9), 0 0 30px rgba(255,220,0,0.8);
  margin-bottom: 16px;
}
.leg-card-showcase {
  position: relative;
  display: inline-block;
  margin-bottom: 14px;
}
.leg-reveal-img {
  width: 140px;
  height: auto;
  border-radius: 12px;
  border: 3px solid #ffd700;
  box-shadow: 0 0 30px rgba(255,215,0,0.8), 0 0 60px rgba(255,150,0,0.5);
  animation: legCardFloat 2s ease-in-out infinite;
}
@keyframes legCardFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-8px) scale(1.02); }
}
.leg-reveal-rarity-tag {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #ffd700, #ff8c00);
  color: #1a0a00;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 12px;
  border-radius: 99px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.leg-reveal-name {
  font-size: 1.15rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 12px rgba(255,255,255,0.7);
  margin: 20px 0 12px;
}
.leg-speech-bubble {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 16px;
  padding: 12px 18px;
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}
.leg-speech-bubble p {
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.leg-close-btn {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a0a00;
  border: none;
  border-radius: 30px;
  padding: 11px 30px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,215,0,0.5);
  transition: transform 0.15s;
}
.leg-close-btn:hover {
  transform: scale(1.04);
}

/* 購入ダイアログのスタイリング */
.purchase-dialog, .game-over-dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 22px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  padding: 0;
}

.purchase-dialog::backdrop, .game-over-dialog::backdrop {
  background: rgba(6, 2, 10, 0.75);
  backdrop-filter: blur(12px);
}

.purchase-layout, .game-over-layout {
  padding: 30px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.purchase-layout h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.purchase-subtitle {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ハート回復・ハート上限拡張セクション */
.economy-action-section {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: left;
}

.economy-section-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.economy-section-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.4;
}

.economy-action-section button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

/* 商品オプションカード */
.purchase-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  margin-bottom: 24px;
}

.purchase-option-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px 14px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
}

.purchase-option-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 209, 102, 0.24);
  transform: translateY(-2px);
}

.purchase-option-card.selected {
  background: rgba(255, 209, 102, 0.06);
  border-color: var(--gold);
  box-shadow: 
    0 0 15px rgba(255, 209, 102, 0.15),
    inset 0 0 10px rgba(255, 209, 102, 0.05);
}

.purchase-option-card.recommended {
  border-color: rgba(255, 95, 162, 0.25);
}

.purchase-option-card.recommended:hover {
  border-color: rgba(255, 95, 162, 0.45);
}

.purchase-option-card.recommended.selected {
  border-color: var(--pink);
  box-shadow: 
    0 0 18px rgba(255, 95, 162, 0.2),
    inset 0 0 10px rgba(255, 95, 162, 0.05);
}

.save-badge {
  position: absolute;
  top: -10px;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: white;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(255, 95, 162, 0.3);
}

.option-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.option-price {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 8px;
}

.purchase-option-card.recommended .option-price {
  color: #ff8fab;
}

.option-desc {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Square 決済フォーム */
.sq-payment-form {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  margin-top: 8px;
  text-align: left;
  animation: fadeIn 0.3s ease;
}

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

.sq-payment-form h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px;
}

#sq-card-container {
  min-height: 48px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease;
}

#sq-card-container:focus-within {
  border-color: var(--gold);
}

.sq-security-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(125, 245, 200, 0.06);
  border: 1px solid rgba(125, 245, 200, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 20px;
}

.sq-security-info .lock-icon {
  font-size: 1rem;
  color: var(--ok);
}

.sq-security-info .security-text {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.4;
}

.sq-error-msg {
  background: rgba(255, 122, 144, 0.08);
  border: 1px solid rgba(255, 122, 144, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* ゲームオーバーダイアログ */
.game-over-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: pulseIcon 1.5s infinite alternate;
}

@keyframes pulseIcon {
  0% { transform: scale(0.95); filter: drop-shadow(0 0 5px rgba(255,209,102,0.1)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 15px rgba(255,209,102,0.4)); }
}

.game-over-layout h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}

.game-over-msg {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.game-over-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* 保護者同意ダイアログ */
.parental-consent-dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 22px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.parental-consent-dialog::backdrop {
  background: rgba(6, 2, 10, 0.75);
  backdrop-filter: blur(12px);
}

.parental-consent-layout {
  padding: 30px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.parental-consent-layout h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}

.parental-consent-desc {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.parental-consent-summary {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.parental-consent-summary p {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
  padding: 6px 0;
}

.parental-consent-summary p strong {
  color: var(--text);
}

.parental-consent-summary p + p {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.parental-consent-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* デイリーログインボーナスダイアログ */
.daily-login-dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 22px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.daily-login-dialog::backdrop {
  background: rgba(6, 2, 10, 0.75);
  backdrop-filter: blur(12px);
}

.daily-login-layout {
  padding: 30px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.daily-login-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: pulseIcon 1.5s infinite alternate;
}

.daily-login-layout h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}

.daily-login-streak {
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 20px;
}

.login-bonus-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  margin-bottom: 20px;
}

.login-bonus-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.login-bonus-day-label {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 700;
}

.login-bonus-day-icon {
  font-size: 1.1rem;
}

.login-bonus-day-amount {
  font-size: 0.66rem;
  color: var(--text);
  font-weight: 800;
}

.login-bonus-day.is-received {
  background: rgba(125, 245, 200, 0.06);
  border-color: rgba(125, 245, 200, 0.2);
  opacity: 0.6;
}

.login-bonus-day.is-today {
  background: rgba(255, 209, 102, 0.08);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(255, 209, 102, 0.15);
  transform: scale(1.06);
}

.daily-login-today-reward {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.daily-login-today-reward strong {
  color: var(--gold);
}

.hidden {
  display: none !important;
}

@media (max-width: 520px) {
  .purchase-options {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .purchase-option-card {
    padding: 16px 8px 12px;
  }
  .purchase-option-card .option-desc {
    display: none;
  }
  .purchase-option-card .option-price {
    font-size: 1.4rem;
    margin-bottom: 4px;
  }
  .purchase-option-card .option-title {
    margin-bottom: 4px;
  }
  .save-badge {
    font-size: 0.58rem;
    padding: 2px 6px;
    top: -8px;
    white-space: nowrap;
  }
  .purchase-layout {
    padding: 20px 14px;
  }
  .purchase-subtitle {
    margin-bottom: 14px;
  }
  .purchase-layout .economy-action-section {
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .purchase-layout .economy-section-desc {
    margin-bottom: 8px;
  }
  .game-over-layout, .parental-consent-layout, .daily-login-layout {
    padding: 24px 16px;
  }
  .login-bonus-grid {
    gap: 4px;
  }
  .login-bonus-day {
    padding: 6px 1px;
  }
  .login-bonus-day-label {
    font-size: 0.56rem;
  }
}

/* ==========================================================================
   追加：年齢プロフィール、フォーラブトーク、QR交換機能のスタイル
   ========================================================================== */

/* プロフィール設定 */
.profile-dialog,
.safety-dialog,
.qr-exchange-dialog {
  width: min(640px, calc(100% - 28px));
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 22px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.profile-settings-layout,
.safety-layout,
.qr-exchange-layout {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
}

.profile-settings-layout h2,
.safety-layout h2,
.qr-exchange-layout h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-subtitle,
.safety-desc,
.safety-intro {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
  white-space: pre-line;
}

.safety-title {
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0 0 16px;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.safety-service-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.safety-service-card {
  padding: 16px;
  border: 1px solid rgba(255, 122, 144, 0.28);
  border-radius: 14px;
  background: rgba(255, 122, 144, 0.06);
}

.safety-service-name {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--pink);
}

.safety-service-desc {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--text);
}

.safety-service-features {
  margin: 0 0 10px;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.safety-service-phone {
  margin: 0;
  font-size: 0.9rem;
}

.safety-service-phone a {
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
}

.safety-service-phone-note {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.safety-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.safety-dialog-actions .primary-button.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

#profileForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--gold);
}

.form-group select {
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 200ms;
}

.form-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.15);
}

/* フォーラブトーク画面 */
.talk-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  min-height: 520px;
}

.talk-content-layout {
  position: relative;
  margin-top: 14px;
}

/* メンバー選択画面 */
.talk-member-select-view,
.talk-chat-view {
  display: none;
}

.talk-member-select-view.active,
.talk-chat-view.active {
  display: block;
}

.talk-instruction {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.talk-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.talk-member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 220ms, border-color 220ms, background-color 220ms;
}

.talk-member-card:hover {
  transform: translateY(-4px);
  border-color: var(--char-theme-color, var(--gold));
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.talk-member-card.is-done {
  opacity: 0.65;
  cursor: default;
}

.talk-member-card.is-done:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.member-avatar-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  font-size: 2.2rem;
  margin-bottom: 14px;
  box-shadow: 0 0 15px var(--char-glow-color, rgba(255,209,102,0.1));
}

.talk-member-card:hover .member-avatar-ring {
  animation: floatAvatar 1.5s ease-in-out infinite alternate;
}

@keyframes floatAvatar {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

.member-card-name {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: #fff;
}

.member-card-status {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--char-theme-color, var(--muted));
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  margin-top: 10px;
}

/* チャット画面 */
.talk-chat-view {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
}

.chat-avatar {
  font-size: 1.6rem;
}

.chat-history {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 340px;
  overflow-y: auto;
  padding: 20px 16px;
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  animation: bubblePop 280ms cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes bubblePop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.chat-bubble.member {
  align-self: flex-start;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--char-theme-color, rgba(255,209,102,0.25));
  border-top-left-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.chat-bubble.user {
  align-self: flex-end;
  color: #210c06;
  background: linear-gradient(135deg, var(--gold), #ff8fab);
  border-top-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(255, 95, 162, 0.15);
}

.chat-bubble.safety-alert {
  align-self: flex-start;
  color: var(--text);
  background: rgba(255, 122, 144, 0.08);
  border: 1px solid rgba(255, 122, 144, 0.35);
  border-top-left-radius: 4px;
  width: auto;
  max-width: 100%;
  padding: 10px 12px;
}

.safety-show-dialog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 95, 162, 0.45);
  background: rgba(255, 95, 162, 0.14);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 200ms;
}

.safety-show-dialog-btn:hover {
  background: rgba(255, 95, 162, 0.24);
}

.chat-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-option-btn {
  padding: 10px 16px;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 12px;
  background: rgba(255, 209, 102, 0.06);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms, background-color 180ms, border-color 180ms;
}

.chat-option-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 209, 102, 0.15);
  border-color: var(--gold);
}

.chat-mission-box {
  margin: 16px;
  padding: 16px;
  border: 1px solid rgba(125, 245, 200, 0.35);
  border-radius: 12px;
  background: rgba(125, 245, 200, 0.08);
  box-shadow: 0 0 15px rgba(125, 245, 200, 0.1);
  animation: missionPulse 2s infinite alternate;
}

@keyframes missionPulse {
  0% { box-shadow: 0 0 10px rgba(125, 245, 200, 0.08); }
  100% { box-shadow: 0 0 20px rgba(125, 245, 200, 0.25); }
}

.chat-mission-box h4 {
  margin: 0 0 8px;
  color: var(--ok);
  font-size: 0.95rem;
  font-weight: 900;
}

.chat-mission-box p {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

/* セーフティ相談窓口 */
.safety-card-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.safety-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.safety-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--pink);
}

.safety-card p {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

.safety-link-btn {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 95, 162, 0.12);
  border: 1px solid rgba(255, 95, 162, 0.4);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background-color 200ms;
}

.safety-link-btn:hover {
  background: rgba(255, 95, 162, 0.24);
}

/* QR交換モーダル */
.qr-tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 10px;
}

.qr-tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 200ms, color 200ms;
}

.qr-tab-btn.is-active {
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.4);
  color: var(--gold);
}

.qr-section {
  display: none;
}

.qr-section.active {
  display: block;
}

.qr-instruction {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.qr-code-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 18px;
  background: #000;
  overflow: hidden;
}

.qr-code-glow {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.3) 0%, transparent 70%);
  filter: blur(14px);
  animation: qrGlowPulse 3s infinite alternate;
}

@keyframes qrGlowPulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.95; }
}

.qr-code-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  z-index: 2;
}

.mock-qr-gfx {
  position: relative;
  width: 160px;
  height: 160px;
  background: 
    linear-gradient(90deg, #fff 2px, transparent 2px) 0 0,
    linear-gradient(90deg, #fff 2px, transparent 2px) 100% 0,
    linear-gradient(180deg, #fff 2px, transparent 2px) 0 0,
    linear-gradient(180deg, #fff 2px, transparent 2px) 0 100%,
    linear-gradient(270deg, #fff 2px, transparent 2px) 100% 0,
    linear-gradient(270deg, #fff 2px, transparent 2px) 100% 100%,
    linear-gradient(180deg, #fff 2px, transparent 2px) 100% 100%,
    linear-gradient(0deg, #fff 2px, transparent 2px) 0 100%;
  background-size: 20px 20px;
  background-repeat: no-repeat;
  display: grid;
  place-items: center;
}

.mock-qr-gfx::after {
  content: "";
  width: 120px;
  height: 120px;
  background-image: 
    radial-gradient(circle, #fff 2px, transparent 2.5px),
    radial-gradient(circle, #fff 2px, transparent 2.5px);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  opacity: 0.65;
}

.scan-line {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: scanAnim 2s infinite linear;
}

@keyframes scanAnim {
  0% { top: 10px; }
  50% { top: 150px; }
  100% { top: 10px; }
}

.qr-inner-logo {
  position: absolute;
  padding: 4px 8px;
  background: #110719;
  border: 1px solid var(--gold);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--gold);
}

.qr-code-text-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.qr-code-copy-box,
.mock-scanner-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.qr-code-copy-box input,
.mock-scanner-input-group input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 0.88rem;
  font-family: monospace;
}

.qr-warning {
  font-size: 0.78rem;
  color: var(--danger);
  text-align: center;
  margin: 0;
}

/* スキャナシミュレーター */
.scanner-simulation-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.sim-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gold);
  margin: 0 0 4px;
}

.sim-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.4;
}

.sim-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms;
}

.sim-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 209, 102, 0.3);
}

.sim-btn .btn-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.sim-btn:hover .btn-badge {
  background: rgba(255, 209, 102, 0.2);
  color: var(--gold);
}

/* ログインオーバーレイ (Google Login) */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(14, 5, 22, 0.96);
  backdrop-filter: blur(16px);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 24px;
  overflow-y: auto;
}

.login-overlay.active {
  display: flex;
}

/* アプリ内ブラウザ警告バナー */
.in-app-browser-alert {
  width: min(400px, 90vw);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 110, 74, 0.12); /* オレンジ基調の警告色 */
  border: 2px solid #ff6e4a;
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 110, 74, 0.2);
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  text-align: left;
}

@keyframes slideDown {
  from { transform: translateY(-15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.in-app-browser-alert .alert-icon {
  font-size: 1.6rem;
  line-height: 1.1;
}

.in-app-browser-alert .alert-content h4 {
  margin: 0 0 4px 0;
  color: #ff8e72;
  font-size: 0.98rem;
  font-weight: 800;
}

.in-app-browser-alert .alert-content p {
  margin: 0;
  color: #ffe5df;
  font-size: 0.8rem;
  line-height: 1.45;
}

.in-app-browser-alert .alert-content p strong {
  color: #ffbba9;
  text-decoration: underline;
}

.login-card {
  position: relative;
  background: rgba(31, 15, 42, 0.65);
  border: 2px solid rgba(255, 95, 162, 0.3);
  border-radius: 24px;
  padding: 40px 24px;
  width: min(400px, 90vw);
  text-align: center;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(255, 95, 162, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.login-logo-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 95, 162, 0.4) 0%, transparent 70%);
  filter: blur(15px);
  pointer-events: none;
}

.login-avatar-ring {
  font-size: 3.5rem;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--pink);
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(255, 95, 162, 0.3);
  animation: floatRing 3s ease-in-out infinite alternate;
}

@keyframes floatRing {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.login-card h2 {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0 0 12px 0;
  background: linear-gradient(135deg, var(--gold), #ff8fab);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(255, 209, 102, 0.2);
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 32px 0;
  padding: 0 8px;
}

.google-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 14px;
  background: #ffffff;
  color: #1f0b2a;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
  transition: all 200ms ease;
}

.google-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.25);
  background: #f7f7f7;
}

.google-login-btn:active {
  transform: translateY(0);
}

.guest-play-btn {
  width: 100%;
  margin-top: 12px;
  font-size: 0.9rem;
}

.guest-play-note {
  margin-top: 14px;
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--muted);
}

.google-icon {
  font-family: "Product Sans", "Roboto", sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #4285F4, #EA4335, #FBBC05, #34A853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ユーザー表示ピル */
.user-status-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  font-size: 0.82rem;
  color: var(--text);
  margin-left: 12px;
}

.user-status-pill.hidden {
  display: none;
}

.user-email-text {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 700;
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--pink);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 150ms;
}

.logout-btn:hover {
  background: rgba(255, 95, 162, 0.1);
}

/* ゲストプレイ表示ピル */
.guest-status-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
  background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.2);
  border-radius: 99px;
  font-size: 0.82rem;
  color: var(--text);
  margin-left: 12px;
}

.guest-status-pill.hidden {
  display: none;
}

.guest-pill-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.guest-pill-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
}

.guest-login-btn {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 150ms;
  white-space: nowrap;
}

.guest-login-btn:hover {
  background: rgba(255, 209, 102, 0.1);
}

/* コンボチェーンエフェクト */
.combo-container {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.combo-text {
  font-family: var(--font-number);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transform: scale(0.3) rotate(-10deg);
  filter: blur(10px);
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-text.animate-in {
  opacity: 1;
  transform: scale(1) rotate(-4deg);
  filter: blur(0);
}

.combo-text.animate-out {
  opacity: 0;
  transform: scale(1.4) rotate(4deg) translateY(-40px);
  filter: blur(15px);
  transition: all 0.4s ease-in;
}

/* チェーン数によるエフェクトの変化（だんだん大きく・派手に） */
.combo-chain-2 {
  font-size: 2.2rem;
  color: #ff8fab;
  text-shadow: 0 0 15px rgba(255, 143, 171, 0.7), 0 0 30px rgba(255, 143, 171, 0.4);
}

.combo-chain-3 {
  font-size: 2.6rem;
  color: #ff5faf;
  text-shadow: 0 0 20px rgba(255, 95, 175, 0.8), 0 0 40px rgba(255, 95, 175, 0.5);
  animation: comboShake 0.15s ease-in-out 2;
}

.combo-chain-4 {
  font-size: 3.0rem;
  color: #b388ff;
  text-shadow: 0 0 25px rgba(179, 136, 255, 0.9), 0 0 50px rgba(179, 136, 255, 0.6);
  animation: comboShake 0.15s ease-in-out 3;
}

.combo-chain-5 {
  font-size: 3.4rem;
  color: #7c4dff;
  text-shadow: 0 0 30px rgba(124, 77, 255, 1), 0 0 60px rgba(124, 77, 255, 0.7);
  animation: comboPopShake 0.2s ease-in-out infinite alternate;
}

.combo-chain-6 {
  font-size: 3.8rem;
  color: #ffb703;
  text-shadow: 0 0 35px rgba(255, 183, 3, 1), 0 0 70px rgba(255, 183, 3, 0.8);
  animation: comboPopShake 0.15s ease-in-out infinite alternate;
}

.combo-chain-7 {
  font-size: 4.2rem;
  color: #ff9f1c;
  text-shadow: 0 0 45px rgba(255, 159, 28, 1), 0 0 90px rgba(255, 159, 28, 0.9);
  animation: comboPopShake 0.12s ease-in-out infinite alternate;
}

.combo-chain-8 {
  font-size: 5.0rem;
  background: linear-gradient(135deg, #fff3b0, #ff8fab, #8c5cff, #ffebd3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 25px rgba(255, 143, 171, 0.8)) drop-shadow(0 0 50px rgba(140, 92, 255, 0.6));
  animation: comboRainbowShake 0.1s ease-in-out infinite alternate, comboScalePerfect 1s ease-in-out;
}

/* アニメーション用のキーフレーム */
@keyframes comboShake {
  0%, 100% { transform: scale(1) rotate(-4deg); }
  50% { transform: scale(1.05) rotate(-2deg) translate(3px, -2px); }
}

@keyframes comboPopShake {
  0% { transform: scale(1) rotate(-5deg) translate(-2px, 2px); }
  100% { transform: scale(1.1) rotate(-3deg) translate(2px, -2px); }
}

@keyframes comboRainbowShake {
  0% { transform: scale(1.05) rotate(-6deg) translate(-3px, 3px); }
  100% { transform: scale(1.15) rotate(-2deg) translate(3px, -3px); }
}

@keyframes comboScalePerfect {
  0% { transform: scale(0.3) rotate(-15deg); }
  40% { transform: scale(1.3) rotate(-5deg); }
  70% { transform: scale(1.1) rotate(-3deg); }
}

/* 舞い散るハートパーティクル */
.heart-particle {
  position: absolute;
  pointer-events: none;
  font-size: var(--size, 1.2rem);
  opacity: 0;
  will-change: transform, opacity;
  animation: floatHeart var(--duration, 1.2s) cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  z-index: 999;
}

@keyframes floatHeart {
  0% {
    transform: translate(0, 0) scale(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(var(--scale)) rotate(var(--rot));
    opacity: 0;
  }
}

/* ==========================================================================
   プレイステータスバー (デスクトップベース)
   ========================================================================== */
.play-quick-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.stat-pill {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
}

.stat-pill strong {
  color: var(--text);
  font-size: 1.05rem;
  font-family: var(--font-number);
}

.heart-stat-pill {
  background: rgba(255, 95, 162, 0.05);
  border-color: rgba(255, 95, 162, 0.2);
  color: #ff8fab;
}

.diamond-stat-pill {
  background: rgba(125, 211, 252, 0.05);
  border-color: rgba(125, 211, 252, 0.2);
  color: #7dd3fc;
}

.heart-stat-pill strong,
.diamond-stat-pill strong {
  color: #fff;
}

/* ==========================================================================
   モバイルアクセス時の画面調整 (max-width: 520px)
   ========================================================================== */
@media (max-width: 520px) {
  /* ヘッダーの余白調整 */
  .hero {
    min-height: auto;
    padding: 10px 0;
  }
  .lead {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* モードナビゲーションの横スクロール対応（スマホでのはみ出し防止） */
  .mode-navigation {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    max-width: 100%;
    border-radius: 16px;
    padding: 6px 10px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  .mode-navigation::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
  }
  .mode-nav-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .user-status-pill,
  .guest-status-pill {
    flex-shrink: 0;
    margin-left: 4px;
    padding: 6px 10px;
  }

  /* クイックステータスバーのレイアウト調整 */
  .play-quick-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    width: 100%;
  }
  .stat-pill {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.76rem;
    color: var(--muted);
    white-space: nowrap;
  }
  .stat-pill strong {
    color: var(--text);
    font-size: 0.88rem;
  }
  .heart-stat-pill {
    background: rgba(255, 95, 162, 0.05);
    border-color: rgba(255, 95, 162, 0.2);
    color: #ff8fab;
  }

  .diamond-stat-pill {
    background: rgba(125, 211, 252, 0.05);
    border-color: rgba(125, 211, 252, 0.2);
    color: #7dd3fc;
  }

  /* アルバム・プロフィールカードのコンパクト化 */
  .album-profile-card {
    padding: 14px;
  }
  .profile-avatar-wrap {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
  }
  .profile-icon {
    font-size: 2.2rem;
  }
  .album-profile-card h2 {
    font-size: 1.1rem;
    margin-bottom: 2px;
  }
  .profile-theme {
    font-size: 0.72rem;
    margin-bottom: 10px;
  }
  .profile-bonds-card {
    width: 100%;
    padding: 8px 12px;
  }
  .bonds-header {
    font-size: 0.74rem;
  }
  .bonds-pts-sub {
    font-size: 0.68rem;
  }

  /* フォーラブトーク・メンバー選択画面のグリッド（2カラム化） */
  .talk-member-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .talk-member-card {
    padding: 16px 10px;
    border-radius: 12px;
  }
  .member-avatar-ring {
    width: 54px;
    height: 54px;
    font-size: 1.6rem;
    margin-bottom: 8px;
  }
  .member-card-name {
    font-size: 0.9rem;
  }
  .member-card-status {
    font-size: 0.68rem;
    padding: 2px 6px;
    margin-top: 6px;
  }

  /* トークチャット画面のコントロール（選択肢縦積みでタップしやすく） */
  .chat-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 8px;
  }
  .chat-option-btn {
    width: 100%;
    text-align: center;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  /* ログイン画面のコンパクト化 */
  .login-card {
    padding: 30px 16px;
  }
  .login-avatar-ring {
    font-size: 2.8rem;
    width: 76px;
    height: 76px;
    margin-bottom: 16px;
  }
  .login-card h2 {
    font-size: 1.35rem;
  }
  .login-subtitle {
    font-size: 0.8rem;
    margin-bottom: 24px;
  }
  .google-login-btn {
    padding: 12px 16px;
    font-size: 0.88rem;
  }
}

/* 縦幅が短いデバイス（iPhone SEなど）向けの調整 */
@media (max-height: 680px) and (max-width: 900px) {
  .app-shell {
    padding: 10px 8px 16px;
  }
  .mode-navigation {
    margin-bottom: 12px;
    padding: 4px;
    gap: 6px;
  }
  .mode-nav-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
  .play-panel {
    padding: 10px;
  }
  .panel-header {
    margin-bottom: 8px;
  }
  .panel-header h2 {
    font-size: 1.1rem;
  }
  .status-pills .pill {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.74rem;
  }
  .play-quick-stats {
    margin-bottom: 8px;
  }
  .stat-pill {
    padding: 6px 4px;
    font-size: 0.7rem;
  }
  .message {
    min-height: 38px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 0.8rem;
  }
  .board {
    gap: 6px;
    max-width: min(270px, 42vh);
  }
  .actions {
    margin-top: 10px;
    gap: 6px;
  }
  .primary-button, .secondary-button, .ghost-button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.8rem;
    border-radius: 10px;
  }
}

/* ==========================================================================
   本物QRコードとカメラスキャンの追加スタイル
   ========================================================================== */
.qr-code-canvas-container {
  background: #fff; /* 白背景にしてQRコードのコントラストを高める */
  border-radius: 16px;
  padding: 10px;
}
.qr-code-canvas-container img,
.qr-code-canvas-container canvas {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
#qrReader {
  border: 2px solid rgba(255, 209, 102, 0.4);
  border-radius: 12px;
  background: #110719;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
#qrReader video {
  width: 100% !important;
  height: auto !important;
  border-radius: 10px;
  object-fit: cover;
}
/* html5-qrcodeが自動生成するコントロール要素の隠蔽やスタイリング */
#qrReader button {
  background: var(--gold) !important;
  color: #210c06 !important;
  border: none !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  margin: 5px !important;
}
.danger-button {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 200ms ease;
  border: 1px solid #ff4d6d;
  background: rgba(255, 77, 109, 0.1);
  color: #ff4d6d;
}
.danger-button:hover {
  background: #ff4d6d;
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 77, 109, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   対話型チュートリアル (オンボーディング) のスタイル
   ========================================================================== */
.tutorial-container {
  width: 100%;
  margin: 15px 0 25px 0;
  padding: 16px;
  background: rgba(25, 12, 38, 0.7);
  border: 1px solid rgba(255, 154, 162, 0.3);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: tutorialFadeIn 0.4s ease-out;
}

@keyframes tutorialFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tutorial-bubble-wrap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.tutorial-avatar {
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 50%;
  border: 2px solid var(--char-theme-color, #ff9aa2);
  box-shadow: 0 0 15px var(--char-glow-color, rgba(255, 154, 162, 0.3));
  flex-shrink: 0;
  animation: floatAvatar 3s ease-in-out infinite;
}

@keyframes floatAvatar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.tutorial-bubble {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 18px;
  position: relative;
}

/* 吹き出しの三角部分 */
.tutorial-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 20px;
  border-width: 8px 8px 8px 0;
  border-style: solid;
  border-color: transparent rgba(255, 255, 255, 0.05) transparent transparent;
  display: block;
  width: 0;
}

.tutorial-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #f1e9f7;
  word-break: break-all;
}

.tutorial-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tutorial-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 200ms ease;
  border: none;
  font-family: inherit;
}

.tutorial-btn.primary {
  background: linear-gradient(135deg, #ff9aa2, #ffb7b2);
  color: #2b0f11;
  box-shadow: 0 4px 12px rgba(255, 154, 162, 0.4);
}

.tutorial-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 154, 162, 0.6);
}

.tutorial-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1e9f7;
}

.tutorial-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* チュートリアル対象のパルス発光ハイライト */
.tutorial-highlight {
  position: relative;
  z-index: 100;
  animation: cardPulse 1.5s infinite ease-in-out;
  pointer-events: auto !important; /* めくり可能 */
}

@keyframes cardPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 154, 162, 0.5), inset 0 0 5px rgba(255, 154, 162, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 154, 162, 0.9), inset 0 0 10px rgba(255, 154, 162, 0.6);
    transform: scale(1.02);
  }
}

/* チュートリアル進行中のオーバーレイ背景 */
.tutorial-dimmed {
  opacity: 0.3 !important;
  pointer-events: none !important; /* クリック不可 */
  filter: grayscale(0.5);
  transition: all 0.3s ease;
}

/* ==========================================================================
   トースト通知 (Toast) のスタイル
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  max-width: 350px;
  width: calc(100% - 40px);
  pointer-events: none; /* 下の要素の操作を邪魔しない */
}

@media (max-width: 520px) {
  .toast-container {
    top: 15px;
    right: 20px;
    left: 20px;
    max-width: none;
  }
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(25, 12, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: #f1e9f7;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto; /* トースト自体はホバーなどを可能に */
  animation: toastSlideIn 0.3s ease-out forwards;
  transition: all 0.3s ease;
}

.toast-item.animate-out {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-15px) scale(0.9);
  }
}

/* トーストのタイプ別ボーダースタイル */
.toast-item.success {
  border-left: 5px solid #ff9aa2; /* テーマピンク */
}

.toast-item.error {
  border-left: 5px solid #ff4d6d; /* 警告赤 */
}

.toast-item.info {
  border-left: 5px solid #4ea8de; /* インフォ青 */
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  flex-grow: 1;
  line-height: 1.4;
  word-break: break-all;
}

/* ==========================================================================
   カスタムモーダルダイアログ (dialog) のスタイル
   ========================================================================== */
.custom-modal-dialog {
  border: 1px solid rgba(255, 154, 162, 0.3);
  background: rgba(25, 12, 38, 0.85);
  border-radius: 24px;
  padding: 0;
  max-width: 400px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: #f1e9f7;
  overflow: hidden;
  animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScaleIn {
  from {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.custom-modal-dialog::backdrop {
  background: rgba(10, 3, 16, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: backdropFadeIn 0.3s ease forwards;
}

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

.custom-modal-content {
  padding: 24px 28px;
}

.custom-modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: #ffb7b2;
  text-align: center;
  letter-spacing: 0.05em;
}

.custom-modal-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e5daf0;
  margin-bottom: 24px;
  text-align: center;
}

.custom-modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.custom-modal-actions.confirm-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.custom-modal-actions button {
  height: 44px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* ==========================================================================
   追加：日替わりイベントバッジ & 思い出追加（再挑戦）機能のスタイル
   ========================================================================== */

/* 日替わりイベントバッジ */
.daily-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 800;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: badgeGlowPulse 2s infinite alternate;
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
}

@keyframes badgeGlowPulse {
  0% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
  100% { transform: scale(1.03); box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1); }
}

/* 曜日ごとのバッジスタイル */
.event-monday {
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  color: #fff;
  border-color: rgba(255, 117, 140, 0.5);
  box-shadow: 0 0 10px rgba(255, 117, 140, 0.4);
}
.event-member-tue {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
  color: #2b101d;
  border-color: rgba(255, 154, 158, 0.5);
  box-shadow: 0 0 10px rgba(255, 154, 158, 0.4);
}
.event-member-wed {
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
  color: #0b2240;
  border-color: rgba(161, 196, 253, 0.5);
  box-shadow: 0 0 10px rgba(161, 196, 253, 0.4);
}
.event-member-thu {
  background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%);
  color: #2c3e50;
  border-color: rgba(207, 217, 223, 0.5);
  box-shadow: 0 0 10px rgba(207, 217, 223, 0.4);
}
.event-member-fri {
  background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
  color: #24143a;
  border-color: rgba(251, 194, 235, 0.5);
  box-shadow: 0 0 10px rgba(251, 194, 235, 0.4);
}
.event-member-sat {
  background: linear-gradient(135deg, #fdcbf1 0%, #fdcbf1 1%, #e6dee9 100%);
  color: #311c2e;
  border-color: rgba(253, 203, 241, 0.5);
  box-shadow: 0 0 10px rgba(253, 203, 241, 0.4);
}
.event-sunday {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #fff;
  border-color: rgba(246, 211, 101, 0.5);
  box-shadow: 0 0 12px rgba(246, 211, 101, 0.5);
}

/* 思い出追加（再挑戦）機能のUIコンテナ */
.extra-challenge-wrap {
  margin: 16px 0 24px 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

.extra-challenge-box {
  background: rgba(25, 12, 38, 0.6);
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 209, 102, 0.05);
}

.extra-challenge-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffd166;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.2);
}

.extra-challenge-subtext {
  font-size: 0.88rem;
  color: #e5daf0;
  margin-bottom: 16px;
  opacity: 0.9;
}

/* シャイン効果ボタン */
.shine-effect {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 117, 140, 0.3);
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  border: none;
  font-weight: 800;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  color: #fff;
  border-radius: 9999px;
  padding: 10px 24px;
  cursor: pointer;
}

.shine-effect:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(255, 117, 140, 0.5);
}

.shine-effect:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(30deg);
  transition: none;
  animation: buttonShine 4s infinite ease-in-out;
}

@keyframes buttonShine {
  0% { left: -60%; }
  15% { left: 130%; }
  100% { left: 130%; }
}

/* イベント仕様の右上カード */
.hero-card.event-monday-card {
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%) !important;
  border-color: rgba(255, 117, 140, 0.8) !important;
  box-shadow: 0 15px 35px rgba(255, 117, 140, 0.4), inset 0 0 0 8px rgba(255, 255, 255, 0.1) !important;
}
.hero-card.event-monday-card span {
  color: #fff !important;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-card.event-sunday-card {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%) !important;
  border-color: rgba(246, 211, 101, 0.8) !important;
  box-shadow: 0 15px 35px rgba(246, 211, 101, 0.4), inset 0 0 0 8px rgba(255, 255, 255, 0.1) !important;
}
.hero-card.event-sunday-card span {
  color: #fff !important;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-card.event-member-card {
  border-color: rgba(255, 209, 102, 0.7) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 209, 102, 0.2) !important;
}

/* ==========================================================================
   追加：親密度Lv.6「運命」解放の豪華演出用スタイル
   ========================================================================== */

/* 運命解放ダイアログ */
.destiny-release-dialog {
  width: min(480px, calc(100% - 24px));
  border: 2px solid;
  border-image: linear-gradient(135deg, #ff758c, #ff7eb3, #a1c4fd, #c2e9fb, #fbc2eb, #a6c1ee, #f6d365) 1;
  border-radius: 24px;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(35, 12, 54, 0.95) 0%, rgba(13, 4, 22, 0.98) 100%);
  box-shadow: 0 0 50px rgba(255, 117, 140, 0.4), 0 20px 80px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: destinyZoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes destinyZoomIn {
  from {
    transform: scale(0.8) rotate(-2deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.destiny-release-dialog::backdrop {
  background: rgba(8, 2, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: backdropFadeIn 0.4s ease forwards;
}

.destiny-release-layout {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 24px;
  text-align: center;
}

.destiny-release-glow {
  position: absolute;
  top: 15%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 117, 140, 0.3) 0%, transparent 70%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
  animation: destinyGlowSpin 10s linear infinite;
}

@keyframes destinyGlowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.destiny-character-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #ff758c, #a1c4fd, #fbc2eb, #f6d365);
  box-shadow: 0 0 25px rgba(255, 117, 140, 0.4);
  z-index: 1;
  margin-bottom: 20px;
  animation: destinyAvatarFloat 4s ease-in-out infinite alternate;
}

@keyframes destinyAvatarFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.destiny-character-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #110419;
}

.destiny-title {
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffd166, #ff758c, #a6c1ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.3);
  letter-spacing: 0.05em;
  z-index: 1;
}

.destiny-char-name {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 24px;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
  z-index: 1;
}

.destiny-bubble-wrap {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 20px;
  width: 100%;
  margin-bottom: 30px;
  z-index: 1;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.destiny-quote {
  font-size: 0.98rem;
  line-height: 1.6;
  color: #f3ebf7;
  font-weight: 700;
  font-style: italic;
  margin: 0;
  white-space: pre-wrap;
}

.destiny-close-btn {
  background: linear-gradient(135deg, #ff758c, #ff7eb3, #a6c1ee, #f6d365) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 15px rgba(255, 117, 140, 0.4);
  z-index: 1;
  cursor: pointer;
}

.destiny-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255, 117, 140, 0.6);
}

/* 虹色パーティクル */
.rainbow-particle {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: rainbowFall 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes rainbowFall {
  0% {
    transform: translateY(-50px) rotate(0deg) scale(0);
    opacity: 1;
  }
  15% {
    transform: translateY(100px) rotate(45deg) scale(1);
  }
  100% {
    transform: translateY(100vh) rotate(360deg) scale(0.4);
    opacity: 0;
  }
}

/* アルバム画面のレインボーバッジ */
.bonds-badge-level-6 {
  background: linear-gradient(135deg, #ff758c, #ff7eb3, #a1c4fd, #c2e9fb, #fbc2eb, #a6c1ee, #f6d365) !important;
  background-size: 400% 400% !important;
  color: #fff !important;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 10px rgba(255, 117, 140, 0.5);
  animation: bondsRainbowGlow 6s ease infinite !important;
}

@keyframes bondsRainbowGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================================================
   全画面共通ステータス＆ショップバー（今日の16枚ヘッダーに統合）
   ========================================================================== */
.global-economy-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  z-index: 90;
  position: relative;
  flex: 1;
  max-width: 500px;
}

.panel-header .global-economy-bar {
  margin: 0;
  padding: 0;
}

.global-economy-bar .stat-pill.clickable {
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  flex: 1;
}

.global-economy-bar .stat-pill.clickable:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.global-economy-bar .heart-stat-pill.clickable:hover {
  border-color: rgba(255, 95, 162, 0.5);
  box-shadow: 0 8px 24px rgba(255, 95, 162, 0.2);
}

.global-economy-bar .diamond-stat-pill.clickable:hover {
  border-color: rgba(125, 211, 252, 0.5);
  box-shadow: 0 8px 24px rgba(125, 211, 252, 0.2);
}

.global-shop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #210c06;
  background: linear-gradient(135deg, var(--gold), #f78c6c);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: all 300ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.global-shop-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-gold);
  filter: brightness(1.05);
}

.global-shop-btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .panel-header .global-economy-bar {
    max-width: none;
    width: 100%;
    justify-content: space-between;
  }
  
  .status-pills {
    justify-content: center;
    width: 100%;
  }

  .panel-title-area {
    text-align: center;
  }
}

@media (max-width: 520px) {
  .global-economy-bar {
    gap: 8px;
  }
  
  .global-economy-bar .stat-pill.clickable {
    padding: 8px 10px;
    font-size: 0.78rem;
    min-width: auto;
  }
  
  .global-shop-btn {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   限定公開・投票（コンパクトな横並びバナーグループ）
   ========================================================================== */
.action-banner-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: -6px auto 18px;
  max-width: 560px;
  width: 100%;
  padding: 0 14px;
}

.preview-vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  color: #210c06;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  box-shadow: 0 4px 12px rgba(255, 95, 162, 0.2);
  transition: all 300ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  flex: 1;
}

.preview-vote-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 95, 162, 0.3);
}

.line-register-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  color: #ffffff;
  background: #06C755;
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.2);
  transition: all 300ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  flex: 1;
}

.line-register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(6, 199, 85, 0.3);
}

.youtube-channel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  color: #ffffff;
  background: #FF0000;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
  transition: all 300ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  flex: 1;
}

.youtube-channel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.3);
}

@media (max-width: 520px) {
  .action-banner-group {
    gap: 8px;
    padding: 0 8px;
  }
  .preview-vote-btn,
  .line-register-btn,
  .youtube-channel-btn {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
}

.vote-shell {
  max-width: 860px;
}
}

.vote-hero {
  display: block;
  min-height: auto;
  margin-bottom: 20px;
}

.vote-panel {
  padding: 22px;
  margin-bottom: 18px;
}

.vote-status-message {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
}

.vote-candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.vote-candidate-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 7, 25, 0.4);
  position: relative;
}

.vote-candidate-card.is-voted {
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.35);
}

.vote-candidate-image {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
}

.vote-candidate-info strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
}

.vote-candidate-caption {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.vote-candidate-btn {
  width: 100%;
}

.vote-result-bar {
  position: relative;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.vote-result-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  transition: width 400ms ease;
}

.vote-result-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.vote-voted-badge {
  text-align: center;
  font-weight: 800;
  color: var(--gold);
  font-size: 0.85rem;
}

.vote-note {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.vote-back-link {
  text-align: center;
}

.vote-back-link a {
  color: var(--muted);
  text-decoration: none;
}

.vote-back-link a:hover {
  color: var(--gold);
}

/* ==========================================================================
   フッター & GEO対策アコーディオン (FAQ/Guide)
   ========================================================================== */
footer {
  margin-top: 60px;
  padding: 40px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(9, 5, 18, 0.5) 0%, rgba(5, 2, 10, 0.95) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 24px 24px 0 0;
}

.footer-container {
  max-width: 800px;
  margin: 0 auto;
}

.footer-title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 24px;
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 95, 162, 0.3);
}

.geo-accordion-group {
  display: grid;
  gap: 16px;
  margin-bottom: 40px;
}

.geo-accordion {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.geo-accordion[open] {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 209, 102, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 209, 102, 0.05);
}

.geo-accordion:hover {
  border-color: rgba(255, 95, 162, 0.2);
}

.geo-summary {
  padding: 18px 24px;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.geo-summary::-webkit-details-marker {
  display: none;
}

.geo-summary::after {
  content: '＋';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--pink);
  transition: transform 0.3s ease;
}

.geo-accordion[open] .geo-summary::after {
  content: '－';
  transform: rotate(180deg);
  color: var(--gold);
}

.geo-content {
  padding: 0 24px 24px 24px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 16px;
}

.geo-content p {
  margin: 0 0 12px 0;
}

.geo-content p:last-child {
  margin-bottom: 0;
}

.geo-content ul {
  margin: 10px 0;
  padding-left: 20px;
}

.geo-content li {
  margin-bottom: 6px;
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin-top: 30px;
  letter-spacing: 0.05em;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
  font-size: 0.82rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--pink);
}

/* ==========================================================================
   法務ページ (legal.html) 用スタイル
   ========================================================================== */
.legal-shell {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.legal-header {
  text-align: center;
  margin-bottom: 40px;
}

.legal-header h1 {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 10px;
  text-shadow: 0 0 25px rgba(255, 95, 162, 0.3);
}

.legal-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.legal-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 15px;
}

.legal-tab-btn {
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.legal-tab-btn:hover {
  border-color: rgba(255, 95, 162, 0.3);
  color: var(--text);
}

.legal-tab-btn.is-active {
  background: rgba(255, 95, 162, 0.1);
  border-color: var(--pink);
  color: var(--text);
  box-shadow: 0 0 15px rgba(255, 95, 162, 0.15);
}

.legal-content-card {
  background: rgba(9, 5, 18, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.legal-panel {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.legal-panel.is-active {
  display: block;
}

.legal-panel h2 {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 24px;
  border-bottom: 2px solid rgba(255, 209, 102, 0.2);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.legal-table th,
.legal-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  width: 250px;
  color: var(--text);
  font-weight: 700;
  font-family: 'Zen Maru Gothic', sans-serif;
  background: rgba(255, 255, 255, 0.02);
}

.legal-table td {
  color: var(--muted);
  line-height: 1.6;
}

.legal-text-content {
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

.legal-text-content h3 {
  color: var(--text);
  font-size: 1.15rem;
  margin-top: 30px;
  margin-bottom: 12px;
  font-family: 'Zen Maru Gothic', sans-serif;
}

.legal-text-content p {
  margin-bottom: 16px;
}

.legal-text-content ul,
.legal-text-content ol {
  margin-bottom: 20px;
  padding-left: 20px;
}

.legal-text-content li {
  margin-bottom: 8px;
}

.legal-footer-nav {
  margin-top: 40px;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

a.secondary-button.legal-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

a.legal-nav-line {
  border-color: #06c755;
  color: #06c755;
  box-shadow: 0 0 15px rgba(6, 199, 85, 0.1);
}

.credits-content h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.credits-content h2:not(:first-child) {
  margin-top: 28px;
}

.credits-divider {
  border: none;
  border-top: 1px solid rgba(255, 209, 102, 0.2);
  margin: 28px 0;
}

.credits-copyright {
  margin-top: 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.credits-footer-links {
  margin-top: 28px;
  padding-bottom: 24px;
}

@media (max-width: 768px) {
  .legal-tabs {
    flex-direction: column;
    gap: 8px;
  }
  .legal-content-card {
    padding: 24px;
  }
  .legal-table th,
  .legal-table td {
    display: block;
    width: 100%;
  }
  .legal-table th {
    background: transparent;
    padding-bottom: 4px;
    border-bottom: none;
  }
  .legal-table td {
    padding-top: 4px;
  }
}

/* ヒーローセクションのLINEミニバッジ */
.line-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(6, 199, 85, 0.15);
  border: 1px solid rgba(6, 199, 85, 0.4);
  padding: 2px 10px;
  border-radius: 999px;
  color: #06C755;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  vertical-align: middle;
  text-shadow: none;
  letter-spacing: 0;
}

.line-mini-badge:hover {
  background: rgba(6, 199, 85, 0.25);
  border-color: #06C755;
  box-shadow: 0 0 10px rgba(6, 199, 85, 0.4);
}

.line-icon-small {
  font-size: 0.85rem;
}

/* ==========================================================================
   投票条件パネル (vote condition panel)
   ========================================================================== */
.vote-condition-panel {
  background: rgba(255, 223, 142, 0.06);
  border: 1px solid rgba(255, 223, 142, 0.22);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.vote-condition-label {
  font-weight: 800;
  color: var(--gold);
  margin: 0 0 10px;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.vote-condition-dl {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.vote-condition-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.vote-condition-row dt {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 100px;
  flex-shrink: 0;
}

.vote-condition-row dd {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  font-size: 0.9rem;
}

.vote-condition-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ==========================================================================
   投票 — テキスト専用モード (character / card_theme)
   ========================================================================== */

/* STEPバナー */
.vote-step-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.vote-step-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--pink), #a78bfa);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.vote-step-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}

/* テキスト専用グリッド */
.vote-candidate-grid--text {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* テキスト専用カード */
.vote-candidate-card--text {
  align-items: center;
  text-align: center;
  padding: 20px 12px 16px;
  gap: 10px;
  min-height: 160px;
  justify-content: space-between;
}
.vote-candidate-card--text.is-voted {
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 2px rgba(255,209,102,0.35), 0 0 18px rgba(255,209,102,0.15);
}

/* キャラ投票: 絵文字 */
.vote-char-emoji {
  font-size: 2.8rem;
  line-height: 1;
}

/* キャラ投票: 名前 */
.vote-char-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

/* カードテーマ投票: テーマ名 */
.vote-theme-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
  padding: 8px 0;
}

/* 大きいゲージ (テキストカード用) */
.vote-result-bar--large {
  height: 40px;
  border-radius: 8px;
  width: 100%;
}
.vote-result-bar--large .vote-result-fill {
  border-radius: 8px;
}
.vote-result-bar--large .vote-result-label {
  font-size: 0.92rem;
  gap: 6px;
  flex-direction: column;
  line-height: 1.2;
}
.vote-result-pct {
  font-size: 1.1em;
  font-weight: 900;
  color: #fff;
}

/* ==========================================================================
   QR交換ダイアログ: SNS共有画像セクション
   ========================================================================== */
.share-image-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.share-image-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 10px;
}

.share-image-want-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.share-image-want-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.share-image-want-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.85rem;
  font-family: var(--font-body);
}

.share-image-want-input::placeholder {
  color: rgba(255,255,255,0.3);
}

/* ==========================================================================
   SNS共有画像ダイアログ
   ========================================================================== */
.share-image-dialog {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  width: min(540px, 95vw);
  max-height: 90svh;
  overflow-y: auto;
}

.share-image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.share-image-layout {
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.share-image-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.share-image-preview-wrap {
  display: flex;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.4);
}

.share-image-canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.share-image-actions {
  display: flex;
  gap: 10px;
}

.share-image-safety {
  font-size: 0.75rem;
  color: #ff9aaa;
  text-align: center;
  margin: 0;
  line-height: 1.6;
}





