/* =========================================================
   まんぷくうさハム神社 CSS分割版 2026-06-29
   方針：スマホファースト / 高齢者にも読みやすい / 和紙・金・鳥獣戯画風 / アプリ化前提
========================================================= */

/* 掲示板系共通：叶絵馬・金願・俳句・相合い傘・病気平癒・お礼参りで共有 */
/* ======================================================
   css/ema-board.css
   叶絵馬掲示板 専用CSS
   2026-06-29
   目的：
   - スマホファースト
   - 高齢者にも読みやすい濃い文字
   - 鳥獣戯画風・和紙・絵馬・金の余韻
   - ドーパミン演出は押した瞬間を中心に
====================================================== */

:root {
  --ema-ink: #241207;
  --ema-ink-soft: #4b351f;
  --ema-paper: #fffdf6;
  --ema-paper-strong: #fffef8;
  --ema-gold: #b19238;
  --ema-gold-light: #f2df9b;
  --ema-gold-deep: #7e5e22;
  --ema-line: #e6dec5;
  --ema-line-gold: #e0c782;
  --ema-shadow: 0 14px 30px rgba(58, 42, 21, 0.14);
  --ema-shadow-soft: 0 6px 18px rgba(58, 42, 21, 0.1);
}

.page-ema {
  color: var(--ema-ink);
}

.ema-page {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 10px 20px;
}

/* =========================
   Header
========================= */
.ema-head {
  text-align: center;
  max-width: 980px;
  margin: 8px auto 14px;
  padding: 0 8px;
}

.ema-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff2c7;
  border: 1px solid rgba(177, 146, 56, 0.42);
  color: var(--ema-ink);
  font-weight: 900;
  font-size: clamp(14px, 3.8vw, 16px);
  line-height: 1.45;
}

.ema-head .title-shrine {
  margin: 0 auto 8px;
  color: var(--ema-ink);
  font-family: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(31px, 8.5vw, 48px);
  line-height: 1.18;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.92);
}

.ema-head .title-shrine::after {
  content: "";
  display: block;
  width: min(82%, 520px);
  height: 9px;
  margin: 7px auto 0;
  border-radius: 999px;
  background: linear-gradient(
        90deg,
        transparent,
        rgba(177, 146, 56, 0.95),
        transparent
      )
      center/100% 3px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 238, 174, 0.95), transparent)
      center/76% 8px no-repeat;
}

.ema-lead {
  margin: 0 auto;
  max-width: 780px;
  color: var(--ema-ink-soft);
  font-weight: 900;
  font-size: clamp(16px, 4.3vw, 19px);
  line-height: 1.75;
}

/* =========================
   Notice
========================= */
.ema-notice {
  max-width: 900px;
  margin: 10px auto;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff8dc;
  border: 1px solid var(--ema-line-gold);
  color: var(--ema-ink);
  font-weight: 900;
  line-height: 1.65;
  text-align: center;
}

.ema-notice.is-error {
  background: #fff1ec;
  border-color: #d9a28e;
}

/* =========================
   Form
========================= */
.ema-form-section {
  max-width: 1040px;
  margin: 0 auto 18px;
}

.ema-form-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(177, 146, 56, 0.32);
  background: radial-gradient(
      circle at 50% 0%,
      rgba(255, 239, 184, 0.36),
      transparent 44%
    ),
    rgba(255, 253, 246, 0.88);
  box-shadow: var(--ema-shadow);
}

.ema-form-visual {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
}

.ema-form-visual .form-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.18) saturate(0.92) brightness(1.05);
}

.form-overlay {
  position: relative;
  z-index: 1;
  padding: clamp(14px, 4vw, 24px);
  background: rgba(255, 253, 246, 0.82);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}

