/* ============================================================
   デジタル名刺 - style.css
   色や余白などの基本トーンはここで管理していますが、
   「推しカラー」自体は config.js の theme / oshimen.color から
   JavaScript経由でCSS変数(--accent など)に反映されます。
   ============================================================ */

:root {
  --accent: #8b5cf6;
  --accent-rgb: 139, 92, 246;
  --bg: #0f0b1a;
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f5f3fa;
  --text-sub: rgba(245, 243, 250, 0.68);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  --max-width: 480px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text-main);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Noto Sans JP", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

/* JavaScriptで hidden 属性を付けた要素は、他のCSS(display:flex など)に
   関わらず必ず非表示にする(表示/非表示の切り替えを確実に効かせるための保険) */
[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
}

/* ------------------------------------------------------------
   共通レイアウト
   ------------------------------------------------------------ */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin: 0 0 14px 4px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

/* スクロールで自然に現れる演出 */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------------
   ファーストビュー
   ------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px calc(40px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -20% -20% auto -20%;
  height: 130%;
  background: radial-gradient(
      circle at 50% 20%,
      rgba(var(--accent-rgb), 0.35),
      transparent 60%
    ),
    radial-gradient(circle at 20% 80%, rgba(var(--accent-rgb), 0.18), transparent 55%);
  animation: drift 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes drift {
  from {
    transform: translate3d(-2%, -2%, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 3%, 0) scale(1.08);
  }
}

.hero-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 36px 26px 30px;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  animation: card-in 0.7s ease both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.venue-greeting {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 18px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.22);
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  font-size: 14px;
  font-weight: 700;
  animation: greeting-pop 0.5s ease 0.2s both;
}

@keyframes greeting-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.12);
}

.avatar-wrap--oshi {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-img:not([src]),
.avatar-img.img-error {
  display: none;
}

.avatar-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    145deg,
    rgba(var(--accent-rgb), 0.55),
    rgba(var(--accent-rgb), 0.2)
  );
  font-size: 34px;
}

.avatar-placeholder.is-active {
  display: flex;
}

.hero-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.hero-name {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero-oshi-row {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-oshi-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
}

.hero-oshi-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 推しごとの色付きチップ(共通クラス。ファーストビューと推し紹介カードで共有) */
.oshi-color-chip {
  --chip-rgb: var(--accent-rgb);
}

.hero-oshi-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: rgba(var(--chip-rgb), 0.18);
  border: 1px solid rgba(var(--chip-rgb), 0.5);
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(var(--chip-rgb), 1);
}

.hero-oshi-chip-mark {
  font-size: 15px;
}

.hero-description {
  margin: 0 0 22px;
  font-size: 14.5px;
  color: var(--text-sub);
}

.hero-description:empty {
  display: none;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  min-height: 44px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 12px 24px -10px rgba(var(--accent-rgb), 0.7);
}

.cta-button:active {
  transform: translateY(1px) scale(0.98);
}

.cta-arrow {
  transition: transform 0.2s ease;
}

.cta-button:hover .cta-arrow {
  transform: translateX(3px);
}

.scroll-hint {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  width: 26px;
  height: 40px;
  border: 2px solid var(--card-border);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-hint-line {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: rgba(var(--accent-rgb), 0.85);
  animation: scroll-bounce 1.6s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(8px);
    opacity: 0.4;
  }
}

/* ------------------------------------------------------------
   プロフィール / 推し紹介
   ------------------------------------------------------------ */

.profile-list {
  margin: 0;
  display: grid;
  gap: 12px;
}

.profile-list:empty {
  display: none;
}

.profile-list .row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
}

.profile-list dt {
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 600;
}

.profile-list dd {
  margin: 0;
}

.chip-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list li {
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  font-size: 13px;
}

.oshi-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.oshi-card {
  text-align: center;
  border-color: rgba(var(--accent-rgb), 0.35);
}

.oshi-name {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.oshi-card .profile-list {
  text-align: left;
}

/* ------------------------------------------------------------
   イベント情報
   ------------------------------------------------------------ */

.event-card {
  text-align: center;
  border-color: rgba(var(--accent-rgb), 0.4);
  background: linear-gradient(
    160deg,
    rgba(var(--accent-rgb), 0.18),
    var(--card-bg) 60%
  );
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5c7a;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 92, 122, 0.55);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 92, 122, 0);
  }
}

.event-name {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
}

.event-message {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.event-submessage {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-sub);
}

/* ------------------------------------------------------------
   SNS
   ------------------------------------------------------------ */

.sns-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.sns-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  text-decoration: none;
  font-weight: 700;
  font-size: 14.5px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sns-link:active {
  transform: translateY(1px) scale(0.97);
}

.sns-link:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.12);
}

.sns-icon {
  font-size: 16px;
}

.sns-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-sub);
  font-size: 13.5px;
  padding: 16px 0;
}

/* ------------------------------------------------------------
   遊び心: 推し活メーター
   ------------------------------------------------------------ */

.meter-card {
  margin-bottom: 14px;
}

.meter-label {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-sub);
}

.meter-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.75), var(--accent));
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.meter-percent {
  margin: 8px 0 0;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: rgba(var(--accent-rgb), 1);
}

/* ------------------------------------------------------------
   遊び心: 隠し小ネタ
   ------------------------------------------------------------ */

.secret-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px dashed var(--card-border);
  cursor: pointer;
  min-height: 56px;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.secret-card:active {
  transform: scale(0.98);
}

.secret-card:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
}

.secret-icon {
  font-size: 20px;
  flex: none;
  transition: transform 0.3s ease;
}

.secret-card.is-open .secret-icon {
  transform: rotate(14deg) scale(1.1);
}

.secret-text {
  font-size: 14px;
  color: var(--text-sub);
}

.secret-card.is-open .secret-text {
  color: var(--text-main);
}

/* ------------------------------------------------------------
   フッター
   ------------------------------------------------------------ */

.footer {
  max-width: var(--max-width);
  margin: 20px auto 0;
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.7;
}

.footer-rights {
  margin: 0 0 4px;
  font-weight: 600;
}

.footer-sub {
  margin: 0;
  opacity: 0.75;
}

.footer-rights:empty,
.footer-sub:empty {
  display: none;
}

/* ------------------------------------------------------------
   レスポンシブ (PCなど広い画面)
   ------------------------------------------------------------ */

@media (min-width: 640px) {
  .section {
    padding: 40px 20px;
  }

  .hero-name {
    font-size: 32px;
  }

  body {
    background: radial-gradient(circle at 50% 0%, rgba(var(--accent-rgb), 0.08), var(--bg) 45%);
  }
}

/* ------------------------------------------------------------
   モーションを抑えたいユーザーへの配慮
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
