:root {
  --vermilion: #c63a27;
  --vermilion-dark: #7f1f18;
  --ink: #17191b;
  --night: #101a2a;
  --cream: #f7dfab;
  --paper: #f3c982;
  --gold: #f3b928;
  --white: #fff5d6;
  --header-h: 76px;
  --mouse-x: 0;
  --mouse-y: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--night);
  overflow-x: hidden;
}

button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { color: var(--white); background: var(--vermilion); }

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .14;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}

.spirit-cursor {
  position: fixed;
  z-index: 120;
  width: 18px;
  height: 24px;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: 70% 30% 62% 38% / 78% 42% 58% 22%;
  background: radial-gradient(circle at 50% 65%, #fff8c8 0 18%, #f5b524 20% 46%, #e94d25 48% 72%, transparent 74%);
  filter: drop-shadow(0 0 10px #f5b524);
  transform: translate(-50%, -70%) rotate(45deg);
  transition: opacity .2s;
}

body.has-pointer .spirit-cursor { opacity: .75; }

.site-header {
  position: fixed;
  z-index: 50;
  top: 18px;
  left: 50%;
  width: min(1780px, calc(100% - 40px));
  height: var(--header-h);
  padding: 0 18px 0 12px;
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--white);
  background: rgba(24, 22, 20, .87);
  border: 1px solid rgba(255, 242, 203, .28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  transition: background .25s, transform .35s;
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  top: 50%;
  border: 2px solid var(--gold);
  transform: translateY(-50%) rotate(45deg);
}
.site-header::before { left: -6px; }
.site-header::after { right: -6px; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.brand-mark {
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--vermilion);
  border: 2px solid var(--gold);
}
.brand-mark img { width: 100%; height: 115%; object-fit: cover; object-position: 50% 8%; }

.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  position: relative;
  padding: 8px 0;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 1px;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s;
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.social-link,
.ca-button {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 245, 214, .34);
  background: rgba(255, 255, 255, .06);
  color: var(--white);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.social-link { min-width: 44px; padding: 0 13px; }
.ca-button { gap: 9px; padding: 0 16px; color: var(--ink); background: var(--gold); border-color: var(--gold); }
.social-link:hover, .ca-button:hover { background: var(--white); color: var(--ink); transform: translateY(-2px); }
.copy-glyph { font-size: 1rem; }

.scene { position: relative; width: 100%; min-height: 100svh; overflow: hidden; isolation: isolate; }
.hero {
  min-height: 1080px;
  color: var(--ink);
  background: #e67836 url("assets/dawn-shrine.jpg") center / cover no-repeat;
  display: grid;
  grid-template-columns: minmax(510px, .92fr) minmax(560px, 1.08fr);
  align-items: center;
  gap: clamp(20px, 4vw, 90px);
  padding: 130px max(5vw, calc((100vw - 1760px) / 2)) 110px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(255, 223, 158, .62) 0%, rgba(255, 223, 158, .12) 48%, rgba(165, 40, 26, .08) 100%);
}

.hero-copy {
  position: relative;
  z-index: 3;
  width: min(760px, 100%);
  padding: clamp(30px, 3.2vw, 58px);
  background: rgba(247, 223, 171, .88);
  border: 2px solid var(--ink);
  box-shadow: 13px 13px 0 rgba(24, 24, 22, .92);
  clip-path: polygon(0 2%, 98% 0, 100% 96%, 94% 100%, 2% 98%);
}

.hero-copy::after {
  content: "神";
  position: absolute;
  right: 24px;
  top: 14px;
  font-family: Georgia, serif;
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(127, 31, 24, .09);
  transform: rotate(8deg);
}

.eyebrow {
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: .77rem;
  font-weight: 950;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow span { width: 42px; height: 3px; background: var(--vermilion); }
.eyebrow.light { color: var(--gold); }
.eyebrow.light span { background: var(--gold); }

h1 { margin: 0; text-transform: uppercase; line-height: .82; }
.title-small { display: block; margin-bottom: 12px; font-size: clamp(.8rem, 1vw, 1.05rem); letter-spacing: .48em; }
.title-main {
  display: block;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(5rem, 7.2vw, 9rem);
  letter-spacing: .015em;
}
.title-outline {
  color: var(--vermilion);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 5px 5px 0 var(--gold);
}
.hero-intro {
  width: min(590px, 100%);
  margin: 28px 0 30px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1.2vw, 1.32rem);
  line-height: 1.6;
  font-weight: 600;
}

.hero-cta { display: flex; align-items: stretch; flex-wrap: wrap; gap: 12px; }
.brush-button,
.text-button {
  min-height: 56px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .12em;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.brush-button { color: var(--white); background: var(--vermilion); box-shadow: 5px 5px 0 var(--ink); }
.text-button { background: transparent; }
.brush-button:hover, .text-button:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }

.blessing-counter {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 30px;
  color: var(--vermilion-dark);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.counter-number { font-family: Georgia, serif; font-size: 1.85rem; font-weight: 900; color: var(--ink); }

.kami-stage {
  position: relative;
  z-index: 2;
  min-height: 700px;
  height: min(72vh, 780px);
  display: grid;
  place-items: center;
  perspective: 1200px;
}
.sun-seal {
  position: absolute;
  width: min(35vw, 610px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--vermilion);
  border: 7px solid var(--ink);
  box-shadow: 0 0 0 13px rgba(247, 223, 171, .52), 0 30px 70px rgba(78, 20, 15, .24);
  animation: sealPulse 5s ease-in-out infinite;
}
.sun-seal::before,
.sun-seal::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 2px dashed rgba(255, 239, 196, .6);
  border-radius: 50%;
  animation: rotateSeal 35s linear infinite;
}
.sun-seal::after { inset: 17%; animation-direction: reverse; animation-duration: 24s; }
.sun-seal span { color: rgba(255, 242, 203, .18); font-family: serif; font-size: min(17vw, 280px); font-weight: 900; }

.aura { position: absolute; border: 2px solid rgba(255, 221, 129, .7); border-radius: 50%; animation: aura 4s ease-out infinite; }
.aura-one { width: 65%; aspect-ratio: 1; }
.aura-two { width: 78%; aspect-ratio: 1; animation-delay: 2s; }

.character-wrap {
  position: relative;
  z-index: 4;
  width: min(33vw, 610px);
  cursor: pointer;
  outline: none;
  transform-style: preserve-3d;
  transform: translate3d(calc(var(--mouse-x) * 12px), calc(var(--mouse-y) * 8px), 20px) rotateY(calc(var(--mouse-x) * 3deg)) rotateX(calc(var(--mouse-y) * -2deg));
  animation: kamiFloat 4.8s ease-in-out infinite;
  transition: filter .2s;
}
.character-wrap:hover, .character-wrap:focus-visible { filter: drop-shadow(0 0 18px rgba(255, 222, 113, .76)); }
.character-wrap.is-booped { animation: kamiBoop .58s cubic-bezier(.16, .9, .24, 1.4); }
.character-wrap.is-ringing { animation: kamiRing .65s ease; }
.kami-character { width: 100%; filter: drop-shadow(0 32px 20px rgba(54, 24, 16, .32)); }
.bell-glow {
  position: absolute;
  left: 48%;
  top: 52%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 212, 51, .35);
  box-shadow: 0 0 20px 8px rgba(255, 205, 30, .26);
  animation: bellGlow 1.7s ease-in-out infinite;
}
.kami-shadow {
  position: absolute;
  z-index: 1;
  bottom: 5%;
  width: 46%;
  height: 6%;
  border-radius: 50%;
  background: rgba(25, 16, 12, .38);
  filter: blur(12px);
  animation: shadowFloat 4.8s ease-in-out infinite;
}
.tap-hint {
  position: absolute;
  z-index: 6;
  right: 2%;
  bottom: 15%;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .14em;
  transform: rotate(-4deg);
  animation: hintWiggle 3s ease-in-out infinite;
}
.vertical-kanji {
  position: absolute;
  right: -2%;
  top: 16%;
  color: rgba(24, 24, 22, .72);
  font-family: serif;
  font-size: clamp(2rem, 3vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
}

.floating-motes { position: absolute; inset: 0; pointer-events: none; }
.floating-motes i {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--gold);
  border: 2px solid var(--ink);
  transform: rotate(45deg);
  animation: mote 7s ease-in-out infinite;
}
.floating-motes i:nth-child(1) { left: 7%; top: 18%; }
.floating-motes i:nth-child(2) { left: 47%; top: 29%; animation-delay: -2s; }
.floating-motes i:nth-child(3) { left: 91%; top: 25%; animation-delay: -4s; }
.floating-motes i:nth-child(4) { left: 53%; top: 73%; animation-delay: -1s; }
.floating-motes i:nth-child(5) { left: 86%; top: 77%; animation-delay: -3s; }
.floating-motes i:nth-child(6) { left: 16%; top: 81%; animation-delay: -5s; }

