@charset "UTF-8";
/* ==========================================================================
   berry.css — キャラクター（ベリーくん／ベリー本体）と、かけら5つ集め
   全ページ共通（404 を除く）。header.php の $useBerry で読み込み
   並び：かけらの置き場所 → 右下のキャラクター → 吹き出し → 5つそろったときの演出 → メニューのRESET → 動きを減らす設定
   各ブロックの中で「ベース → 768px以下 → 480px以下」
   ========================================================================== */

/* ---------- かけらの置き場所（.piece-spot の位置は各ページのCSS） ---------- */
.piece-spot { z-index: 3; }
.piece-spot svg { overflow: visible; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
/* ときどき、ほんの少しだけ光る（見つけられるけれど目立たない程度） */
.piece-spot::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  background:
    linear-gradient(var(--c-accent), var(--c-accent)) center / 1px 100% no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) center / 100% 1px no-repeat;
  opacity: 0;
  transform: scale(.2) rotate(0deg);
  pointer-events: none;
  animation: piece-glint 7s ease-in-out infinite;
  animation-delay: var(--glint-delay, 2s);
}
@keyframes piece-glint {
  0%, 88%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); }
  93% { opacity: .9; transform: scale(1) rotate(45deg); }
}
@media (hover: hover) {
  .piece-spot:hover svg { transform: rotate(18deg) scale(1.5); }
}
.piece-spot.is-found { pointer-events: none; }
.piece-spot.is-found svg { transform: rotate(200deg) scale(2.4); opacity: 0; transition: transform .5s ease, opacity .4s ease; }
.piece-spot.is-found::after { animation: none; }
.piece-spot[hidden] { display: none; }

/* 飛んでいくかけら（見つけた場所 → キャラクターのバッジ） */
.piece-fly {
  position: fixed;
  left: 0; top: 0;
  z-index: 35;
  width: 14px; height: 19px;
  pointer-events: none;
}

/* ---------- 右下のキャラクター ---------- */
.berry {
  --edge: 28px;
  position: fixed;
  right: var(--edge);
  bottom: var(--edge);
  z-index: 30;                       /* メニュー（40）の下 */
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  transform: translateY(calc(100% + var(--edge) + 20px));
  transition: transform .7s cubic-bezier(.3, 1.4, .5, 1), opacity .4s ease;
}
.berry.is-shown { transform: none; }
.berry.is-tucked { transform: translateY(calc(100% + var(--edge) + 20px)); }   /* フッターが見えたら下に隠れる */
.berry[hidden] { display: none; }
.berry > * { pointer-events: auto; }

.berry__body {
  position: relative;
  flex: none;
  width: 64px;
  height: 79px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.berry__float { display: block; width: 100%; height: 100%; animation: berry-bob 2.4s ease-in-out infinite; }
@keyframes berry-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.berry__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.berry__body.is-hop .berry__svg { animation: berry-hop .45s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes berry-hop {
  0%   { transform: translateY(0) rotate(0); }
  40%  { transform: translateY(-18px) rotate(-12deg); }
  100% { transform: translateY(0) rotate(0); }
}
.berry__body:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 4px; border-radius: 8px; }

/* ベリーくんの顔：まばたき・うれしい顔 */
.berry__eyes { transform-box: fill-box; transform-origin: center; animation: berry-blink 3.4s infinite; }
@keyframes berry-blink {
  0%, 95%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(.1); }
}
.berry__happy, .berry__mouth--happy { display: none; }
.is-happy .berry__eyes, .is-happy .berry__mouth--normal { display: none; }
.is-happy .berry__happy, .is-happy .berry__mouth--happy { display: inline; }
.berry__shadow { transition: rx .6s ease; }

/* ベリー本体（5つそろったあと） */
.berry.is-honmono .berry__body { width: 96px; height: 138px; }

/* バッジ「n/5」 */
.berry__badge {
  position: absolute;
  right: -8px; top: -10px;
  padding: 3px 7px;
  background: var(--c-bg);
  color: var(--c-accent);
  border: 1px solid var(--c-accent);
  border-radius: 999px;
  font: 700 11px/1.2 var(--font-en);
  letter-spacing: .04em;
  transition: transform .4s cubic-bezier(.3, 1.8, .5, 1);
}
.berry__badge.is-pop { transform: scale(1.35); }
.berry.is-honmono .berry__badge { display: none; }