.form-title {
  margin: 0 0 4px;
  color: var(--ema-ink);
  font-size: clamp(24px, 6.6vw, 34px);
  line-height: 1.3;
  text-align: center;
  font-family: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

.form-help {
  margin: 0 auto 12px;
  max-width: 720px;
  color: var(--ema-ink-soft);
  text-align: center;
  font-weight: 850;
  font-size: clamp(15px, 4vw, 17px);
  line-height: 1.7;
}

.ema-form {
  max-width: 720px;
  margin: 0 auto;
}

.ema-form .form-row {
  margin: 10px 0;
}

.ema-form .form-label {
  display: block;
  margin: 0 0 5px;
  color: var(--ema-ink);
  font-size: clamp(17px, 4.6vw, 20px);
  line-height: 1.4;
  font-weight: 900;
}

.ema-form .form-control {
  width: 100%;
  min-height: 48px;
  padding: 0.66rem 0.78rem;
  border: 2px solid #d9c68e;
  border-radius: 13px;
  background: var(--ema-paper-strong);
  color: var(--ema-ink);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 700;
  box-shadow: inset 0 2px 7px rgba(58, 42, 21, 0.05);
}

.ema-form textarea.form-control {
  resize: vertical;
  min-height: 112px;
}

.ema-form .form-control:focus {
  outline: 0;
  border-color: var(--ema-gold);
  box-shadow: 0 0 0 4px rgba(177, 146, 56, 0.22),
    inset 0 2px 7px rgba(58, 42, 21, 0.05);
}

.ema-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: center;
  margin: 7px 0 4px;
  color: var(--ema-ink-soft);
  font-weight: 900;
  line-height: 1.5;
}

.count {
  color: var(--ema-ink);
  background: #fff2c7;
  border: 1px solid rgba(177, 146, 56, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
}

.count-sub {
  font-size: 15px;
}

/* =========================
   Ema figure
========================= */
.ema-figure {
  position: relative;
  max-width: 520px;
  margin: 12px auto 0;
  filter: drop-shadow(0 12px 14px rgba(58, 42, 21, 0.16));
}

.ema-figure.ema-preview {
  max-width: min(520px, 94vw);
}

.ema-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.ema-inside {
  position: absolute;
  top: 41%;
  right: 5%;
  bottom: 10%;
  left: 5%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
  pointer-events: none;
}

.ema-text {
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  text-align: center;
  color: var(--ema-ink) !important;
  font-family: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78), 0 0 1px rgba(43, 24, 12, 0.24);
}

.ema-text p {
  margin: 0;
}

/* =========================
   Submit button
========================= */
.submit-row {
  display: flex;
  justify-content: center;
  margin: 10px 0 0;
}

.ema-submit-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.26s cubic-bezier(0.18, 0.75, 0.12, 1.2), filter 0.26s;
  -webkit-tap-highlight-color: transparent;
}

.submit-img {
  width: min(48vw, 190px);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(58, 42, 21, 0.18));
}

.ema-submit-btn .submit-label {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  color: var(--ema-ink);
  font-size: clamp(19px, 5vw, 27px);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 2px 6px rgba(0, 0, 0, 0.12);
}

.ema-submit-btn .shrine-halo {
  position: absolute;
  inset: -12% -14%;
  z-index: 1;
  border-radius: 18px;
  background: radial-gradient(
      280px 160px at 50% 45%,
      rgba(255, 236, 170, 0.72),
      transparent 62%
    ),
    radial-gradient(
      420px 240px at 10% 0%,
      rgba(255, 226, 140, 0.24),
      transparent 60%
    ),
    radial-gradient(
      420px 240px at 100% 0%,
      rgba(255, 226, 140, 0.2),
      transparent 60%
    );
  opacity: 0;
  filter: blur(0.6px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.ema-submit-btn.glow .shrine-halo {
  opacity: 0.9;
  transform: scale(1.03);
}

.ema-submit-btn:active,
.ema-submit-btn.press-deep,
.dopamine-press.press-deep {
  transform: translateY(7px) scale(0.97);
}

/* =========================
   Board
========================= */
.ema-board {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 0 4px;
}

.ema-board-head {
  text-align: center;
  margin: 0 auto 12px;
  padding: 0 8px;
}

.board-title {
  margin: 0 0 4px;
  color: var(--ema-ink);
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.3;
  font-family: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  letter-spacing: 0.05em;
}

.board-lead {
  margin: 0 auto 6px;
  max-width: 780px;
  color: var(--ema-ink-soft);
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 850;
  line-height: 1.7;
}

.board-count {
  display: inline-flex;
  margin: 2px auto 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff8dc;
  border: 1px solid rgba(177, 146, 56, 0.32);
  color: var(--ema-ink);
  font-weight: 900;
}

.ema-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  justify-items: center;
  align-items: start;
}

.ema-card {
  width: min(94vw, 390px);
  max-width: 100%;
  position: relative;
  margin: 0;
  padding: 12px;
  border-radius: 18px;
  border: 2px solid rgba(177, 146, 56, 0.38);
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.84),
      rgba(255, 250, 230, 0.94)
    ),
    var(--ema-paper);
  box-shadow: var(--ema-shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.84);
}

.ema-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 34px;
  height: 12px;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #7b4d20, #4e2d12);
  opacity: 0.18;
  pointer-events: none;
}

