:root {
  --night: #010812;
  --sky-mid: #062631;
  --sky-deep: #020b14;
  --red: #cf2d2d;
  --red-dark: #941e26;
  --gold: #edc66c;
  --gold-bright: #ffe3a0;
  --cream: #fff6df;
  --paper: #fffaf0;
  --ink: #32151c;
  --green: #315f3b;
  --shadow: 0 22px 60px rgb(0 5 12 / 52%);
  --display: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif;
  --sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--night);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--cream);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 48% -8%, rgb(13 117 124 / 34%) 0, transparent 39rem),
    linear-gradient(180deg, var(--night) 0%, var(--sky-mid) 48%, var(--sky-deep) 100%);
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.night-sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 12% 18%, rgb(19 145 129 / 10%), transparent 37%),
    radial-gradient(ellipse at 88% 38%, rgb(44 148 177 / 10%), transparent 34%);
}

.night-sky::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image:
    radial-gradient(circle, #fff 1px, transparent 1.5px),
    radial-gradient(circle, var(--gold) 1px, transparent 1.5px);
  background-position: 17px 24px, 71px 62px;
  background-size: 96px 96px, 121px 121px;
  z-index: 2;
}

.aurora {
  position: absolute;
  left: -35vw;
  top: -8vh;
  z-index: 1;
  width: 170vw;
  height: 48vh;
  border-radius: 42% 58% 48% 52%;
  opacity: .58;
  filter: blur(20px) saturate(1.35);
  background:
    linear-gradient(108deg, transparent 8%, rgb(88 255 163 / 10%) 18%, rgb(74 255 186 / 78%) 27%, rgb(80 238 221 / 62%) 35%, rgb(96 204 246 / 42%) 43%, transparent 55%, rgb(125 255 198 / 48%) 68%, transparent 81%);
  mix-blend-mode: screen;
  clip-path: polygon(0 20%, 12% 8%, 27% 32%, 42% 13%, 57% 38%, 73% 16%, 89% 34%, 100% 20%, 100% 77%, 86% 64%, 70% 84%, 52% 58%, 35% 79%, 18% 56%, 0 72%);
  transform: skewY(-7deg) translate3d(0, 0, 0);
  animation: aurora-drift 14s ease-in-out infinite alternate;
}
.aurora-two {
  top: 17vh;
  left: -46vw;
  width: 190vw;
  height: 42vh;
  opacity: .4;
  filter: blur(24px) saturate(1.45);
  background: linear-gradient(98deg, transparent 7%, rgb(78 255 173 / 66%) 25%, rgb(54 213 208 / 54%) 34%, transparent 47%, rgb(83 190 235 / 58%) 62%, rgb(106 246 219 / 42%) 72%, transparent 88%);
  clip-path: polygon(0 34%, 13% 14%, 27% 39%, 43% 19%, 59% 43%, 74% 17%, 89% 37%, 100% 24%, 100% 70%, 84% 57%, 69% 78%, 51% 55%, 34% 75%, 17% 53%, 0 72%);
  animation: aurora-drift-two 18s ease-in-out infinite alternate;
}
.aurora-three {
  top: 46vh;
  left: -30vw;
  width: 165vw;
  height: 35vh;
  opacity: .27;
  filter: blur(28px) saturate(1.35);
  background: linear-gradient(104deg, transparent 11%, rgb(79 255 172 / 58%) 28%, rgb(76 231 218 / 44%) 39%, transparent 52%, rgb(87 210 239 / 48%) 68%, transparent 86%);
  clip-path: polygon(0 40%, 16% 17%, 33% 45%, 49% 19%, 65% 43%, 82% 20%, 100% 40%, 100% 75%, 81% 58%, 64% 80%, 47% 56%, 30% 77%, 14% 55%, 0 71%);
  animation: aurora-drift-three 22s ease-in-out infinite alternate;
}

