:root {
  --vermilion: #B7282E;
  --vermilion-dark: #7A1A1F;
  --kinari: #FBFAF5;
  --sumi: #1A1A1A;
  --sumi-soft: #3A3A3A;
  --paper: #F5EBD0;
  --gold: #C9A24F;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* L37-B M9: プラン期限切れ前 7 日警告バナー */
.plan-expiry-banner {
  margin: 8px 12px;
  padding: 10px 14px;
  background: #FFF3E0;
  border: 1.5px solid #FFCC80;
  border-radius: 8px;
  color: #6a4500;
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
}
.plan-expiry-banner a {
  color: var(--vermilion);
  font-weight: 600;
  text-decoration: underline;
  margin-left: 6px;
}

/* L42-A: screen-reader 専用ラベル（視覚的に隠すが NVDA/VoiceOver は読み上げる） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* L35-B F6: 本文へスキップリンク（screen reader / キーボードユーザー向け） */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 99999;
  padding: 10px 18px;
  background: #B7282E;
  color: #FBFAF5;
  text-decoration: none;
  border: 2px solid #FBFAF5;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
.skip-link:focus {
  top: 8px;
  outline: 3px solid #C9A24F;
  outline-offset: 2px;
}

/* L33-B B3: 御朱印グリッドや絵馬ボードが空の時に表示する案内 */
.empty-state {
  padding: 28px 18px;
  text-align: center;
  color: #6a5028;
  font-size: 13.5px;
  line-height: 1.85;
  background: rgba(255, 248, 225, 0.5);
  border: 1px dashed rgba(201, 162, 79, 0.4);
  border-radius: 10px;
  margin: 8px 0;
}
.empty-state strong { display: block; font-size: 15px; color: #5a3f0f; margin-bottom: 6px; letter-spacing: 0.05em; }
/* L36-B H2/H3: small / hint 系の最低サイズを 13px に底上げ + コントラスト確保 (旧 #8a7050 は AA 不合格 3.4:1) */
.empty-state small { display: block; font-size: 13px; color: #5A4F3F; margin-top: 8px; }

/* L36-B H2: muted-hint, small 系の汎用底上げ（個別 CSS で 9-11px 指定箇所は局所的に維持されるが、グローバルでは 13px 確保） */
.muted-hint, small.muted, .footer-disclaimer small, .footer-nav a {
  font-size: 13px;
}

/* L36-B H3: 高齢ユーザのコントラスト不足の温床だったグレーファミリーを WCAG AA 通過色に統一
   旧 #8a7050 / #8a7c64 / #8a6f3f (3.2-3.9:1) → #5A4F3F (~7.5:1) */
.lucky-action-hint, .profile-completion-hint, .contact-note,
.oracle-redraw small { color: #5A4F3F !important; }

/* L31-D #5: 全 interactive 要素にキーボード focus 可視リング（WCAG 2.4.7 Focus Visible）。
   :focus-visible はマウスクリック時には出ず、Tab キー操作時のみ点灯するため UX を阻害しない */
:where(button, a, input, select, textarea, [role="button"], [tabindex]):focus-visible {
  outline: 3px solid rgba(201, 162, 79, 0.85);
  outline-offset: 2px;
}

/* L31-D #5: aria-disabled or .is-disabled なボタンの汎用 visual style（個別 CSS 漏れの保険） */
button[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

/* Mob H-4: iOS Safari の自動ズーム回避（フォーカス時 16px 未満で zoom する）
   全 input/select/textarea のグローバルベース font-size を 16px に。
   個別 CSS で 14px 指定されていた場所はモバイル時のみ 16px に上書きする。 */
input, select, textarea, button { font-family: inherit; }
@media (max-width: 1024px) {
  input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
  input[type="search"], input[type="password"], input[type="url"], input[type="date"],
  input:not([type]), select, textarea {
    font-size: 16px !important;
  }
}

html, body {
  background: linear-gradient(180deg, #FBE6D4 0%, #F5E1B9 60%, #E8D2A6 100%);
  color: var(--sumi);
  font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  /* L32-C M7: iOS Safari URL バー伸縮で 100vh が変動するため 100dvh を採用（古い iOS は 100vh フォールバック） */
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  /* L32-C L11: Android Chrome の pull-to-refresh で本文を誤って reload させない */
  overscroll-behavior-y: contain;
  /* L36-B H1: 60+ ターゲットに合わせて body base を 16px に引き上げ
     （WCAG 1.4.4 + 老眼配慮）旧 default は browser 16px 期待だが Mincho の x-height が小さく実効感は 14px 程度だった */
  font-size: 16px;
  line-height: 1.7;
  /* L37-A F8: ブラウザの自動テキスト拡大を抑止（Firefox Android / Samsung Internet で
     ユーザがシステムフォントサイズを上げた時に意図しない倍率がかかるのを防止） */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.header {
  text-align: center;
  padding: 32px 16px 16px;
}

.logo {
  font-size: clamp(28px, 6vw, 44px);
  letter-spacing: 0.08em;
  color: var(--vermilion-dark);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

.tagline {
  margin-top: 6px;
  color: var(--sumi-soft);
  font-size: 14px;
}
.tagline-sub {
  margin: 2px 0 0;
  color: var(--vermilion);
  /* L73: 11px→13px(60代可読性・チームの装飾テキスト下限13px方針)+ opacity 引上げでコントラスト確保 */
  font-size: 13px;
  letter-spacing: 0.18em;
  font-weight: 500;
  opacity: 0.95;
}
.ema-encouragement {
  background: linear-gradient(135deg, rgba(255,234,224,0.6), rgba(248,197,201,0.4));
  border-left: 3px solid var(--vermilion);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #5a3f0f;
  line-height: 1.7;
  margin: 0 0 10px;
}
/* L67: #8a6f3f は背景によって WCAG AA 未達になり得るため濃いめに統一 */
.ema-encouragement small { color: #6a5028; }
.ema-meta-tip {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--vermilion);
  opacity: 0.85;
}

.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

.shrine-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(122, 26, 31, 0.25);
  background: #1A1A1A;
}

.shrine-bg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.shrine-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.shrine-stage.dim::after { opacity: 1; }

.bell-illust {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 11%;
  height: 50%;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
  overflow: visible;
}
.bell-illust .bell-pivot {
  transform-origin: 50px 0px;
  transform-box: fill-box;
}
.bell-illust.swing .bell-pivot {
  animation: bellSwing 1.6s cubic-bezier(0.36, 0.07, 0.5, 1);
}
@keyframes bellSwing {
  0%   { transform: rotate(0deg); }
  10%  { transform: rotate(-15deg); }
  25%  { transform: rotate(11deg); }
  40%  { transform: rotate(-8deg); }
  55%  { transform: rotate(5deg); }
  70%  { transform: rotate(-3deg); }
  85%  { transform: rotate(1.5deg); }
  100% { transform: rotate(0deg); }
}

.paper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.2) rotate(-8deg);
  width: 56%;
  max-width: 340px;
  aspect-ratio: 3 / 4;
  background: linear-gradient(180deg, #FFF8E0, #F5E5B6);
  border: 1px solid #C9A24F;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), inset 0 0 60px rgba(184, 134, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
  z-index: 2;
}

.paper.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.paper-inner {
  position: absolute;
  inset: 14px;
  border: 1px double #B8862A;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  text-align: center;
}

.paper-level {
  font-size: clamp(36px, 8vw, 60px);
  color: var(--vermilion-dark);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

.paper-summary {
  font-size: clamp(13px, 2.4vw, 16px);
  color: var(--sumi);
  line-height: 1.7;
}

.paper-seal {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: var(--vermilion);
  color: var(--kinari);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  transform: rotate(-6deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0 32px;
  flex-wrap: wrap;
}

.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.05em;
}

.btn-primary {
  background: var(--vermilion);
  color: var(--kinari);
  box-shadow: 0 4px 12px rgba(183, 40, 46, 0.35);
}
.btn-primary:hover { background: var(--vermilion-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); }
/* L35-B F3: WCAG 1.4.3 AA (4.5:1) を満たす disabled 色（旧 #C9A8A8 は 2.3:1 で AA 不合格） */
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] { background: #8B5A5A; color: #fff; cursor: not-allowed; box-shadow: none; opacity: 0.7; }

.btn-ghost {
  background: transparent;
  color: var(--vermilion-dark);
  border: 2px solid var(--vermilion-dark);
}
.btn-ghost:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--vermilion-dark); color: var(--kinari); }
/* L77 fix: disabled な btn-ghost に無効化スタイルが無く「押せそうで無反応」(見せかけアフォーダンス)。
   .btn-primary:disabled と対称化。plan-cta(利用中プラン等)も同様に。 */
.btn-ghost:disabled, .btn-ghost[aria-disabled="true"],
.plan-cta:disabled, .plan-cta[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.3); }

.oracle {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.oracle-meta {
  text-align: center;
  color: var(--sumi-soft);
  font-size: 14px;
}

.card {
  background: var(--kinari);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(122, 26, 31, 0.1);
  border: 1px solid rgba(201, 162, 79, 0.3);
}

.card-label {
  font-size: 13px; /* L73: 全カード見出しラベル。60代可読性のため 12→13px */
  color: var(--vermilion-dark);
  letter-spacing: 0.2em;
  margin-bottom: 12px;
  font-weight: 700;
}

.color-swatch {
  border-radius: 10px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.color-name { font-size: 28px; font-weight: 700; letter-spacing: 0.1em; }
.color-reading { font-size: 13px; opacity: 0.85; }
.color-hex { font-size: 13px; opacity: 0.85; font-family: ui-monospace, monospace; margin-top: 4px; } /* L77: 60代可読性のため 12→13px / opacity 0.7→0.85 (.color-reading と統一) */
.color-meaning { font-size: 14px; color: var(--sumi-soft); line-height: 1.7; }

.fortune-level-big {
  text-align: center;
  font-size: clamp(40px, 8vw, 60px);
  color: var(--vermilion);
  font-weight: 700;
  letter-spacing: 0.1em;
  border: 3px double var(--vermilion);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #FFF8E0, #FBFAF5);
}

.fortune-summary {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 12px;
  font-weight: 500;
}

.fortune-advice {
  font-size: 14px;
  color: var(--sumi-soft);
  line-height: 1.8;
  padding: 12px;
  background: #FBF6E8;
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  margin-bottom: 16px;
}

/* ===== 今日の一言（中央モーダル・お参りと独立）===== */
.hitokoto-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #674196 0%, #8E69BF 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: 'Shippori Mincho', serif;
  font-size: 0.95em;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(104, 65, 150, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hitokoto-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(104, 65, 150, 0.5);
}
.hitokoto-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 9998;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: hitokotoFadeIn 0.3s ease;
}
.hitokoto-backdrop[hidden] { display: none; }
.hitokoto-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 440px);
  z-index: 9999;
  /* 夜の神社画像をほぼそのまま見せる。文字は内側パネル＋影で読める設計 */
  background:
    url('assets/hitokoto-bg.webp') center / cover no-repeat,
    #0a1230;
  border: 1.5px solid rgba(255, 200, 130, 0.55);
  border-radius: 18px;
  box-shadow:
    0 16px 60px rgba(0, 0, 0, 0.85),
    0 0 40px rgba(120, 180, 255, 0.25);
  padding: 36px 26px 28px;
  text-align: center;
  font-family: 'Shippori Mincho', serif;
  color: #fff;
  animation: hitokotoAppear 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.hitokoto-modal[hidden] { display: none; }
.hitokoto-close {
  position: absolute;
  top: 12px;
  right: 12px;
  /* L70-B fix: 閉じる×ボタンが反応しないバグ修正。
     直後の .hitokoto-icon が filter:drop-shadow で新スタッキングコンテキストを作り、
     DOM 上 close ボタンより後にあるため全幅の icon ボックスが×に重なって上に描画され、
     クリックを奪っていた（モバイルで「バツが反応しない」）。z-index で×を最前面へ。 */
  z-index: 10;
  /* L32-C M5: 44×44 タップターゲット（旧 32×32 は WCAG 2.5.5 違反） */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(150, 220, 255, 0.5);
  background: rgba(0, 10, 30, 0.55);
  color: #cce5ff;
  font-size: 1.3em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}
.hitokoto-close:hover {
  background: rgba(30, 60, 110, 0.75);
  transform: scale(1.08);
  border-color: #aee0ff;
}
.hitokoto-icon {
  font-size: 3em;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 12px rgba(150, 220, 255, 0.85));
  color: #fff;
}
.hitokoto-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.32em;
  color: #ffe6c8;
  margin: 4px 0 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 1),
    0 0 8px rgba(0, 0, 0, 0.95),
    0 2px 6px rgba(0, 0, 0, 1),
    0 0 16px rgba(255, 200, 120, 0.45);
}
/* 一言本文 — 明朝体（読みやすさ最優先・神社らしい品） */
.hitokoto-text {
  font-family: 'Shippori Mincho', 'YuMincho', 'Hiragino Mincho ProN', serif;
  font-size: 1.32em;
  font-weight: 700;
  color: #fffaf0;
  line-height: 2.0;
  letter-spacing: 0.06em;
  margin: 18px 4px 14px;
  padding: 22px 18px;
  /* 文字部分のみ強めに暗くして読みやすく（外側の画像は見える） */
  background:
    radial-gradient(ellipse at center, rgba(0, 4, 18, 0.78) 0%, rgba(0, 4, 18, 0.92) 100%);
  border: 1px solid rgba(255, 220, 160, 0.4);
  border-radius: 6px;
  text-align: center;
  /* 文字を背景から確実に浮かせる三重影 */
  text-shadow:
    0 0 1px rgba(0, 0, 0, 1),
    0 2px 4px rgba(0, 0, 0, 0.95),
    0 0 10px rgba(255, 240, 200, 0.25);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.55),
    0 0 16px rgba(120, 180, 255, 0.18);
  position: relative;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.hitokoto-text::before,
.hitokoto-text::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 220, 160, 0.55);
  opacity: 0.7;
}
.hitokoto-text::before { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.hitokoto-text::after { bottom: 6px; right: 6px; border-left: none; border-top: none; }
.hitokoto-sub {
  font-family: 'Shippori Mincho', serif;
  font-size: 0.95em;
  color: #f0e0c0;
  margin: 12px 0 0;
  font-style: normal;
  letter-spacing: 0.06em;
  font-weight: 500;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 1),
    0 0 8px rgba(0, 0, 0, 0.95),
    0 2px 4px rgba(0, 0, 0, 1);
}
/* 「⛩ 心に留める」ボタンも夜の神社に合うトーンに */
.hitokoto-modal .btn-primary {
  background: linear-gradient(180deg, #c4302b 0%, #8a1f1c 100%);
  border: 1px solid rgba(255, 180, 100, 0.5);
  color: #fff7e8;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow:
    0 4px 16px rgba(196, 48, 43, 0.5),
    0 0 24px rgba(255, 120, 80, 0.18);
}
.hitokoto-modal .btn-primary:hover {
  background: linear-gradient(180deg, #d83a35 0%, #9c2522 100%);
}
@keyframes hitokotoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes hitokotoAppear {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
body.hitokoto-open { overflow: hidden; }
@media (max-width: 480px) {
  .hitokoto-modal {
    width: 94vw;
    padding: 30px 18px 22px;
    border-radius: 14px;
  }
  .hitokoto-text {
    font-size: 1.18em;
    padding: 18px 14px;
    line-height: 1.95;
  }
  .hitokoto-title { font-size: 1.18em; }
}

/* ===== 縁を投じるモーダル ===== */
.en-throw-modal .en-throw-balance {
  font-size: 0.95em;
  color: #f0e0c0;
  margin: 8px 0 14px;
  font-family: 'Shippori Mincho', serif;
  text-shadow: 0 0 2px rgba(0,0,0,1), 0 0 8px rgba(0,0,0,0.95);
}
.en-throw-modal .en-throw-balance strong {
  color: #ffd86a;
  font-size: 1.2em;
  margin: 0 4px;
}
.en-throw-modal .en-throw-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.en-throw-modal .en-preset {
  padding: 10px 6px;
  border: 1px solid rgba(255, 220, 160, 0.5);
  background: rgba(0, 6, 24, 0.75);
  color: #ffe6c8;
  border-radius: 8px;
  font-family: 'Shippori Mincho', serif;
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s ease;
  text-shadow: 0 0 2px rgba(0,0,0,1), 0 2px 4px rgba(0,0,0,0.8);
}
.en-throw-modal .en-preset:hover,
.en-throw-modal .en-preset.selected {
  background: rgba(183, 40, 46, 0.75);
  border-color: #ffd86a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 180, 100, 0.3);
}
.en-throw-modal .en-throw-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 6px;
  color: #f0e0c0;
  font-family: 'Shippori Mincho', serif;
  text-shadow: 0 0 2px rgba(0,0,0,1), 0 0 8px rgba(0,0,0,0.95);
}
.en-throw-modal .en-throw-custom input {
  width: 110px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 220, 160, 0.5);
  background: rgba(0, 6, 24, 0.8);
  color: #fffaf0;
  border-radius: 6px;
  font-family: 'Shippori Mincho', serif;
  font-size: 1.05em;
  text-align: center;
}
/* L65-C H4: outline:none を :focus-visible 限定にしてキーボード focus 可視性を確保。
   旧コードはマウス click 後の outline 削除を意図していたが、キーボードユーザの
   focus indicator まで消えていた。:focus-visible で keyboard navigation 時のみ
   global focus ring を上書きする。 */
.en-throw-modal .en-throw-custom input:focus {
  border-color: #ffd86a;
  box-shadow: 0 0 12px rgba(255, 180, 100, 0.3);
}
.en-throw-modal .en-throw-custom input:focus:not(:focus-visible) {
  outline: none;
}
.en-throw-modal .en-throw-custom input:focus-visible {
  outline: 3px solid #C9A24F;
  outline-offset: 2px;
}

/* ===== 縁の失効警告 ・ 有効期限注記 ===== */
.en-expiry-warn {
  margin: 8px 0 12px;
  padding: 10px 14px;
  background: rgba(201, 162, 79, 0.10);
  border: 1px solid rgba(201, 162, 79, 0.4);
  border-left: 4px solid #C9A24F;
  border-radius: 6px;
  color: #5a3f0f;
  font-size: 0.86em;
  line-height: 1.55;
}
.en-expiry-warn.urgent {
  background: rgba(183, 40, 46, 0.08);
  border-color: rgba(183, 40, 46, 0.5);
  border-left-color: #B7282E;
  color: #7a1a1f;
  animation: enUrgentPulse 1.8s ease-in-out infinite;
}
@keyframes enUrgentPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(183, 40, 46, 0); }
  50% { box-shadow: 0 0 12px rgba(183, 40, 46, 0.25); }
}
.en-validity-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(255, 215, 0, 0.06);
  border-radius: 6px;
  color: #5a4f3f;
  font-size: 0.84em;
  line-height: 1.7;
}