/* ---------- 吹き出し ---------- */
.berry__bubble {
  position: relative;
  max-width: 300px;
  margin-bottom: 30px;
  transform-origin: right bottom;
  transform: scale(.6);
  opacity: 0;
  visibility: hidden;
  transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), opacity .25s ease, visibility 0s .35s;
}
.berry__bubble.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.berry.is-honmono .berry__bubble { margin-bottom: 70px; }
.berry__say {
  padding: 14px 18px 10px;
  background: var(--c-text);
  color: var(--c-bg);
  border-radius: 16px 16px 4px 16px;
  font: 500 14px/1.75 var(--font-ja);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.berry__line { min-height: 1.75em; margin: 0; }
.berry__caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--c-bg); animation: berry-caret 1s steps(1) infinite; }
.berry__say.is-done .berry__caret { display: none; }
@keyframes berry-caret { 50% { opacity: 0; } }
.berry__card { position: relative; }
.berry__tail { position: absolute; right: -6px; bottom: 0; width: 14px; height: 14px; background: var(--c-text); clip-path: polygon(0 0, 100% 100%, 0 100%); }
.berry__meta { display: flex; justify-content: space-between; gap: 16px; margin: 6px 0 0; font: 500 10px/1.4 var(--font-en); letter-spacing: .14em; color: var(--c-mute); }
.berry__close {
  position: absolute;
  right: -16px; top: -22px;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.berry__close span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #2A2A2F; color: var(--c-text); font-size: 12px; transition: background-color .2s, color .2s; }
@media (hover: hover) {
  .berry__close:hover span { background: var(--c-accent); color: var(--c-on-accent); }
}

@media (max-width: 768px) {
  .berry { --edge: 16px; }
  .berry__body { width: 52px; height: 64px; }
  .berry.is-honmono .berry__body { width: 72px; height: 104px; }
  .berry__bubble { max-width: 230px; margin-bottom: 24px; }
  .berry.is-honmono .berry__bubble { margin-bottom: 52px; }
  .berry__say { font-size: 13px; padding: 12px 15px 9px; }
}
@media (max-width: 480px) {
  .berry__bubble { max-width: calc(100vw - 52px - 16px * 2 - 10px); }
  .berry.is-honmono .berry__bubble { max-width: calc(100vw - 72px - 16px * 2 - 10px); }
}

/* ---------- 5つそろったときの演出 ---------- */
.berry-done {
  position: fixed;
  inset: 0;
  z-index: 97;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(13, 13, 15, .9);
  opacity: 0;
  transition: opacity .4s ease;
}
.berry-done.is-open { opacity: 1; }
.berry-done__skip {
  position: absolute;
  right: var(--m); top: 24px;
  min-height: 44px;
  padding: 0 16px;
  background: none;
  color: var(--c-gray);
  border: 1px solid var(--c-line-2);
  font: 500 12px/1 var(--font-en);
  letter-spacing: .16em;
  cursor: pointer;
}
.berry-done__stage { position: relative; display: flex; flex-direction: column; align-items: center; }
.berry-done__label {
  margin: 0 0 20px;
  font: 700 12px/1 var(--font-en);
  letter-spacing: .3em;
  color: var(--c-accent);
  opacity: 0;
  transition: opacity .4s ease;
}
.berry-done__label.is-on { opacity: 1; }
.berry-done__logo { width: clamp(140px, 22vw, 220px); height: auto; overflow: visible; color: var(--c-text); transition: transform .8s cubic-bezier(.3, 1.3, .5, 1), width .8s cubic-bezier(.3, 1.3, .5, 1); }
.berry-done__ring { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.8) rotate(-40deg); transition: opacity .6s ease, transform .9s var(--ease-out); }
.berry-done__logo.is-ring .berry-done__ring { opacity: 1; transform: none; }
.berry-done__piece { fill: var(--c-accent); transform-box: fill-box; transform-origin: center; opacity: 0; }
.berry-done__flash {
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--c-accent);
  opacity: 0;
  pointer-events: none;
}
.berry-done.is-small .berry-done__logo { width: clamp(64px, 8vw, 88px); }
.berry-done__who { position: relative; display: flex; flex-direction: column; align-items: center; }
.berry-done__chara {
  position: relative;
  width: clamp(140px, 20vw, 220px);
  aspect-ratio: 160 / 230;
  margin-top: 12px;
  opacity: 0;
  transform: translateY(60px) scale(.6);
  transition: transform .7s cubic-bezier(.3, 1.6, .5, 1), opacity .3s ease;
}
.berry-done__chara.is-on { opacity: 1; transform: none; }
.berry-done__chara svg { width: 100%; height: 100%; overflow: visible; }
.berry-done__bubble {
  position: absolute;
  left: calc(50% + clamp(46px, 6.4vw, 70px)); top: 6%;
  width: max-content;
  max-width: 260px;
  margin: 0;
  padding: 14px 18px;
  background: var(--c-text);
  color: var(--c-bg);
  border-radius: 16px 16px 16px 4px;
  font: 700 15px/1.7 var(--font-ja);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  transform-origin: left bottom;
  transform: scale(.6);
  opacity: 0;
  transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), opacity .25s ease;
}
.berry-done__bubble.is-on { transform: none; opacity: 1; }
.berry-done__close {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  margin-top: 28px;
  padding: 0 28px;
  background: var(--c-accent);
  color: var(--c-on-accent);
  border: 0;
  font: 700 15px/1 var(--font-ja);
  letter-spacing: .08em;
  cursor: pointer;
  opacity: 0;
  transition: opacity .4s ease, transform .3s var(--ease-out);
}
.berry-done__close span { transition: transform .4s var(--ease-out); }
@media (hover: hover) {
  .berry-done__close:hover span { transform: translateX(6px); }
}
.berry-done__close:focus-visible, .berry-done__skip:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 4px; }
.berry-done__close.is-on { opacity: 1; }
.berry-done__confetti { position: absolute; inset: 0; pointer-events: none; }
.berry-done__confetti svg { position: absolute; top: -40px; width: 16px; height: 22px; }

@media (max-width: 768px) {
  .berry-done__bubble { position: relative; left: auto; top: auto; margin-top: 4px; max-width: 240px; font-size: 14px; text-align: center; transform-origin: center top; border-radius: 16px; }
  .berry-done__close { margin-top: 20px; }
}

/* ---------- メニューの RESET ---------- */
.site-menu__reset {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 14px;
  background: none;
  color: var(--c-mute);
  border: 1px dashed var(--c-line-2);
  font: 500 11px/1 var(--font-en);
  letter-spacing: .16em;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.site-menu__reset[hidden] { display: none; }
.site-menu__reset-count { color: var(--c-accent); }
.site-menu__reset.is-confirm { color: var(--c-text); border-color: var(--c-accent); border-style: solid; }
@media (hover: hover) {
  .site-menu__reset:hover { color: var(--c-text); border-color: var(--c-accent); }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  .piece-spot::after, .berry__float, .berry__eyes { animation: none; }
}
