/* =========================================================
   PING PONG CLUB — style.css
   色：生成り＋ほぼ黒（大人の落ち着き）＋卓球台グリーン＋ボールのオレンジ（アクセント）
   ========================================================= */
:root {
  --bg: #F3EEE4;          /* 生成り */
  --bg-2: #EAE3D6;        /* 1段濃い生成り */
  --ink: #1B1B1B;         /* ほぼ黒 */
  --ink-sub: rgba(27, 27, 27, .64);
  --line: rgba(27, 27, 27, .14);
  --green: #1F4A3A;       /* 卓球台グリーン */
  --orange: #EE7A2B;      /* ボール */
  --white: #FBF8F2;

  --font-en: "DM Serif Display", "Times New Roman", serif;
  --font-num: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;

  --ease: cubic-bezier(.19, 1, .22, 1);   /* 速く動き出してゆっくり止まる */
  --gutter: clamp(20px, 5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 2;
  letter-spacing: .05em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol { margin: 0; padding: 0; }
em { font-style: italic; }
::selection { background: var(--orange); color: var(--white); }

/* ボール（共通の見た目） */
.opening__ball, .rally__ball, .reserve__ball {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFD2AE 0%, var(--orange) 45%, #C85A12 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

/* =========================================================
   アニメーション1：オープニング（約2秒）
   ========================================================= */
.opening {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 28px;
  background: var(--bg);
  transition: opacity .45s ease, visibility .45s;
}
body.is-open .opening { opacity: 0; visibility: hidden; }
.opening__court { position: relative; width: min(80vw, 560px); height: 90px; }
.opening__table {
  position: absolute; inset: 0;
  background: var(--green);
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px var(--white);
  transform: perspective(600px) rotateX(35deg);
}
.opening__net {
  position: absolute; left: 50%; top: -14px; bottom: 0;
  width: 3px; background: var(--white);
  translate: -50% 0;
}
.opening__ball {
  top: 10px;
  left: 0;
  animation: openX 1.5s linear forwards, openBounce 1.5s forwards;
}
.opening__shadow {
  position: absolute; top: 30px; left: 0;
  width: 22px; height: 6px; border-radius: 50%;
  background: rgba(0,0,0,.35);
  animation: openX 1.5s linear forwards;
}
@keyframes openX { from { left: -4%; } to { left: 100%; } }
/* 台の上で3回弾む */
@keyframes openBounce {
  0%   { transform: translateY(-110px); animation-timing-function: cubic-bezier(.5,0,1,1); }
  22%  { transform: translateY(0); animation-timing-function: cubic-bezier(0,0,.5,1); }
  44%  { transform: translateY(-80px); animation-timing-function: cubic-bezier(.5,0,1,1); }
  66%  { transform: translateY(0); animation-timing-function: cubic-bezier(0,0,.5,1); }
  83%  { transform: translateY(-50px); animation-timing-function: cubic-bezier(.5,0,1,1); }
  100% { transform: translateY(0); }
}
.opening__logo {
  font-family: var(--font-en);
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1;
  opacity: 0; transform: translateY(14px);
  animation: logoIn .6s var(--ease) 1.1s forwards;
}
.opening__logo em { color: var(--orange); }
@keyframes logoIn { to { opacity: 1; transform: none; } }

/* ---------- ヘッダー ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background .6s var(--ease), padding .6s var(--ease);
}
.header.is-scrolled {
  background: rgba(243, 238, 228, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-top: 12px; padding-bottom: 12px;
}
.header__logo { font-family: var(--font-en); font-size: 22px; line-height: 1; }
.header__logo em, .footer__logo em { color: var(--orange); }
.header__nav { display: none; gap: 32px; margin-right: 210px; }
.header__nav a { font-size: 13px; letter-spacing: .14em; position: relative; }
.header__nav a::after {
  content: ""; position: absolute; left: 0; bottom: 2px;
  width: 100%; height: 1px; background: var(--orange);
  transform: scaleX(0); transform-origin: right;
  transition: transform .6s var(--ease);
}
.header__nav a:hover::after { transform: scaleX(1); transform-origin: left; }
@media (min-width: 900px) { .header__nav { display: flex; } }

/* ---------- ファーストビュー ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; align-content: center;
  padding: 120px var(--gutter) 180px;
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; width: 100%; }
.hero__en { font-family: var(--font-en); font-size: clamp(16px, 2.2vw, 22px); color: var(--ink-sub); margin-bottom: 18px; }
.hero__en em { color: var(--green); }
.hero__title {
  font-weight: 700;
  font-size: clamp(38px, 8.4vw, 96px);
  line-height: 1.35;
  letter-spacing: .04em;
}
.hero__lead { margin-top: 28px; color: var(--ink-sub); font-size: 15px; }
/* 画面下にのぞく卓球台 */
.hero__table {
  position: absolute; left: 50%; bottom: -60px;
  width: min(130vw, 1200px); height: 220px;
  translate: -50% 0;
  background: var(--green);
  border-radius: 10px;
  box-shadow: inset 0 0 0 4px var(--white);
  transform: perspective(900px) rotateX(55deg);
  transform-origin: bottom;
}
.hero__table.fade { transform: perspective(900px) rotateX(55deg) translateY(40px); }
.hero__table.fade.is-in { transform: perspective(900px) rotateX(55deg); }
.hero__table-line { position: absolute; left: 0; right: 0; top: 50%; height: 3px; background: var(--white); opacity: .8; }
.hero__table-net { position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; background: var(--white); translate: -50% 0; }

/* ---------- 流れる文字 ---------- */
.marquee {
  background: var(--ink); color: var(--bg);
  overflow: hidden;
  padding: 14px 0;
}
.marquee__track {
  display: flex; align-items: center; gap: 36px;
  width: max-content;
  animation: marquee 30s linear infinite;
  font-family: var(--font-en);
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.2;
  white-space: nowrap;
}
.marquee__track em { color: var(--orange); }
.marquee__track i { width: 14px; height: 14px; border-radius: 50%; background: var(--orange); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 見出し ---------- */
.sec-title { display: flex; flex-direction: column; gap: 4px; margin-bottom: clamp(40px, 7vw, 72px); }
.sec-title__en { font-family: var(--font-en); font-size: clamp(40px, 7vw, 72px); line-height: 1.1; }
.sec-title__ja { font-size: 13px; letter-spacing: .24em; color: var(--ink-sub); display: flex; align-items: center; gap: 10px; }
.sec-title__ja::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }

/* スクロールで浮かび上がる */
.fade { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.fade.is-in { opacity: 1; transform: none; }

.about, .point, .flow, .qa { padding: clamp(96px, 13vw, 160px) var(--gutter); }
.about > *, .point > *, .flow > *, .qa > * { max-width: 1080px; margin-left: auto; margin-right: auto; }

/* ---------- About ---------- */
.about__text { font-size: clamp(17px, 2.2vw, 21px); line-height: 2.2; font-weight: 500; }

/* =========================================================
   アニメーション2：ラリー（約2秒）
   ========================================================= */
.rally {
  position: relative;
  height: 200px;
  margin-top: 64px !important;
  max-width: 640px !important;
}
.rally__floor { position: absolute; left: 12%; right: 12%; bottom: 36px; height: 3px; background: var(--green); border-radius: 2px; }
.rally__paddle {
  position: absolute; bottom: 40px;
  width: 56px; height: 64px;
  border-radius: 50% 50% 46% 46%;
  background: #C0392B;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.15);
  transform-origin: 50% 110%;
}
.rally__paddle::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  width: 14px; height: 34px; translate: -50% -4px;
  background: #8A5A34; border-radius: 3px;
}
.rally__paddle--l { left: 0; transform: rotate(-20deg); }
.rally__paddle--r { right: 0; transform: rotate(20deg); background: var(--ink); }
.rally__ball { left: 58px; bottom: 90px; }

/* 1往復＝約2秒。画面に入ったら、ずっとラリーを続ける */
.rally.is-in .rally__ball { animation: rallyX 2s linear infinite, rallyY 2s infinite; }
.rally.is-in .rally__paddle--l { animation: hitL 2s ease-in-out infinite; }
.rally.is-in .rally__paddle--r { animation: hitR 2s ease-in-out infinite; }
@keyframes rallyX {
  0%   { left: 58px; }
  50%  { left: calc(100% - 80px); }
  100% { left: 58px; }
}
/* 往復の途中で1回ずつ台に弾む */
@keyframes rallyY {
  0%   { transform: translateY(0); animation-timing-function: cubic-bezier(.3,0,.7,1); }
  25%  { transform: translateY(54px); animation-timing-function: cubic-bezier(.3,0,.7,1); }
  50%  { transform: translateY(0); animation-timing-function: cubic-bezier(.3,0,.7,1); }
  75%  { transform: translateY(54px); animation-timing-function: cubic-bezier(.3,0,.7,1); }
  100% { transform: translateY(0); }
}
/* 左：ボールが戻ってくる瞬間（0%＝100%）に打ち返す */
@keyframes hitL {
  0%, 100% { transform: rotate(18deg); }
  14%, 86% { transform: rotate(-20deg); }
}
/* 右：ボールが届く瞬間（50%）に打ち返す */
@keyframes hitR {
  0%, 36%, 64%, 100% { transform: rotate(20deg); }
  50% { transform: rotate(-18deg); }
}
.rally__caption { margin-top: 8px !important; text-align: center; color: var(--ink-sub); }

/* ---------- Point ---------- */
.point { background: var(--bg-2); }
.point__list { display: grid; gap: 20px; }
.point__item {
  background: var(--white);
  border-radius: 24px;
  padding: 36px 28px;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease), opacity 1.1s var(--ease);
}
.point__item:hover { transform: translateY(-4px); box-shadow: 0 16px 40px -20px rgba(0,0,0,.25); }
.point__num { font-family: var(--font-en); font-size: 18px; color: var(--ink-sub); }
.point__num span { font-family: var(--font-num); font-weight: 800; font-size: 44px; color: var(--orange); margin-left: 4px; }
.point__item h3 { font-size: clamp(17px, 1.7vw, 20px); letter-spacing: .02em; font-weight: 700; margin: 8px 0 10px; }
.point__item p:not(.point__num) { color: var(--ink-sub); font-size: 14px; }
@media (min-width: 900px) {
  .point__list { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .point__item:nth-child(2) { transition-delay: .1s; }
  .point__item:nth-child(3) { transition-delay: .2s; }
}

/* =========================================================
   アニメーション3：スコアボード（約2秒）
   ========================================================= */
.score {
  background: var(--green); color: var(--white);
  padding: clamp(96px, 13vw, 160px) var(--gutter);
  text-align: center;
}
.score__board {
  display: inline-flex; align-items: center; gap: clamp(12px, 3vw, 28px);
  padding: 24px clamp(16px, 4vw, 40px);
  background: #11291F;
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px rgba(251,248,242,.12);
}
.score__label { font-family: var(--font-en); font-size: 15px; color: rgba(251,248,242,.7); margin-bottom: 8px; }
.score__digits { display: flex; gap: 6px; perspective: 400px; }
.flip {
  display: grid; place-items: center;
  width: clamp(54px, 12vw, 96px); height: clamp(78px, 17vw, 136px);
  background: #1B1B1B;
  border-radius: 8px;
  font-family: var(--font-num); font-weight: 800;
  font-size: clamp(56px, 12vw, 104px); line-height: 1;
  color: var(--white);
  position: relative;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.flip::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(0,0,0,.6); }
.flip.is-flip { animation: flip .18s ease-out; }
@keyframes flip { 0% { transform: rotateX(80deg); filter: brightness(.6); } 100% { transform: none; } }
.score__colon { font-family: var(--font-num); font-size: clamp(48px, 9vw, 80px); color: var(--orange); margin-top: 28px; }
.score__board.is-done .score__side:first-child .flip { color: var(--orange); }
.score__text { margin-top: 40px; font-size: clamp(18px, 2.4vw, 22px); font-weight: 500; line-height: 2; }

/* ---------- Flow ---------- */
.flow__list { list-style: none; display: grid; gap: 16px; }
.flow__step {
  display: grid; grid-template-columns: auto 1fr; column-gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.flow__step:last-child { border-bottom: 1px solid var(--line); }
.flow__num { grid-row: span 2; font-family: var(--font-num); font-weight: 800; font-size: 56px; line-height: 1; color: var(--green); }
.flow__step h3 { font-size: 19px; font-weight: 700; }
.flow__step p { color: var(--ink-sub); font-size: 14px; }
@media (min-width: 900px) {
  .flow__list { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .flow__step { border-bottom: 1px solid var(--line); }
}

/* ---------- Q&A ---------- */
.qa { background: var(--bg-2); }
.qa__list { border-top: 1px solid var(--line); max-width: 820px !important; }
.qa__item { border-bottom: 1px solid var(--line); }
.qa__item summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 22px 44px 22px 40px;
  font-weight: 500; font-size: 16px;
}
.qa__item summary::-webkit-details-marker { display: none; }
.qa__item summary::before { content: "Q"; position: absolute; left: 4px; top: 18px; font-family: var(--font-en); font-size: 22px; color: var(--orange); }
.qa__item summary::after {
  content: ""; position: absolute; right: 10px; top: 50%;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange);
  translate: 0 -50%;
  transition: transform .5s var(--ease);
}
.qa__item[open] summary::after { transform: scale(.6); }
.qa__item p { padding: 0 20px 26px 40px; color: var(--ink-sub); font-size: 14px; }

/* =========================================================
   アニメーション4：予約（約2秒）ボールが落ちてボタンで弾む
   ========================================================= */
.reserve {
  padding: clamp(110px, 15vw, 190px) var(--gutter) clamp(120px, 15vw, 190px);
  text-align: center;
  background: var(--ink); color: var(--bg);
}
.reserve__en { font-family: var(--font-en); font-size: clamp(20px, 3vw, 28px); color: var(--orange); margin-bottom: 10px; }
.reserve__title { font-size: clamp(30px, 6vw, 60px); font-weight: 700; line-height: 1.45; margin-bottom: 24px; }
.reserve__lead { color: rgba(243,238,228,.7); margin-bottom: 20px; }
.reserve__stage { position: relative; display: inline-block; padding-top: 150px; }
.reserve__ball { left: 50%; top: 0; margin-left: -11px; opacity: 0; }
.reserve__stage.is-in .reserve__ball { animation: dropBall 2s forwards; }
.reserve__stage.is-in .btn { animation: squash 2s forwards; }
/* 落ちる → ボタンで2回弾む → 横へ転がって消える */
@keyframes dropBall {
  0%   { opacity: 1; transform: translate(0, 0); animation-timing-function: cubic-bezier(.5,0,1,1); }
  30%  { transform: translate(0, 118px); animation-timing-function: cubic-bezier(0,0,.5,1); }
  52%  { transform: translate(40px, 50px); animation-timing-function: cubic-bezier(.5,0,1,1); }
  70%  { transform: translate(80px, 118px); animation-timing-function: cubic-bezier(0,0,.5,1); }
  84%  { opacity: 1; transform: translate(120px, 90px); animation-timing-function: cubic-bezier(.5,0,1,1); }
  100% { opacity: 0; transform: translate(170px, 200px); }
}
@keyframes squash {
  0%, 28% { transform: none; }
  32% { transform: scale(1.08, .88); }
  40% { transform: scale(.96, 1.05); }
  48%, 68% { transform: none; }
  72% { transform: scale(1.04, .94); }
  80%, 100% { transform: none; }
}
.btn {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 20px 40px;
  border-radius: 999px;
  background: var(--orange); color: var(--white);
  font-size: 16px; font-weight: 700; letter-spacing: .1em;
  transition: background .5s var(--ease), box-shadow .5s var(--ease);
}
.btn:hover { background: #F28E47; box-shadow: 0 0 0 8px rgba(238,122,43,.25); }
.btn__arrow { transition: transform .5s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(5px); }

/* ---------- フッター ---------- */
.footer { padding: 64px var(--gutter) 120px; text-align: center; }
.footer__logo { font-family: var(--font-en); font-size: clamp(40px, 9vw, 80px); line-height: 1.1; margin-bottom: 18px; }
.footer__info { font-size: 13px; color: var(--ink-sub); margin-bottom: 28px; }
.footer__copy { font-family: var(--font-en); color: var(--ink-sub); }

/* ---------- 常に表示するInstagram予約ボタン ---------- */
.ig-float {
  position: fixed; z-index: 60;
  left: 16px; right: 16px; bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 24px;
  border-radius: 999px;
  background: var(--green); color: var(--white);
  font-size: 15px; font-weight: 700; letter-spacing: .1em;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  transition: background .5s var(--ease), transform .5s var(--ease);
}
.ig-float:hover { background: var(--orange); transform: translateY(-2px); }
.ig-float__icon { width: 20px; height: 20px; flex-shrink: 0; }
@media (min-width: 900px) {
  .ig-float { left: auto; right: var(--gutter); top: 12px; bottom: auto; padding: 10px 22px; font-size: 14px; }
}

/* Instagram未設定のときのお知らせ */
.toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 70;
  translate: -50% 0;
  width: max-content; max-width: calc(100% - 32px);
  padding: 10px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 13px;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.toast.is-show { opacity: 1; transform: none; }
@media (min-width: 900px) { .toast { bottom: auto; top: 70px; left: auto; right: var(--gutter); translate: none; } }

/* ---------- 動きを減らす設定の人には止める ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade { opacity: 1 !important; transform: none !important; }
  .opening { display: none; }
}