/* ===== 縁プレミアム ボタン（高額お賽銭・任意金額）===== */
.tip-btn.tip-premium {
  background: linear-gradient(135deg, #B7282E 0%, #C9A24F 100%);
  color: #fff;
  border-color: #C9A24F;
}
.tip-btn.tip-premium:hover { transform: translateY(-1px); }
.tip-btn.tip-custom {
  background: linear-gradient(135deg, #674196 0%, #C9A24F 100%);
  color: #fff;
  border-color: #674196;
}
.tip-btn.tip-custom:hover { transform: translateY(-1px); }

/* 絵馬：縁を投じるボタン */
.ema-throw-en {
  padding: 6px 12px;
  /* L73: タップ44px(WCAG 2.5.5)。他の絵馬ボタンと揃える。 */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #C9A24F 0%, #FFD700 100%);
  border: 1px solid #C9A24F;
  border-radius: 6px;
  color: #1A1A1A;
  font-family: 'Shippori Mincho', serif;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}
.ema-throw-en:hover {
  background: linear-gradient(135deg, #FFD700 0%, #C9A24F 100%);
  transform: translateY(-1px);
}

/* ===== 縁（前払いポイント）システム ===== */
.enbalance {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(201, 162, 79, 0.08) 0%, rgba(255, 215, 0, 0.06) 100%);
  border: 1px solid rgba(201, 162, 79, 0.4);
  border-radius: 8px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}
.enbalance-label { color: #5A4F3F; font-size: 0.85em; }
.enbalance-num { font-size: 1.5em; font-weight: 700; color: #B7282E; font-family: 'Shippori Mincho', serif; }
.enbalance-unit { color: #5A4F3F; font-size: 0.95em; margin-right: auto; }

.tip-disclaimer {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(183, 40, 46, 0.04);
  border-left: 3px solid rgba(183, 40, 46, 0.3);
  border-radius: 4px;
  font-size: 0.78em;
  color: #5a4f3f;
  line-height: 1.6;
}
.tip-disclaimer a { color: #B7282E; }

.en-charge-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9998;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.en-charge-backdrop[hidden] { display: none; }
.en-charge-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(94vw, 480px);
  max-height: 90vh;
  overflow-y: auto;
  z-index: 9999;
  background: linear-gradient(160deg, #FBFAF5 0%, #F0E8DC 100%);
  border: 2px solid #C9A24F;
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(201, 162, 79, 0.4);
  padding: 32px 22px 24px;
  text-align: center;
  font-family: 'Shippori Mincho', serif;
  animation: hitokotoAppear 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.en-charge-modal[hidden] { display: none; }
.en-charge-desc {
  font-size: 0.9em;
  color: #5A4F3F;
  margin: 8px 0 16px;
  line-height: 1.7;
}
.en-pack-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 8px 0 12px;
}
.en-pack {
  padding: 14px 8px;
  background: #fff;
  border: 1.5px solid rgba(201, 162, 79, 0.5);
  border-radius: 10px;
  font-family: 'Shippori Mincho', serif;
  font-size: 0.95em;
  color: #1A1A1A;
  cursor: pointer;
  transition: all 0.15s ease;
}
.en-pack:hover {
  background: rgba(255, 215, 0, 0.08);
  border-color: #C9A24F;
  transform: translateY(-1px);
}
.en-pack span {
  display: block;
  margin-top: 4px;
  color: #B7282E;
  font-weight: 700;
  font-size: 0.95em;
}
.en-pack span small {
  display: block;
  margin-top: 2px;
  color: #5A4F3F;
  font-size: 0.78em;
  font-weight: 400;
}
@media (max-width: 480px) {
  .en-pack-row { grid-template-columns: 1fr; }
}

/* ===== 今日の一手（ラッキーアクション専用カード）===== */
.card-lucky-action {
  background: linear-gradient(135deg, rgba(104, 65, 150, 0.06) 0%, rgba(104, 190, 141, 0.08) 100%);
  border-left: 4px solid #674196;
}
.card-lucky-action .card-label {
  color: #674196;
}
.lucky-action-text {
  font-size: 16px;
  line-height: 1.85;
  font-weight: 600;
  color: var(--sumi);
  margin: 12px 0 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
}
.lucky-action-hint {
  font-size: 12px;
  color: #8a7c64;
  text-align: right;
  margin: 0;
  font-style: italic;
}

.categories {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.categories li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: #FBF6E8;
  border-radius: 6px;
  font-size: 14px;
}

.categories .stars {
  color: var(--gold);
  letter-spacing: 0.1em;
}

.footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--sumi-soft);
  font-size: 12px;
  line-height: 1.7;
}

.footer a { color: var(--vermilion-dark); }

@media (max-width: 480px) {
  .paper-inner { padding: 14px 10px; }
}

/* ========== Status Bar ========== */
.status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(201, 162, 79, 0.4);
  border-radius: 999px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  flex-wrap: wrap;
  font-size: 13px;
}
.status-title {
  font-weight: 700;
  color: var(--vermilion-dark);
  letter-spacing: 0.08em;
}
.status-title[data-rank="3"] { color: #B8862A; }
.status-title[data-rank="4"] { color: #C9A24F; text-shadow: 0 0 4px rgba(201,162,79,0.4); }
.status-title[data-rank="5"] { color: #B8862A; text-shadow: 0 0 6px rgba(201,162,79,0.5); }
.status-title[data-rank="6"], .status-title[data-rank="7"] {
  background: linear-gradient(90deg, #C9A24F, #FFE9A8, #C9A24F);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.status-streak { color: var(--sumi); font-weight: 500; }
.status-next { color: var(--sumi-soft); font-size: 13px; } /* L77: 次称号cue(機能情報)。60代可読性下限 12→13px(status-bar基底と統一) */

/* ========== Missions ========== */
.missions-card {
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(255,255,255,0.5);
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 79, 0.3);
}
.missions-label {
  font-size: 13px; /* L73: 60代可読性 11→13px */
  color: var(--vermilion-dark);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 700;
}
.missions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mission {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(58,58,58,0.15);
  font-size: 13px;
  color: var(--sumi-soft);
  opacity: 0.55;
  transition: all 0.3s ease;
}
.mission.done {
  opacity: 1;
  background: linear-gradient(180deg, #FFF8E0, #F5E5B6);
  border-color: var(--gold);
  color: var(--vermilion-dark);
  font-weight: 700;
}
.mission-emoji { font-size: 16px; }
.mission-progress {
  font-weight: 700;
  font-size: 14px;
  color: var(--vermilion-dark);
  margin-left: 8px;
}

/* ========== Paper rank/rarity styling ========== */
.paper[data-rank="3"] { border: 2px solid var(--gold); }
.paper[data-rank="4"] { border: 2px solid var(--gold); box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 24px rgba(201,162,79,0.5), inset 0 0 60px rgba(184, 134, 42, 0.18); }
.paper[data-rank="5"] { border: 3px double var(--gold); }
.paper[data-rank="6"], .paper[data-rank="7"] {
  border: 3px solid transparent;
  background:
    linear-gradient(180deg, #FFF8E0, #F5E5B6) padding-box,
    linear-gradient(135deg, #C9A24F, #FFE9A8, #C9A24F, #B8862A) border-box;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 32px rgba(201,162,79,0.7);
}
.paper[data-rarity="gold"] {
  background:
    linear-gradient(180deg, #FFF4C4, #F0D27A) padding-box,
    linear-gradient(135deg, #FFD700, #FFA500, #FFD700) border-box;
  border: 3px solid transparent;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 40px rgba(255,215,0,0.7);
  animation: goldPulse 2s ease-in-out infinite;
}
.paper[data-rarity="divine"] {
  background:
    linear-gradient(180deg, #FFE9F5, #FFD7F0) padding-box,
    linear-gradient(135deg, #FF1493, #C9A24F, #4169E1, #FF1493) border-box;
  border: 4px solid transparent;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 60px rgba(255,20,147,0.6);
  animation: divinePulse 1.5s ease-in-out infinite;
}
@keyframes goldPulse {
  0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px rgba(255,215,0,0.6); }
  50% { box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 60px rgba(255,215,0,0.9); }
}
@keyframes divinePulse {
  0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 50px rgba(255,20,147,0.5); }
  50% { box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 80px rgba(255,20,147,0.85); }
}

.rare-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.rare-tag[data-rarity="gold"] { background: linear-gradient(90deg, #FFD700, #FFA500); color: #5A3F0F; }
.rare-tag[data-rarity="divine"] { background: linear-gradient(90deg, #FF1493, #4169E1); color: #FFFFFF; }

/* ========== Share buttons ========== */
.share-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-btn {
  flex: 1;
  min-width: 110px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.05em;
}
.share-x { background: #000; color: #FFF; }
.share-line { background: #06C755; color: #FFF; }
.share-copy { background: var(--kinari); color: var(--sumi); border: 1px solid var(--gold); }
.share-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }

/* ========== Tip jar ========== */
.tip-desc {
  font-size: 13px;
  color: var(--sumi-soft);
  line-height: 1.7;
  margin-bottom: 12px;
}
.tip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}
.tip-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #FFF8E0, #F5E5B6);
  color: var(--vermilion-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tip-btn small {
  font-size: 10px;
  font-weight: 500;
  color: var(--sumi-soft);
  letter-spacing: 0.1em;
}
.tip-btn:hover {
  background: linear-gradient(180deg, #FFE9A8, #C9A24F);
  color: var(--vermilion-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(201,162,79,0.4);
}
.tip-msg {
  margin-top: 12px;
  padding: 10px;
  background: #FBF6E8;
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-size: 13px;
  color: var(--sumi);
}

/* ========== History calendar ========== */
.card-history { margin-top: 16px; cursor: pointer; }
.history-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.hist-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: #FBF6E8;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 11px;
}
.hist-cell.today { border-color: var(--vermilion); background: #FFF8E0; }
.hist-cell.empty { opacity: 0.5; }
.hist-day { color: var(--sumi-soft); font-weight: 700; }
.hist-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}
.hist-dot.empty { background: transparent !important; border: 1px dashed rgba(0,0,0,0.2); }
.hist-cell.rare-gold { background: linear-gradient(180deg, #FFF4C4, #F0D27A); border-color: #FFD700; }
.hist-cell.rare-divine {
  background: linear-gradient(180deg, #FFE9F5, #FFD7F0);
  border-color: #FF1493;
}
.hist-level {
  color: var(--sumi);
  font-size: 11px; /* L77: 機能テキスト(運勢レベル)。10→11px(7列グリッド幅で13pxは溢れるため隣接要素と同じ11pxに底上げ) */
  font-weight: 700;
}
.history-hint {
  font-size: 11px;
  color: var(--sumi-soft);
  text-align: center;
  margin-top: 8px;
}

/* ========== Top nav ========== */
.topnav {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.topnav-btn {
  font-family: inherit;
  font-size: 13px;
  /* タッチターゲット 44px 以上を満たすため min-height 確保 */
  padding: 10px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(122, 26, 31, 0.25);
  background: rgba(255,255,255,0.5);
  color: var(--vermilion-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.05em;
}
.topnav-btn:hover { background: var(--vermilion); color: var(--kinari); }

/* ========== Collapsible cards ========== */
.collapsible {
  margin-top: 16px;
  animation: fadeUp 0.3s ease;
}

/* ========== Profile ========== */
.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.profile-row label {
  flex: 0 0 80px;
  font-weight: 700;
  color: var(--sumi);
  font-size: 14px;
}
.profile-row input[type="text"],
.profile-row input[type="date"] {
  flex: 1;
  min-width: 180px;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--kinari);
}
.btn-small { padding: 8px 18px; font-size: 14px; }
.btn-danger { color: #c33; border-color: #c33; }
.btn-danger:hover { background: #c33; color: #fff; }
.muted-hint {
  /* L66 MED: 84 行の共通ルール(13px, 60+/WCAG 1.4.4 確保)が同特異度・後方の本ルール 11px に
     打ち消されていた。最も多用される説明文の可読性を意図通り 13px に統一する。 */
  font-size: 13px;
  color: var(--sumi-soft);
  margin-top: 6px;
}

.rope-options { display: flex; gap: 8px; flex-wrap: wrap; }
/* L73: タップ領域44px確保（見た目の円は 36px のまま padding + background-clip で内側に描く）。誤タップ低減。 */
.rope-swatch {
  width: 44px;
  height: 44px;
  padding: 4px;
  background-clip: content-box;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rope-swatch[data-rope="default"] {
  background: linear-gradient(135deg, #B7282E, #F5D87E, #3F6E3A, #FBFAF5, #674196, #B7282E);
}
.rope-swatch[data-rope="red"] { background: linear-gradient(135deg, #7A1A1F, #FBFAF5, #B7282E); }
.rope-swatch[data-rope="blue"] { background: linear-gradient(135deg, #1B2538, #FBFAF5, #1E50A2); }
.rope-swatch[data-rope="gold"] { background: linear-gradient(135deg, #7A5A18, #FFE9A8, #C9A24F); }
.rope-swatch[data-rope="purple"] { background: linear-gradient(135deg, #3F2960, #FBFAF5, #674196); }
.rope-swatch.active { border-color: var(--vermilion); transform: scale(1.1); }

/* ========== Goshuin ========== */
.goshuin-summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--vermilion-dark);
  margin-bottom: 12px;
  text-align: center;
}
.goshuin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.goshuin-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: #FBF6E8;
  font-size: 11px;
  text-align: center;
}
.goshuin-cell.owned { border-color: var(--gold); background: linear-gradient(180deg, #FFF8E0, #F5E5B6); }
.goshuin-cell.locked { opacity: 0.4; }
.goshuin-emoji { font-size: 24px; }
.goshuin-name { font-weight: 700; font-size: 11px; }
.goshuin-date { color: var(--sumi-soft); font-size: 9px; }
.goshuin-cell.kind-rare.owned { background: linear-gradient(180deg, #FFE9F5, #FFD7F0); border-color: #FF1493; }
.goshuin-cell.kind-milestone.owned { background: linear-gradient(180deg, #FFF4C4, #F0D27A); border-color: #FFD700; }
.goshuin-cell.kind-activity.owned { background: linear-gradient(180deg, #E5F5E5, #C8E6C9); border-color: #4CAF50; }
.goshuin-hint { font-size: 9px; color: var(--sumi-soft); margin-top: 2px; }

/* 進捗バー（達成可能感を強化） */
.goshuin-progress {
  background: rgba(255, 248, 224, 0.6);
  border: 1px solid #E5D9B6;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  text-align: left;
}
.goshuin-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--vermilion-dark);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.goshuin-progress-text strong { color: #B7282E; font-size: 16px; }
.goshuin-progress-bar {
  height: 8px;
  background: #E5D9B6;
  border-radius: 4px;
  overflow: hidden;
}
.goshuin-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #B7282E);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
  box-shadow: 0 0 8px rgba(255,215,0,0.5);
}
.goshuin-next {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255, 215, 0, 0.15);
  border-left: 3px solid #C9A24F;
  border-radius: 4px;
  font-size: 13px; /* L77: 御朱印取得ガイダンス(機能テキスト)。60代可読性下限 12→13px */
  color: #5a3f0f;
  font-weight: 600;
}

/* ========== Plans ========== */
.plan-intro {
  font-size: 13px;
  color: var(--sumi-soft);
  margin-bottom: 16px;
  line-height: 1.7;
}
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.plan {
  background: linear-gradient(180deg, #FFFFFF, #FBF6E8);
  border: 2px solid rgba(201,162,79,0.3);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.plan.recommended {
  border-color: var(--vermilion);
  box-shadow: 0 4px 16px rgba(183,40,46,0.2);
  transform: scale(1.02);
}
.plan.current { background: #FBF6E8; }
.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--vermilion);
  color: var(--kinari);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: 0.1em;
}
.plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--vermilion-dark);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}
.plan-price {
  font-size: 14px;
  text-align: center;
  margin-bottom: 12px;
  color: var(--sumi);
}
.plan-price strong { font-size: 24px; color: var(--vermilion-dark); }
.plan-features {
  list-style: none;
  flex: 1;
  margin-bottom: 12px;
  font-size: 14px; /* L73: 購入判断直前のプラン機能リスト。60代可読性のため 12→14px */
}
.plan-features li {
  padding: 4px 0 4px 18px;
  position: relative;
  color: var(--sumi-soft);
  line-height: 1.5;
}
.plan-features li::before {
  content: '✓';
  color: var(--vermilion);
  font-weight: 700;
  position: absolute;
  left: 0;
}
.plan-cta { width: 100%; }

/* ========== Settings ========== */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-wrap: wrap;
}
.settings-row:last-child { border-bottom: none; }
.settings-row strong { font-size: 14px; color: var(--sumi); }

/* ========== Chat (AI神主) ========== */
/* L77 fix: Cookie同意バナー表示中はチャットFABをバナー上端より上へ退避(覆い被さってタップ不能になるのを防ぐ) */
body.cookie-open .chat-fab { bottom: calc(150px + env(safe-area-inset-bottom)); }
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: var(--vermilion);
  color: var(--kinari);
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(183,40,46,0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  animation: chatPulse 3s ease-in-out infinite;
}
.chat-fab:hover { background: var(--vermilion-dark); transform: translateY(-2px); }
.chat-fab-emoji { font-size: 20px; }
@keyframes chatPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(183,40,46,0.4); }
  50% { box-shadow: 0 6px 24px rgba(183,40,46,0.7), 0 0 0 8px rgba(183,40,46,0.1); }
}

.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.chat-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.chat-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  background: var(--kinari);
  border: 2px solid var(--gold);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeUp 0.4s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.chat-header {
  background: linear-gradient(180deg, var(--vermilion), var(--vermilion-dark));
  color: var(--kinari);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header strong { font-size: 16px; letter-spacing: 0.1em; }
.chat-header small { display: block; font-size: 13px; opacity: 0.85; margin-top: 2px; } /* L77: 残謁見回数・資格条件(プラン判断直結の機能テキスト)。60代可読性下限 11→13px */
.chat-close {
  background: transparent;
  border: none;
  color: var(--kinari);
  font-size: 24px;
  cursor: pointer;
  /* L32-C M5: WCAG 2.5.5 / Apple HIG / Material 準拠の 44×44 タップターゲット
     （旧 32×32 は高齢ユーザのミスタップ多発要因だった） */
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.15s ease;
}
.chat-close:hover { background: rgba(255,255,255,0.2); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, #FBF6E8, #FBFAF5);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-priest { justify-content: flex-start; }
.chat-user { justify-content: flex-end; }
.chat-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #FFF8E0, #C9A24F);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 1px solid var(--gold);
}
.chat-bubble {
  background: #FFFFFF;
  border: 1px solid rgba(201,162,79,0.4);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.7;
  max-width: 78%;
  color: var(--sumi);
  /* L77: 長URL・連続英数字がバブルを突き抜けて横スクロール化するのを防ぐ(.ema-wish と同パターン) */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-priest .chat-bubble {
  background: #FFF8E0;
  border-color: var(--gold);
}
.chat-user .chat-bubble {
  background: var(--vermilion);
  color: var(--kinari);
  border-color: var(--vermilion-dark);
}
.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(201,162,79,0.3);
  background: var(--kinari);
}
.chat-form input {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #FFFFFF;
}
.chat-disclaimer {
  /* L70-B fix: 相談窓口の電話番号(いのちの電話/よりそい)を含むため 10px→12px に。
     危機文脈での可読性(WCAG 1.4.4)を確保。 */
  font-size: 12px;
  color: var(--sumi-soft);
  text-align: center;
  padding: 8px 16px 12px;
  background: var(--kinari);
}

@media (max-width: 480px) {
  .chat-fab { bottom: 16px; right: 16px; padding: 12px 16px; }
  .chat-fab-label { display: none; }
  .plan { padding: 12px; }
}

/* ========== Admin banner & panel ========== */
.admin-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #1A1A1A, #3A2A18);
  color: #FFD700;
  text-align: center;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  border-bottom: 2px solid #FFD700;
}
body.admin-mode { background: linear-gradient(180deg, #2B2B2B 0%, #1A1A1A 4%, #FBE6D4 4%, #F5E1B9 60%, #E8D2A6 100%); }
.admin-panel {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 80;
  width: 220px;
  background: #1A1A1A;
  color: #FFD700;
  border: 2px solid #FFD700;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  font-size: 12px;
}
.admin-panel.collapsed .admin-panel-body { display: none; }
.admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.admin-panel-head strong { font-size: 13px; }
.admin-panel-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-panel-body .btn {
  background: #2B2B2B;
  color: #FFD700;
  border-color: #FFD700;
  font-size: 11px;
  padding: 6px 8px;
  text-align: left;
}
.admin-panel-body .btn:hover { background: #FFD700; color: #1A1A1A; }
.admin-panel-body .btn-danger { color: #FF6B6B; border-color: #FF6B6B; }
.admin-panel-body .btn-danger:hover { background: #FF6B6B; color: #1A1A1A; }
.admin-panel #adminClose {
  background: transparent;
  color: #FFD700;
  border: none;
  font-size: 18px;
  width: 24px; height: 24px;
  cursor: pointer;
}

.admin-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1A1A1A;
  color: #FFD700;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #FFD700;
  font-size: 13px;
  font-weight: 700;
  /* L70-B fix: 旧 z-index:999 は全モーダル(consent/onboard=10000, en-charge/contact/hitokoto=9999)の
     背面で、モーダル表示中の toast(お問合せのバリデーション/送信失敗/レート制限、同意の年齢未チェック、
     縁チャージ二重タップ等)が完全に不可視→「押しても何も起きない」行き止まりだった。最前面へ。 */
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-width: 90vw;
  text-align: center;
}
.admin-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 運営モード専用 UI: 通常は非表示、admin-mode 有効時のみ表示 */
.admin-only { display: none !important; }
body.admin-mode .admin-only { display: flex !important; }

/* ========== Community rooms ========== */
.rooms-intro {
  font-size: 13px;
  color: var(--sumi-soft);
  line-height: 1.7;
  margin-bottom: 12px;
}
.rooms-actions-top { margin-bottom: 16px; text-align: center; }
.rooms-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.room-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #FFFFFF, #FBF6E8);
  border: 1px solid rgba(201,162,79,0.4);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.room-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(122,26,31,0.2); }
.room-card.locked { opacity: 0.7; }
.room-card.locked:hover { transform: none; box-shadow: none; }
.room-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.room-body { flex: 1; min-width: 0; }
.room-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--vermilion-dark);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.room-mine {
  background: var(--vermilion);
  color: var(--kinari);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 999px;
  vertical-align: middle;
  font-weight: 700;
  letter-spacing: 0.1em;
}
/* L73 fix(モバイル): タップ領域 44px を確保しつつ見た目は 28px の小円を維持（.ema-del-btn と同パターン）。
   旧 28px 固定は WCAG 2.5.5 未達で 60代が押しにくく誤タップを誘発していた。 */
.room-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--vermilion);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 5;
}
.room-delete-btn::before {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  background: rgba(122,26,31,0.08);
  border: 1px solid rgba(122,26,31,0.2);
  border-radius: 50%;
  z-index: -1;
  transition: all 0.15s ease;
}
.room-delete-btn:hover::before {
  background: var(--vermilion);
  transform: scale(1.05);
}
.room-delete-btn:hover {
  color: #fff;
}
.room-card { position: relative; }
.status-en-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}
/* ロビーの縁残高 + 授かるボタン（独立配置） */
.lobby-en-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 12px auto 0;
  max-width: 540px;
}
.lobby-en-balance {
  display: inline-block;
  background: linear-gradient(135deg, #C9A24F, #E0BF6F);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(122,26,31,0.15);
}
.lobby-en-add {
  background: var(--vermilion);
  color: #fff;
  border: 2px solid #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(122,26,31,0.3);
  transition: all 0.15s ease;
  position: relative;
  z-index: 100;
  pointer-events: auto !important;
}
.lobby-en-add:hover { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(122,26,31,0.4); }
.lobby-en-add:active { transform: translateY(0); }
.status-en-balance {
  display: inline-block;
  background: linear-gradient(135deg, #C9A24F, #E0BF6F);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(122,26,31,0.15);
}
.status-en-add {
  background: var(--vermilion);
  color: #fff;
  border: 2px solid #fff;
  /* L65-C H3 / L77 fix: WCAG 2.5.5 タップ領域 44x44。旧実装の padding:6px + background-clip:content-box は
     直後の padding:0 で無効化された死にコードで、活かすと白ボーダーと赤円の間に透明リングが出て逆に崩れるため除去。
     44px 全面を赤円(border-radius:50%)で着色する現挙動を正とする。 */
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(122,26,31,0.35);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 100;
  pointer-events: auto !important;
  user-select: none;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  vertical-align: middle;
  /* ふんわり呼吸アニメーション（押せることを示唆） */
  animation: enAddBreath 2.4s ease-in-out infinite;
}
.status-en-add:hover {
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 4px 14px rgba(122,26,31,0.5);
}
.status-en-add:active {
  transform: scale(0.85) rotate(180deg);
  box-shadow: 0 1px 4px rgba(122,26,31,0.6) inset;
  transition-duration: 0.05s;
}
.status-en-add:focus,
.status-en-add:focus-visible { outline: 3px solid rgba(201,162,79,0.6); outline-offset: 2px; text-decoration: none !important; }
.status-en-add::after { content: none !important; }
.status-en-wrap a, .status-en-wrap button { text-decoration: none !important; }
/* L70-A: 旧 status-en-add-wide variant は撤去（常時 ＋ ボタンに統一）。
   古いキャッシュで .status-en-add-wide クラスが付与されても影響しないよう no-op に。 */
.status-en-add.status-en-add-wide {
  /* no-op */
}
@keyframes enAddBreath {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(122,26,31,0.35); }
  50%      { transform: scale(1.08); box-shadow: 0 4px 14px rgba(122,26,31,0.5); }
}

/* ===== 案D：静寂の金波紋（3重・1.5秒・画面を覆わない） ===== */
.tip-ripple-layer {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 9999;
}
.tip-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border: 2px solid rgba(255, 215, 0, 0.85);
  border-radius: 50%;
  box-shadow:
    0 0 14px rgba(255, 215, 0, 0.5),
    inset 0 0 10px rgba(255, 235, 180, 0.4);
  animation: tipRippleExpand 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.tip-ripple-1 { animation-delay: 0s; }
.tip-ripple-2 { animation-delay: 0.18s; }
.tip-ripple-3 { animation-delay: 0.36s; }
@keyframes tipRippleExpand {
  0%   { transform: scale(0.3); opacity: 0; border-width: 4px; }
  20%  { opacity: 1; }
  100% { transform: scale(5); opacity: 0; border-width: 1px; }
}
.tip-ripple-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #C9A24F;
  font-family: var(--font-mincho, "Shippori Mincho", "Yu Mincho", serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  white-space: nowrap;
  text-shadow:
    0 0 8px rgba(255, 235, 180, 0.95),
    0 0 14px rgba(255, 215, 0, 0.7),
    0 1px 2px rgba(122,26,31,0.3);
  opacity: 0;
  animation: tipRippleText 1.5s ease-out forwards;
}
@keyframes tipRippleText {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ===== 旧コインレイヤー（互換用・無効化） ===== */
.tip-coin-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.tip-coin {
  position: absolute;
  top: -60px;
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 6px rgba(122,26,31,0.4));
  animation: tipCoinFall var(--dur, 2s) cubic-bezier(0.45, 0, 0.55, 1) forwards;
  will-change: transform, opacity;
}
/* 絵文字コインの強い金色グロー */
.tip-coin-glow {
  filter:
    drop-shadow(0 0 8px rgba(255,215,0,0.95))
    drop-shadow(0 0 24px rgba(255,215,0,0.7))
    drop-shadow(0 4px 8px rgba(122,26,31,0.45));
}
.tip-coin-layer.tier-mythic .tip-coin-glow,
.tip-coin-layer.tier-legend .tip-coin-glow {
  filter:
    drop-shadow(0 0 12px #FFD700)
    drop-shadow(0 0 36px rgba(255,215,0,0.85))
    drop-shadow(0 0 60px rgba(183,40,46,0.4));
}

/* ===== 案C：朱赤判子＋金光線 ===== */
@keyframes tipCoinFall {
  0%   { transform: translate(0, 0) rotate(0deg) scale(0.3); opacity: 0; }
  10%  { opacity: 1; transform: translate(0, 30px) rotate(45deg) scale(1); }
  60%  { opacity: 1; transform: translate(calc(var(--drift, 0) * 0.6), 60vh) rotate(calc(var(--rot, 360deg) * 0.6)) scale(1.05); }
  100% { transform: translate(var(--drift, 0), 100vh) rotate(var(--rot, 720deg)) scale(0.85); opacity: 0; }
}

/* 光のフラッシュ */
.tip-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,215,0,0.45) 0%, transparent 70%);
  animation: tipFlash 1.4s ease-out forwards;
  pointer-events: none;
}
@keyframes tipFlash {
  0%   { opacity: 0; transform: scale(0.4); }
  20%  { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.6); }
}
.tip-coin-layer.tier-mythic .tip-flash,
.tip-coin-layer.tier-legend .tip-flash {
  background: radial-gradient(circle at center, rgba(255,215,0,0.7) 0%, rgba(183,40,46,0.3) 30%, transparent 80%);
  animation-duration: 2s;
}

/* 紙吹雪リボン */
.tip-ribbon {
  position: absolute;
  top: -30px;
  width: 8px;
  height: 16px;
  border-radius: 2px;
  animation: tipRibbonFall var(--dur, 3s) ease-in forwards;
  will-change: transform, opacity;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
@keyframes tipRibbonFall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--ribbon-drift, 0), 100vh) rotate(var(--ribbon-rot, 720deg)); opacity: 0; }
}

/* 花火 */
.tip-firework {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
  animation: tipFirework 1.6s ease-out forwards;
  pointer-events: none;
}
@keyframes tipFirework {
  0%   { transform: scale(0.3); opacity: 0; box-shadow: 0 0 0px currentColor; }
  20%  { transform: scale(1); opacity: 1; box-shadow: 0 0 60px currentColor, 0 0 120px currentColor; }
  60%  { transform: scale(2.5); opacity: 0.6; box-shadow: 0 0 80px currentColor, 0 0 160px currentColor; }
  100% { transform: scale(4); opacity: 0; box-shadow: 0 0 0px currentColor; }
}

/* 神からの感謝カード */
.tip-thanks-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  background: linear-gradient(135deg, #FBFAF5 0%, #F5EFE0 100%);
  border: 3px solid #C9A24F;
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,215,0,0.7), 0 0 120px rgba(183,40,46,0.4), inset 0 0 30px rgba(255,215,0,0.15);
  animation: tipCardAppear 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, tipCardExit 1s ease 3.5s forwards;
  font-family: var(--font-mincho, "Shippori Mincho", "Yu Mincho", serif);
  z-index: 10;
  max-width: 90vw;
}
.tip-thanks-icon {
  font-size: 3.2rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 8px rgba(183,40,46,0.5));
  animation: tipIconBob 1.4s ease-in-out infinite;
}
@keyframes tipIconBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.tip-thanks-msg {
  font-size: 17px;
  color: #7A1A1F;
  font-weight: 700;
  margin: 8px 0;
  letter-spacing: 0.05em;
}
.tip-thanks-amount {
  font-size: 13px;
  color: #C9A24F;
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: 0.1em;
}
@keyframes tipCardAppear {
  0%   { transform: translate(-50%, -50%) scale(0.4) rotate(-8deg); opacity: 0; }
  60%  { transform: translate(-50%, -50%) scale(1.08) rotate(2deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}
@keyframes tipCardExit {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -150%) scale(0.85); opacity: 0; }
}
/* mythic だけは特別な背景発光 */
.tip-coin-layer.tier-mythic .tip-thanks-card {
  background: linear-gradient(135deg, #FFFEF5 0%, #FFF1B8 50%, #FFD700 100%);
  border-color: #FFD700;
  box-shadow: 0 0 100px rgba(255,215,0,0.9), 0 0 200px rgba(183,40,46,0.5);
}
.tip-coin-layer.tier-mythic .tip-thanks-msg { color: #5a2a00; }

/* ===== 絵馬への祈り：軽い感謝演出 ===== */
.ema-prayer-layer {
  position: fixed;
  top: 50%; left: 50%;
  width: 1px; height: 1px;
  pointer-events: none;
  z-index: 9998;
}
.ema-prayer-particle {
  position: absolute;
  top: 0; left: 0;
  font-size: 1.6rem;
  animation: emaPrayerBurst 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  filter: drop-shadow(0 2px 6px rgba(122,26,31,0.4));
}
@keyframes emaPrayerBurst {
  0%   { transform: translate(0, 0) scale(0.3); opacity: 0; }
  20%  { opacity: 1; transform: translate(calc(var(--dx) * 0.3), calc(var(--dy) * 0.3)) scale(1.2); }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.6); opacity: 0; }
}
/* 小さな絵馬札（実画像） */
.ema-mini-card {
  position: absolute;
  top: -28px;
  left: -28px;
  width: 56px;
  height: 64px;
  filter: drop-shadow(0 3px 8px rgba(122,26,31,0.45));
  animation: emaMiniFloat 2s cubic-bezier(0.25, 1, 0.45, 1) forwards;
}
.ema-mini-img img,
.ema-mini-img picture { width: 100%; height: 100%; object-fit: contain; display: block; }
@keyframes emaMiniFloat {
  0%   { transform: translate(0, 0) rotate(-15deg) scale(0.4); opacity: 0; }
  20%  { opacity: 1; transform: translate(calc(var(--dx) * 0.4), calc(var(--dy) * 0.4)) rotate(-8deg) scale(1); }
  60%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(15deg) scale(0.7); opacity: 0; }
}
/* 中央の光のリング */
.ema-prayer-ring {
  position: absolute;
  top: -40px;
  left: -40px;
  width: 80px;
  height: 80px;
  border: 3px solid rgba(255,215,0,0.9);
  border-radius: 50%;
  animation: emaPrayerRingExpand 1.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow: 0 0 30px rgba(255,215,0,0.6), inset 0 0 20px rgba(255,235,180,0.5);
}
@keyframes emaPrayerRingExpand {
  0%   { transform: scale(0.2); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; border-width: 1px; }
}

/* ===== 金/神慮 の特別お告げ説明モーダル ===== */
.rare-oracle-popup {
  position: fixed; inset: 0;
  z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  animation: rareOracleFade 0.5s ease forwards;
}
.rare-oracle-popup.exit { animation: rareOracleFade 0.4s ease reverse forwards; }
.rare-oracle-overlay {
  position: absolute; inset: 0;
  background: rgba(20, 5, 0, 0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.rare-oracle-panel {
  position: relative;
  border: 3px solid;
  border-radius: 20px;
  padding: 28px 24px 24px;
  max-width: 420px;
  width: calc(100vw - 40px);
  text-align: center;
  box-shadow: 0 10px 60px rgba(122,26,31,0.35), 0 0 80px rgba(255,215,0,0.4);
  animation: rareOraclePop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-mincho, "Shippori Mincho", "Yu Mincho", serif);
  overflow: hidden;
}
.rare-oracle-rays {
  position: absolute; inset: -50%;
  background: conic-gradient(transparent, rgba(255,215,0,0.18), transparent, rgba(255,215,0,0.12), transparent, rgba(255,215,0,0.2), transparent);
  animation: rareOracleSpin 8s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.rare-oracle-icon {
  position: relative; z-index: 1;
  font-size: 3.5rem;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 14px rgba(183,40,46,0.5));
  animation: rareOracleIconBob 2.4s ease-in-out infinite;
}
.rare-oracle-title {
  position: relative; z-index: 1;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 4px 0 2px;
  text-shadow: 0 2px 8px rgba(255,255,255,0.5);
}
.rare-oracle-sub {
  position: relative; z-index: 1;
  font-size: 12px;
  letter-spacing: 0.2em;
  margin-bottom: 16px;
  opacity: 0.85;
}
.rare-oracle-body {
  position: relative; z-index: 1;
  font-size: 13px;
  color: #5a3f0f;
  line-height: 1.85;
  text-align: left;
  margin: 14px 4px 18px;
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  padding: 14px 16px;
}
.rare-oracle-body p { margin: 0 0 10px; }
.rare-oracle-body p:last-child { margin-bottom: 0; }
.rare-oracle-cta {
  position: relative; z-index: 1;
  border: none !important;
  color: #fff !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  padding: 12px 20px !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
@keyframes rareOracleFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rareOraclePop {
  0%   { transform: scale(0.5) rotate(-6deg); opacity: 0; }
  60%  { transform: scale(1.06) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes rareOracleSpin { to { transform: rotate(360deg); } }
@keyframes rareOracleIconBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-8px) scale(1.05); }
}
/* status-en-add の hover/active は 1692 行で定義済み（ここの重複定義を削除） */
.room-desc {
  font-size: 13px; /* L77: 部屋説明(機能テキスト)。60代可読性下限 12→13px */
  color: var(--sumi-soft);
  line-height: 1.5;
  margin-bottom: 6px;
}
.room-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px; /* L77: 入場条件テキスト。60代可読性下限 11→13px */
  color: var(--sumi-soft);
}
.room-tier.ok { color: #2a7a45; font-weight: 700; }
.room-tier.locked { color: #B7282E; font-weight: 700; }
.room-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 18px;
}

/* Room detail modal */
.room-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.room-panel { max-width: 600px; max-height: 85vh; }
.room-desc-line {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--sumi-soft);
  background: #FBF6E8;
  border-bottom: 1px solid rgba(201,162,79,0.3);
}
.room-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, #FBF6E8, #FBFAF5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}
.room-msg {
  background: #FFF;
  border: 1px solid rgba(201,162,79,0.3);
  border-radius: 8px;
  padding: 10px 12px;
  max-width: 85%;
}
.room-msg.by-me {
  background: linear-gradient(180deg, #FFF8E0, #F5E5B6);
  border-color: var(--gold);
  align-self: flex-end;
}
.room-msg-head {
  font-size: 11px;
  color: var(--vermilion-dark);
  margin-bottom: 4px;
}
.room-msg-head small { color: var(--sumi-soft); margin-left: 6px; }
.room-msg-del {
  background: transparent;
  border: none;
  color: rgba(122, 26, 31, 0.45);
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
  padding: 0;
  border-radius: 6px;
  transition: all 0.15s ease;
  vertical-align: middle;
  /* L77 fix: WCAG 2.5.5 44px タップ領域(60代誤タップ防止)。絵馬の .ema-del-btn と同方針で視覚は小さく保ちつつ hit-area を 44px に拡張 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
.room-msg-del:hover {
  background: rgba(183, 40, 46, 0.1);
  color: var(--vermilion);
  transform: scale(1.1);
}
.room-msg-del:active { transform: scale(0.95); }
.room-msg-hide {
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
  padding: 0;
  border-radius: 6px;
  transition: all 0.15s ease;
  vertical-align: middle;
  /* L77 fix: WCAG 2.5.5 44px タップ領域(60代誤タップ防止)。.ema-del-btn と同方針 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
.room-msg-hide:hover {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}
/* 絵馬の右上ボタン（削除/非表示）
   L36-B H4: WCAG 2.5.5 / Apple HIG 44×44 確保（旧 28×28 は高齢ユーザの誤タップで「自分の絵馬を誤削除」のリスクが高かった）
   視覚的なアイコンは内側 28px、透明な hit area で 44×44 確保 */
.ema-del-btn, .ema-hide-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: transparent;
  border: none;
  color: rgba(122,26,31,0.7);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 5;
  padding: 0;
}
.ema-del-btn::before, .ema-hide-btn::before {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(122,26,31,0.25);
  border-radius: 50%;
  z-index: -1;
  transition: all 0.15s ease;
}
.ema-del-btn { color: var(--vermilion); }
.ema-del-btn::before { border-color: rgba(183,40,46,0.35); }
.ema-del-btn:hover::before { background: var(--vermilion); }
.ema-del-btn:hover { color: #fff; transform: scale(1.08); }
.ema-hide-btn:hover::before { background: rgba(0,0,0,0.7); }
.ema-hide-btn:hover { color: #fff; transform: scale(1.08); }
.ema { position: relative; }
.room-msg-text { font-size: 13px; line-height: 1.6; color: var(--sumi); overflow-wrap: anywhere; word-break: break-word; } /* L77: 長URL折返し */

.room-lock-msg {
  padding: 16px;
  text-align: center;
  background: linear-gradient(180deg, #FFE9F5, #FFD7F0);
  color: var(--vermilion-dark);
  font-weight: 700;
  font-size: 13px;
  border-top: 1px solid rgba(201,162,79,0.3);
}
.room-form {
  border-top: 1px solid rgba(201,162,79,0.3);
}

@media (max-width: 480px) {
  .rooms-list { grid-template-columns: 1fr; }
  .room-icon { width: 44px; height: 44px; font-size: 22px; }
}

/* ========== Divine beast (epic appearance) ========== */
.divine-beast-wrap {
  position: fixed;  /* 画面全体に固定（重なり防止） */
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 9000;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 70%);
  padding: 5vh 16px;
}
.divine-beast {
  font-size: 18vh;
  filter: drop-shadow(0 0 32px rgba(255,215,0,0.95)) drop-shadow(0 0 60px rgba(255,20,147,0.65));
  transform: scale(0.05) rotate(-180deg);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}
.divine-beast-img {
  max-height: 55vh;
  max-width: 80vw;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  filter: drop-shadow(0 0 40px rgba(255,215,0,1)) drop-shadow(0 0 80px rgba(199,162,79,0.6));
  transform: scale(0.05) rotate(-30deg);
  opacity: 0;
  transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}
.divine-beast-wrap picture { display: contents; }
.divine-beast-wrap.roar .divine-beast-img {
  transform: scale(1) rotate(0deg);
  opacity: 1;
  animation: beastShake 0.8s ease-in-out 0.6s 2;
}
.divine-beast-wrap.exit .divine-beast-img {
  transform: scale(1.5) rotate(15deg);
  opacity: 0;
  transition: all 0.9s ease;
}
.divine-beast-wrap.roar .divine-beast {
  transform: scale(1) rotate(0deg);
  opacity: 1;
  animation: beastShake 0.6s ease-in-out 0.6s 2;
}
.divine-beast-cry {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 0 0 12px rgba(0,0,0,0.9), 0 0 20px rgba(255,215,0,0.8);
  letter-spacing: 0.2em;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease 0.8s;
}
.divine-beast-name {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.4em;
  opacity: 0;
  transition: opacity 0.4s ease 1.2s;
  text-shadow: 0 0 8px rgba(0,0,0,0.9);
}
.divine-beast-wrap.roar .divine-beast-cry,
.divine-beast-wrap.roar .divine-beast-name { opacity: 1; transform: translateY(0); }
.divine-beast-wrap.exit .divine-beast {
  transform: scale(1.4) rotate(20deg);
  opacity: 0;
  transition: all 0.8s ease;
}
.divine-beast-wrap.exit .divine-beast-cry,
.divine-beast-wrap.exit .divine-beast-name { opacity: 0; transition: opacity 0.5s ease; }

@keyframes beastShake {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(-3deg); }
  75% { transform: scale(1.05) rotate(3deg); }
}

/* ========== Gold beam (光柱) ========== */
.gold-beam {
  position: absolute;
  top: -10%;
  left: 50%;
  width: 30%;
  height: 130%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent 0%, rgba(255,215,0,0.85) 30%, rgba(255,215,0,0.95) 50%, rgba(255,215,0,0.85) 70%, transparent 100%);
  filter: blur(24px);
  opacity: 0;
  z-index: 4;
  pointer-events: none;
  animation: beamFlash 3s ease-out forwards;
}
@keyframes beamFlash {
  0%   { opacity: 0; width: 5%; }
  20%  { opacity: 1; width: 30%; }
  60%  { opacity: 1; }
  100% { opacity: 0; width: 50%; }
}

.gold-giant-char {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.1);
  font-size: 22vh;
  font-weight: 900;
  font-family: serif;
  color: #FFD700;
  text-shadow: 0 0 24px #FFA500, 0 0 48px #FF6B00, 0 0 80px rgba(255,215,0,0.7);
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  animation: giantChar 3s ease-out forwards;
}
@keyframes giantChar {
  0%   { transform: translate(-50%, -50%) scale(0.1) rotate(-30deg); opacity: 0; }
  25%  { transform: translate(-50%, -50%) scale(1.3) rotate(0deg); opacity: 1; }
  60%  { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2) rotate(10deg); opacity: 0; }
}

/* ========== God-style chat ========== */
.god-fab {
  background: linear-gradient(135deg, #1A1A1A 0%, #5A3F0F 50%, #C9A24F 100%);
  color: #FFD700;
  border: 2px solid #FFD700;
  font-family: serif;
}
.god-fab .chat-fab-emoji {
  font-family: serif;
  font-weight: 900;
  background: linear-gradient(180deg, #FFE9A8, #C9A24F);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 22px;
}
.god-panel {
  background: linear-gradient(180deg, #1A1A1A 0%, #2B2B2B 100%);
  border: 2px solid #FFD700;
  color: var(--kinari);
}
.god-header {
  background: linear-gradient(180deg, #1A1A1A, #3A2A18) !important;
  color: #FFD700 !important;
  border-bottom: 1px solid #FFD700;
}
.god-header strong {
  background: linear-gradient(90deg, #FFE9A8, #C9A24F);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.2em;
}
.god-panel .chat-log {
  background: linear-gradient(180deg, #2B2B2B, #1A1A1A);
}
.god-avatar {
  background: linear-gradient(135deg, #1A1A1A, #5A3F0F, #C9A24F) !important;
  border: 1px solid #FFD700 !important;
  color: #FFD700 !important;
  font-family: serif;
  font-weight: 900;
  font-size: 18px;
}
.god-bubble {
  background: linear-gradient(180deg, #2B2B2B, #1A1A1A) !important;
  border: 1px solid #FFD700 !important;
  color: #FFE9A8 !important;
  font-family: serif !important;
}
.god-panel .chat-user .chat-bubble {
  background: rgba(255,215,0,0.15) !important;
  color: var(--kinari) !important;
  border: 1px solid rgba(255,215,0,0.4) !important;
}
.god-panel .chat-form {
  background: #1A1A1A;
  border-top: 1px solid #FFD700;
}
.god-panel .chat-form input {
  background: #2B2B2B;
  color: #FFE9A8;
  border-color: #FFD700;
}
.god-panel .chat-disclaimer {
  background: #1A1A1A;
  color: rgba(255,232,168,0.78); /* L77 fix: 危機ホットライン番号(命綱)が 0.5 で約3:1の低コントラストだった→0.78(約7:1) */
  border-top: 1px solid rgba(255,215,0,0.2);
}

/* 神の降臨オーバーレイ（軽量版） */
.god-reveal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* L77 fix: 横持ち/小型端末で figure+長文 safety_response+「閉じる」が縦に収まらない時、
     overflow:hidden + justify-content:center だと末尾の dismiss ボタンが上下対称に溢れてクリップされ、
     最も繊細な危機 surface で手動クローズ不能になり得た。safe center で溢れ時は flex-start 相当に分岐させ、
     overflow-y:auto でスクロール到達可能にする(背景タップ/自動 hide/永続 crisis バブルに加えた保険)。 */
  justify-content: safe center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  transition: opacity 0.55s ease-out;
}
.god-reveal.show  { opacity: 1; }
.god-reveal.closing { opacity: 0; }

.god-reveal-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 55% 60% at center 40%, rgba(255,245,200,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.god-reveal-rays { display: none; }

.god-reveal-figure {
  position: relative;
  width: min(60vw, 360px);
  height: min(60vw, 360px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: translateY(-24px) scale(0.9);
  transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.god-reveal.show .god-reveal-figure {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.god-reveal-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
}
.god-reveal-halo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,245,0.4) 0%, rgba(255,250,220,0.1) 10%, transparent 30%);
  mix-blend-mode: screen;
}

.god-reveal-text {
  position: relative;
  z-index: 4;
  max-width: min(82vw, 620px);
  margin-top: 18px;
  padding: 16px 22px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 230, 160, 0.5);
  border-radius: 10px;
  color: #FFF2C2;
  font-family: serif;
  font-size: 18px;
  line-height: 1.85;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: pre-wrap;
  min-height: 1.5em;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.god-reveal.text-shown .god-reveal-text { opacity: 1; }

.god-reveal-dismiss {
  position: relative;
  z-index: 4;
  margin-top: 14px;
  background: transparent;
  color: #FFE9A8;
  border: 1px solid rgba(255, 230, 160, 0.5);
  padding: 8px 22px;
  min-height: 44px; /* L73: タップ44px */
  border-radius: 20px;
  font-family: serif;
  letter-spacing: 0.15em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease-out, background 0.15s ease;
}
.god-reveal.text-shown .god-reveal-dismiss { opacity: 1; }
.god-reveal-dismiss:hover { background: rgba(255, 230, 160, 0.15); }

/* 神の声 ON/OFF ボタン */
.chat-voice {
  background: rgba(255,215,0,0.12);
  border: 1px solid rgba(255,215,0,0.4);
  color: #FFD700;
  font-size: 16px;
  cursor: pointer;
  /* L65-C H3: 34x34 → 44x44 WCAG 2.5.5 */
  width: 44px; height: 44px;
  border-radius: 50%;
  transition: background 0.15s ease, transform 0.15s ease;
}
.chat-voice:hover { background: rgba(255,215,0,0.25); transform: scale(1.06); }

/* ===== 毎日のお告げ通知バナー ===== */
.daily-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 14px 16px;
  /* 朱赤の濃い背景に金文字 → 高コントラストで視認性◎ */
  background: linear-gradient(135deg, #B7282E 0%, #8A1F23 100%);
  border: 2px solid #FFD700;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(183, 40, 46, 0.35);
  animation: dailyNoticeSlideIn 0.4s ease;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: rgba(255, 215, 0, 0.3);
}
.daily-notice:hover, .daily-notice:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(183, 40, 46, 0.5);
}
.daily-notice-bell {
  font-size: 1.8em;
  animation: dailyNoticeBellSwing 2.4s ease-in-out infinite;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}
.daily-notice-body { flex: 1; min-width: 0; }
.daily-notice-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.02em;
  font-weight: 700;
  color: #FFD700;
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.daily-notice-sub {
  font-size: 0.84em;
  color: #fff;
  opacity: 0.92;
  margin-top: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.daily-notice-close {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: #fff;
  font-size: 1.2em;
  /* L65-C H3: 28x28 → 44x44 WCAG 2.5.5 */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
  position: relative;
  z-index: 2;
}
.daily-notice-close:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: #FFD700;
  transform: scale(1.08);
}
@keyframes dailyNoticeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dailyNoticeBellSwing {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-6deg); }
  40% { transform: rotate(6deg); }
  60% { transform: rotate(-3deg); }
  80% { transform: rotate(3deg); }
}

/* ライトモード時の調整（背景は朱赤のままで OK だが、ヘッダーがライトな場合） */
@media (prefers-color-scheme: light) {
  .daily-notice { box-shadow: 0 4px 16px rgba(183, 40, 46, 0.4); }
}

/* ===== プロフィール完成度バー ===== */
.profile-completion {
  margin: 12px 0 20px;
  padding: 12px 14px;
  background: rgba(201, 162, 79, 0.06);
  border-radius: 8px;
  border-left: 3px solid #C9A24F;
}
.profile-completion-label {
  font-size: 0.92em;
  color: #5A4F3F;
  font-weight: 700;
  margin-bottom: 8px;
}
.profile-completion-label span { color: #B7282E; font-size: 1.08em; }
.profile-completion-bar {
  height: 10px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.profile-completion-fill {
  height: 100%;
  background: linear-gradient(90deg, #C9A24F, #FFD700);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.profile-completion-hint {
  margin: 8px 0 0;
  /* L67: 相対 em(~13px)を明示 13px に。色も AA 確保のため濃いめへ。 */
  font-size: 13px;
  color: #6a5028;
  line-height: 1.6;
}

/* ===== 紙吹雪演出 ===== */
.confetti-piece {
  position: fixed;
  top: -20px;
  width: 8px;
  height: 14px;
  z-index: 9500;  /* consent-modal/onboard-overlay (10000) より下に */
  pointer-events: none;
  border-radius: 2px;
  animation: confettiFall 1.4s ease-in forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.8; }
}

/* ===== 時間帯アクセント（CSS 変数経由）===== */
:root {
  --time-accent: #B7282E;
}
body[data-time-of-day="morning"] .header,
body[data-time-of-day="midday"] .header { background-image: linear-gradient(180deg, rgba(248, 181, 0, 0.04) 0%, transparent 100%); }
body[data-time-of-day="evening"] .header { background-image: linear-gradient(180deg, rgba(158, 61, 63, 0.05) 0%, transparent 100%); }
body[data-time-of-day="night"] .header,
body[data-time-of-day="midnight"] .header { background-image: linear-gradient(180deg, rgba(73, 30, 60, 0.06) 0%, transparent 100%); }

/* ===== ローディング スケルトン ===== */
.skeleton {
  background: linear-gradient(90deg, rgba(183,40,46,0.06) 0%, rgba(183,40,46,0.12) 50%, rgba(183,40,46,0.06) 100%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.6s ease-in-out infinite;
  border-radius: 6px;
  color: transparent;
  user-select: none;
}
@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 1em; margin: 6px 0; }
.skeleton-circle { border-radius: 50%; aspect-ratio: 1/1; }

/* ===== もう一枚引く ボタン ===== */
.oracle-redraw {
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(183, 40, 46, 0.18);
}
.oracle-redraw button { font-family: 'Shippori Mincho', serif; }
.oracle-redraw small { color: #8a7c64; font-size: 0.78em; margin-left: 4px; }

/* ===== 部屋がロックされている時のプレビュー ===== */
.room-locked-preview {
  text-align: center;
  padding: 40px 20px;
  color: #5a3f0f;
}
.room-locked-icon {
  font-size: 3em;
  margin-bottom: 12px;
  opacity: 0.6;
}
.room-locked-msg {
  font-size: 1.0em;
  line-height: 1.7;
  margin: 12px 0;
}
.room-locked-sub {
  font-size: 0.85em;
  color: #8a7c64;
  margin: 8px 0 0;
}

/* ===== 控えめな専門相談リンク（絵馬・集いタブ用） ===== */
.quiet-help-link {
  margin: 12px 0;
  padding: 8px 12px;
  background: rgba(104, 65, 150, 0.04);
  border-radius: 6px;
  font-size: 0.85em;
}
.quiet-help-link summary {
  color: #674196;
  cursor: pointer;
  padding: 4px 0;
  font-weight: 700;
}
.quiet-help-link ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #5A4F3F;
}
.quiet-help-link li { margin: 4px 0; }
.quiet-help-link a { color: #B7282E; }

/* ===== お問合せフォーム ===== */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  padding: 16px;
}
.contact-card {
  background: linear-gradient(180deg, #FBFAF5 0%, #F5EFE0 100%);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  font-family: 'Shippori Mincho', serif;
  color: #1A1A1A;
}
.contact-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(183,40,46,0.2);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.contact-head strong { color: #B7282E; font-size: 1.1em; }
.contact-desc { color: #5A4F3F; font-size: 0.9em; line-height: 1.6; }
.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9em; color: #5A4F3F; }
.contact-form .required { color: #B7282E; }
.contact-form input, .contact-form textarea {
  padding: 10px 12px;
  border: 1px solid rgba(183,40,46,0.3);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1.0em;
  background: #fff;
  color: #1A1A1A;
}
.contact-form textarea { resize: vertical; min-height: 100px; }
.contact-note { font-size: 0.78em; color: #8a7c64; margin: 4px 0 0; line-height: 1.5; }
.contact-success { padding: 24px 12px; text-align: center; color: #5A4F3F; font-size: 0.95em; line-height: 1.8; }


/* ===== Cookie バナー ===== */
/* L77 fix: 全画面モーダル(z-index:200)表示中は Cookie バナー(z-index:9999)を退避。
   これが無いとモバイル初回セッションで bottom 固定バナーがチャット入力欄/絵馬「奉納する」submit を覆い
   タップ不能になる(主要CTA=収益導線の行き止まり)。pushModalOpen が hitokoto-open を付与/popModalOpen が除去。 */
body.hitokoto-open .cookie-banner { display: none; }
.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom)); /* L77: iPhone X+ ホームインジケーター回避(safe-area) */
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(20, 12, 10, 0.96);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  color: #f5e9d6;
  font-family: 'Shippori Mincho', serif;
  font-size: 0.85em;
  max-width: 720px;
  margin: 0 auto;
  backdrop-filter: blur(6px);
}
.cookie-text { margin: 0; flex: 1; min-width: 220px; line-height: 1.5; }
.cookie-text a { color: #FFD700; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-btn {
  padding: 8px 14px;
  min-height: 44px; /* L73: タップ44px */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: 'Shippori Mincho', serif;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid rgba(255,215,0,0.4);
  transition: all 0.15s ease;
}
.cookie-decline { background: transparent; color: #c8b89c; }
.cookie-decline:hover { background: rgba(255,255,255,0.08); }
.cookie-accept { background: #FFD700; color: #1a0a08; font-weight: 700; }
.cookie-accept:hover { background: #FFE94A; }

/* ===== 初回オンボーディング ===== */
.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(15,8,5,0.96) 0%, rgba(40,20,15,0.96) 100%);
  padding: 32px 16px;
  font-family: 'Shippori Mincho', serif;
  color: #f5e9d6;
}
.onboard-card-wrap {
  width: 100%;
  max-width: 420px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboard-card {
  text-align: center;
  padding: 24px;
  animation: onboardFadeIn 0.4s ease;
}
@keyframes onboardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.onboard-emoji {
  font-size: 4em;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(255,215,0,0.4));
}
.onboard-title {
  color: #FFD700;
  font-size: 1.6em;
  margin: 12px 0;
  font-weight: 700;
}
.onboard-desc {
  font-size: 1.0em;
  line-height: 1.8;
  color: #e8d8b8;
  margin: 16px 0 24px;
}
.onboard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
  padding: 16px 8px env(safe-area-inset-bottom, 16px);
}
.onboard-skip, .onboard-next {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,215,0,0.4);
  color: #f5e9d6;
  padding: 8px 16px;
  min-height: 44px; /* L73: タップ44px(オンボーディング完走率・60代スワイプ不慣れ対策) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: 'Shippori Mincho', serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.onboard-skip:hover, .onboard-next:hover { background: rgba(255,215,0,0.15); }
.onboard-dots {
  display: flex;
  gap: 8px;
}
.onboard-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,215,0,0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}
.onboard-dots .dot.active {
  background: #FFD700;
  transform: scale(1.3);
}

/* ===== 画面右上 ストリーク常設バッジ ===== */
.streak-badge {
  position: fixed;
  top: env(safe-area-inset-top, 8px);
  right: 8px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(20, 12, 10, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 999px;
  color: #FFD700;
  font-family: 'Shippori Mincho', serif;
  font-size: 0.85em;
  font-weight: 700;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}
.streak-badge .streak-icon { font-size: 1.0em; }
.streak-badge .streak-num { font-size: 1.05em; }
.streak-badge .streak-label { font-size: 0.78em; opacity: 0.85; }
@media (max-width: 480px) {
  .streak-badge { font-size: 0.78em; padding: 5px 8px; }
}

/* ===== 神の声 ピッカー ===== */
.voice-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  padding: 16px;
}
.voice-picker-card {
  background: linear-gradient(180deg, #1a1310 0%, #2a1f1c 100%);
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  color: #f5e9d6;
  font-family: 'Shippori Mincho', serif;
}
.voice-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,215,0,0.2);
}
.voice-picker-head strong { font-size: 1.08em; color: #FFD700; }
.voice-picker-desc {
  padding: 12px 18px 4px;
  font-size: 0.88em;
  color: #c8b89c;
  margin: 0;
}
.voice-picker-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px 16px;
}
.voice-preset {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,215,0,0.18);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.voice-preset.active {
  border-color: #FFD700;
  background: rgba(255,215,0,0.08);
}
.voice-preset-info { flex: 1; min-width: 0; }
.voice-preset-info strong { display: block; font-size: 1.0em; color: #FFD700; }
.voice-preset-info small { color: #c8b89c; font-size: 0.82em; line-height: 1.4; }
.voice-preset-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.voice-preview-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,215,0,0.3);
  color: #f5e9d6;
}
.voice-preview-btn:hover { background: rgba(255,255,255,0.16); }

@media (max-width: 480px) {
  .voice-preset { flex-direction: column; align-items: stretch; }
  .voice-preset-actions { justify-content: flex-end; }
}

/* ===== 運営 設定スタジオ ===== */
.studio-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.studio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.studio-panel {
  position: relative;
  background: #1a1a1a;
  color: #FFE9A8;
  border: 1px solid #FFD700;
  border-radius: 12px;
  width: min(960px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
  overflow: hidden;
}
.studio-header {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #3a2a08, #1a1a1a);
  font-family: serif;
}
.studio-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  background: #221a0a;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  overflow-x: auto;
}
.studio-tab {
  background: transparent;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-bottom: none;
  color: #FFE9A8;
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-family: serif;
}
.studio-tab.active {
  background: #1a1a1a;
  border-color: #FFD700;
  color: #FFD700;
  font-weight: 700;
}
.studio-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.studio-section { display: none; }
.studio-section.active { display: block; }

.studio-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
}

/* プラン編集 */
.studio-plan-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.studio-plan-row {
  display: grid;
  grid-template-columns: 1fr 110px 1fr auto;
  gap: 8px;
  padding: 10px;
  background: #2a220e;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  align-items: start;
}
.studio-plan-row input, .studio-plan-row textarea {
  background: #1a1a1a;
  color: #FFE9A8;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  width: 100%;
}
.studio-plan-row textarea { min-height: 60px; resize: vertical; font-family: serif; }
.studio-plan-row-label {
  font-size: 11px;
  color: rgba(255, 232, 168, 0.6);
  display: block;
  margin-bottom: 2px;
}
@media (max-width: 700px) {
  .studio-plan-row { grid-template-columns: 1fr; }
}

/* 絵馬モデレーション */
.studio-ema-list, .studio-room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.studio-ema-item, .studio-room-item {
  padding: 10px 12px;
  background: #2a220e;
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}
.studio-ema-item.hidden-by-admin {
  opacity: 0.4;
  background: #1a1410;
}
.studio-ema-content { font-size: 13px; }
.studio-ema-meta {
  font-size: 11px;
  color: rgba(255, 232, 168, 0.6);
  margin-top: 4px;
}
.studio-ema-wish { font-family: serif; font-size: 14px; margin: 2px 0; }
.studio-ema-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* システム設定 */
.studio-form { display: flex; flex-direction: column; gap: 14px; }
.studio-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.studio-form .muted-hint { margin: 0; font-size: 11px; }

/* Divination wizard */
/* L77: 「拝殿」ホームボタン — ロビー(拠点)へ戻る入口として朱色塗りで明確化 */
.topnav-home {
  background: var(--vermilion) !important;
  color: var(--kinari) !important;
  border-color: var(--vermilion) !important;
  font-weight: 700;
}
.topnav-home:hover { filter: brightness(1.08); background: var(--vermilion) !important; color: var(--kinari) !important; }
.topnav-divination {
  background: linear-gradient(135deg, #1A1A1A, #5A3F0F, #C9A24F) !important;
  color: #FFD700 !important;
  border-color: #FFD700 !important;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.topnav-divination:hover {
  background: linear-gradient(135deg, #C9A24F, #FFE9A8) !important;
  color: #1A1A1A !important;
}
.divination-panel {
  max-width: 540px;
}
.divination-panel .chat-header {
  border-bottom: 1px solid #FFD700;
}
.divination-step {
  padding: 24px 20px;
  background: linear-gradient(180deg, #2B2B2B, #1A1A1A);
  color: var(--kinari);
  min-height: 280px;
}
.divination-substep h3, /* L77 fix: 実 markup は h3 だが CSS は h4 限定で desktop 未スタイルだった */
.divination-substep h4 {
  font-size: 18px;
  color: #FFE9A8;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}
.divination-substep p {
  font-size: 13px;
  color: rgba(255,232,168,0.7);
  margin-bottom: 14px;
}
.divination-substep input,
.divination-substep select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  background: #1A1A1A;
  color: #FFE9A8;
  border: 1px solid #FFD700;
  border-radius: 8px;
}
.mbti-questions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 340px;
  overflow-y: auto;
}
.mbti-q-text {
  font-size: 13px !important;
  color: var(--kinari) !important;
  margin-bottom: 4px !important;
}
.mbti-q select {
  font-size: 14px;
  padding: 8px 12px;
}
.divination-nav {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1A1A1A;
  border-top: 1px solid rgba(255,215,0,0.3);
}
.divination-nav .btn {
  min-width: 80px;
}
.div-summary-card {
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.div-summary-line {
  font-size: 14px !important;
  color: var(--kinari) !important;
  margin-bottom: 6px !important;
  line-height: 1.6;
}
.div-summary-line strong {
  color: #FFE9A8;
  margin-right: 6px;
}
.div-summary-quote {
  margin-top: 12px !important;
  font-style: italic;
  color: #FFD700 !important;
  text-align: center;
  font-size: 14px !important;
  border-top: 1px solid rgba(255,215,0,0.3);
  padding-top: 10px !important;
}

/* God-thinking indicator */
.chat-thinking .dots {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
}
.chat-thinking .dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFD700;
  animation: thinkBounce 1.2s infinite ease-in-out;
}
.chat-thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinkBounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* ========== Room photo upload ========== */
.room-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
}
.room-form-row input[type="text"] {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #FFFFFF;
}
.room-photo-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--kinari);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.room-photo-btn:hover { background: var(--gold); transform: scale(1.05); }
/* L66 MED: display:flex は UA の hidden(display:none) を上書きするため、明示的に隠す */
.room-photo-btn[hidden] { display: none !important; }
.room-photo-preview {
  position: relative;
  padding: 0 16px 8px;
}
.room-photo-preview img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  display: block;
  object-fit: cover;
}
.room-photo-clear {
  position: absolute;
  top: -4px;
  left: 196px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--vermilion);
  color: var(--kinari);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.room-msg-photo {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid rgba(201,162,79,0.3);
  display: block;
  margin: 6px 0;
  cursor: pointer;
}

/* ========== Sacred overlay & particles ========== */
.sacred-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255,232,168,0.0) 0%, rgba(255,232,168,0.0) 100%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}
.sacred-overlay.pulse {
  animation: sacredPulse 1.4s ease-out;
}
@keyframes sacredPulse {
  0%   { opacity: 0; background: radial-gradient(circle at center, rgba(255,232,168,0.0) 0%, rgba(255,232,168,0.0) 100%); }
  30%  { opacity: 1; background: radial-gradient(circle at center, rgba(255,232,168,0.65) 0%, rgba(255,232,168,0.0) 70%); }
  100% { opacity: 0; background: radial-gradient(circle at center, rgba(255,232,168,0.0) 0%, rgba(255,232,168,0.0) 100%); }
}

.particle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}
.particle {
  position: absolute;
  top: -10%;
  left: var(--x);
  font-size: var(--size);
  animation: particleFall var(--dur) linear var(--delay) forwards;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.6));
  will-change: top, transform, opacity;
  opacity: 0;
}
.particle-gold { filter: drop-shadow(0 0 8px rgba(255,215,0,0.9)); }
.particle-divine { filter: drop-shadow(0 0 12px rgba(255,20,147,0.85)); }
/* top % は親要素 (.particle-layer) 基準で機能。transform は揺れと回転だけに使う。 */
@keyframes particleFall {
  0%   { top: -10%; transform: translateX(0)                                 rotate(var(--rot));                  opacity: 0; }
  10%  { opacity: 1; }
  50%  {            transform: translateX(var(--drift, 0px))                 rotate(calc(var(--rot) + 180deg)); }
  90%  { opacity: 1; }
  100% { top: 110%; transform: translateX(calc(var(--drift, 0px) * 1.4))     rotate(calc(var(--rot) + 360deg)); opacity: 0; }
}

/* ===== グローバル overflow ガード（code 要素のはみ出し防止） ===== */
code, pre {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

/* ===== Hero CTA（ファーストビューに参拝ボタン） ===== */
.hero-cta {
  text-align: center;
  margin: 14px 0 8px;
}
.hero-cta-btn {
  background: linear-gradient(180deg, #B7282E, #962020);
  color: #FFE9A8;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 16px;
  font-family: 'Shippori Mincho', serif;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.1em;
  box-shadow: 0 6px 18px rgba(183,40,46,0.35), inset 0 -2px 0 rgba(0,0,0,0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hero-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(183,40,46,0.45), inset 0 -2px 0 rgba(0,0,0,0.18);
}
.hero-cta-hint {
  font-size: 13px; /* L77: 「毎朝1回・無料」(頻度/料金の機能情報)。60代可読性下限 11→13px */
  color: var(--sumi-soft);
  margin: 6px 0 0;
}

/* ===== フッターヘルプライン（自殺予防など常設） ===== */
.footer-helpline {
  background: rgba(255, 240, 240, 0.6);
  border: 1px solid rgba(183, 40, 46, 0.3);
  border-left: 4px solid #B7282E;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 12px auto;
  max-width: 600px;
  font-size: 12px;
  color: #5a3f0f;
  line-height: 1.7;
}
.footer-helpline strong { color: #B7282E; display: block; margin-bottom: 4px; }
.footer-helpline ul { list-style: none; padding: 0; margin: 0; }
.footer-helpline li { padding: 2px 0; }
.footer-helpline a { color: #1E50A2; text-decoration: none; font-family: ui-monospace, monospace; }
.footer-helpline a:hover { text-decoration: underline; }

/* ===== 解約フロー ===== */
.cancel-modal .upgrade-panel { max-width: 500px; }
.cancel-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.cancel-stat {
  background: linear-gradient(180deg, #FFF8E0, #F5E5B6);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 12px 6px;
  text-align: center;
}
.cancel-stat strong {
  display: block;
  font-size: 22px;
  color: #B7282E;
  font-family: 'Shippori Mincho', serif;
}
.cancel-stat small {
  font-size: 10px;
  color: var(--sumi-soft);
}
.cancel-narrative {
  font-size: 13px;
  color: #5a3f0f;
  line-height: 1.8;
  background: rgba(255,248,225,0.6);
  border-left: 3px solid #C9A24F;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 14px 0;
}
.cancel-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
@media (max-width: 480px) {
  .cancel-stats { grid-template-columns: repeat(2, 1fr); }
}

/* 御朱印カテゴリ別の彩色（ロック中も一目で種類が分かる） */
.goshuin-cell.kind-milestone { background: rgba(255,248,224,0.5); }
.goshuin-cell.kind-activity  { background: rgba(232,245,233,0.5); }
.goshuin-cell.kind-seasonal  { background: rgba(232,240,250,0.5); }
.goshuin-cell.kind-monthly   { background: rgba(245,230,232,0.5); }
.goshuin-cell.kind-rare      { background: rgba(250,230,250,0.5); border-color: #FF1493; }

/* ===== Bonus Chat 獲得ポップアップ（連続マイルストーン到達時） ===== */
.bonus-celebration .upgrade-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #FFF8E0, #FBF6E8);
  border: 2px solid #FFD700;
  box-shadow: 0 0 60px rgba(255, 215, 0, 0.5);
}
.bonus-glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(ellipse at center, rgba(255,215,0,0.35) 0%, transparent 60%);
  pointer-events: none;
  animation: bonus-glow-pulse 2.5s ease-in-out infinite;
  z-index: 0;
}
.bonus-celebration .upgrade-panel > * { position: relative; z-index: 1; }
@keyframes bonus-glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
.bonus-emoji {
  font-size: 60px;
  margin: 8px 0 4px;
  animation: bonus-emoji-bounce 1.5s ease-in-out infinite;
}
@keyframes bonus-emoji-bounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}
.bonus-grant-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #B7282E, #962020);
  color: #FFE9A8;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 6px 18px rgba(183, 40, 46, 0.4);
}
.bonus-grant-icon {
  font-size: 36px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
}
.bonus-grant-text { text-align: left; flex: 1; }
.bonus-grant-text strong {
  display: block;
  font-size: 18px;
  font-family: 'Shippori Mincho', serif;
  letter-spacing: 0.05em;
}
.bonus-grant-text small {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}
.bonus-confirm {
  width: 100%;
  margin-top: 8px;
}
.bonus-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.bonus-go-chat {
  width: 100%;
  font-size: 16px;
  font-weight: 700;
}

/* ===== 認証スロット（ログインボタン or ユーザ表示） ===== */
.auth-slot {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 5;
}
.auth-user {
  font-size: 11px;
  color: var(--vermilion-dark);
  font-family: 'Shippori Mincho', serif;
}
@media (max-width: 480px) {
  .auth-slot { top: 8px; right: 8px; }
  .auth-user { font-size: 10px; }
}

/* ===== オンボーディングツアー ===== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
}
.onboarding-spotlight {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.7), 0 0 30px rgba(255,215,0,0.6);
  transition: all 0.4s ease;
  pointer-events: none;
}
.onboarding-tip {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 2px solid #B7282E;
  border-radius: 12px;
  padding: 18px 22px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  pointer-events: auto;
  z-index: 9991;
}
.onboarding-tip .ob-step { font-size: 11px; color: #B7282E; font-weight: 700; }
.onboarding-tip h3 { color: #B7282E; margin: 6px 0 8px; font-family: 'Shippori Mincho', serif; }
.onboarding-tip p { font-size: 13px; line-height: 1.7; color: #4a3010; }
.onboarding-tip .ob-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ===== 月次心の歩みレター ===== */
.monthly-letter .upgrade-panel { max-width: 520px; padding: 20px; }
.letter-paper {
  background: linear-gradient(180deg, #FFF8E0, #FBF6E8);
  border: 2px solid #C9A24F;
  border-radius: 8px;
  padding: 24px;
  font-family: 'Shippori Mincho', serif;
  text-align: left;
  line-height: 2;
  color: #4a3010;
  margin-bottom: 14px;
}
.letter-title { color: #B7282E; font-size: 18px; margin: 0 0 4px; text-align: center; }
.letter-meta { font-size: 11px; color: var(--sumi-soft); text-align: center; margin: 0 0 16px; }
.letter-body p { margin: 8px 0; }
.letter-body strong { color: #B7282E; }

/* ===== お参り後アクション（シェア・紹介） ===== */
.post-pray-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== ダークモード ===== */
body.dark-mode {
  background: linear-gradient(180deg, #1a1410, #0f0a08);
  color: #FFE9A8;
}
body.dark-mode .header,
body.dark-mode .card,
body.dark-mode .topnav-btn,
body.dark-mode .status-bar,
body.dark-mode .missions-card {
  background: rgba(40, 30, 20, 0.85);
  color: #FFE9A8;
  border-color: rgba(255, 215, 0, 0.3);
}
/* L77 fix(HIGH): 暗転コンテナ内のテキスト系CSS変数を明色に再定義。旧コードは背景だけ暗転し
   var(--sumi)=#1A1A1A 等の子要素(称号/連続日数/精進ラベル/各カード導入文/プロフィールラベル等)が
   暗背景に暗文字(コントラスト約1.2〜1.6:1)で判読不能だった。モーダル等の明背景UIはこのスコープ外。 */
body.dark-mode .header,
body.dark-mode .card,
body.dark-mode .status-bar,
body.dark-mode .missions-card {
  --sumi: #F5E9D0;
  --sumi-soft: #D8C7A8;
  --vermilion-dark: #FFB3A0;
}
/* 暗転カードの内側でも「明背景のまま」のチップ/アイテムは元の暗色テキストへ再固定
   (.plan/.room-card=白グラデ, .mission/.mine-stat=白0.7, .ema=明るい木目, .mine-shrine-name=明黄,
    .visit-calendar-wrap=明0.5) */
body.dark-mode .plan,
body.dark-mode .room-card,
body.dark-mode .mission,
body.dark-mode .ema,
body.dark-mode .mine-stat,
body.dark-mode .mine-shrine-name,
body.dark-mode .visit-calendar-wrap {
  --sumi: #1A1A1A;
  --sumi-soft: #3A3A3A;
  --vermilion-dark: #7A1A1F;
  /* L77 fix: 変数 re-pin だけでは .card の color:#FFE9A8 が継承され、color 未指定の子(plan-features 等)が
     白背景チップ内で cream 文字になる。明示 color で継承を遮断する。 */
  color: var(--sumi);
}
body.dark-mode .logo, body.dark-mode .card-label {
  color: #FFD700;
}
/* UX H1: .upgrade-panel は light bg のままなので、ダークモード時もタイトル色は朱（既定）に */
body.dark-mode .upgrade-title { color: #B7282E; }
body.dark-mode .topnav-btn { color: #FFE9A8; border: 1px solid rgba(255, 215, 0, 0.4); }
body.dark-mode .muted-hint { color: rgba(255, 232, 168, 0.6); }
/* UX M6: ダークモード時の settings-row strong / 通常テキストを読める色に */
body.dark-mode .settings-row strong { color: #FFE9A8; }
body.dark-mode .footer-disclaimer { background: rgba(30, 20, 12, 0.9); color: #FFE9A8; }
body.dark-mode .visit-cal-grid .vc-missed { background: rgba(80, 70, 60, 0.4); color: #888; }

/* ===== 訪問カレンダー（月次ヒートマップ） ===== */
.visit-calendar-wrap {
  margin: 14px 0;
  padding: 12px 14px;
  background: rgba(251, 246, 232, 0.5);
  border: 1px solid var(--gold);
  border-radius: 10px;
}
.visit-cal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.visit-cal-head strong { color: var(--vermilion-dark); font-family: 'Shippori Mincho', serif; }
.visit-cal-head .muted-hint strong { color: #B7282E; }
.visit-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  font-size: 11px;
}
.vc-head {
  text-align: center;
  font-weight: 700;
  color: var(--sumi-soft);
  padding: 4px 0;
}
.vc-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  position: relative;
  font-size: 11px;
}
.vc-cell.empty { visibility: hidden; }
.vc-visited { background: linear-gradient(180deg, #FFE9A8, #C9A24F); color: #4a3010; font-weight: 700; }
.vc-missed { background: rgba(255,255,255,0.4); color: #aaa; }
.vc-future { background: transparent; color: #ccc; }
.vc-today { outline: 2px solid #B7282E; }
.vc-rare-gold { background: linear-gradient(180deg, #FFE066, #FFD700); }
.vc-rare-divine { background: linear-gradient(180deg, #FFB7E5, #FF1493); color: #fff; }
.vc-mark { font-size: 8px; line-height: 1; }

/* ===== お守り（プラン特典・神主+） ===== */
.omamori-wrap {
  margin: 14px 0;
  padding: 14px;
  background: rgba(255, 248, 224, 0.6);
  border: 1px solid var(--gold);
  border-radius: 10px;
}
.omamori-locked { text-align: center; }
.omamori-locked strong { display: block; margin-bottom: 6px; color: var(--vermilion-dark); }
.omamori-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.omamori-head strong { color: var(--vermilion-dark); font-family: 'Shippori Mincho', serif; }
.omamori-quota { font-size: 12px; color: var(--sumi-soft); }
.omamori-quota strong { color: #B7282E; font-size: 14px; }
.omamori-draw-btn { width: 100%; margin-bottom: 10px; }
.omamori-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.omamori-card {
  background: linear-gradient(180deg, #fff, #FBF6E8);
  border: 2px solid var(--c, #C9A24F);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.omamori-card .omamori-emoji {
  font-size: 28px;
  margin-bottom: 4px;
}
.omamori-card .omamori-img {
  display: block;
  width: 80%;
  margin: 0 auto 6px;
  filter: drop-shadow(0 2px 6px rgba(122,26,31,0.18));
}
.omamori-card .omamori-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}
.omamori-card .omamori-name {
  font-family: 'Shippori Mincho', serif;
  font-size: 14px;
  color: var(--c, #B7282E);
  font-weight: 700;
  margin-bottom: 4px;
}
.omamori-card .omamori-phrase {
  font-size: 11px;
  color: var(--sumi);
  line-height: 1.5;
  font-family: 'Shippori Mincho', serif;
}

/* 管理モード: プラン直接編集ボタン */
.plan { position: relative; }
.plan-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #1a1a1a;
  color: #FFD700;
  border: 1px solid #FFD700;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background 0.15s ease;
}
.plan-edit-btn:hover { background: #2a1f08; }

/* ========== Personal shrine ========== */
.mine-card {
  background: linear-gradient(180deg, #FBFAF5, #FFF8E0);
  border: 2px solid var(--gold);
}
.mine-shrine-name {
  text-align: center;
  padding: 12px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #FFF4C4, #F5E5B6);
  border-radius: 8px;
  border: 1px solid var(--gold);
}
.mine-shrine-label { font-size: 13px; color: var(--sumi-soft); margin-right: 6px; }
.mine-shrine-display { font-size: 22px; font-weight: 700; color: var(--vermilion-dark); letter-spacing: 0.1em; }

.mine-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.mine-stat {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(201,162,79,0.3);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mine-stat-label { font-size: 11px; color: var(--sumi-soft); letter-spacing: 0.1em; }
.mine-stat-val { font-size: 16px; font-weight: 700; color: var(--vermilion-dark); }

.mine-shrine-name-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: rgba(255,255,255,0.5);
  border-radius: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.mine-shrine-name-form label {
  flex: 0 0 120px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sumi);
}
.mine-shrine-name-form input {
  flex: 1;
  min-width: 140px;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--gold);
  border-radius: 6px;
}

/* ========== Ema board ========== */
.ema-intro {
  font-size: 13px;
  color: var(--sumi-soft);
  line-height: 1.7;
  margin-bottom: 12px;
}
.ema-actions-top {
  margin-bottom: 16px;
  text-align: center;
}
.ema-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
/* ===== 絵馬：本物の絵馬風（五角形・木目・赤紐） ===== */
.ema {
  /* 木目調の背景 */
  background:
    repeating-linear-gradient(91deg,
      rgba(139, 90, 43, 0.045) 0px, rgba(139, 90, 43, 0.045) 1px,
      transparent 1px, transparent 7px),
    repeating-linear-gradient(0deg,
      rgba(139, 90, 43, 0.025) 0px, rgba(139, 90, 43, 0.025) 1px,
      transparent 1px, transparent 11px),
    radial-gradient(ellipse at 30% 20%, rgba(255,235,180,0.5) 0%, transparent 60%),
    linear-gradient(180deg, #f4dfb0 0%, #e6c98a 50%, #d8b87a 100%);
  border: 2.5px solid #8b6f47;
  border-radius: 4px 4px 12px 12px;
  padding: 36px 14px 14px;  /* 上に屋根の余白を確保 */
  margin-top: 20px;          /* 屋根の三角分を上に確保 */
  box-shadow:
    0 4px 12px rgba(122,26,31,0.18),
    inset 0 2px 4px rgba(255,255,255,0.5),
    inset 0 -3px 6px rgba(139,90,43,0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 屋根（三角形・上に張り出す） */
.ema::before {
  content: '';
  position: absolute;
  top: -22px;
  left: -2.5px;
  right: -2.5px;
  height: 24px;
  background:
    repeating-linear-gradient(91deg,
      rgba(139, 90, 43, 0.07) 0px, rgba(139, 90, 43, 0.07) 1px,
      transparent 1px, transparent 7px),
    linear-gradient(180deg, #b8945a 0%, #d4b078 100%);
  clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
  filter: drop-shadow(0 -1px 2px rgba(122,26,31,0.15));
}
/* 赤い紐 */
.ema::after {
  content: '';
  position: absolute;
  top: -24px;
  left: 50%;
  width: 6px;
  height: 22px;
  background: linear-gradient(180deg, #B7282E 0%, #7A1A1F 100%);
  border-radius: 3px;
  transform: translateX(-50%) rotate(8deg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 -2px 0 #FFD700;
  z-index: 2;
}
.ema.blessed {
  background:
    repeating-linear-gradient(91deg,
      rgba(139, 90, 43, 0.04) 0px, rgba(139, 90, 43, 0.04) 1px,
      transparent 1px, transparent 7px),
    radial-gradient(ellipse at 50% 30%, rgba(255,250,205,0.6) 0%, transparent 70%),
    linear-gradient(180deg, #FFF4C4 0%, #F0D27A 100%);
  border-color: #C9A24F;
  box-shadow:
    0 4px 16px rgba(255,215,0,0.4),
    inset 0 2px 6px rgba(255,255,255,0.6),
    0 0 24px rgba(255,215,0,0.25);
}
.ema.blessed::before {
  background: linear-gradient(180deg, #C9A24F 0%, #E8C673 100%);
}
.ema.mine {
  border-color: var(--vermilion);
  box-shadow:
    0 4px 16px rgba(183,40,46,0.25),
    inset 0 2px 4px rgba(255,255,255,0.5);
}
.ema.mine::after {
  background: linear-gradient(180deg, #FFD700 0%, #C9A24F 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 -2px 0 #B7282E;
}
.ema-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  flex-wrap: wrap;
}
.ema-cat {
  background: var(--vermilion);
  color: var(--kinari);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.ema-badge {
  background: linear-gradient(90deg, #FFD700, #FFA500);
  color: #5A3F0F;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.ema-mine-badge {
  background: var(--vermilion-dark);
  color: var(--kinari);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.ema-wish {
  font-size: 14px;
  line-height: 1.7;
  color: var(--sumi);
  /* L71-A M6: 長文 URL / 連続カタカナで列が破綻するのを防ぐ */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ema-author, .ema-comment {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ema-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--sumi-soft);
}
.ema-comments {
  background: rgba(255,255,255,0.6);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ema-comment { line-height: 1.5; color: var(--sumi); }
.ema-comment strong { color: var(--vermilion-dark); margin-right: 4px; }
.ema-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ema-pray, .ema-comment-btn {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  /* L67: タップターゲット 44px+(WCAG 2.5.5) — モバイルで押しやすく */
  min-height: 44px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--vermilion);
  background: var(--kinari);
  color: var(--vermilion-dark);
  transition: all 0.15s ease;
  font-weight: 700;
}
.ema-pray:hover { background: var(--vermilion); color: var(--kinari); }
.ema-pray.done {
  background: linear-gradient(135deg, #C9A24F, #FFE9A8);
  color: #5A3F0F;
  border-color: var(--gold);
}
.ema-comment-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(0,0,0,0.2);
  color: var(--sumi-soft);
}

/* ========== Ema modal ========== */
.ema-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ema-panel { max-width: 520px; }
.ema-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--kinari);
}
.ema-form label {
  font-weight: 700;
  font-size: 13px;
  color: var(--sumi);
}
.ema-form select, .ema-form textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: #FFF;
  resize: vertical;
}
.ema-public-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* ========== Higher-tier plan polish ========== */
.plan.tier-5 {
  background: linear-gradient(180deg, #FFF8E0, #F5E5B6);
  border-color: var(--gold);
}
.plan.tier-6 {
  background:
    linear-gradient(180deg, #FFFFFF, #FBF6E8) padding-box,
    linear-gradient(135deg, #C9A24F, #FFE9A8, #C9A24F) border-box;
  border: 2px solid transparent;
  box-shadow: 0 4px 16px rgba(201,162,79,0.4);
}
.plan-disclaimer {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--sumi-soft);
  text-align: center;
  margin-top: 12px;
  line-height: 1.7;
}
code {
  background: rgba(0,0,0,0.05);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

@media (max-width: 480px) {
  .admin-panel { width: calc(100% - 32px); left: 16px; right: 16px; bottom: 16px; }
  .ema-board { grid-template-columns: 1fr; }
  .topnav-btn { font-size: 13px; padding: 9px 12px; min-height: 44px; } /* L67: 60代可読性+44px */
}

/* ========== 本番リリース用 UI ========== */

/* フッター（本番） */
.footer-disclaimer {
  background: #FBF6E8;
  border: 1px solid #E5D9B6;
  border-left: 4px solid #B7282E;
  padding: 10px 14px;
  margin: 16px auto 12px;
  max-width: 680px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: #4a3010;
}
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
  font-size: 12px;
}
.footer-nav a { color: #5a3f0f; text-decoration: none; }
.footer-nav a:hover { color: #B7282E; text-decoration: underline; }
.footer-sep { color: #c9a24f; }
/* L67: #888(3.39:1)+11px は WCAG AA 未達。本文級の濃さ+12px に引上げ。 */
.footer-copy { display: block; text-align: center; color: #6a5028; margin-top: 6px; font-size: 12px; }

/* 規約同意モーダル（初回） */
body.consent-locked { overflow: hidden; }
.consent-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.consent-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(4px);
}
.consent-panel {
  position: relative;
  background: linear-gradient(180deg, #FBFAF5, #F4ECDC);
  border: 2px solid #B7282E;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 28px 24px 22px;
  box-shadow: 0 0 60px rgba(183,40,46,0.4);
  font-family: 'Shippori Mincho', serif;
  color: #1A1A1A;
}
.consent-panel h2 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #B7282E;
  text-align: center;
}
.consent-lead {
  text-align: center;
  color: #4a3010;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.7;
}
.consent-points {
  background: rgba(255,255,255,0.55);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.consent-point {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 0;
  border-bottom: 1px dashed #E5D9B6;
  font-size: 13px;
}
.consent-point:last-child { border-bottom: none; }
.consent-point strong { color: #B7282E; font-size: 13.5px; }
.consent-point span { color: #555; line-height: 1.6; }
.consent-agree {
  font-size: 12px;
  color: #4a3010;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.6;
}
.consent-agree a { color: #B7282E; }
.consent-actions { text-align: center; }
.consent-actions .btn-large {
  padding: 12px 32px; font-size: 15px; font-weight: 700;
  background: #B7282E; color: #fff; border: none; border-radius: 24px;
  cursor: pointer; box-shadow: 0 4px 12px rgba(183,40,46,0.4);
}
.consent-actions .btn-large:hover { background: #962020; }
.consent-actions .btn-large:disabled,
.consent-actions .btn-large.is-disabled,
.consent-actions .btn-large[aria-disabled="true"] {
  background: #c8a6a8; cursor: not-allowed; box-shadow: none; opacity: 0.7;
}
.consent-age-check {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 12px 0; padding: 10px 14px;
  background: #FFF8E1; border: 1px solid #E6D2A6; border-radius: 8px;
  font-size: 12.5px; color: #4a3010; line-height: 1.55;
  cursor: pointer;
}
.consent-age-check input[type="checkbox"] {
  margin-top: 2px; min-width: 18px; min-height: 18px;
  accent-color: #B7282E;
}
.consent-age-check strong { color: #B7282E; }
.consent-age {
  display: block;
  text-align: center;
  margin-top: 12px;
  color: #888;
  font-size: 11px;
  line-height: 1.5;
}

/* プラン画面のソーシャルプルーフ */
.plan-social-proof {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(90deg, #FFF8E1, #FBFAF5);
  border-left: 3px solid #C9A24F;
  padding: 8px 14px;
  margin: 10px 0;
  border-radius: 6px;
  font-size: 12px;
  color: #5a3f0f;
}
.psp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 8px rgba(76,175,80,0.7);
  animation: psp-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes psp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* アップグレード誘導モーダル */
.upgrade-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.upgrade-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.72);
}
.upgrade-panel {
  position: relative;
  background: linear-gradient(180deg, #FBFAF5, #F4ECDC);
  border: 2px solid #C9A24F;
  border-radius: 14px;
  max-width: 460px;
  width: 100%;
  /* L73 fix(モバイル): 解約/決済など縦長フォームが小型スマホで画面外に切れて操作不能になるのを防ぐ。
     パネル内でスクロールできるよう max-height + overflow を設定（全 upgrade 系モーダルに適用）。 */
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 26px 22px 18px;
  font-family: 'Shippori Mincho', serif;
  color: #1A1A1A;
  box-shadow: 0 0 60px rgba(201,162,79,0.5);
  text-align: center;
  animation: upgrade-in 0.35s ease-out;
}
@keyframes upgrade-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.upgrade-close {
  position: absolute; top: 8px; right: 10px;
  background: transparent; border: none; font-size: 22px;
  color: #5a3f0f; cursor: pointer;
}
.upgrade-rank {
  display: inline-block;
  background: linear-gradient(90deg, #B7282E, #C9A24F);
  color: #fff;
  padding: 4px 14px;
  border-radius: 12px;
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.upgrade-title {
  font-size: 22px;
  color: #B7282E;
  margin: 8px 0 14px;
}
.upgrade-investment {
  background: rgba(255,255,255,0.6);
  border-left: 3px solid #4caf50;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  text-align: left;
  font-size: 13px;
  line-height: 1.9;
  color: #2a5a2e;
}
.upgrade-loss {
  font-size: 13px;
  color: #5a3f0f;
  background: rgba(255,243,200,0.6);
  padding: 10px 14px;
  border-radius: 6px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.upgrade-cta-block { margin: 14px 0 8px; }
.upgrade-trial {
  font-size: 14px;
  color: #B7282E;
  margin-bottom: 10px;
  line-height: 1.6;
}
.upgrade-trial strong { font-size: 16px; }
.upgrade-premium {
  font-size: 13px;
  color: #5a3f0f;
  background: linear-gradient(90deg, rgba(255,215,0,0.12), rgba(183,40,46,0.08));
  border: 1px solid rgba(201,162,79,0.4);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  font-family: 'Shippori Mincho', serif;
}
.upgrade-confirm {
  display: block;
  width: 100%;
  padding: 14px;
  background: #B7282E;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Shippori Mincho', serif;
  box-shadow: 0 4px 14px rgba(183,40,46,0.4);
  margin-bottom: 8px;
}
.upgrade-confirm:hover { background: #962020; }
.upgrade-later {
  background: transparent;
  border: 1px solid #C9A24F;
  color: #5a3f0f;
  padding: 8px 18px;
  border-radius: 18px;
  cursor: pointer;
  /* L77 fix: 二次ボタン「いま少し考える」がタップ44px未満で 60代が誤タップしやすい→WCAG 2.5.5 達成。 */
  min-height: 44px;
}
.upgrade-disclaimer {
  display: block;
  margin-top: 14px;
  /* L77 fix(MEDIUM): サブスク課金直前の法務・自動更新開示テキストが #888(約3.5:1)+11px で WCAG AA 未達かつ
     60代スマホで判読困難だった。自動更新の開示は特商法上も重要→濃色 #5a3f0f(約7:1)+13px に引き上げ。 */
  color: #5a3f0f;
  font-size: 13px;
  line-height: 1.65;
  border-top: 1px dashed #E5D9B6;
  padding-top: 10px;
}
.upgrade-disclaimer a { color: #B7282E; }

/* Checkout フォーム（決済画面） */
.checkout-header {
  text-align: center;
  padding: 8px 0 14px;
  border-bottom: 1px dashed #E5D9B6;
  margin-bottom: 12px;
}
.checkout-rank {
  display: inline-block;
  background: linear-gradient(90deg, #B7282E, #C9A24F);
  color: #fff;
  padding: 4px 14px;
  border-radius: 12px;
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.checkout-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 4px;
}
.checkout-price .price-old {
  font-size: 16px;
  color: #888;
  text-decoration: line-through;
}
.checkout-price .price-new {
  font-size: 28px;
  color: #B7282E;
  font-weight: 700;
}
.checkout-price small {
  /* L77 fix: 価格脇の注記(税込/月 等)も #888 11px で 60代に読みにくい→濃色+13px。 */
  color: #6a5028;
  font-size: 13px;
  margin-left: 4px;
}
.checkout-trial {
  display: block;
  color: #4caf50;
  font-size: 12px;
  font-weight: 600;
}
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
/* UX M1: .checkout-row 系は Square 移行で撤去済み（dead CSS 削除） */
.checkout-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  /* L73 fix: 月額サブスク課金の法的必須同意ラベル。11px は判読困難なので 13px に。 */
  font-size: 13px;
  color: #5a3f0f;
  margin: 6px 0;
  line-height: 1.6;
}
/* L73 fix: 同意チェックボックスのタップ領域を拡大(規約同意は必須インタラクション) */
.checkout-checkbox input { margin-top: 2px; width: 22px; height: 22px; flex-shrink: 0; }
.checkout-checkbox a { color: #B7282E; }
.checkout-submit {
  background: linear-gradient(180deg, #B7282E, #962020);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Shippori Mincho', serif;
  box-shadow: 0 4px 14px rgba(183,40,46,0.4);
  margin-top: 4px;
  transition: transform 0.12s ease;
}
.checkout-submit:hover:not(:disabled) { transform: translateY(-1px); }
.checkout-submit:disabled { opacity: 0.65; cursor: wait; }
.checkout-secure {
  display: block;
  text-align: center;
  color: #888;
  font-size: 10px;
  margin-top: 4px;
}
.checkout-pending {
  background: rgba(255, 248, 225, 0.6);
  border: 1px solid #C9A24F;
  border-radius: 8px;
  padding: 14px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.7;
  color: #4a3010;
  text-align: left;
}
.checkout-error {
  background: rgba(255, 220, 220, 0.6);
  border-left: 3px solid #c33;
  padding: 6px 10px;
  margin: 8px 0;
  font-size: 12px;
  color: #963;
  font-family: ui-monospace, monospace;
}
.checkout-mailto {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  text-align: center;
  text-decoration: none;
}

/* ストリーク途切れ警告（損失回避） */
.streak-warning {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(90deg, #FFF3CD, #FFE9A8);
  border: 1px solid #C9A24F;
  border-left: 4px solid #B7282E;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  color: #5a3f0f;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 480px;
  width: calc(100% - 32px);
  font-family: 'Shippori Mincho', serif;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.3,1), opacity 0.4s;
}
.streak-warning.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.streak-warning-icon { font-size: 18px; flex-shrink: 0; }
.streak-warning strong { color: #B7282E; }
.streak-warning-close {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #5a3f0f;
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================================ */
/* ===== スマートフォン最適化 (本番公開用) ===== */
/* ============================================================ */

/* タブレット以下: 760px */
@media (max-width: 760px) {
  /* レイアウト全体の余白を縮める */
  body { font-size: 14px; }
  .container { padding: 0 12px; }
  .header { padding: 16px 12px 8px; }
  .logo { font-size: 26px; }
  .tagline { font-size: 12px; }

  /* ナビボタンを横スクロールではなく折返しに */
  .topnav {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
    justify-content: center;
  }
  .topnav-btn {
    font-size: 13px; /* L67: 60代可読性 */
    padding: 6px 10px;
    flex: 0 0 auto;
  }

  /* 神社画像 */
  .shrine-frame, .shrine-photo, .shrine-image { max-width: 100%; height: auto; }

  /* プラン: 1 列に */
  .plans { grid-template-columns: 1fr; gap: 10px; }
  .plan { min-width: 0; padding: 14px 12px; }
  .plan-price strong { font-size: 22px; }
  .plan-features li { font-size: 13px; } /* L77: 購入判断直前UI。v275 のデスクトップ14px fix が mobile で 12px に上書きされ退行していたため 60代可読性下限 13px に */

  /* お賽銭ボタンを 3 列に */
  .tip-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .tip-btn { padding: 8px 4px; font-size: 12px; }
  .tip-btn small { font-size: 9px; }

  /* 御朱印グリッド: セルをコンパクトに */
  .goshuin-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
  .goshuin-cell { padding: 8px 4px; font-size: 10px; }
  .goshuin-emoji { font-size: 20px; }
  .goshuin-name { font-size: 10px; }
  .goshuin-date, .goshuin-hint { font-size: 8px; }

  /* チャットモーダル: 全画面
     L32-C M7: 100vh は iOS Safari URL バーで伸縮するため 100dvh をフォールバック付きで適用 */
  .chat-modal .chat-panel,
  .ema-modal .chat-panel,
  .room-modal .room-panel,
  /* L77 fix: createRoomModal は id=createRoomModal/class=room-modal でパネルが .chat-panel.ema-panel。
     旧 `.create-room-modal .chat-panel` はどの要素にもマッチせず全画面化されず submit が見切れていた。 */
  #createRoomModal .chat-panel {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    max-width: 100vw;
    border-radius: 0;
  }
  /* L77 fix: 絵馬奉納/部屋作成フォームをパネル内スクロール可能に(チャットと同 flex パターン)。
     これが無いと小型端末/キーボード表示時に「奉納する」「この部屋を開く」submit に指が届かない。 */
  .ema-panel .ema-form {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  .chat-log { padding: 12px; }
  .chat-bubble { font-size: 14px; max-width: 80%; }
  .chat-form { padding: 8px; }
  /* L77 fix: 個人鑑定ウィザードのステップ本文をパネル内スクロール化(ema-form と同パターン)。
     短いビューポート(横持ち/小型端末)で「戻る/次へ」ナビがクリップされ到達不能になるのを防ぐ。 */
  .divination-panel .divination-step { flex: 1 1 auto; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
  /* L77 fix: 部屋メッセージ欄も同様に min-height:0 へ。デスクトップ定義の min-height:200px が残ると、
     キーボード表示で利用可能高さが縮んでも 200px を死守し、送信フォーム(.room-form)が overflow:hidden の
     パネル外へクリップされ送信ボタンに指が届かなくなる(ema-form/divination-step は対策済の取りこぼし第3要素)。 */
  .room-modal .room-messages { min-height: 0; }
  /* L70-B fix: iOS Safari は font-size <16px の input/textarea/select にフォーカスすると
     ページを自動ズームする。旧コードは .chat-form input だけ 16px にしていたが、より詳細度の高い
     .room-form-row input[type=text]:14px / .ema-form textarea:14px / .divination-substep input:15px
     に負けてズームが発動 → 部屋の📷・送信ボタンが画面外に押し出され「見切れ」ていた。
     全フォームコントロールを 16px に統一して根治（!important は iOS ズーム抑止の定石用途）。 */
  input[type="text"], input[type="email"], input[type="date"],
  input[type="number"], input[type="search"], input[type="tel"], input[type="password"],
  textarea, select { font-size: 16px !important; }
  /* 入力欄が縮めなくて横はみ出すのを防ぐ（flex item の min-width:auto 対策） */
  /* L77 fix: AI神チャットの .chat-form input にも min-width:0 を適用。これが無いと input が内在最小幅まで
     縮まず「奏上」送信ボタンを画面外へ押し出して見切れていた(部屋フォームだけ対策済みだった漏れ)。 */
  .room-form-row input[type="text"], .chat-form input { min-width: 0; }
  /* L77 fix(二重堅牢化): 送信ボタンは縮めず固定し、入力欄側が縮むようにする。
     これで input の挙動に関わらず送信ボタンが必ず全幅表示され、横の見切れが起きない。 */
  .chat-form > button[type="submit"], .room-form-row button[type="submit"] { flex-shrink: 0; }
  .chat-disclaimer { font-size: 12px; padding: 6px 10px; line-height: 1.5; }

  /* 神の降臨オーバーレイ: スマホでも見やすく */
  .god-reveal-figure { width: min(75vw, 280px); height: min(75vw, 280px); }
  .god-reveal-text { font-size: 15px; padding: 12px 14px; max-width: calc(100vw - 24px); }
  .god-reveal-dismiss { font-size: 13px; padding: 7px 18px; }

  /* 同意モーダル */
  .consent-panel { padding: 22px 16px 18px; max-height: 95vh; }
  .consent-panel h2 { font-size: 18px; }
  .consent-lead { font-size: 13px; }
  .consent-point strong { font-size: 12.5px; }
  .consent-point span { font-size: 12px; }
  .consent-actions .btn-large { padding: 11px 22px; font-size: 14px; }

  /* アップグレード / Checkout モーダル */
  .upgrade-panel { max-width: calc(100vw - 24px); padding: 20px 16px 14px; }
  .upgrade-title { font-size: 18px; }
  .upgrade-investment, .upgrade-loss { font-size: 12px; padding: 8px 10px; }
  .upgrade-confirm { font-size: 14px; padding: 12px; }
  .checkout-row span { font-size: 11px; }
  .checkout-row input { font-size: 16px; padding: 10px; /* iOS ズーム抑止 */ }
  .checkout-price .price-new { font-size: 24px; }
  .checkout-submit { font-size: 14px; padding: 13px; }
  .checkout-checkbox { font-size: 13px; } /* L73: 60代可読性(旧10px) */

  /* 設定スタジオ (運営) */
  .studio-panel { max-width: 100vw; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .studio-tabs { padding: 6px 8px 0; }
  .studio-tab { font-size: 11px; padding: 6px 10px; }
  .studio-body { padding: 12px; }
  .studio-plan-row { grid-template-columns: 1fr; gap: 6px; padding: 10px; }
  .studio-form label { font-size: 12px; }

  /* チャット FAB を片手で押せる位置に */
  .chat-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* フッター */
  .footer-disclaimer { font-size: 11px; padding: 10px 12px; }
  .footer-nav { font-size: 11px; gap: 4px; }

  /* ストリーク警告 */
  .streak-warning {
    bottom: 70px;
    font-size: 12px;
    padding: 10px 12px;
    width: calc(100% - 16px);
  }

  /* 個人鑑定モーダル */
  .divination-panel { max-width: 100vw; max-height: 100vh; max-height: 100dvh; border-radius: 0; padding: 20px 16px; }
  .divination-step h3 { font-size: 16px; }

  /* 部屋カード */
  .room-card { padding: 12px; }
  .room-name { font-size: 14px; }
  .room-desc { font-size: 13px; } /* L77: モバイルも 60代可読性下限 13px(11px退行解消) */
}

/* スマホ縦持ち: 480px 以下 (細かい調整) */
@media (max-width: 480px) {
  .logo { font-size: 22px; }
  .header { padding: 12px 10px 4px; }
  .container { padding: 0 8px; }

  /* ナビボタンを 1 行 3 個程度に圧縮（タッチターゲット 40px 確保） */
  .topnav-btn { font-size: 13px; padding: 8px 10px; min-height: 44px; } /* L77: 後勝ちカスケードで前段(4406)の13pxを12pxに上書きしていた退行を解消。メインナビは機能テキスト13px下限 */

  /* お賽銭は 2 列 */
  .tip-row { grid-template-columns: repeat(2, 1fr); }

  /* 御朱印セルをさらに小さく */
  .goshuin-grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 5px; }

  /* 同意モーダル */
  .consent-points { padding: 10px; }
  .consent-point { padding: 6px 0; }

  /* チャット入力 */
  .chat-form input { padding: 8px 10px; }

  /* 神の降臨 */
  .god-reveal-text { font-size: 14px; line-height: 1.7; }
}

/* タッチデバイスでホバー演出を抑制 (誤発火防止) */
@media (hover: none) {
  .btn:hover, .tip-btn:hover, .topnav-btn:hover { transform: none !important; }
}

/* セーフエリア対応 (iPhone X 以降のノッチ・ホームバー) */
@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .chat-fab { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .streak-warning { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: env(safe-area-inset-bottom); }
  /* L73 fix(iPhone): 全画面チャット/部屋/絵馬モーダルの下端が iPhone ホームインジケーターに被り
     disclaimer 等の最終行が隠れるのを防ぐ。パネル下部に safe-area 分の余白を足す。 */
  .chat-panel, .room-panel, .ema-panel {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

/* ========================================
   L70-A: prefers-reduced-motion 全面撤去（ユーザ要望 / アニメーション完全保証）
   WCAG 2.3.3 非準拠だが、ゲーム体験を最優先する判断。OS 設定に関わらず全アニメ再生。
   ========================================*/

/* ========================================
   L70-B: 課金後アニメーション（client 完結・サーバ保存ゼロ・transform/opacity のみで軽量）
   ① 縁購入 → 光の葉が残高ピルへ吸い込まれ、数字がカウントアップ
   ② 氏子サブスク開始 → 鳥居に光が差す祝福オーバーレイ
   ========================================*/
.en-coin-fx { position: fixed; inset: 0; pointer-events: none; z-index: 9998; }
.en-coin {
  position: fixed; font-size: 22px; line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(183,40,46,0.45));
  animation: enCoinFly 0.95s cubic-bezier(.5,.05,.3,1) forwards;
  will-change: transform, opacity;
}
@keyframes enCoinFly {
  0%   { transform: translate(0,0) scale(.5); opacity: 0; }
  18%  { opacity: 1; transform: translate(calc(var(--tx) * 0.04), -30px) scale(1.15); }
  100% { transform: translate(var(--tx), var(--ty)) scale(.35); opacity: 0; }
}
.en-balance-pop { animation: enBalancePop 0.6s ease; }
@keyframes enBalancePop {
  0%,100% { transform: scale(1); }
  35%     { transform: scale(1.2); }
}

.subscribe-blessing {
  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: radial-gradient(circle at 50% 42%, rgba(255,243,210,0) 0%, rgba(40,18,8,0.6) 72%);
  opacity: 0; transition: opacity .5s ease; pointer-events: none; padding: 24px;
}
.subscribe-blessing.show { opacity: 1; }
.blessing-rays {
  position: absolute; top: 50%; left: 50%; width: 150vmax; height: 150vmax;
  transform: translate(-50%, -58%);
  background: conic-gradient(from 0deg,
    rgba(255,221,128,0) 0deg, rgba(255,221,128,0.20) 7deg, rgba(255,221,128,0) 15deg,
    rgba(255,221,128,0) 25deg, rgba(255,221,128,0.20) 32deg, rgba(255,221,128,0) 40deg);
  animation: blessingRays 14s linear infinite; pointer-events: none;
}
.blessing-torii {
  font-size: 92px; line-height: 1; z-index: 1;
  filter: drop-shadow(0 0 26px rgba(255,221,128,0.95));
  animation: blessingTorii 2.6s ease both;
}
.blessing-text {
  font-family: serif; font-size: 22px; font-weight: 700; color: #FFE9A8; z-index: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.65); animation: blessingTextIn 2.6s ease both;
}
.blessing-sub { font-size: 13px; color: #FCE9C8; opacity: .92; z-index: 1; animation: blessingTextIn 2.8s ease both; }
@keyframes blessingRays { to { transform: translate(-50%, -58%) rotate(360deg); } }
@keyframes blessingTorii {
  0%   { transform: scale(.4) translateY(10px); opacity: 0; }
  45%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes blessingTextIn {
  0%, 25% { opacity: 0; transform: translateY(8px); }
  55%     { opacity: 1; transform: translateY(0); }
  100%    { opacity: 1; }
}