/* meta */
.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 32px;
  margin: 2px 0 8px;
}

.card-time-topleft {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff8dc;
  border: 1px solid #ead9a1;
  color: #4b351f;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
}

.poster-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbf4e6, #e0c27d, #f7ead0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.poster-name .rank-mini {
  display: block;
  flex: 0 0 auto;
}

.poster-name .name-text {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  padding: 2px 8px 3px;
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ema-ink);
  font-weight: 900;
  font-size: 16px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* actions */
.ema-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  row-gap: 8px;
  margin-top: 10px;
}

.ema-like-center {
  display: grid;
  place-items: center;
}

.like-form {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "btn"
    "counter";
  justify-items: center;
  align-items: center;
  row-gap: 0;
}

.like-btn {
  grid-area: btn;
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer;
}

.like-btn.only-icon {
  display: grid;
  place-items: center;
  min-width: 78px;
  min-height: 78px;
  border-radius: 999px;
  transition: transform 0.22s cubic-bezier(0.18, 0.75, 0.12, 1.2), filter 0.22s;
}

.like-btn.only-icon:focus-visible {
  outline: 4px solid rgba(177, 146, 56, 0.45);
  outline-offset: 3px;
}

.like-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.like-icon.xl {
  display: block;
  width: min(30vw, 112px);
  height: auto;
  transform-origin: center;
  filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.65));
}

.like-btn.only-icon:not(:disabled) .like-icon {
  animation: emaInvitePulse 2.8s ease-in-out infinite;
}

.leaf-row {
  grid-area: counter;
}

.leaf-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.leaf-wrap .leaf-img {
  display: block;
  width: clamp(92px, 30vw, 136px);
  height: auto;
}

.leaf-wrap .leaf-num {
  position: absolute;
  left: 50%;
  top: 50%;
  min-width: 2ch;
  transform: translate(-50%, -50%);
  color: var(--ema-ink);
  font-weight: 900;
  font-size: clamp(28px, 8vw, 36px) !important;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.leaf-num[data-digits="1"] {
  transform: translate(-50%, -50%) scale(1);
}
.leaf-num[data-digits="2"] {
  transform: translate(-50%, -50%) scale(0.96);
}
.leaf-num[data-digits="3"] {
  transform: translate(-50%, -50%) scale(0.9);
}
.leaf-num[data-digits="4"] {
  transform: translate(-50%, -50%) scale(0.84);
}
.leaf-num[data-digits="5"] {
  transform: translate(-50%, -50%) scale(0.78);
}

.rank-banner {
  margin-top: 2px;
}

.rank-banner--elegant {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 16px;
  background: linear-gradient(90deg, #fff7dd, #f3e3b1);
  border: 1px solid #e0c782;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
  color: #4b360e;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 900;
  line-height: 1.55;
  text-align: center;
}

.rank-badge {
  flex: 0 0 auto;
  display: block;
}

.rank-text {
  font-weight: 900;
}

.ema-expire-note {
  margin: 0;
  color: #6b5436;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 850;
}

/* =========================
   Empty
========================= */
.empty-state {
  width: min(94vw, 720px);
  padding: 20px 14px;
  border-radius: 18px;
  background: rgba(255, 253, 246, 0.9);
  border: 1px solid rgba(177, 146, 56, 0.36);
  box-shadow: var(--ema-shadow-soft);
  color: var(--ema-ink);
  text-align: center;
  font-weight: 900;
  line-height: 1.7;
}

.empty-state p {
  margin: 0 0 10px;
}

.empty-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff2c7, #ffe49c);
  border: 1px solid rgba(177, 146, 56, 0.5);
  color: var(--ema-ink);
  text-decoration: none;
  font-weight: 900;
}

/* =========================
   Pager
========================= */
.ema-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 16px 0 4px;
}

.pager-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.pager-wrap img {
  display: block;
}

.pager-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ema-ink);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.86);
}

.page-link,
.next-link {
  display: inline-block;
  transition: transform 0.18s ease;
}

.page-link.is-active .pager-wrap {
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px rgba(255, 215, 120, 0.8));
}

.page-link:active,
.next-link:active {
  transform: translateY(2px) scale(0.98);
}

.pager-gap {
  display: inline-flex;
  align-items: center;
  color: #6b5436;
  font-weight: 900;
  padding: 0 3px;
}

.next-link .pager-wrap {
  animation: nextPulse 1.2s ease-in-out infinite;
}

