/* Roa のメンバーカード（lib/card.js）。設定と、はじめの案内で使う */
.rc {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 30%;
  --paper: #fdfbee; --ink: #1f3a52;
  position: relative; width: 240px; height: 360px; flex: none;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none; cursor: default; user-select: none; text-align: left;
}
.rc.live { transition: transform 0.25s ease-out; }
.rc:focus-visible .rc-face { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-accent, #4152d8); }
.rc-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(0.3, 1.2, 0.4, 1); }
.rc.flipped .rc-inner { transform: rotateY(180deg); }
.rc-face {
  position: absolute; inset: 0; border-radius: 10px; overflow: hidden; backface-visibility: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24), 0 2px 6px rgba(0, 0, 0, 0.14);
}

/* ---- 表 ---- */
.rc-front { display: flex; flex-direction: column; padding: 16px 16px 14px; box-sizing: border-box; background: var(--paper); color: var(--ink); }
/* 絵：テーマの色の溜まりをぼかして重ね、ゆっくり漂わせる（メッシュグラデーション）。形は波の切り抜き */
.rc-art { position: relative; width: 208px; height: 182px; flex: none; overflow: hidden; background: var(--mesh-base); clip-path: var(--art-clip); }
.rc-mesh { position: absolute; inset: -10%; filter: blur(20px) saturate(1.1); }
.rc-mesh i { position: absolute; border-radius: 50%; opacity: 0.85; animation: rc-drift 18s ease-in-out infinite alternate; }
.rc-mesh i:nth-child(2) { animation-duration: 23s; animation-direction: alternate-reverse; }
.rc-mesh i:nth-child(3) { animation-duration: 27s; }
.rc-mesh i:nth-child(4) { animation-duration: 21s; animation-direction: alternate-reverse; }
@keyframes rc-drift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(14%, -10%) scale(1.12); }
  66% { transform: translate(-12%, 12%) scale(0.92); }
  100% { transform: translate(8%, 6%) scale(1.05); }
}
.rc-name { flex: none; margin-top: 18px; font: 700 28px/1.1 -apple-system, "SF Pro Display", "Hiragino Sans", sans-serif; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-title { flex: none; margin-top: 4px; font: 500 11px/1.3 "SF Mono", Menlo, monospace; letter-spacing: 0.04em; }
.rc-foot { position: relative; margin-top: auto; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 10px 8px; align-items: end; }
.rc-stamp { position: relative; grid-row: 1; grid-column: 1; width: 46px; height: 46px; color: var(--ink-accent, #4152d8); display: grid; place-items: center; transform: rotate(-14deg); }
.rc-stamp svg { position: absolute; inset: 0; width: 100%; height: 100%; font-family: "SF Mono", Menlo, monospace; }
.rc-stamp-n { position: relative; font: 800 12px/1 "SF Mono", Menlo, monospace; }
.rc-sign { grid-row: 1; grid-column: 2 / 4; height: 46px; display: flex; align-items: flex-end; }
.rc-sign[hidden] { display: none; }
.rc-sign svg { width: 100%; height: 46px; overflow: visible; }
.rc-sign path { fill: none; stroke: #1d2f7a; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.rc-meta { grid-row: 2; grid-column: 1 / 3; justify-self: start; display: flex; align-items: center; border: 1.1px solid var(--ink); border-radius: 2px; font: 600 9px/16px "SF Mono", Menlo, monospace; white-space: nowrap; }
.rc-meta > span:not(.rc-hatch) { padding: 0 6px; }
.rc-hatch { width: 14px; height: 16px; border-inline: 1.1px solid var(--ink); background: repeating-linear-gradient(45deg, var(--ink) 0 0.8px, transparent 0.8px 3px); }
.rc-maker { grid-row: 2; grid-column: 3; justify-self: end; font: 700 9.5px/1.05 "Didot", "Times New Roman", serif; text-align: center; letter-spacing: 0.02em; }
/* 光：ごく弱く、カーソルの方だけ少し明るくする */
.rc-glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.5s; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 60%);
}
.rc.live .rc-glare { opacity: 1; }

/* ---- 裏 ---- */
/* 裏：表と同じ紙。ロゴ・名前・記録・バーコードを静かに並べる（会員証の裏面） */
.rc-back {
  transform: rotateY(180deg); display: flex; flex-direction: column; padding: 26px 26px 24px; box-sizing: border-box; color: var(--ink);
  background: var(--paper);
}
.rc-back-head { position: relative; display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 10px; border-bottom: 0.75px solid color-mix(in srgb, var(--ink) 28%, transparent); }
.rc-back-logo { font: 700 15px/1 "Didot", "Times New Roman", serif; letter-spacing: 0.22em; }
.rc-back-kind { font: 600 7.5px/1 "SF Mono", Menlo, monospace; letter-spacing: 0.22em; color: var(--ink-accent, var(--ink)); }
.rc-back-name { position: relative; margin: 22px 0 0; font: 700 22px/1.1 -apple-system, "SF Pro Display", "Hiragino Sans", sans-serif; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-stats { position: relative; margin: 18px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
.rc-stats div { display: flex; flex-direction: column; gap: 4px; }
.rc-stats dt { font: 600 7.5px/1 "SF Mono", Menlo, monospace; letter-spacing: 0.16em; opacity: 0.55; }
.rc-stats dd { margin: 0; font: 600 15px/1.1 "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
.rc-cert { position: relative; margin: auto 0 12px; font: italic 400 10px/1.5 "Didot", "Times New Roman", serif; opacity: 0.75; }
.rc-bar { position: relative; display: flex; flex-direction: column; gap: 5px; }
.rc-barcode { display: flex; gap: 1.5px; height: 28px; }
.rc-barcode i { background: currentColor; }
.rc-barcode i:nth-child(3n) { opacity: 0; }
.rc-bar-no { font: 600 8px/1 "SF Mono", Menlo, monospace; letter-spacing: 0.3em; }

/* カードの下の操作（共有・保存・絵柄を変える・はじめの案内） */
.rc-actions { display: flex; justify-content: center; gap: 6px; }
.rc-actions button {
  all: unset; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--rc-act, rgba(127, 127, 127, 0.9)); cursor: default;
  transition: background 0.15s, color 0.15s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rc-actions button:hover { background: rgba(127, 127, 127, 0.14); color: var(--rc-act-hover, currentColor); }
.rc-actions button:active { transform: scale(0.9); }
.rc-actions button:focus-visible { outline: 2px solid var(--ink-accent, #4152d8); outline-offset: 1px; }
.rc-actions svg { width: 19px; height: 19px; }
.rc-actions .spin svg { animation: rc-roll 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes rc-roll { from { transform: rotate(-200deg) scale(0.7); } }

@media (prefers-reduced-motion: reduce) { .rc, .rc-inner { transition: none !important; } .rc-mesh i { animation: none !important; } }
