/* ════════════════════════════════════════════════════════════════════
   金ピカ DOGE クーポン ＋ 浮遊演出  —  全22言語ページ共通で読込
   ・流れ星のように飛ぶ DOGE の「2回に1回」を金ピカ版にすり替える(日本語のみ)。
   ・出現タイミング/軌道は共有 app.js と同じ(8s 後→10s ごと)。
   ・金ピカをタップした時だけ、時間帯に応じたクーポンを表示する。
   ・浮遊演出: 金ピカは毎回必ず0.7倍速＋途中5秒浮遊。通常DOGEは浮遊しない。
   ・波動(リング等)は全廃。金ピカの浮遊中(.is-pausing)だけ、周りの星(✦)が
     ギラギラ輝く(s1〜s3強化＋増援s4/s5出現)。
   ・DOGEは常に1匹だけ(consecutive: 消えてから次を起動)。
   ・共有 app.js / style.css は無改変。CSP: 'self' のみ・インライン不使用。
   ════════════════════════════════════════════════════════════════════ */

/* 元 doge-rocket.png を金色に gild する共通フィルター */
:root { --gd-gild: sepia(1) saturate(2.25) brightness(1.16) contrast(.97) hue-rotate(-6deg); }

/* 全ページで app.js の流れ星 DOGE を隠し、本ファイルの DOGE に置き換える */
.doge-star { display: none !important; }

/* ── 流れ星 DOGE（通常）: .doge-star を忠実に再現 ─────────────────── */
.gd-fly {
  position: fixed; left: 0; top: 0;
  width: 88px; height: auto;
  pointer-events: none; z-index: 60;
  opacity: 0; will-change: transform, opacity;
  filter: drop-shadow(0 3px 7px rgba(80,40,10,.3));
}
/* DOGE 本体ラッパー: 傾き/反転(rotate/scaleX)はここに掛ける。吹き出しは外側なので無回転。 */
.gd-fly__body { position: relative; width: 100%; }
.gd-fly img { width: 100%; height: auto; display: block; -webkit-user-drag: none; }

/* ── 金ピカ版: gild ＋ 金色グロー ＋ 光沢 ＋ キラ ＋ タップ可 ──────── */
.gd-fly.is-gold {
  width: 100px;
  pointer-events: auto; cursor: pointer; z-index: 61;
  filter: none;
  -webkit-tap-highlight-color: transparent;
}
.gd-fly.is-gold img {
  filter: var(--gd-gild) drop-shadow(0 0 7px rgba(255,200,60,.8));
  animation: gdGlow 1.4s ease-in-out infinite;
}
.gd-fly__glow {
  position: absolute; left: 50%; top: 50%;
  width: 150px; height: 150px; margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,96,.55) 0%, rgba(255,190,40,.22) 45%, transparent 70%);
  filter: blur(2px); pointer-events: none;
  animation: gdHalo 1.6s ease-in-out infinite;
}
.gd-fly__glint {
  position: absolute; inset: 0;
  background: linear-gradient(115deg,
              transparent 36%, rgba(255,255,255,.85) 47%,
              rgba(255,249,212,.98) 50%, rgba(255,255,255,.85) 53%, transparent 64%);
  background-size: 250% 100%; background-position: 180% 0;
  -webkit-mask-image: url("doge-rocket.png");        mask-image: url("doge-rocket.png");
  -webkit-mask-size: contain;     mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center;  mask-position: center;
  mix-blend-mode: screen; pointer-events: none;
  animation: gdGlint 1.8s ease-in-out infinite;
}
.gd-fly__spark {
  position: absolute; font-size: 13px; line-height: 1;
  color: #fff4b0; text-shadow: 0 0 6px #ffcf4d, 0 0 12px #ffb020;
  opacity: 0; pointer-events: none;
  animation: gdSpark 1.4s ease-in-out infinite;
}
.gd-fly__spark.s1 { left: -6px; top:  0;   animation-delay: 0s; }
.gd-fly__spark.s2 { left: 86px; top: 30px; animation-delay: .5s; }
.gd-fly__spark.s3 { left: 40px; top: -10px; animation-delay: .9s; }
/* 増援の星: 普段は完全に不可視。金ピカの浮遊中だけギラギラ隊に加わる */
.gd-fly__spark.s4 { left: -14px; top: 44px; animation: none; opacity: 0; }
.gd-fly__spark.s5 { left: 96px;  top: -8px; animation: none; opacity: 0; }