.scroll-cue {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  transform: translateX(-50%);
}
.scroll-cue span { width: 32px; height: 2px; background: currentColor; animation: scrollPulse 1.3s ease-in-out infinite; }

.marquee {
  position: absolute;
  z-index: 7;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 12px 0;
  overflow: hidden;
  color: var(--white);
  background: var(--ink);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
}
.marquee-track { width: max-content; display: flex; gap: 24px; align-items: center; animation: marquee 24s linear infinite; }
.marquee span { font-family: Impact, sans-serif; font-size: 1.05rem; letter-spacing: .14em; }
.marquee b { color: var(--gold); }

.realm {
  min-height: 1080px;
  color: var(--white);
  background: var(--night) url("assets/moon-garden.jpg") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 118px max(4vw, calc((100vw - 1740px) / 2)) 92px;
}
.realm::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(6, 13, 24, .28); }
.realm-vignette { position: absolute; inset: 0; z-index: -1; box-shadow: inset 0 0 180px 30px rgba(2, 7, 14, .7); }
.realm-grid { width: 100%; display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 4vw, 78px); align-items: center; }

.lore-panel { padding: 10px 0; text-shadow: 0 3px 20px rgba(0, 0, 0, .6); }
.lore-panel h2, .game-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}
.lore-panel h2 em { color: var(--gold); font-weight: 500; }
.lore-copy {
  max-width: 690px;
  margin: 26px 0 32px;
  padding-left: 20px;
  border-left: 4px solid var(--vermilion);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.1vw, 1.22rem);
  line-height: 1.64;
  color: #faedce;
}
.lore-copy p { margin: 0 0 15px; }
.lore-copy strong { color: var(--gold); }

