/* スキットル50 Home —— ゼリーの見た目
 *
 * Home(`<body class="home">`)だけに読み込む上乗せ。土台は style.css のまま。
 * 1.1.0 の「ゼリー」スタイル(ToyBean+Looks の `.jelly`: 0.74 で透け・彩度 1.3・
 * 縁の照り・中の泡)を、ページの部品すべてに広げたもの。
 *
 * 決めごとは style.css と同じ:
 * - 色は Theme.swift のトークンだけ(透けは alpha で作り、新しい色相を足さない)
 * - JS もインライン style も無し。動きは CSS の keyframes だけ
 * - 動きを減らす設定では style.css の末尾が animation を全部止める
 */

.home {
  --jelly-radius: 28px;
}

/* ── 背景: 空に浮かぶ泡 ───────────────────── */

.home {
  background:
    radial-gradient(60% 40% at 12% 18%, rgba(255,157,187,.35), transparent 70%),
    radial-gradient(50% 35% at 92% 30%, rgba(255,226,122,.35), transparent 70%),
    radial-gradient(70% 45% at 70% 88%, rgba(143,224,106,.35), transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-hi) 34%, var(--hill-hi) 62%, var(--hill) 100%);
  background-attachment: fixed;
}

.bubbles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bubbles i {
  position: absolute;
  bottom: -80px;
  width: var(--s, 40px);
  height: var(--s, 40px);
  border-radius: 50%;
  /* 泡: 中は透けて、縁が白く、左上に光の点 */
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,.95) 0 9%, transparent 11%),
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(255,255,255,.55) 70%, rgba(255,255,255,.1) 72%);
  box-shadow: inset 0 0 12px rgba(255,255,255,.35);
  animation: rise var(--t, 18s) linear var(--d, 0s) infinite;
  opacity: .75;
}
.bubbles i:nth-child(1)  { left: 4%;  --s: 34px; --t: 19s; --d: -2s; }
.bubbles i:nth-child(2)  { left: 14%; --s: 70px; --t: 26s; --d: -14s; }
.bubbles i:nth-child(3)  { left: 27%; --s: 22px; --t: 15s; --d: -7s; }
.bubbles i:nth-child(4)  { left: 38%; --s: 48px; --t: 23s; --d: -18s; }
.bubbles i:nth-child(5)  { left: 52%; --s: 18px; --t: 13s; --d: -4s; }
.bubbles i:nth-child(6)  { left: 63%; --s: 58px; --t: 24s; --d: -9s; }
.bubbles i:nth-child(7)  { left: 74%; --s: 26px; --t: 17s; --d: -12s; }
.bubbles i:nth-child(8)  { left: 84%; --s: 84px; --t: 30s; --d: -21s; }
.bubbles i:nth-child(9)  { left: 92%; --s: 30px; --t: 16s; --d: -1s; }
.bubbles i:nth-child(10) { left: 46%; --s: 40px; --t: 21s; --d: -16s; }

@keyframes rise {
  0%   { transform: translate(0, 0) scale(1, 1); }
  25%  { transform: translate(14px, -30vh) scale(1.06, .94); }
  50%  { transform: translate(-10px, -60vh) scale(.95, 1.05); }
  75%  { transform: translate(12px, -90vh) scale(1.04, .96); }
  100% { transform: translate(0, -125vh) scale(1, 1); }
}

/* ── ヘッダ: ナビもゼリー粒に ─────────────── */

.home .site-nav a {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,248,238,.7));
  box-shadow: inset 0 -3px 0 rgba(235,217,184,.8), inset 0 1px 0 #fff, 0 4px 10px -4px rgba(30,66,88,.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ── ヒーロー ───────────────────────────── */

.home .hero { padding-top: 34px; }