/* 飛行中の金ピカに付く「タップでクーポン」吹き出し。body の外＝回転を受けないので常に水平。 */
.gd-fly__tag {
  position: absolute; left: 50%; top: 100%;
  transform: translate(-50%, 8px);
  white-space: nowrap;
  background: linear-gradient(180deg,#ffffff,#fff3d2);
  color: #a35f0e; font-weight: 800; font-size: 11px; letter-spacing: .01em;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid #f0cf78;
  box-shadow: 0 3px 9px rgba(150,90,10,.32);
  pointer-events: none;
  animation: gdTagPulse 1s ease-in-out infinite;
}
.gd-fly__tag::after {
  content: ''; position: absolute; left: 50%; top: -4px;
  width: 8px; height: 8px;
  background: #ffffff; border-left: 1px solid #f0cf78; border-top: 1px solid #f0cf78;
  transform: translateX(-50%) rotate(45deg);
}
@keyframes gdTagPulse { 0%,100% { box-shadow: 0 3px 9px rgba(150,90,10,.32); } 50% { box-shadow: 0 3px 9px rgba(150,90,10,.32), 0 0 0 4px rgba(255,205,90,.35); } }

@keyframes gdGlow {
  0%,100% { filter: var(--gd-gild) drop-shadow(0 0 6px rgba(255,205,70,.75)); }
  50%     { filter: var(--gd-gild) drop-shadow(0 0 13px rgba(255,228,128,.95)) brightness(1.2); }
}
@keyframes gdHalo {
  0%,100% { transform: scale(.9);  opacity: .5; }
  50%     { transform: scale(1.1); opacity: .9; }
}
@keyframes gdGlint {
  0%   { background-position: 180% 0; }
  55%  { background-position: -80% 0; }
  100% { background-position: -80% 0; }
}
@keyframes gdSpark {
  0%,100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  45%     { opacity: 1; transform: scale(1) rotate(35deg); }
}

/* ── 浮遊中(1回目＋3の倍数回)の本体: ふわふわ上下(通常/金ピカ共通) ── */
.gd-fly.is-pausing img {
  animation: gdBob 1.6s ease-in-out infinite;
}
/* 金ピカは通常時の金グロー(gdGlow)を維持したまま、ふわふわを追加 */
.gd-fly.is-gold.is-pausing img {
  animation: gdGlow 1.4s ease-in-out infinite, gdBob 1.6s ease-in-out infinite;
}
@keyframes gdBob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-7px); }
}

/* ── 金ピカ浮遊中: 周りの星がギラギラ輝く(波動は無し) ─────────────
   常設のs1〜s3を強化し、増援s4/s5も出現。大きく・明るく・速く明滅し、
   位相をずらして常にどれかが光っている状態にする。 */
.gd-fly.is-gold.is-pausing .gd-fly__spark {
  font-size: 21px;
  color: #fff7cf;
  text-shadow: 0 0 6px #ffe27a, 0 0 14px #ffc23e, 0 0 26px #ff9d00;
  opacity: 0;
  animation: gdGira .55s ease-in-out infinite;
}
.gd-fly.is-gold.is-pausing .gd-fly__spark.s2 { animation-delay: .11s; }
.gd-fly.is-gold.is-pausing .gd-fly__spark.s3 { animation-delay: .22s; }
.gd-fly.is-gold.is-pausing .gd-fly__spark.s4 { animation-delay: .33s; }
.gd-fly.is-gold.is-pausing .gd-fly__spark.s5 { animation-delay: .44s; }
@keyframes gdGira {
  0%,100% { opacity: .35; transform: scale(.55) rotate(-14deg); filter: brightness(1); }
  50%     { opacity: 1;   transform: scale(1.5)  rotate(16deg); filter: brightness(1.65); }
}