/* =========================
   Overlay
========================= */
#emaPostedScreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  place-items: center;
  padding: 18px;
  background: radial-gradient(
      circle at 50% 0%,
      rgba(255, 238, 180, 0.42),
      transparent 44%
    ),
    rgba(29, 16, 5, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

#emaPostedScreen.show {
  display: grid;
}

#emaPostedScreen .panel {
  width: min(94vw, 760px);
  max-height: 92dvh;
  overflow: auto;
  border-radius: 22px;
  border: 2px solid rgba(177, 146, 56, 0.42);
  background: radial-gradient(
      circle at 50% 0%,
      rgba(255, 238, 180, 0.38),
      transparent 42%
    ),
    var(--ema-paper-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  padding: 18px 14px 20px;
  text-align: center;
  color: var(--ema-ink);
}

#emaPostedScreen .title {
  margin: 0 0 8px;
  font-size: clamp(24px, 6.8vw, 36px);
  line-height: 1.35;
}

.goldline {
  display: inline-block;
  position: relative;
  padding-bottom: 0.45rem;
}

.goldline::after {
  content: "";
  display: block;
  width: min(92%, 520px);
  height: 6px;
  margin: 0.35rem auto 0;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #eddba4 12%,
    #b19238 52%,
    #7e5e22 86%,
    transparent 100%
  );
}

#emaPostedScreen .miko {
  display: block;
  width: min(42vw, 220px);
  height: auto;
  margin: 4px auto 8px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.12));
  animation: mikoFloat 3.8s ease-in-out infinite;
}

#emaPostedScreen .msg {
  margin: 0 auto 8px;
  color: var(--ema-ink-soft);
  font-size: clamp(16px, 4.2vw, 19px);
  font-weight: 900;
  line-height: 1.75;
}

#emaPostedScreen .hr {
  width: 92%;
  height: 1px;
  margin: 12px auto;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(177, 146, 56, 0.58),
    transparent
  );
}

.mini-ema {
  position: relative;
  width: min(86vw, 420px);
  margin: 0 auto;
}

.mini-ema-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.mini-ema-write {
  position: absolute;
  top: 38%;
  left: 9%;
  right: 9%;
  bottom: 10%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
  color: var(--ema-ink);
  font-family: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
}

.mini-ema-name {
  color: #3a2816;
}

.mini-ema-text {
  color: var(--ema-ink);
}

#emaPostedScreen .foot {
  margin: 10px auto 0;
  color: #6b5436;
  font-size: 14px;
  font-weight: 850;
}

/* =========================
   Toast
========================= */
.ema-toast {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 100000;
  max-width: min(92vw, 380px);
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(186, 150, 90, 0.58);
  background: var(--ema-paper-strong);
  color: var(--ema-ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  font-weight: 900;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ema-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   Dopamine animations
========================= */
@keyframes emaInvitePulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.65));
  }
  50% {
    transform: scale(1.045);
    filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.75))
      drop-shadow(0 0 10px rgba(255, 220, 130, 0.55));
  }
}

.boom,
.dopamine-like .boom {
  animation: likeBoom 0.6s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

@keyframes likeBoom {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.like-icon.shine {
  animation: likeShine 0.6s ease-out both;
}

@keyframes likeShine {
  0% {
    filter: brightness(1);
  }
  40% {
    filter: brightness(1.28) drop-shadow(0 0 12px rgba(255, 220, 130, 0.75));
  }
  100% {
    filter: brightness(1);
  }
}

.plus-one {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  color: var(--ema-gold);
  font-weight: 900;
  text-shadow: 0 1px 0 #fff;
  pointer-events: none;
  animation: plusRise 0.7s ease-out both;
}

@keyframes plusRise {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -22px);
  }
}

.spark-mini {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #ffe9a8 0%,
    #ffcf4d 55%,
    rgba(255, 213, 94, 0) 74%
  );
  filter: drop-shadow(0 0 2px rgba(255, 215, 110, 0.9));
  opacity: 0;
  pointer-events: none;
  animation: sparkFly 0.9s ease-out forwards;
}

@keyframes sparkFly {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(0.1);
  }
}

.counter-pop {
  animation: counterPop 0.45s ease-out both;
}