/* 見出し: 透けたいちごゼリーの文字。上半分に照りを重ねる(data-text の写し) */
.home .hero h1 {
  position: relative;
  display: inline-block;
  color: transparent;
  background: linear-gradient(180deg, var(--coral-hi) 0%, var(--coral) 52%, var(--coral-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  filter:
    drop-shadow(0 3px 0 var(--coral-edge))
    drop-shadow(0 0 1px rgba(255,255,255,.9))
    drop-shadow(0 12px 16px rgba(194,58,102,.4));
  animation: wobble 5.5s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.home .hero h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  background: linear-gradient(180deg, rgba(255,255,255,.9) 0 30%, rgba(255,255,255,0) 46%);
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
}

/* リード文はゼリーの札に載せて、空の上でも読める地を作る */
.home .hero__lede,
.home .hero__sub { text-shadow: none; }
.home .hero__lede {
  display: table;   /* 幅は中身に合わせつつ、見出しの横には並べない */
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,248,238,.66));
  box-shadow: inset 0 1px 0 #fff, inset 0 -4px 0 rgba(235,217,184,.7), 0 10px 20px -12px rgba(30,66,88,.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.home .hero__sub { margin-top: 4px; font-weight: 700; }

/* 場面とスコアバーを載せる透明な台(ゼリーの皿) */
.stage {
  position: relative;
  margin: 26px auto 30px;
  max-width: 720px;
  padding: 10px clamp(10px, 3vw, 28px) 18px;
  border-radius: 40px;
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(255,255,255,.55), transparent 60%),
    linear-gradient(180deg, rgba(255,253,244,.34), rgba(255,253,244,.14));
  border: 2px solid rgba(255,255,255,.7);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.9),
    inset 0 -14px 28px rgba(30,124,156,.18),
    0 22px 40px -22px rgba(30,66,88,.6);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
}
/* 台の左上の照り */
.stage::before {
  content: "";
  position: absolute;
  top: 12px; left: 26px;
  width: 30%; height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.85), rgba(255,255,255,0));
  pointer-events: none;
}
.home .scene { margin: 16px 0 14px; }
.home .thrower { width: clamp(150px, 44vw, 340px); }
/* 狭い画面では皿を左右いっぱいまで広げ、ピンを少し細くして場面を1列に収める */
@media (max-width: 520px) {
  .stage { margin-inline: -12px; padding-inline: 6px; border-radius: 32px; }
  .home .scene { gap: 4px; }
  .home .pins { gap: 5px; }
  .home .pin { width: 33px; height: 68px; }
}
.home .score__scale { margin: 0; }

/* 豆助: 足もとを支点に、ぷるんと揺れ続ける */
.bean-wobble {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: squish 2.6s ease-in-out infinite;
}
.jelly-bubbles { animation: shimmer 3.2s ease-in-out infinite; }

@keyframes squish {
  0%, 100% { transform: scale(1, 1); }
  18%      { transform: scale(1.045, .955); }
  34%      { transform: scale(.975, 1.03); }
  50%      { transform: scale(1.015, .99); }
  64%      { transform: scale(1, 1); }
}
@keyframes wobble {
  0%, 70%, 100% { transform: scale(1, 1); }
  76%           { transform: scale(1.04, .95); }
  84%           { transform: scale(.98, 1.03); }
  92%           { transform: scale(1.01, .99); }
}
@keyframes shimmer {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}

/* ピン: 盤面と同じクリームのまま、照りとぷるぷるだけ足す */
.home .pin {
  box-shadow:
    0 4px 0 rgba(30,66,88,.18),
    0 10px 16px -8px rgba(30,66,88,.5),
    inset -4px -6px 10px rgba(184,158,110,.35),
    inset 3px 3px 0 rgba(255,255,255,.8);
  transform-origin: 50% 100%;
  animation: squish 3s ease-in-out infinite;
}
.home .pin::after { /* 左肩の照り */
  content: "";
  position: absolute;
  top: 7%; left: 20%;
  width: 22%; height: 18%;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  transform: rotate(-18deg);
}
.home .pin:nth-child(2) { animation-delay: -.4s; }
.home .pin:nth-child(3) { animation-delay: -.8s; }
.home .pin:nth-child(4) { animation-delay: -1.2s; }
.home .pin:nth-child(5) { animation-delay: -1.6s; }