.star { position: absolute; z-index: 3; color: var(--gold-bright); opacity: .7; animation: twinkle 2.6s ease-in-out infinite; }
.s1 { top: 12%; left: 8%; }
.s2 { top: 25%; right: 8%; animation-delay: -.7s; }
.s3 { top: 48%; left: 5%; animation-delay: -1.3s; }
.s4 { top: 61%; right: 6%; animation-delay: -.4s; }
.s5 { top: 78%; left: 12%; animation-delay: -1.8s; }
.s6 { top: 91%; right: 15%; animation-delay: -1s; }

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: min(100% - 20px, 720px);
  min-height: 207px;
  margin: 0 auto;
  padding-top: max(14px, env(safe-area-inset-top));
}

.brand { display: inline-flex; align-items: center; min-height: 175px; margin: 18px auto 0; }
.brand img { display: block; width: 160px; height: 175px; object-fit: contain; filter: drop-shadow(0 9px 16px rgb(0 0 0 / 42%)); }

.header-actions { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 0; display: flex; gap: 8px; }
.round-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 48px;
  height: 44px;
  padding: 0 11px;
  border: 1px solid rgb(255 227 160 / 46%);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgb(1 14 23 / 78%);
  box-shadow: inset 0 1px rgb(255 255 255 / 12%);
  cursor: pointer;
}
.round-control[aria-pressed="true"] { color: var(--night); background: var(--gold); border-color: var(--gold); }
.control-text { font-size: .63rem; font-weight: 800; letter-spacing: .05em; }

main, footer { position: relative; z-index: 1; }

.en-sub {
  display: block;
  margin-top: .32rem;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .025em;
  line-height: 1.45;
  opacity: .7;
  text-transform: none;
}

.festival {
  width: min(100% - 24px, 650px);
  margin: 0 auto;
  padding: 4px 0 34px;
  text-align: center;
}

.lantern-line {
  display: grid;
  grid-template-columns: 1fr 36px 1fr 36px 1fr 36px 1fr;
  align-items: start;
  max-width: 520px;
  height: 52px;
  margin: 2px auto 12px;
}
.lantern-line i { height: 1px; margin-top: 9px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.lantern-line span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 42px;
  border: 1px solid #ffb370;
  border-radius: 5px 5px 11px 11px;
  color: #fff1c8;
  font-family: var(--display);
  font-weight: 900;
  background: linear-gradient(90deg, #b81f29, #ee4d30 48%, #a71928);
  box-shadow: 0 0 18px rgb(255 104 45 / 48%);
  transform-origin: top;
  animation: lantern-sway 3.2s ease-in-out infinite alternate;
}
.lantern-line span:nth-of-type(2) { animation-delay: -.7s; }
.lantern-line span:nth-of-type(3) { animation-delay: -1.3s; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-bright);
  font-size: clamp(.68rem, 2.7vw, .82rem);
  font-weight: 800;
  letter-spacing: .12em;
}
.eyebrow .en-sub { color: var(--cream); letter-spacing: .025em; }