.kami-traits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 680px; }
.kami-traits div {
  min-height: 108px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  background: rgba(9, 17, 29, .78);
  border: 1px solid rgba(255, 235, 189, .3);
  backdrop-filter: blur(7px);
}
.kami-traits span { grid-row: 1 / 3; color: var(--gold); font-family: serif; font-size: 2rem; font-weight: 900; }
.kami-traits b { font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; }
.kami-traits small { color: #c5c9d1; font-size: .72rem; }

.game-panel {
  position: relative;
  padding: clamp(28px, 3vw, 48px);
  color: var(--ink);
  background: rgba(246, 222, 174, .95);
  border: 4px solid var(--ink);
  box-shadow: 12px 12px 0 var(--vermilion), 24px 24px 0 rgba(0, 0, 0, .36);
  clip-path: polygon(0 0, 96% 0, 100% 5%, 100% 100%, 4% 100%, 0 95%);
}
.game-panel::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(23, 25, 27, .32);
  pointer-events: none;
}
.game-heading { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.game-kicker { margin: 0 0 6px; color: var(--vermilion-dark); font-size: .72rem; font-weight: 950; letter-spacing: .18em; text-transform: uppercase; }
.game-panel h2 { font-size: clamp(2.4rem, 3.4vw, 4.6rem); }
.best-score {
  min-width: 82px;
  padding: 8px 12px;
  text-align: center;
  color: var(--white);
  background: var(--ink);
  transform: rotate(2deg);
}
.best-score span { display: block; color: var(--gold); font-size: .62rem; letter-spacing: .16em; }
.best-score b { font-family: monospace; font-size: 1.35rem; }
.game-instruction { max-width: 560px; margin: 18px 0 26px; font-family: Georgia, serif; font-size: 1.02rem; line-height: 1.5; }

.fortune-meter {
  position: relative;
  height: 94px;
  margin: 0 0 18px;
  overflow: hidden;
  background: var(--ink);
  border: 5px solid var(--ink);
  box-shadow: inset 0 0 30px #000;
}
.fortune-meter::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .25;
  background: repeating-linear-gradient(90deg, transparent 0 9.7%, rgba(255,255,255,.35) 9.8% 10%);
}
.danger-zone { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(189, 47, 32, .65), transparent 25% 75%, rgba(189, 47, 32, .65)); }
.lucky-zone {
  position: absolute;
  left: 43%;
  top: 0;
  width: 14%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border-inline: 3px solid var(--white);
  box-shadow: 0 0 24px var(--gold);
}
.lucky-zone span { font-size: .63rem; font-weight: 950; letter-spacing: .16em; transform: rotate(-90deg); }
.spirit-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  z-index: 3;
  background: var(--white);
  box-shadow: 0 0 5px #fff, 0 0 18px 6px #ff681f;
  transform: translateX(-50%);
}
.spirit-marker span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 60% 40% 65% 35%;
  background: var(--white);
  box-shadow: 0 0 14px 6px var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