/* ── クーポン表示モーダル ──────────────────────────────────────── */
.gd-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(40,22,4,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; animation: gdFade .25s ease forwards;
}
.gd-card {
  position: relative; width: min(366px,92vw);
  /* overflow-x hidden: 左右DOGEのハロー拡縮で横スクロールバーが出入りして
     カードの高さ(=外枠)が周期的に15px動くのを防ぐ。縦は従来どおりauto。 */
  max-height: 92vh; overflow-y: auto; overflow-x: hidden;
  background: linear-gradient(180deg,#fffaf0,#fff2d8);
  border: 1px solid #eccb7e; border-radius: 20px;
  padding: 26px 22px 22px; text-align: center;
  box-shadow: 0 24px 60px rgba(80,45,5,.42);
  transform: translateY(10px) scale(.96);
  animation: gdPop .34s cubic-bezier(.2,1.3,.4,1) .04s forwards;
}
.gd-close {
  position: absolute; top: 8px; right: 10px;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: 0;
  font-size: 22px; line-height: 1; color: #b08534; cursor: pointer;
}
.gd-close:hover { color: #8a5a12; }
/* 割引名〜価格のブロックを金ピカDOGEで左右対称に挟む(右は鏡像で内向き)。
   DOGEは左右の余白を一杯に使うよう伸縮し、ブロック全体の中央に縦位置を合わせる。
   見た目は飛んでいるキラキラ金ピカと同一: gild＋脈打つグロー(gdGlow/gdHalo)
   ＋光沢スイープ(gdGlint)＋キラ星(gdSpark)。 */
.gd-hero { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 0; }
.gd-hero__center { flex: 0 1 auto; min-width: 0; }
.gd-flankbox {
  position: relative; flex: 1 1 0; min-width: 40px; max-width: 104px;
  align-self: center; pointer-events: none;
}
.gd-flankbox--r { transform: scaleX(-1); }   /* 鏡像: 星/光沢ごと反転 */
.gd-flankbox img {
  width: 100%; height: auto; display: block; aspect-ratio: 240 / 177;
  -webkit-user-drag: none;
  filter: var(--gd-gild) drop-shadow(0 0 7px rgba(255,200,60,.8));
  /* キラキラ(gdGlow)＋浮遊のふわふわ(gdBob)。 */
  animation: gdGlow 1.4s ease-in-out infinite, gdBob 2.2s ease-in-out infinite;
}
/* 右のDOGEは浮遊の位相を半周期ずらし、左右が交互にふわふわする */
.gd-flankbox--r img { animation-delay: 0s, 1.1s; }
.gd-flankbox__glow {
  position: absolute; left: 50%; top: 50%;
  /* 124%: gdHaloの最大scale(1.1)でも約136%=カード余白(22px)内に収まり、
     はみ出しによるスクロールバー出現もグローの視覚的な切れも起きない */
  width: 124%; aspect-ratio: 1 / 1; margin: -62% 0 0 -62%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,96,.55) 0%, rgba(255,190,40,.22) 45%, transparent 70%);
  filter: blur(2px);
  animation: gdHalo 1.6s ease-in-out infinite;
}
.gd-flankbox__glint {
  position: absolute; inset: 0;
  background: linear-gradient(115deg,
              transparent 36%, rgba(255,255,255,.85) 47%,
              rgba(255,249,212,.98) 50%, rgba(255,255,255,.85) 53%, transparent 64%);
  background-size: 250% 100%; background-position: 180% 0;
  -webkit-mask-image: url("doge-rocket.png");        mask-image: url("doge-rocket.png");
  -webkit-mask-size: contain;     mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center;  mask-position: center;
  mix-blend-mode: screen;
  animation: gdGlint 1.8s ease-in-out infinite;
}
.gd-flankbox__spark {
  position: absolute; font-size: 13px; line-height: 1;
  color: #fff4b0; text-shadow: 0 0 6px #ffcf4d, 0 0 12px #ffb020;
  opacity: 0;
  animation: gdSpark 1.4s ease-in-out infinite;
}
.gd-flankbox__spark.s1 { left: -8%; top: 0;    animation-delay: 0s; }
.gd-flankbox__spark.s2 { left: 88%; top: 38%;  animation-delay: .5s; }
.gd-flankbox__spark.s3 { left: 40%; top: -14%; animation-delay: .9s; }