@keyframes counterPop {
  0% {
    transform: translate(-50%, -50%) scale(0.92);
  }
  45% {
    transform: translate(-50%, -50%) scale(1.14);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

.leaf-wrap.is-alive .leaf-img {
  animation: leafPulse 2.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes leafPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

.ema-submit-btn .ring {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(200, 162, 74, 0.85);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0.9;
  pointer-events: none;
  animation: ringPulse 0.6s ease-out forwards;
}

@keyframes ringPulse {
  to {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0;
  }
}

@keyframes nextPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes mikoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

/* =========================
   Tiers
========================= */
.ema-card[data-tier] .leaf-num,
.ema-card[data-tier] .like-icon.xl {
  transition: transform 0.25s ease, color 0.25s ease, text-shadow 0.25s ease,
    filter 0.25s ease;
}

.ema-card[data-tier="t30"] .leaf-num {
  color: #6c531b;
  text-shadow: 0 1px 0 #fff, 0 0 6px rgba(255, 215, 140, 0.6);
}

.ema-card[data-tier="t50"] .leaf-num {
  color: #8a6f25;
  text-shadow: 0 1px 0 #fff, 0 0 8px rgba(255, 205, 100, 0.75);
}

.ema-card[data-tier="t50"] .like-icon.xl {
  filter: drop-shadow(0 0 8px rgba(255, 200, 90, 0.75));
}

.ema-card[data-tier="t100"] .leaf-num {
  color: #a5801f;
  text-shadow: 0 1px 0 #fff, 0 0 10px rgba(255, 195, 80, 0.9);
}

.ema-card[data-tier="t200"] .leaf-num {
  color: #b68a20;
  text-shadow: 0 1px 0 #fff, 0 0 12px rgba(255, 185, 60, 1);
}

.ema-card[data-tier="t300"] .like-form::before,
.ema-card[data-tier="t500"] .like-form::before,
.ema-card[data-tier="t800"] .like-form::before,
.ema-card[data-tier="t1000"] .like-form::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 20px;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 225, 150, 0.26),
    transparent 68%
  );
  animation: auraPulse 2.2s ease-in-out infinite;
}

@keyframes auraPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.03);
  }
}

/* =========================
   Responsive
========================= */
@media (min-width: 760px) {
  .ema-page {
    padding-inline: 14px;
  }

  .form-overlay {
    padding: 24px;
  }

  .ema-grid {
    grid-template-columns: repeat(2, minmax(320px, 390px));
    gap: 22px 24px;
  }
}

@media (min-width: 1120px) {
  .ema-grid {
    grid-template-columns: repeat(3, minmax(320px, 390px));
  }
}

@media (max-width: 380px) {
  .ema-page {
    padding-inline: 8px;
  }

  .ema-card {
    width: min(96vw, 390px);
    padding: 10px;
  }

  .poster-name .name-text {
    max-width: 138px;
  }

  .card-time-topleft {
    font-size: 14px;
  }

  .ema-inside {
    top: 42%;
    left: 5%;
    right: 5%;
    bottom: 10%;
  }
}

/* =========================
   Reduced motion / high contrast
========================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  .form-overlay,
  .ema-card,
  #emaPostedScreen .panel {
    background: #fff !important;
  }

  .ema-lead,
  .board-lead,
  .form-help,
  .ema-expire-note {
    color: #241207;
  }
}

/* =========================
   Owner delete link
========================= */
.owner-delete-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 2px;
  padding: 0.46rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(154, 59, 47, 0.32);
  background: linear-gradient(180deg, #fff8ef, #ffe8dc);
  color: #6b241b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(58, 42, 21, 0.08);
}

.owner-delete-link:hover,
.owner-delete-link:focus {
  color: #6b241b;
  text-decoration: none;
  filter: brightness(1.02);
}

.owner-delete-link:active {
  transform: translateY(2px) scale(0.985);
}

/* =========================
   Cookie note
========================= */
.ema-cookie-note {
  max-width: 720px;
  margin: 8px auto 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff8dc;
  border: 1px solid rgba(177, 146, 56, 0.38);
  color: #4b351f;
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 850;
  line-height: 1.75;
  text-align: left;
}

@media (max-width: 430px) {
  .ema-cookie-note {
    margin: 8px auto 12px;
    padding: 10px;
  }
}

/* 掲示板テーマ共通の読みやすさ補強 */
[class^="page-"] .ema-lead,
[class^="page-"] .board-lead,
[class^="page-"] .form-help,
[class^="page-"] .ema-cookie-note {
  color: #3a2a15;
  font-weight: 850;
}

.board-theme-note {
  max-width: 760px;
  margin: 10px auto;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(177, 146, 56, 0.36);
  background: rgba(255, 248, 220, 0.9);
  color: #3a2a15;
  font-weight: 850;
  line-height: 1.75;
}
