/* ============================================================
   SHINDO — Refer a friend (Build_20)
   Palette from the app's Refer a Friend screen: black, gold wave. Tickets on cream ticket paper, stamps in red ink.
   ============================================================ */
.mod--rf, .rf-band { --gold: #C9A24A; --gold2: #E9CF8A; --paper: #F2EAD6; --paper2: #E6DABD; --ink-red: #C8372D; --tk-ink: #2B3A35; }

/* ---------- Ticket (shared by hero + homepage band) ---------- */
.rf-tk { position: relative; display: grid; grid-template-columns: 19% 1fr; width: 100%; aspect-ratio: 2.55; border-radius: 10px; color: var(--tk-ink); font-family: var(--font-mono); user-select: none; }
.rf-tk__stub, .rf-tk__body { position: relative; background:
    repeating-linear-gradient(135deg, rgba(43,58,53,0.045) 0 2px, transparent 2px 7px),
    radial-gradient(120% 90% at 30% 20%, var(--paper), var(--paper2)); }
.rf-tk__stub { border-radius: 10px 0 0 10px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 8px; text-align: center;
  -webkit-mask: radial-gradient(circle 4px at 100% 8px, transparent 3.5px, #000 4px) 0 0 / 100% 16px repeat-y; mask: radial-gradient(circle 4px at 100% 8px, transparent 3.5px, #000 4px) 0 0 / 100% 16px repeat-y; }
.rf-tk__body { border-radius: 0 10px 10px 0; padding: 7% 7% 6% 6%; display: grid; grid-template-rows: auto 1fr auto; gap: 4px;
  -webkit-mask: radial-gradient(circle 4px at 0 8px, transparent 3.5px, #000 4px) 0 0 / 100% 16px repeat-y; mask: radial-gradient(circle 4px at 0 8px, transparent 3.5px, #000 4px) 0 0 / 100% 16px repeat-y; }
.rf-tk__stub b { font-family: var(--font-display); font-size: clamp(18px, 2vw, 30px); font-weight: 600; }
.rf-tk__stub small { font-size: clamp(8px, 0.75vw, 11px); letter-spacing: 0.08em; opacity: 0.7; writing-mode: vertical-rl; }
.rf-tk__top { display: flex; justify-content: space-between; gap: 8px; font-size: clamp(8px, 0.75vw, 11px); letter-spacing: 0.12em; }
.rf-tk__top b { font-weight: 700; }
.rf-tk__mid { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 14px; }
.rf-tk__big { font-family: var(--font-display); font-weight: 300; font-size: clamp(28px, 3.4vw, 54px); line-height: 0.9; letter-spacing: -0.04em; color: #1b2723; }
.rf-tk__big small { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: clamp(9px, 0.8vw, 12px); letter-spacing: 0.12em; }
.rf-tk__route { justify-self: end; text-align: right; font-size: clamp(9px, 0.85vw, 13px); line-height: 1.5; }
.rf-tk__route b { display: block; font-family: var(--font-display); font-size: clamp(13px, 1.25vw, 19px); font-weight: 500; letter-spacing: 0; }
.rf-tk__bot { display: flex; justify-content: space-between; align-items: end; gap: 8px; font-size: clamp(8px, 0.75vw, 11px); letter-spacing: 0.1em; }
.rf-tk__code { font-size: clamp(11px, 1.05vw, 15px); font-weight: 700; letter-spacing: 0.14em; color: #1b2723; }
.rf-tk__ex { padding: 2px 6px; border: 1px solid currentColor; border-radius: 4px; color: var(--ink-red); font-weight: 700; }

/* ---------- 1 · Hero ---------- */
.rf-hero { position: relative; min-height: 100svh; overflow: hidden; color: #fff; isolation: isolate; background: #000;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(32px, 5vw, 90px);
  padding: calc(var(--nav-h) + 30px) clamp(24px, 4.6vw, 88px) 60px; }
.rf-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 0% 0%, rgba(201,162,74,0.28), transparent 70%), radial-gradient(50% 50% at 100% 100%, rgba(201,162,74,0.12), transparent 70%); }
.rf-hero::after { content: ""; position: absolute; left: -5%; right: -5%; top: 80%; height: 120px; z-index: -1; opacity: 0.5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 70 C150 110 260 40 400 60 S650 20 760 55 S1000 100 1200 40' fill='none' stroke='%23C9A24A' stroke-width='1.5'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.rf-hero__copy { display: grid; gap: 22px; max-width: 560px; }
.rf-hero .eyebrow { color: var(--gold2); }
.rf-hero__title { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(40px, 4.4vw, 76px); line-height: 1.03; letter-spacing: -0.04em; }
.rf-hero__lead { margin: 0; font-size: clamp(16px, 1.2vw, 19px); line-height: 1.6; color: rgba(255,255,255,0.7); }
.rf-badge { margin: 0; justify-self: start; display: inline-flex; gap: 10px; align-items: center; padding: 8px 16px; border-radius: 99px; border: 1px solid rgba(201,162,74,0.5); color: var(--gold2); font-size: 14px; font-weight: 600; }
.rf-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(201,162,74,0.6); animation: rfBadge 2.4s ease-out infinite; }
@keyframes rfBadge { 0% { box-shadow: 0 0 0 0 rgba(201,162,74,0.6); } 100% { box-shadow: 0 0 0 10px rgba(201,162,74,0); } }
.rf-book { position: relative; display: grid; gap: 22px; justify-items: center; }
.rf-book__stack { position: relative; width: min(560px, 100%); aspect-ratio: 2.55; perspective: 1400px; margin-bottom: 40px; }
.rf-book__stack .rf-tk { position: absolute; inset: 0; transform: translate(calc(var(--i) * 3px), calc(var(--i) * 4px)) rotate(calc(var(--i) * 0.5deg)); filter: brightness(calc(1 - var(--i) * 0.05)); box-shadow: 0 1px 0 rgba(0,0,0,0.25); transition: transform 500ms var(--ease), filter 500ms; }
.rf-book__stack .rf-tk.is-top { cursor: grab; box-shadow: 0 30px 60px rgba(0,0,0,0.55); }
.rf-book__stack .rf-tk.is-top:active { cursor: grabbing; }
.rf-book__stack .rf-tk__body { transform-origin: 0% 50%; transition: transform 450ms cubic-bezier(.2,1.4,.4,1); will-change: transform; }
.rf-book__stack .rf-tk.is-drag .rf-tk__body { transition: none; }
.rf-book__stack .rf-tk.is-torn .rf-tk__body { transition: transform 900ms cubic-bezier(.3,.6,.3,1), opacity 900ms; transform: translate(130%, -40%) rotate(16deg) !important; opacity: 0; }
.rf-book__stack .rf-tk.is-torn .rf-tk__stub { transition: transform 700ms 350ms var(--ease), opacity 700ms 350ms; transform: translateY(80px) rotate(-6deg); opacity: 0; }
.rf-tk__tear { position: absolute; left: 19%; top: 0; bottom: 0; width: 6px; margin-left: -3px; pointer-events: none; opacity: 0; transition: opacity 200ms;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.25), transparent); }
.rf-tk.is-drag .rf-tk__tear { opacity: 1; }
.rf-book__ui { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 14px; color: rgba(255,255,255,0.6); }
.rf-book__left { font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--gold2); }
.rf-book__reset { border: 1px solid rgba(255,255,255,0.25); background: transparent; color: #fff; font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 99px; cursor: pointer; }
.rf-book__reset[hidden] { display: none; }
.rf-book__stubs { display: flex; gap: 4px; min-height: 26px; }
.rf-book__stubs i { width: 12px; height: 26px; border-radius: 3px; background: linear-gradient(var(--paper), var(--paper2)); opacity: 0.85; animation: rfStub 500ms var(--ease) both; }
@keyframes rfStub { from { transform: translateY(-20px); opacity: 0; } }
.rf-sent { position: absolute; z-index: 5; left: 50%; top: -52px; transform: translate(-50%, 0); padding: 8px 16px; border-radius: 99px; background: rgba(201,162,74,0.16); color: var(--gold2); font-size: 13px; font-weight: 600; white-space: nowrap; animation: rfSent 1.8s var(--ease) both; pointer-events: none; }
@keyframes rfSent { 0% { opacity: 0; transform: translate(-50%, 10px); } 15%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -10px); } }

/* ---------- 3 · Stamp rally ---------- */
.rf-rally { margin: 0 var(--inset); border-radius: var(--radius-xl); background: #0b0b0b; color: #fff; padding: clamp(80px, 10vw, 150px) clamp(24px, 4.6vw, 88px);
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 90px); align-items: center; }
.rf-rally .eyebrow { color: var(--gold2); }
.rf-rally__copy { display: grid; gap: 20px; } .rf-rally__copy p { margin: 0; color: rgba(255,255,255,0.66); font-size: 17px; line-height: 1.6; }
.rf-card { color: var(--tk-ink); border-radius: 18px; padding: clamp(20px, 3vw, 36px); background: repeating-linear-gradient(0deg, rgba(43,58,53,0.035) 0 1px, transparent 1px 22px), linear-gradient(160deg, var(--paper), var(--paper2)); box-shadow: 0 40px 80px rgba(0,0,0,0.5); transform: rotate(-1.2deg); }
.rf-card.is-thunk { animation: rfThunk 260ms ease-out; }
@keyframes rfThunk { 0% { transform: rotate(-1.2deg) translateY(0); } 40% { transform: rotate(-1.2deg) translateY(3px) scale(0.997); } 100% { transform: rotate(-1.2deg); } }
.rf-card__head { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; padding-bottom: 14px; border-bottom: 1.5px dashed rgba(43,58,53,0.35); }
.rf-card__slots { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rf-card__slots li { display: grid; justify-items: center; gap: 8px; text-align: center; }
.rf-card__slots li b { font-size: 15px; } .rf-card__slots li small { font-size: 13px; line-height: 1.45; color: rgba(43,58,53,0.75); }
.rf-stamp { position: relative; width: min(150px, 100%); aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(43,58,53,0.35); background: transparent; cursor: pointer; padding: 0; }
.rf-stamp__ink { position: absolute; inset: 6%; border-radius: 50%; opacity: 0; transform: scale(1.7) rotate(-30deg); }
.rf-stamp.is-on .rf-stamp__ink { animation: rfPress 520ms cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes rfPress { 0% { opacity: 0; transform: scale(1.7) rotate(-30deg); } 60% { opacity: 1; transform: scale(0.94) rotate(var(--r, -8deg)); } 100% { opacity: 0.92; transform: scale(1) rotate(var(--r, -8deg)); } }
.rf-stamp__ink svg { width: 100%; height: 100%; display: block; }
.rf-stamp:focus-visible { outline: 2px solid var(--ink-red); outline-offset: 4px; }

/* ---------- 4 · Ledger ---------- */
.rf-ledger { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: clamp(32px, 5vw, 90px); align-items: center; padding: clamp(80px, 10vw, 150px) clamp(24px, 4.6vw, 88px); }
.rf-ledger__copy { display: grid; gap: 20px; } .rf-ledger__copy > p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink-soft); }
.rf-ledger__tally { display: flex; align-items: baseline; gap: 12px; }
.rf-ledger__tally b { font-family: var(--font-display); font-weight: 300; font-size: clamp(56px, 6vw, 96px); line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.rf-ledger__tally span { color: var(--ink-soft); }
.rf-ledger__play { justify-self: start; border: 0; background: var(--ink); color: #fff; font: inherit; font-size: 14px; font-weight: 600; padding: 12px 20px; border-radius: 99px; cursor: pointer; }
.rf-ledger__board { border-radius: var(--radius-xl); background: #050505; color: #fff; padding: clamp(18px, 2.4vw, 32px); display: grid; gap: 10px; }
.rf-ledger__you { display: grid; grid-template-columns: 8.5em 1fr; align-items: center; gap: 10px; font-size: 13px; color: var(--gold2); font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.l-you { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; height: 22px; }
.l-you i { border-radius: 4px; background: rgba(255,255,255,0.06); transition: background 400ms, box-shadow 400ms; }
.l-you i.is-on { background: var(--gold); box-shadow: 0 0 12px rgba(201,162,74,0.6); }
.rf-ledger__months { display: grid; grid-template-columns: 8.5em repeat(12, 1fr); gap: 3px; font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.35); text-align: center; }
.rf-ledger__rows { display: grid; gap: 4px; }
.l-row { display: grid; grid-template-columns: 8.5em repeat(12, 1fr); gap: 3px; align-items: center; height: 22px; }
.l-row > span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: rgba(255,255,255,0.5); display: flex; gap: 8px; align-items: center; }
.l-row > span em { font-style: normal; font-size: 10px; color: rgba(255,255,255,0.35); }
.l-row > i { height: 100%; border-radius: 4px; background: rgba(255,255,255,0.035); transition: background 400ms; }
.l-row > i.is-gift { background: #EFE6CF; }
.l-row > i.is-stay { background: rgba(201,162,74,0.35); }
.l-row > i.is-left { background: rgba(255,255,255,0.08); }
.l-row.is-stay > span { color: var(--gold2); } .l-row.is-left > span { opacity: 0.45; }
.l-fly { position: fixed; z-index: 50; width: 20px; height: 14px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 12px rgba(201,162,74,0.8); pointer-events: none; transition: transform 800ms cubic-bezier(.5,0,.2,1), opacity 300ms 700ms; }
.rf-ledger__fine { margin: 6px 0 0; font-size: 11px; color: rgba(255,255,255,0.35); }

/* ---------- 5 · Receipt ---------- */
.rf-receipt { margin: 0 var(--inset); border-radius: var(--radius-xl); background: #0b0b0b; color: #fff; padding: clamp(80px, 10vw, 140px) clamp(24px, 4.6vw, 88px) clamp(60px, 8vw, 110px);
  display: grid; justify-items: center; gap: clamp(30px, 4vw, 56px); text-align: center; overflow: hidden; }
.rf-receipt .eyebrow { color: var(--gold2); } .rf-receipt__copy { display: grid; gap: 16px; justify-items: center; }
.rf-paper { position: relative; width: min(400px, 100%); }
.rf-paper::before { content: ""; position: absolute; left: -14px; right: -14px; top: -14px; height: 22px; border-radius: 11px; background: linear-gradient(#2a2a2a, #111); box-shadow: 0 6px 14px rgba(0,0,0,0.6); z-index: 2; }
.rf-paper__roll { position: relative; background: #FAF7EF; color: #222; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; text-align: left; padding: 26px 26px 34px;
  clip-path: inset(0 0 calc((1 - var(--u, 0)) * 100%) 0); transform: translateY(calc((1 - var(--u, 0)) * -6px));
  -webkit-mask: linear-gradient(#000, #000) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 16px 10px repeat-x;
  mask: linear-gradient(#000, #000) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 16px 10px repeat-x; }
.rf-paper__roll p { margin: 0; } .rf-paper__roll ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rf-paper__roll li { display: grid; grid-template-columns: 1.4em 1fr; } .rf-paper__roll li::before { content: "・"; }
.r-h { text-align: center; font-weight: 700; letter-spacing: 0.2em; font-size: 16px; } .r-h small { font-weight: 400; font-size: 11px; letter-spacing: 0.16em; }
.r-sep { height: 0; border-top: 1.5px dashed rgba(0,0,0,0.3); margin: 16px 0 !important; }
.r-warn { font-weight: 700; color: var(--ink-red); } .r-small { font-size: 11px; color: rgba(0,0,0,0.55); }
.r-bar { height: 44px; margin: 18px 0 12px !important; background: repeating-linear-gradient(90deg, #222 0 2px, transparent 2px 4px, #222 4px 5px, transparent 5px 9px, #222 9px 12px, transparent 12px 14px); }
.r-thanks { font-size: 12px; }

/* ---------- 6 · Tear ---------- */
.rf-tear { position: relative; margin: var(--inset) var(--inset) 0; border-radius: var(--radius-xl); min-height: 80vh; background: #000; color: #fff; overflow: hidden;
  display: grid; grid-template-rows: 1fr auto 1fr; align-items: stretch; }
.rf-tear__half { display: grid; padding: 40px 24px; text-align: center; background: radial-gradient(80% 120% at 50% 100%, rgba(201,162,74,0.16), transparent 70%); transition: none; }
.rf-tear__half--a { align-items: end; transform: translateY(calc(var(--t, 0) * -26px)) rotate(calc(var(--t, 0) * -1.2deg)); }
.rf-tear__half--b { align-items: start; background: radial-gradient(80% 120% at 50% 0%, rgba(201,162,74,0.16), transparent 70%); transform: translateY(calc(var(--t, 0) * 26px)) rotate(calc(var(--t, 0) * 0.8deg)); }
.rf-tear h2 { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(38px, 6vw, 100px); line-height: 1.04; letter-spacing: -0.045em; }
.rf-tear__half--b h2 { color: var(--gold2); }
.rf-tear__perf { height: 10px; margin: 0 6%; background: radial-gradient(circle 3px, rgba(255,255,255,0.5) 2.5px, transparent 3px) 0 50% / 16px 10px repeat-x; opacity: calc(1 - var(--t, 0) * 0.8); }

/* ---------- Homepage band ---------- */
.rf-band { margin: 0 auto; max-width: 1400px; text-decoration: none; border-radius: var(--radius-xl); background: #000; color: #fff; padding: clamp(36px, 5vw, 64px) clamp(24px, 5vw, 80px); overflow: hidden; position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.rf-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 80% at 0% 0%, rgba(201,162,74,0.22), transparent 70%); pointer-events: none; }
.rf-band__copy { position: relative; display: grid; gap: 14px; }
.rf-band .eyebrow { color: var(--gold2); }
.rf-band h2 { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(28px, 2.8vw, 44px); line-height: 1.08; letter-spacing: -0.03em; }
.rf-band p { margin: 0; color: rgba(255,255,255,0.62); font-size: 16px; line-height: 1.55; max-width: 46ch; }
.rf-band__go { justify-self: start; color: var(--gold2); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(233,207,138,0.4); padding-bottom: 2px; }
.rf-band__tk { position: relative; transform: rotate(-3deg); transition: transform 600ms var(--ease); }
.rf-band__tk .rf-tk__body { transition: transform 600ms cubic-bezier(.2,1.4,.4,1); transform-origin: 0 50%; }
.rf-band:hover .rf-band__tk { transform: rotate(-1deg); }
.rf-band:hover .rf-band__tk .rf-tk__body { transform: translateX(10px) rotate(2deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .rf-hero, .rf-rally, .rf-ledger, .rf-band { grid-template-columns: 1fr; }
  .rf-hero { padding-top: calc(var(--nav-h) + 10px); }
  .rf-card__slots { grid-template-columns: 1fr; } .rf-card__slots li { grid-template-columns: 90px 1fr; justify-items: start; text-align: left; align-items: center; column-gap: 16px; }
  .rf-card__slots li .rf-stamp { grid-row: span 2; width: 90px; }
  .rf-ledger__you, .rf-ledger__months, .l-row { grid-template-columns: 5.5em repeat(12, 1fr); }
  .rf-ledger__you { grid-template-columns: 5.5em 1fr; }
  .l-row > span em { display: none; }
}
html[lang="ja"] .rf-hero__title { font-size: clamp(34px, 3.8vw, 64px); line-height: 1.15; }
@media (prefers-reduced-motion: reduce) { .rf-badge i { animation: none; } .rf-band:hover .rf-band__tk .rf-tk__body { transform: none; } }