.gd-name {
  display: inline-block; margin: 0;
  padding: 6px 18px; border-radius: 999px;
  background: linear-gradient(180deg,#fbd66a,#e8a92e);
  color: #5a3a06; font-weight: 800; font-size: 15px; letter-spacing: .04em;
  box-shadow: 0 3px 8px rgba(180,120,20,.35), inset 0 1px 0 rgba(255,255,255,.5);
}
.gd-off { margin-top: 12px; font-size: 34px; font-weight: 900; color: #d9881a; line-height: 1; }
.gd-off small { font-size: 18px; font-weight: 800; margin-left: 3px; }
.gd-price { margin-top: 6px; font-size: 13px; color: #9a7c4e; }
.gd-price b { color: #c0791a; }

/* 当日限定バナー(日付つき): 重要な制限なのでコーラルで目立たせる */
.gd-today {
  margin: 14px 0 2px; padding: 8px 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  background: #fbeee8; border: 1px solid #f0b9a3; border-radius: 10px;
}
.gd-today__tag {
  background: #d85a30; color: #fff;
  font-weight: 800; font-size: 12px; letter-spacing: .04em;
  padding: 3px 11px; border-radius: 999px; white-space: nowrap;
}
.gd-today__date { color: #993c1d; font-weight: 700; font-size: 13px; }

.gd-rows { margin: 16px 4px 0; text-align: left; }
.gd-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 2px; border-top: 1px dashed #e6cd95; font-size: 13px;
}
.gd-row .l { color: #a9803a; font-weight: 700; white-space: nowrap; }
.gd-row .v { color: #5b4520; text-align: right; }

.gd-use {
  margin: 16px 0 4px; padding: 12px 14px;
  border-radius: 12px; background: #fff7e4; border: 1px solid #f0dca6; text-align: left;
}
.gd-use .h { font-size: 12px; font-weight: 800; color: #b07f24; letter-spacing: .06em; }
.gd-use p { margin: 6px 0 0; font-size: 12.5px; color: #7a5e2c; line-height: 1.65; }
.gd-usenote { margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed #ecd9a8;
  font-size: 11.5px; color: #8a6a3a; line-height: 1.6; }
.gd-codeline { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.gd-codeline .code {
  flex: 1; padding: 9px 12px; border-radius: 8px;
  background: repeating-linear-gradient(135deg,#fff,#fff 7px,#fdf0d2 7px,#fdf0d2 14px);
  border: 1px dashed #d9b262; font-weight: 800; color: #9a6a1a; font-size: 14px;
  text-align: center; letter-spacing: .03em;
}
.gd-copy {
  flex: 0 0 auto; padding: 9px 13px; border: 0; border-radius: 8px;
  background: #eab94e; color: #5a3a06; font-weight: 800; font-size: 12px; cursor: pointer;
}
.gd-copy:hover { filter: brightness(1.05); }

.gd-book {
  margin-top: 16px; display: block; padding: 13px 0;
  border-radius: 999px; text-decoration: none; text-align: center;
  background: linear-gradient(180deg,#f5b13d,#e0911f);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .03em;
  box-shadow: 0 6px 16px rgba(200,130,20,.4);
}
.gd-book:hover { filter: brightness(1.05); }
.gd-foot { margin-top: 10px; font-size: 11px; color: #a78b5e; line-height: 1.6; }

@keyframes gdFade { to { opacity: 1; } }
@keyframes gdPop  { to { transform: translateY(0) scale(1); } }

/* ── スマホはスクロール無しで収まるように余白/サイズを圧縮 ───────── */
@media (max-width: 480px) {
  .gd-modal { padding: 10px; }
  .gd-card { padding: 16px 16px 14px; max-height: 95vh; border-radius: 16px; }
  .gd-hero { gap: 6px; margin: 2px 0 0; }
  .gd-flankbox { min-width: 36px; max-width: 84px; }
  .gd-name { font-size: 14px; padding: 5px 15px; margin: 0; }
  .gd-off { font-size: 29px; margin-top: 7px; }
  .gd-off small { font-size: 15px; }
  .gd-price { font-size: 12.5px; margin-top: 3px; }
  .gd-today { margin: 9px 0 0; padding: 6px 10px; gap: 6px; }
  .gd-today__tag { font-size: 11.5px; padding: 2px 9px; }
  .gd-today__date { font-size: 12.5px; }
  .gd-rows { margin-top: 8px; }
  .gd-row { padding: 6px 2px; font-size: 12.5px; }
  .gd-use { margin: 10px 0 0; padding: 9px 11px; }
  .gd-use .h { font-size: 11.5px; }
  .gd-use p { font-size: 12px; margin-top: 4px; line-height: 1.55; }
  .gd-codeline { margin-top: 7px; }
  .gd-codeline .code { padding: 7px 10px; font-size: 13px; }
  .gd-copy { padding: 7px 11px; }
  .gd-usenote { margin-top: 7px; padding-top: 6px; font-size: 11px; line-height: 1.5; }
  .gd-book { margin-top: 10px; padding: 11px 0; font-size: 14px; }
  .gd-foot { margin-top: 7px; font-size: 10.5px; line-height: 1.5; }
}