h1 { margin: 0; font-family: var(--display); line-height: 1.05; text-shadow: 0 4px 18px rgb(0 0 0 / 32%); }
h1 span { display: block; color: var(--cream); font-size: clamp(1.2rem, 5vw, 1.7rem); letter-spacing: .08em; }
h1 strong {
  display: block;
  margin-top: 5px;
  color: var(--gold-bright);
  font-size: clamp(2.55rem, 12vw, 5rem);
  letter-spacing: .035em;
  background: linear-gradient(180deg, #fff8d7 5%, #ffd77a 46%, #c88a2c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.title-en {
  display: block;
  margin-top: .45rem;
  color: rgb(255 246 223 / 74%);
  font-family: var(--sans);
  font-size: clamp(.78rem, 3vw, .95rem);
  font-weight: 700;
  letter-spacing: .08em;
  -webkit-text-fill-color: currentColor;
}

.lead {
  max-width: 520px;
  margin: 15px auto 20px;
  color: rgb(255 246 223 / 88%);
  font-size: clamp(.88rem, 3.4vw, 1rem);
  font-weight: 650;
  line-height: 1.75;
}
.lead .en-sub { max-width: 430px; margin-inline: auto; color: var(--cream); }

.festival-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(112px, .9fr) minmax(148px, 1.1fr);
  align-items: end;
  min-height: 410px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid var(--gold);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgb(30 172 161 / 13%), transparent 58%),
    radial-gradient(circle at 58% 35%, #0d4a58 0, #062832 60%, #020d16 100%);
  box-shadow: var(--shadow), inset 0 0 0 5px rgb(255 255 255 / 4%);
  transition: opacity .35s, transform .35s;
}
.festival-stage::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 75px;
  z-index: -1;
  opacity: .68;
  background: repeating-linear-gradient(90deg, #8d182b 0 25px, #c73530 25px 50px, #f6d28a 50px 54px);
  clip-path: polygon(0 22%, 5% 3%, 10% 22%, 15% 3%, 20% 22%, 25% 3%, 30% 22%, 35% 3%, 40% 22%, 45% 3%, 50% 22%, 55% 3%, 60% 22%, 65% 3%, 70% 22%, 75% 3%, 80% 22%, 85% 3%, 90% 22%, 95% 3%, 100% 22%, 100% 100%, 0 100%);
}
.festival-stage.is-leaving { opacity: 0; transform: translateY(-14px) scale(.97); }

.sunburst {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 410px;
  aspect-ratio: 1;
  z-index: -2;
  opacity: .22;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, var(--gold) 0 8deg, transparent 8deg 18deg);
  mask-image: radial-gradient(circle, #000 0 47%, transparent 70%);
  animation: rotate-slow 30s linear infinite;
}

.mascot-wrap { position: relative; align-self: end; z-index: 3; min-width: 0; padding: 44px 0 45px 4px; transform-origin: bottom center; }
.mascot-wrap.is-cheering { animation: mascot-hop .55s cubic-bezier(.2,.8,.3,1); }
.mascot-wrap.is-grand-cheer { animation: mascot-grand-cheer 1.02s cubic-bezier(.2,.8,.25,1); }
.mascot-wrap.is-grand-cheer .mascot { animation: mascot-golden-glow 1.02s ease-out; }
.mascot { display: block; width: min(120%, 230px); max-width: none; max-height: 295px; margin: 0 0 0 -7%; object-fit: contain; filter: drop-shadow(0 12px 8px rgb(0 0 0 / 28%)); }

.speech-bubble {
  position: absolute;
  top: 12px;
  left: 20%;
  z-index: 2;
  min-width: 86px;
  padding: 9px 12px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  color: var(--ink);
  font-weight: 900;
  background: var(--paper);
  box-shadow: 4px 5px 0 rgb(50 21 28 / 35%);
  transform: rotate(-4deg);
}
.speech-bubble > span { display: block; }
.speech-bubble small { display: block; margin-top: 2px; font-family: var(--sans); font-size: .75rem; font-weight: 750; opacity: .62; }
.speech-bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -10px;
  width: 14px;
  height: 14px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  transform: rotate(45deg);
}

.draw-zone { align-self: center; position: relative; z-index: 4; padding: 26px 14px 52px 0; }
.omikuji-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(142px, 42vw, 220px);
  aspect-ratio: .78;
  margin: 0 auto;
  overflow: hidden;
  border: 4px solid #6e0d20;
  border-radius: 9px 9px 20px 20px;
  color: var(--cream);
  background:
    linear-gradient(90deg, rgb(255 255 255 / 8%), transparent 24% 76%, rgb(0 0 0 / 12%)),
    linear-gradient(155deg, #f24a36, #bc1e2e 55%, #8e1226);
  box-shadow: 0 18px 25px rgb(10 0 8 / 38%), inset 0 0 0 3px #f58f62, inset 0 -16px 30px rgb(80 3 16 / 28%);
  cursor: pointer;
  transform: rotate(2deg);
  transition: filter .2s, transform .2s;
  touch-action: manipulation;
}
.omikuji-box:hover { filter: brightness(1.08); transform: rotate(0) translateY(-3px); }
.omikuji-box:active { transform: rotate(-2deg) translateY(3px) scale(.97); }
.omikuji-box.is-tapped { animation: box-shake .46s cubic-bezier(.36,.07,.19,.97); }
.omikuji-box.is-drawing { animation: box-draw .72s cubic-bezier(.36,.07,.19,.97) both; pointer-events: none; }