.game-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.game-stats div { padding: 11px 14px; display: flex; align-items: baseline; justify-content: space-between; background: rgba(128, 65, 28, .1); border-bottom: 2px solid var(--ink); }
.game-stats span { font-size: .63rem; font-weight: 950; letter-spacing: .12em; }
.game-stats b { font-family: monospace; font-size: 1.35rem; }

.game-result { min-height: 74px; margin: 20px 0; padding: 14px 17px; display: flex; align-items: center; gap: 14px; background: var(--white); border: 2px solid var(--ink); }
.result-symbol { display: grid; place-items: center; flex: 0 0 38px; height: 38px; color: var(--white); background: var(--vermilion); border-radius: 50%; }
.game-result b, .game-result small { display: block; }
.game-result b { margin-bottom: 3px; font-family: Georgia, serif; font-size: 1.05rem; }
.game-result small { color: #5b554b; font-size: .78rem; }

.ring-button {
  width: 100%;
  min-height: 68px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: var(--white);
  background: var(--vermilion);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  text-transform: uppercase;
  font-weight: 950;
  letter-spacing: .13em;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.ring-button:hover { background: #d64a2e; transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.ring-button:active, .ring-button.is-ringing { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.bell-icon { width: 22px; height: 22px; color: var(--gold); border: 3px solid var(--gold); border-radius: 50% 50% 42% 42%; }
.ring-button kbd { margin-left: auto; padding: 4px 7px; color: var(--ink); background: var(--white); border: 1px solid var(--ink); border-bottom-width: 3px; font-size: .62rem; }
.game-note { margin: 16px 0 0; text-align: center; font-size: .68rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }

.site-footer {
  position: absolute;
  left: max(4vw, calc((100vw - 1740px) / 2));
  right: max(4vw, calc((100vw - 1740px) / 2));
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 239, 201, .34);
  color: #d7d9df;
  font-size: .72rem;
  letter-spacing: .05em;
}
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--white); font-family: Georgia, serif; font-weight: 800; }
.footer-brand img { width: 34px; height: 34px; border-radius: 50%; background: var(--vermilion); object-fit: cover; object-position: top; }
.site-footer > div:last-child { display: flex; gap: 18px; align-items: center; }
.site-footer a, .site-footer button { color: var(--gold); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: 28px;
  padding: 15px 22px;
  color: var(--white);
  background: var(--ink);
  border: 2px solid var(--gold);
  box-shadow: 5px 5px 0 var(--vermilion);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 25px);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.spark {
  position: fixed;
  z-index: 130;
  width: 10px;
  height: 10px;
  pointer-events: none;
  background: var(--gold);
  border-radius: 2px;
  animation: spark .75s ease-out forwards;
}