/* スコアバー: 溝はガラス、中身はレモンゼリー。泡がゆっくり流れる */
.home .score { margin-bottom: 0; }
.home .score__trough {
  height: 26px;
  padding: 3px;
  background: linear-gradient(180deg, rgba(30,124,156,.85), rgba(23,98,123,.9));
  box-shadow: inset 0 3px 6px rgba(0,0,0,.3), 0 1px 0 rgba(255,255,255,.7);
}
.home .score__fill {
  position: relative;
  background:
    radial-gradient(circle at 12% 60%, rgba(255,255,255,.7) 0 3px, transparent 4px),
    radial-gradient(circle at 37% 40%, rgba(255,255,255,.55) 0 2px, transparent 3px),
    radial-gradient(circle at 63% 65%, rgba(255,255,255,.6) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 88% 45%, rgba(255,255,255,.5) 0 2px, transparent 3px),
    linear-gradient(180deg, var(--sunshine-hi), rgba(255,182,41,.92) 55%, var(--sunshine-lo));
  background-size: 160px 100%, 160px 100%, 160px 100%, 160px 100%, 100% 100%;
  box-shadow: inset 0 -3px 0 rgba(201,126,0,.8), inset 0 2px 0 rgba(255,255,255,.6);
  animation: flow 6s linear infinite;
}
.home .score__fill::after { /* 上面の照り */
  content: "";
  position: absolute;
  left: 10px; right: 10px; top: 3px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
}
@keyframes flow {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 160px 0, 160px 0, 160px 0, 160px 0, 0 0; }
}
.home .score__scale { text-shadow: none; }

/* ── ボタン: 押すとへこむゼリー粒 ──────────── */

.home .gel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 15px 30px;
  background: linear-gradient(180deg, var(--sunshine-hi), rgba(255,182,41,.95) 52%, var(--sunshine-lo));
  box-shadow:
    inset 0 -6px 10px rgba(201,126,0,.45),
    inset 0 0 0 2px rgba(255,255,255,.35),
    0 5px 0 var(--sunshine-edge),
    0 12px 20px -8px rgba(201,126,0,.7);
  transition: transform .12s cubic-bezier(.3,1.8,.5,1), box-shadow .12s ease;
}
.home .gel::before { /* 上半分の照り */
  content: "";
  position: absolute;
  z-index: -1;
  left: 16%; right: 16%; top: 3px;
  height: 34%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0));
}
.home .gel::after { /* 右下の泡 */
  content: "";
  position: absolute;
  z-index: -1;
  right: 16px; bottom: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.75);
}
.home .gel:hover { animation: boing .5s ease-out; }
.home .gel:active {
  animation: none;
  transform: translateY(4px) scale(1.04, .92);
  box-shadow: inset 0 -4px 8px rgba(201,126,0,.45), 0 1px 0 var(--sunshine-edge);
}
.home .gel--sky {
  background: linear-gradient(180deg, var(--sky-hi), rgba(59,184,222,.95) 52%, var(--sky-edge));
  box-shadow:
    inset 0 -6px 10px rgba(23,98,123,.45),
    inset 0 0 0 2px rgba(255,255,255,.3),
    0 5px 0 #17627B,
    0 12px 20px -8px rgba(23,98,123,.7);
  text-shadow: 0 1px 1px rgba(23,98,123,.6);
}
.home .gel--sky:active { box-shadow: inset 0 -4px 8px rgba(23,98,123,.45), 0 1px 0 #17627B; }

@keyframes boing {
  0%   { transform: scale(1, 1); }
  30%  { transform: scale(1.08, .92); }
  55%  { transform: scale(.96, 1.05); }
  78%  { transform: scale(1.02, .98); }
  100% { transform: scale(1, 1); }
}

/* ── カード: すりガラスのゼリー板 ──────────── */

.home .card--coral { --j: var(--coral);    --j-hi: var(--coral-hi);    --j-lo: rgba(240,65,117,.28); }
.home .card--sky   { --j: var(--sky);      --j-hi: var(--sky-hi);      --j-lo: rgba(30,124,156,.26); }
.home .card--lime  { --j: var(--lime);     --j-hi: var(--lime-hi);     --j-lo: rgba(55,158,48,.26); }
.home .card--sun   { --j: var(--sunshine); --j-hi: var(--sunshine-hi); --j-lo: rgba(240,154,12,.28); }

.home .card {
  position: relative;
  border-radius: var(--jelly-radius);
  padding: 32px 28px;
  margin-bottom: 26px;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(255,255,255,.75), transparent 55%),
    linear-gradient(180deg, rgba(255,253,244,.9), rgba(255,248,238,.8));
  border: 2px solid rgba(255,255,255,.85);
  box-shadow:
    inset 0 -8px 0 var(--j-lo, rgba(30,124,156,.2)),
    inset 0 2px 0 #fff,
    0 18px 36px -20px rgba(30,66,88,.65);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}