.box-rope { position: absolute; inset: 15px auto 15px 18px; width: 6px; border-radius: 4px; background: repeating-linear-gradient(0deg, #f7d47f 0 7px, #7c391f 7px 11px); box-shadow: 0 0 0 1px rgb(70 10 18 / 30%); }
.box-shine { position: absolute; top: -20%; right: 8%; width: 28%; height: 140%; opacity: .18; background: #fff; transform: rotate(14deg); }
.box-emblem {
  display: grid;
  place-items: center;
  width: 62px;
  aspect-ratio: 1;
  margin-bottom: 8px;
  border: 2px solid var(--gold-bright);
  border-radius: 50%;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 4px rgb(255 227 160 / 16%);
}
.box-title { writing-mode: vertical-rl; color: #fff8dc; font-family: var(--display); font-size: clamp(1.5rem, 6vw, 2.1rem); font-weight: 900; letter-spacing: .16em; }
.box-english { margin-top: 6px; color: rgb(255 246 223 / 78%); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.box-brand { margin-top: 10px; color: var(--gold-bright); font-size: .58rem; font-weight: 900; letter-spacing: .15em; }
.tap-ripple { position: absolute; inset: 50% auto auto 50%; width: 20px; aspect-ratio: 1; border: 3px solid #fff; border-radius: 50%; opacity: 0; transform: translate(-50%, -50%); }
.omikuji-box.is-tapped .tap-ripple { animation: ripple .46s ease-out; }

.tap-progress { display: flex; flex-direction: column; align-items: center; margin-top: 14px; }
.tap-progress strong { color: #fff5d6; font-size: .88rem; letter-spacing: .03em; }
.tap-progress strong > small { display: block; margin-top: 3px; color: rgb(255 246 223 / 62%); font-size: .72rem; font-weight: 650; letter-spacing: .02em; }
#tapCount { display: block; margin-top: 5px; color: rgb(255 246 223 / 70%); font-size: .75rem; }
#tapCount span { display: block; }
#tapCountEn { margin-top: 1px; font-size: .72rem; opacity: .72; }
.tap-pips { display: flex; gap: 7px; margin-bottom: 7px; }
.tap-pips span { width: 13px; height: 13px; border: 2px solid var(--gold); border-radius: 50%; background: transparent; transition: transform .2s, background .2s; }
.tap-pips span.is-filled { background: var(--gold-bright); transform: scale(1.2); box-shadow: 0 0 10px var(--gold); }

.fortune-card {
  position: relative;
  display: none;
  max-width: 560px;
  margin: 18px auto 0;
  padding: 38px clamp(22px, 7vw, 52px) 34px;
  overflow: visible;
  color: var(--ink);
  text-align: center;
  background:
    linear-gradient(90deg, rgb(130 83 44 / 7%), transparent 12% 88%, rgb(130 83 44 / 7%)),
    radial-gradient(circle at 20% 30%, rgb(160 108 48 / 7%) 0 1px, transparent 2px),
    var(--paper);
  background-size: auto, 17px 17px, auto;
  border: 1px solid #d8b670;
  border-radius: 4px;
  box-shadow: var(--shadow), inset 0 0 40px rgb(173 115 45 / 8%);
  outline: none;
}
.fortune-card::before, .fortune-card::after { content: ""; position: absolute; left: -10px; right: -10px; height: 22px; border: 1px solid #c49c52; background: linear-gradient(180deg, #fff9ea, #ead8ac); box-shadow: 0 4px 8px rgb(31 8 18 / 16%); }
.fortune-card::before { top: -12px; border-radius: 50% 50% 3px 3px; }
.fortune-card::after { bottom: -12px; border-radius: 3px 3px 50% 50%; }
.fortune-card.is-visible { z-index: 101; display: block; animation: scroll-open .78s cubic-bezier(.2,.8,.25,1) both; }
.paper-cord { position: absolute; top: -18px; left: 50%; width: 120px; height: 7px; z-index: 3; border-radius: 50%; background: repeating-linear-gradient(90deg, var(--red-dark) 0 8px, #fff 8px 14px); transform: translateX(-50%); }
.fortune-topline { display: flex; align-items: center; justify-content: space-between; color: #8b6339; font-family: var(--display); font-size: .8rem; font-weight: 700; }
.fortune-topline > span:first-child > span, .fortune-topline small { display: block; }
.fortune-topline small { margin-top: 2px; font-family: var(--sans); font-size: .72rem; font-weight: 650; opacity: .66; }
.fortune-seal { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-weight: 900; transform: rotate(-8deg); }
.fortune-grade { margin: 12px 0 2px; color: var(--red); font-family: var(--display); font-size: clamp(3.6rem, 18vw, 6.2rem); font-weight: 900; letter-spacing: .08em; line-height: 1; text-shadow: 2px 3px 0 #f1d4ae; }
.fortune-grade > span { display: block; }
.fortune-grade small { display: block; margin-top: .55rem; color: #8f4a3f; font-family: var(--sans); font-size: .82rem; font-weight: 800; letter-spacing: .08em; line-height: 1.3; text-shadow: none; }
.fortune-ribbon { display: inline-block; margin: 15px 0 10px; padding: 5px 18px; color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .12em; background: var(--red-dark); clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%); }
.fortune-kicker-en { margin: -5px 0 14px; color: #956d4b; font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
.fortune-card h2 { margin: 0; color: var(--ink); font-family: var(--display); font-size: clamp(1.5rem, 7vw, 2.1rem); }
.fortune-card h2 > span, .fortune-card h2 small { display: block; }
.fortune-card h2 small { margin-top: .4rem; color: #805d50; font-family: var(--sans); font-size: .78rem; font-weight: 750; letter-spacing: .03em; }
.fortune-message { margin: 13px auto 20px; font-family: var(--display); font-size: 1rem; font-weight: 650; line-height: 1.9; }
.fortune-message > span, .fortune-message small { display: block; }
.fortune-message small { margin: .55rem auto 0; color: #785d55; font-family: var(--sans); font-size: .76rem; font-weight: 600; line-height: 1.55; }
.lucky-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid #ddc89d; border-radius: 10px; background: #ddc89d; }
.lucky-grid div { padding: 12px 7px; background: rgb(255 255 255 / 58%); }
.lucky-grid > div > span { display: block; color: #8b6339; font-size: .72rem; font-weight: 800; letter-spacing: .05em; }
.lucky-grid > div > span small { display: block; margin-top: 2px; font-size: .72rem; opacity: .64; }
.lucky-grid strong { display: block; margin-top: 7px; color: var(--red-dark); font-size: .88rem; }
.lucky-grid strong > span, .lucky-grid strong small { display: block; }
.lucky-grid strong small { margin-top: 3px; color: #865e54; font-size: .72rem; font-weight: 650; }
.fortune-action { display: flex; align-items: center; gap: 12px; margin: 14px 0 20px; padding: 13px 15px; border-left: 4px solid var(--green); color: var(--ink); text-align: left; background: #eef3e7; }
.fortune-action > span { color: var(--green); font-size: 1.4rem; }
.fortune-action strong { display: block; margin-top: 3px; font-size: .86rem; }
.fortune-action div > small { display: block; color: #8b6339; font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.fortune-action div > small span { display: block; margin-top: 2px; font-size: .72rem; opacity: .64; }
.fortune-action strong > span, .fortune-action strong small { display: block; }
.fortune-action strong small { margin-top: 4px; color: #5f735d; font-size: .72rem; font-weight: 650; }
.result-actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 9px; }
.result-actions button { min-height: 50px; border-radius: 999px; font-weight: 850; cursor: pointer; }
.result-actions button > span:last-child { display: block; }
.result-actions button small { display: block; margin-top: 1px; font-size: .72rem; font-weight: 700; opacity: .72; }
.primary-action { border: 2px solid var(--red-dark); color: #fff; background: var(--red-dark); box-shadow: 0 6px 0 #591322; }
.secondary-action { border: 2px solid #a67c45; color: #6b4528; background: transparent; }
.result-actions button:active { transform: translateY(3px); box-shadow: none; }
.share-status { min-height: 1em; margin: 12px 0 0; color: var(--green); font-size: .76rem; font-weight: 750; }

.tiny-note { margin: 24px 0 0; color: rgb(255 246 223 / 68%); font-size: .76rem; }
.tiny-note .en-sub { font-size: .72rem; }

.how-it-counts {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  width: min(100% - 36px, 600px);
  margin: 0 auto 36px;
  padding: 17px;
  border: 1px solid rgb(255 227 160 / 25%);
  border-radius: 16px;
  color: rgb(255 246 223 / 74%);
  background: rgb(1 14 23 / 54%);
  text-align: left;
}
.mini-leaf { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); }
.how-it-counts h2 { margin: 0 0 7px; color: var(--gold-bright); font-size: .82rem; }
.how-it-counts h2 small, .how-it-counts p small { display: block; margin-top: 3px; font-family: var(--sans); font-size: .72rem; font-weight: 600; line-height: 1.5; opacity: .68; }
.how-it-counts p { margin: 0; font-size: .76rem; line-height: 1.65; }

footer { display: flex; align-items: center; justify-content: center; min-height: 212px; padding: 27px 16px 34px; border-top: 1px solid rgb(255 227 160 / 18%); color: var(--cream); font-family: var(--display); font-size: .72rem; background: rgb(1 10 18 / 72%); }
.footer-link {
  display: block;
  width: min(100%, 430px);
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  transition: filter .2s, transform .2s;
}
.footer-link:hover, .footer-link:focus-visible { filter: brightness(1.1); transform: translateY(-2px); outline: none; }
.footer-link:focus-visible { outline: 3px solid rgb(255 255 255 / 90%); outline-offset: 4px; }
.footer-link:active { filter: brightness(.96); transform: translateY(5px); }
.footer-brand-row { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 13px; }
.footer-link img { width: 86px; height: 70px; object-fit: contain; filter: drop-shadow(0 4px 5px rgb(0 0 0 / 38%)); }
.footer-copy { min-width: 0; }
.footer-copy > span, .footer-copy > small { display: block; }
.footer-copy > span { color: var(--cream); font-size: .82rem; font-weight: 800; line-height: 1.35; }
.footer-copy > small { margin-top: 3px; color: rgb(255 246 223 / 74%); font-family: var(--sans); font-size: .72rem; font-weight: 650; line-height: 1.35; }
.footer-button { display: grid; grid-template-columns: 1fr 46px; align-items: center; min-height: 66px; overflow: hidden; border: 2px solid var(--gold-bright); border-radius: 999px; color: #fffaf0; background: linear-gradient(180deg, #c62b36, #981a28); box-shadow: 0 7px 0 #5a1019, 0 13px 28px rgb(0 0 0 / 38%), 0 0 22px rgb(255 210 96 / 20%), inset 0 1px rgb(255 255 255 / 22%); font-family: var(--sans); text-align: center; }
.footer-button strong { display: block; padding: 10px 8px 9px 22px; font-size: 1rem; font-weight: 950; letter-spacing: .04em; line-height: 1.2; text-shadow: 0 2px rgb(75 7 15 / 60%); }
.footer-button strong small { display: block; margin-top: 4px; color: var(--gold-bright); font-size: .76rem; font-weight: 900; letter-spacing: .11em; }
.footer-arrow { display: grid; place-items: center; width: 46px; height: 100%; border-left: 1px solid rgb(255 227 160 / 46%); color: var(--gold-bright); background: rgb(70 4 15 / 24%); font-size: 1.45rem; font-weight: 950; }

.effects-layer { position: fixed; inset: 0; z-index: 100; overflow: hidden; pointer-events: none; }
.confetti {
  position: absolute;
  top: -12vh;
  width: 12px;
  height: 18px;
  border-radius: 70% 10% 70% 10%;
  animation: confetti-fall var(--fall, 1.8s) cubic-bezier(.25,.65,.5,1) forwards;
}
.celebration-ring { position: absolute; left: 50%; top: 45%; width: 25px; aspect-ratio: 1; border: 4px solid var(--gold-bright); border-radius: 50%; transform: translate(-50%, -50%); animation: ring-pop .85s ease-out forwards; }
.firework { position: absolute; width: 2px; height: 2px; }
.firework::after { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #fff4bd; box-shadow: 0 0 18px 7px rgb(255 215 122 / 70%); animation: firework-core .65s ease-out forwards; }
.firework-spark { position: absolute; left: 0; top: 0; width: 4px; height: 13px; border-radius: 999px; box-shadow: 0 0 9px currentColor; transform-origin: center; animation: firework-spark .92s cubic-bezier(.16,.7,.3,1) var(--spark-delay, 0s) forwards; }
.golden-leaf-reveal {
  position: fixed;
  z-index: 105;
  font-size: clamp(3.2rem, 16vw, 6.6rem);
  line-height: 1;
  opacity: 0;
  filter: sepia(1) saturate(2.2) hue-rotate(349deg) brightness(1.32) drop-shadow(0 0 9px #fff1a8) drop-shadow(0 0 28px #f2b641);
  transform: translate(-50%, -50%) scale(.2) rotate(-25deg);
  animation: golden-leaf-rise 1.18s cubic-bezier(.16,.78,.22,1) forwards;
}
.touch-sparkle {
  position: fixed;
  z-index: 104;
  color: var(--gold-bright);
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 8px #fff4c7, 0 0 16px #eebd4f;
  transform: translate(-50%, -50%) scale(.25);
  animation: touch-sparkle-pop .72s ease-out forwards;
}
.touch-sparkle.is-leaf {
  font-size: 1rem;
  filter: sepia(1) saturate(1.9) brightness(1.2);
}

@keyframes twinkle { 0%,100% { opacity: .25; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.25); } }
@keyframes aurora-drift { 0% { transform: skewY(-8deg) translate3d(-5vw, -1vh, 0) scaleY(.92); } 50% { transform: skewY(4deg) translate3d(4vw, 4vh, 0) scaleY(1.12); } 100% { transform: skewY(-3deg) translate3d(10vw, -2vh, 0) scaleY(.98); } }
@keyframes aurora-drift-two { 0% { transform: skewY(7deg) translate3d(8vw, 1vh, 0) scaleX(.9); } 50% { transform: skewY(-5deg) translate3d(-2vw, -3vh, 0) scaleX(1.08); } 100% { transform: skewY(3deg) translate3d(-10vw, 5vh, 0) scaleX(.96); } }
@keyframes aurora-drift-three { 0% { transform: skewY(-4deg) translate3d(-8vw, 2vh, 0) scaleX(.94); } 50% { transform: skewY(6deg) translate3d(3vw, -2vh, 0) scaleX(1.06); } 100% { transform: skewY(-2deg) translate3d(9vw, 3vh, 0) scaleX(.98); } }
@keyframes lantern-sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes rotate-slow { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes mascot-hop { 0%,100% { transform: translateY(0) rotate(0); } 36% { transform: translateY(-18px) rotate(-3deg); } 65% { transform: translateY(0) rotate(3deg); } }
@keyframes mascot-grand-cheer { 0%,100% { transform: translateY(0) rotate(0) scale(1); } 25% { transform: translateY(-28px) rotate(-5deg) scale(1.05); } 48% { transform: translateY(-17px) rotate(6deg) scale(1.09); } 72% { transform: translateY(-25px) rotate(-3deg) scale(1.06); } }
@keyframes mascot-golden-glow { 0%,100% { filter: drop-shadow(0 12px 8px rgb(0 0 0 / 28%)); } 45% { filter: drop-shadow(0 12px 8px rgb(0 0 0 / 28%)) drop-shadow(0 0 17px #ffe38a) brightness(1.18); } }
@keyframes box-shake { 0%,100% { transform: rotate(2deg); } 20% { transform: rotate(-7deg) translateX(-5px); } 40% { transform: rotate(8deg) translateX(5px); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(5deg); } }
@keyframes box-draw { 0% { transform: rotate(2deg) scale(1); } 25% { transform: rotate(-10deg) scale(1.04); } 50% { transform: rotate(11deg) scale(1.08); filter: brightness(1.35); } 75% { transform: rotate(-7deg) scale(1.04); } 100% { transform: rotate(0) scale(.92); opacity: .3; } }
@keyframes ripple { from { width: 20px; opacity: .8; } to { width: 180px; opacity: 0; } }
@keyframes scroll-open { from { opacity: 0; transform: translateY(-18px) scaleY(.18); transform-origin: center top; } 45% { opacity: 1; } to { transform: translateY(0) scaleY(1); } }
@keyframes confetti-fall { 0% { transform: translate3d(0,0,0) rotate(0); opacity: 1; } 100% { transform: translate3d(var(--drift, 0), 115vh, 0) rotate(620deg); opacity: .1; } }
@keyframes ring-pop { from { width: 25px; opacity: 1; } to { width: min(120vw, 620px); opacity: 0; } }
@keyframes firework-spark { 0% { opacity: 1; transform: translate(0, 0) scaleY(.35); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--spark-x), var(--spark-y)) scaleY(.8) rotate(160deg); } }
@keyframes firework-core { from { opacity: 1; transform: scale(.35); } to { opacity: 0; transform: scale(2.3); } }
@keyframes golden-leaf-rise { 0% { opacity: 0; transform: translate(-50%, -15%) scale(.2) rotate(-25deg); } 16% { opacity: 1; } 58% { opacity: 1; transform: translate(-50%, -128px) scale(1.2) rotate(215deg); } 82% { opacity: 1; transform: translate(-50%, -174px) scale(1.75) rotate(322deg); } 100% { opacity: 0; transform: translate(-50%, -205px) scale(2.6) rotate(390deg); } }
@keyframes touch-sparkle-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--sparkle-x)), calc(-50% + var(--sparkle-y))) scale(1.15) rotate(var(--sparkle-rotate)); } }

@media (max-width: 365px) {
  .topbar { min-height: 240px; }
  .brand { min-height: 164px; margin-top: 58px; }
  .brand img { width: 150px; height: 164px; }
  .festival { width: min(100% - 16px, 650px); }
  .festival-stage { grid-template-columns: 42% 58%; min-height: 380px; }
  .mascot-wrap { padding-left: 0; }
  .draw-zone { padding-right: 8px; }
  .omikuji-box { width: 138px; }
  .speech-bubble { left: 6%; font-size: .78rem; }
  .result-actions { grid-template-columns: 1fr; }
  footer { padding-inline: 10px; }
  .footer-brand-row { gap: 10px; }
  .footer-link img { width: 72px; height: 62px; }
  .footer-copy > span { font-size: .7rem; }
  .footer-copy > small { font-size: .64rem; }
  .footer-button { grid-template-columns: 1fr 42px; }
  .footer-button strong { padding-left: 10px; font-size: .9rem; }
  .footer-button strong small { font-size: .7rem; }
  .footer-arrow { width: 42px; }
}

@media (min-width: 600px) {
  .topbar { min-height: 225px; }
  .brand { min-height: 197px; margin-top: 12px; }
  .brand img { width: 180px; height: 197px; }
  .festival-stage { min-height: 470px; }
  .mascot { width: 255px; max-height: 350px; margin-left: -4%; }
  .mascot-wrap { padding-bottom: 52px; }
  .draw-zone { padding-right: 34px; }
  .star { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