@keyframes sealPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes rotateSeal { to { transform: rotate(360deg); } }
@keyframes aura { 0% { transform: scale(.72); opacity: 0; } 28% { opacity: .7; } 100% { transform: scale(1.08); opacity: 0; } }
@keyframes kamiFloat { 0%,100% { margin-top: 0; } 50% { margin-top: -18px; } }
@keyframes shadowFloat { 0%,100% { transform: scale(1); opacity: .42; } 50% { transform: scale(.88); opacity: .28; } }
@keyframes bellGlow { 0%,100% { transform: scale(.8); opacity: .2; } 50% { transform: scale(1.25); opacity: .8; } }
@keyframes kamiBoop { 0% { transform: scale(1); } 35% { transform: scale(.94) rotate(-2deg); } 70% { transform: scale(1.06) rotate(2deg); } 100% { transform: scale(1); } }
@keyframes kamiRing { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-3deg); } 40% { transform: rotate(3deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(2deg); } }
@keyframes hintWiggle { 0%,85%,100% { transform: rotate(-4deg); } 90% { transform: rotate(2deg) scale(1.06); } 95% { transform: rotate(-6deg); } }
@keyframes mote { 0%,100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(-24px) rotate(225deg); } }
@keyframes scrollPulse { 0%,100% { transform: scaleX(.45); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spark { to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(180deg) scale(.2); } }

@media (max-width: 1180px) {
  .hero { grid-template-columns: .95fr 1.05fr; padding-inline: 32px; }
  .hero-copy { padding: 32px; }
  .nav-links { display: none; }
  .header-actions { margin-left: auto; }
  .kami-stage { min-height: 680px; }
  .character-wrap { width: min(42vw, 540px); }
  .sun-seal { width: min(43vw, 540px); }
  .realm { padding-inline: 32px; }
  .realm-grid { gap: 32px; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .site-header { top: 10px; width: calc(100% - 20px); padding: 0 10px; }
  .brand span:last-child { display: none; }
  .brand-mark { width: 44px; height: 44px; }
  .social-link { display: none; }
  .ca-button { padding-inline: 12px; }
  .scene, .hero, .realm { min-height: auto; }
  .hero { min-height: 100svh; grid-template-columns: 1fr; padding: 100px 18px 90px; gap: 18px; }
  .hero-copy { order: 2; width: 100%; padding: 28px 24px 34px; box-shadow: 8px 8px 0 var(--ink); }
  .title-main { font-size: clamp(4rem, 20vw, 7rem); }
  .kami-stage { order: 1; min-height: 470px; height: 55svh; }
  .character-wrap { width: min(67vw, 430px); }
  .sun-seal { width: min(70vw, 460px); }
  .vertical-kanji { right: 5%; }
  .tap-hint { right: 7%; bottom: 11%; }
  .scroll-cue { display: none; }
  .realm { padding: 96px 18px 110px; }
  .realm-grid { grid-template-columns: 1fr; }
  .lore-panel { padding: 0 8px; }
  .game-panel { padding: 30px 24px; box-shadow: 8px 8px 0 var(--vermilion); }
  .site-footer { position: static; margin-top: 60px; flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
  .hero-intro { font-size: 1rem; }
  .hero-cta { display: grid; }
  .brush-button, .text-button { width: 100%; }
  .kami-stage { min-height: 390px; height: 48svh; }
  .character-wrap { width: min(78vw, 390px); }
  .sun-seal { width: min(79vw, 400px); }
  .tap-hint, .vertical-kanji { display: none; }
  .kami-traits { grid-template-columns: 1fr; }
  .kami-traits div { min-height: 78px; }
  .game-heading { align-items: center; }
  .game-panel h2 { font-size: 2.45rem; }
  .fortune-meter { height: 76px; }
  .game-stats div { padding: 9px 7px; display: grid; gap: 3px; }
  .ring-button kbd { display: none; }
  .site-footer > div:last-child { flex-wrap: wrap; justify-content: center; }
}

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