/* 右上に浮かぶ色つきのゼリー玉(飾り) */
.home .card::before {
  content: "";
  position: absolute;
  top: -16px; right: 22px;
  width: 44px; height: 40px;
  border-radius: 50% 50% 46% 46% / 56% 56% 44% 44%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 12%, transparent 14%),
    radial-gradient(circle at 50% 40%, var(--j-hi, var(--sky-hi)), var(--j, var(--sky)) 75%);
  box-shadow: inset 0 -5px 8px rgba(0,0,0,.12), 0 6px 12px -4px rgba(30,66,88,.45);
  opacity: .92;
  animation: squish 3.4s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.home .card:nth-of-type(2n)::before { right: auto; left: 22px; animation-delay: -1.3s; }

/* 見出しの下線もゼリーの棒に */
.home .card h2::after {
  width: 64px;
  height: 9px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.75) 0 35%, transparent 36%),
    linear-gradient(180deg, var(--j-hi, var(--coral-hi)), var(--j, var(--coral)));
  box-shadow: 0 3px 6px -2px var(--j-lo, rgba(30,66,88,.3));
}

/* ── タイル: 色つきのゼリーブロック ─────────── */

.home .tile--coral, .home .tile--burst { --t: 255,92,138;  --t-edge: var(--coral-lo); }
.home .tile--sky                       { --t: 59,184,222;  --t-edge: var(--sky-edge); }
.home .tile--lime,  .home .tile--win   { --t: 76,190,62;   --t-edge: var(--lime-lo); }
.home .tile--sun                       { --t: 255,182,41;  --t-edge: var(--sunshine-edge); }

.home .tile {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  padding: 20px 20px 18px;
  background:
    radial-gradient(90% 60% at 20% 0%, rgba(255,255,255,.85), transparent 60%),
    linear-gradient(180deg, rgba(var(--t, 59,184,222), .12), rgba(var(--t, 59,184,222), .3));
  box-shadow:
    inset 0 0 0 2px rgba(var(--t, 59,184,222), .35),
    inset 0 -6px 12px rgba(var(--t, 59,184,222), .25),
    inset 0 2px 0 rgba(255,255,255,.9),
    0 8px 16px -10px rgba(var(--t, 59,184,222), .9);
  transition: transform .2s cubic-bezier(.3,1.6,.5,1);
}
/* 中に閉じこめた泡 */
.home .tile::after {
  content: "";
  position: absolute;
  right: 14px; bottom: 12px;
  width: 30px; height: 26px;
  pointer-events: none;
  background:
    radial-gradient(circle at 70% 70%, transparent 5px, rgba(255,255,255,.8) 6px, transparent 7.5px),
    radial-gradient(circle at 18% 22%, transparent 3px, rgba(255,255,255,.7) 4px, transparent 5.5px);
}
.home .tile h3 { color: var(--t-edge, var(--sky-edge)); }
.home .tile:hover { animation: boing .55s ease-out; }

/* ── フッタ ─────────────────────────────── */

.home .site-foot {
  background: linear-gradient(180deg, rgba(255,253,244,.9), rgba(255,248,238,.78));
  border: 2px solid rgba(255,255,255,.85);
  border-radius: var(--jelly-radius);
  box-shadow: inset 0 -6px 0 rgba(76,184,104,.25), inset 0 2px 0 #fff, 0 14px 30px -18px rgba(30,66,88,.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* 動きを減らす設定: 泡は出さない(止まった泡が散らばって見えるだけなので) */
@media (prefers-reduced-motion: reduce) {
  .bubbles { display: none; }
}
