/* ============================================================
   CELESTIAL9 — 九重天签
   A ritual table, a printed deity card, and one answer per question.
   ============================================================ */

:root {
  --oracle-red: #9f211c;
  --oracle-red-bright: #e33b2f;
  --oracle-gold: #f2b940;
  --oracle-night: #08070c;
}

body.oracle-body {
  min-height: 100svh;
  background: var(--oracle-night);
  color: var(--paper);
  overflow-x: clip;
}

.oracle-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(8,7,12,.08), rgba(8,7,12,.28) 56%, rgba(8,7,12,.95)),
    url('../assets/img/oracle/shrine-table.jpg') center top / cover no-repeat;
}
.oracle-atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 0 42%, rgba(8,7,12,.64) 92%),
    radial-gradient(circle at center, rgba(246,236,210,.16) 1px, transparent 1.3px);
  background-size: auto, 6px 6px;
  mix-blend-mode: multiply;
}

.oracle-nav {
  width: min(100% - 2rem, 1440px);
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
}

.oracle-brand { display: block; width: clamp(8.2rem, 15vw, 12rem); }
.oracle-brand img { width: 100%; height: auto; }

.oracle-nav__right { display: flex; align-items: center; gap: .65rem; }
.oracle-day,
.oracle-home {
  border: 2px solid rgba(246,236,210,.7);
  padding: .42rem .7rem .34rem;
  font-family: var(--f-label);
  font-size: .75rem;
  letter-spacing: .12em;
  line-height: 1;
  text-decoration: none;
}
.oracle-day { color: var(--oracle-gold); border-color: rgba(242,185,64,.72); }
.oracle-home { transition: background-color .15s, color .15s; }
.oracle-home:hover { background: var(--paper); color: var(--ink); }

.oracle-main {
  width: min(100% - 2rem, 1180px);
  margin-inline: auto;
  padding: clamp(1.2rem, 4vh, 3.5rem) 0 9.5rem;
}

.oracle-intro {
  max-width: 760px;
  margin: 0 auto clamp(1.8rem, 5vh, 3.3rem);
  text-align: center;
  text-wrap: balance;
}
.oracle-kicker {
  font-family: var(--f-util);
  font-size: clamp(.72rem, 1.6vw, .9rem);
  color: var(--oracle-gold);
  letter-spacing: .26em;
  text-transform: uppercase;
}
.oracle-intro h1 {
  margin-top: .28rem;
  /* Bangers for Latin (and Oswald for Cyrillic, via --f-display); the Chinese
     display face only comes in for CJK, where Bangers has no glyphs. */
  font-family: var(--f-display);
  font-size: clamp(4.3rem, 11vw, 8.5rem);
  font-weight: 400;
  letter-spacing: .015em;
  line-height: .94;
  color: var(--paper);
  text-shadow:
    5px 6px 0 var(--ink),
    .035em 0 0 rgba(224,51,46,.85),
    -.035em 0 0 rgba(23,162,176,.72);
}
html[data-cjk] .oracle-intro h1 { font-family: var(--f-cn); letter-spacing: .08em; }
.oracle-lead {
  margin-top: .9rem;
  font-family: var(--f-body);
  font-size: clamp(1rem, 2vw, 1.25rem);
  letter-spacing: .13em;
  line-height: 1.8;
  color: rgba(246,236,210,.82);
}
.oracle-rule {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  margin-top: 1.15rem;
  color: var(--oracle-gold);
  font-family: var(--f-label);
  font-size: .72rem;
}
.oracle-rule i { width: clamp(2.5rem, 8vw, 6.2rem); border-top: 1px solid rgba(242,185,64,.55); }

.oracle-machine {
  position: relative;
  color: var(--ink);
  background:
    linear-gradient(rgba(246,236,210,.97), rgba(234,220,184,.97)),
    radial-gradient(circle, rgba(11,10,15,.2) 1px, transparent 1.2px);
  border: 4px solid var(--ink);
  box-shadow:
    0 0 0 2px var(--oracle-gold),
    0 0 0 7px var(--ink),
    14px 18px 0 rgba(0,0,0,.52);
  min-height: 590px;
  overflow: hidden;
}
.oracle-machine::before,
.oracle-machine::after {
  content: '';
  position: absolute;
  z-index: 4;
  width: 110px;
  height: 110px;
  border: 3px solid var(--ink);
  background:
    linear-gradient(135deg, transparent 45%, var(--ink) 46% 48%, transparent 49%),
    var(--oracle-gold);
  transform: rotate(45deg);
  opacity: .9;
}
.oracle-machine::before { left: -78px; top: -78px; }
.oracle-machine::after { right: -78px; bottom: -78px; }

.oracle-machine__edge {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: .5rem;
  writing-mode: vertical-rl;
  display: grid;
  place-items: center;
  padding: .7rem .15rem;
  border-right: 1px solid rgba(11,10,15,.23);
  font-family: var(--f-label);
  font-size: .68rem;
  letter-spacing: .32em;
  color: rgba(11,10,15,.45);
}

.oracle-view { display: none; min-height: 590px; }
.oracle-view.is-active { display: grid; }

.oracle-view--ask {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
}
.question-panel {
  padding: clamp(2rem, 5vw, 4.4rem) clamp(2rem, 5vw, 4.5rem);
  border-right: 3px solid var(--ink);
}
.question-panel__head { display: flex; align-items: center; gap: 1rem; }
.seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--oracle-red-bright);
  color: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--f-label);
  font-size: 1.05rem;
  letter-spacing: .08em;
  transform: rotate(-3deg);
}
.eyebrow {
  color: var(--oracle-red);
  font-family: var(--f-util);
  font-size: .72rem;
  letter-spacing: .22em;
}
.question-panel h2 {
  margin-top: .15rem;
  font-family: var(--f-title);
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .04em;
}

.question-box {
  position: relative;
  display: block;
  margin-top: clamp(1.4rem, 3.5vw, 2.2rem);
  background:
    repeating-linear-gradient(transparent 0 2.65rem, rgba(11,10,15,.18) 2.7rem 2.76rem),
    rgba(255,251,235,.58);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}
.question-box textarea {
  display: block;
  width: 100%;
  min-height: 9.2rem;
  resize: none;
  border: 0;
  outline: 0;
  padding: 1.05rem 1.1rem 1.6rem;
  background: transparent;
  color: var(--ink);
  font: 400 clamp(1.05rem, 2.2vw, 1.25rem)/2.2 var(--f-body);
  letter-spacing: .06em;
}
.question-box textarea::placeholder { color: rgba(42,39,51,.48); }
.question-box:focus-within {
  outline: 3px solid var(--celestial);
  outline-offset: 3px;
}
.question-count {
  position: absolute;
  right: .65rem;
  bottom: .35rem;
  font-family: var(--f-util);
  font-size: .68rem;
  color: var(--ink-soft);
}

.question-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.question-prompts button {
  padding: .35rem .7rem .28rem;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  font-family: var(--f-label);
  font-size: .78rem;
  letter-spacing: .12em;
  transition: transform .14s, background-color .14s, color .14s;
}
.question-prompts button:hover {
  transform: translateY(-2px) rotate(-1deg);
  background: var(--celestial);
  color: var(--paper);
}

.question-error {
  min-height: 1.4em;
  margin-top: .55rem;
  color: var(--oracle-red);
  font-family: var(--f-body);
  font-size: .78rem;
}
.question-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.draw-button,
.share-button,
.oracle-steam a {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 13.5rem;
  padding: .72rem 1.25rem .62rem;
  background: var(--oracle-red-bright);
  color: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s;
}
.draw-button:hover,
.share-button:hover,
.oracle-steam a:hover {
  transform: translate(-2px,-2px);
  box-shadow: 7px 7px 0 var(--ink);
  filter: saturate(1.12);
}
.draw-button:active,
.share-button:active,
.oracle-steam a:active {
  transform: translate(3px,3px);
  box-shadow: 2px 2px 0 var(--ink);
}
.draw-button__main,
.share-button span {
  font-family: var(--f-label);
  font-size: 1.12rem;
  letter-spacing: .12em;
}
.draw-button__sub,
.share-button small {
  margin-top: .1rem;
  font-family: var(--f-body);
  font-size: .64rem;
  letter-spacing: .12em;
  opacity: .72;
}
.restore-button,
.copy-button,
.again-button {
  padding: .62rem .8rem .52rem;
  border: 2px solid var(--ink);
  background: transparent;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--f-label);
  font-size: .78rem;
  letter-spacing: .06em;
}
.restore-button:hover,
.copy-button:hover,
.again-button:hover { background: var(--oracle-gold); }
/* Han glyphs read noticeably smaller than Latin caps at the same px, and these
   are the smallest labels a visitor still has to act on. Size them up for CJK
   rather than enlarging the Latin buttons, which are already comfortable. */
html[data-cjk] .restore-button,
html[data-cjk] .copy-button,
html[data-cjk] .again-button {
  font-size: .95rem;
  letter-spacing: .12em;
  padding: .58rem .95rem .5rem;
}
.privacy-note {
  margin-top: .9rem;
  font-family: var(--f-body);
  font-size: .68rem;
  color: rgba(42,39,51,.62);
  letter-spacing: .06em;
}

.deck-panel {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 100%;
  padding: 2rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(242,185,64,.48), transparent 27%),
    linear-gradient(155deg, #183b3e, #0c171d 70%);
}
.deck-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .38;
  background:
    radial-gradient(circle, rgba(246,236,210,.5) 1px, transparent 1.2px);
  background-size: 6px 6px;
  mix-blend-mode: overlay;
}
.deck-panel::after {
  content: '天命九重';
  position: absolute;
  bottom: 1.35rem;
  right: 1.1rem;
  writing-mode: vertical-rl;
  color: rgba(246,236,210,.18);
  font-family: var(--f-cn);
  font-size: 2rem;
  letter-spacing: .25em;
}

.deck-whisper {
  position: relative;
  z-index: 2;
  margin-top: 2rem;
  color: rgba(246,236,210,.75);
  font-family: var(--f-body);
  font-size: .78rem;
  letter-spacing: .16em;
  text-align: center;
}
.incense-smoke { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.incense-smoke i {
  position: absolute;
  left: 50%;
  top: 59%;
  width: 80px;
  height: 220px;
  border-left: 3px solid rgba(246,236,210,.24);
  border-radius: 50%;
  filter: blur(2px);
  animation: smoke-rise 5s ease-in-out infinite;
}
.incense-smoke i:nth-child(2) { animation-delay: -1.6s; margin-left: 22px; transform: scale(.8); }
.incense-smoke i:nth-child(3) { animation-delay: -3.2s; margin-left: -28px; transform: scale(.65); }

.oracle-view--drawing {
  place-items: center;
  align-content: center;
  color: var(--paper);
  background:
    radial-gradient(circle at center, rgba(242,185,64,.25), transparent 34%),
    linear-gradient(145deg, #141018, #071d21);
}
.drawing-sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: min(46vw, 250px);
  aspect-ratio: 1;
  border: 3px solid var(--oracle-gold);
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(242,185,64,.25), inset 0 0 45px rgba(242,185,64,.16);
  animation: sigil-turn 3.2s linear infinite;
}
.drawing-sigil::before,
.drawing-sigil::after,
.drawing-sigil i {
  content: '';
  position: absolute;
  inset: 11%;
  border: 1px solid rgba(242,185,64,.55);
  transform: rotate(45deg);
}
.drawing-sigil::after { inset: 23%; transform: rotate(22.5deg); }
.drawing-sigil i:nth-of-type(1) { inset: -8%; border-style: dashed; border-radius: 50%; }
.drawing-sigil i:nth-of-type(2) { inset: 5%; transform: rotate(67.5deg); }
.drawing-sigil i:nth-of-type(3) { inset: 34%; transform: rotate(0); background: rgba(242,185,64,.08); }
.drawing-sigil span {
  font-family: var(--f-cn);
  font-size: 5rem;
  color: var(--paper);
  text-shadow: 4px 4px 0 var(--oracle-red);
}
.drawing-line {
  margin-top: 2.2rem;
  font-family: var(--f-body);
  font-size: 1rem;
  letter-spacing: .2em;
  animation: text-pulse 1.2s ease-in-out infinite;
}

.oracle-view--result {
  grid-template-columns: minmax(340px, .9fr) minmax(0, 1.1fr);
  background:
    linear-gradient(135deg, rgba(246,236,210,.97), rgba(220,203,159,.97)),
    radial-gradient(circle, rgba(11,10,15,.2) 1px, transparent 1.2px);
}
.result-card {
  position: relative;
  width: min(calc(100% - 3rem), 410px);
  margin: 2.4rem auto;
  align-self: center;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 9px 11px 0 var(--ink);
  transform: rotate(-1.2deg);
}
.result-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(11,10,15,.23) 1px, transparent 1.1px);
  background-size: 5px 5px;
  mix-blend-mode: multiply;
  opacity: .45;
}
.result-card__art {
  --fortune-color: var(--nether);
  position: relative;
  height: clamp(300px, 42vw, 430px);
  margin: .75rem;
  overflow: hidden;
  border: 3px solid var(--ink);
  background:
    radial-gradient(circle at 50% 35%, rgba(246,236,210,.75), transparent 31%),
    linear-gradient(165deg, var(--fortune-color), #171018);
}
.result-card__art::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 37%, transparent 0 24%, rgba(11,10,15,.18) 25% 26%, transparent 27%),
    repeating-conic-gradient(from 0deg at 50% 37%, rgba(246,236,210,.24) 0 4deg, transparent 4deg 12deg);
}
.result-card__art > img {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -2%;
  width: 112%;
  height: 96%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  filter: drop-shadow(5px 6px 0 rgba(11,10,15,.55));
}
.result-card__clouds {
  position: absolute;
  z-index: 1;
  left: -10%;
  right: -10%;
  bottom: -9%;
  height: 29%;
  background:
    radial-gradient(circle at 10% 72%, var(--paper) 0 22%, transparent 23%),
    radial-gradient(circle at 30% 52%, var(--paper) 0 27%, transparent 28%),
    radial-gradient(circle at 52% 66%, var(--paper) 0 28%, transparent 29%),
    radial-gradient(circle at 77% 45%, var(--paper) 0 30%, transparent 31%),
    radial-gradient(circle at 92% 68%, var(--paper) 0 23%, transparent 24%);
  opacity: .82;
}
.result-rank {
  position: absolute;
  z-index: 4;
  top: .65rem;
  right: .65rem;
  padding: .48rem .55rem .4rem;
  color: var(--paper);
  background: var(--oracle-red-bright);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--f-label);
  font-size: .86rem;
  letter-spacing: .08em;
  transform: rotate(2deg);
}
.result-deity {
  position: absolute;
  z-index: 4;
  left: .65rem;
  right: .65rem;
  bottom: .55rem;
  padding: .6rem .75rem .48rem;
  color: var(--paper);
  background: rgba(11,10,15,.88);
  border: 2px solid var(--paper);
}
.result-deity span {
  display: block;
  color: var(--oracle-gold);
  font-family: var(--f-label);
  font-size: .62rem;
  letter-spacing: .18em;
}
.result-deity h2 {
  margin-top: .08rem;
  font-family: var(--f-title);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 400;
  letter-spacing: .12em;
  line-height: 1.1;
}
.result-card__body {
  position: relative;
  z-index: 1;
  padding: .4rem 1.15rem 1.35rem;
  text-align: center;
}
.result-number {
  color: var(--oracle-red);
  font-family: var(--f-label);
  font-family: var(--f-util);
  font-size: .66rem;
  letter-spacing: .18em;
}
.result-card__body h3 {
  margin-top: .22rem;
  font-family: var(--f-title);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  font-weight: 400;
  letter-spacing: .12em;
}
.result-card blockquote {
  margin: .75rem 0 0;
  color: var(--ink);
  font-family: var(--f-cn);
  font-size: clamp(.92rem, 2.2vw, 1.08rem);
  font-style: normal;
  letter-spacing: .16em;
  line-height: 1.85;
  white-space: pre-line;
}
.result-gloss {
  margin-top: .7rem;
  padding-top: .7rem;
  border-top: 1px dashed rgba(11,10,15,.35);
  color: var(--ink-soft);
  font-family: var(--f-body);
  font-size: .8rem;
  line-height: 1.55;
}
.result-action {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .5rem;
  margin-top: .72rem;
}
.result-action span {
  flex: none;
  padding: .2rem .4rem .15rem;
  background: var(--oracle-red);
  color: var(--paper);
  font-family: var(--f-label);
  font-size: .66rem;
}
.result-action p {
  font-family: var(--f-body);
  font-size: .78rem;
  letter-spacing: .06em;
}

.result-aside {
  align-self: center;
  padding: clamp(2rem, 5vw, 4.7rem);
  border-left: 3px solid var(--ink);
}
.asked-question span,
.culture-note > span {
  display: inline-block;
  padding: .3rem .55rem .24rem;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--f-label);
  font-size: .72rem;
  letter-spacing: .14em;
}
.asked-question p {
  margin-top: .75rem;
  font-family: var(--f-body);
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  letter-spacing: .07em;
  line-height: 1.45;
}
.culture-note {
  margin-top: 1.6rem;
  padding: 1.1rem;
  background: rgba(255,251,235,.44);
  border: 2px solid var(--ink);
  border-left: 8px solid var(--oracle-gold);
}
.culture-note p {
  margin-top: .75rem;
  font-family: var(--f-body);
  font-size: .9rem;
  line-height: 1.65;
}
.culture-note small {
  display: block;
  margin-top: .65rem;
  color: rgba(42,39,51,.58);
  font-size: .68rem;
  line-height: 1.55;
}
.result-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.4rem;
}
.share-button { min-width: 12rem; }
.copy-button,
.again-button { align-self: stretch; }
.share-status {
  min-height: 1.5em;
  margin-top: .65rem;
  color: var(--oracle-red);
  font-family: var(--f-body);
  font-size: .72rem;
}
.oracle-disclaimer {
  margin-top: 1.2rem;
  color: rgba(246,236,210,.52);
  font-family: var(--f-body);
  font-size: .68rem;
  letter-spacing: .06em;
  text-align: center;
}

.oracle-steam {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(.75rem, env(safe-area-inset-bottom));
  width: min(calc(100% - 1.5rem), 900px);
  min-height: 76px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .6rem .55rem 1rem;
  color: var(--ink);
  background: rgba(246,236,210,.96);
  border: 3px solid var(--ink);
  box-shadow: 7px 8px 0 rgba(0,0,0,.68);
  backdrop-filter: blur(10px);
}
.oracle-steam > div { display: flex; align-items: center; min-width: 0; gap: .9rem; }
.oracle-steam img { width: 7.2rem; height: auto; }
.oracle-steam p {
  color: var(--ink-soft);
  font-family: var(--f-body);
  font-size: .72rem;
  letter-spacing: .06em;
}
.oracle-steam a {
  flex: none;
  min-width: 12.8rem;
  padding: .58rem .9rem .5rem;
  text-decoration: none;
}
.oracle-steam a span {
  font-family: var(--f-label);
  font-size: .9rem;
  letter-spacing: .08em;
}
.oracle-steam a small {
  font-family: var(--f-body);
  font-size: .58rem;
  opacity: .75;
}

.result-card.is-revealing { animation: reveal-card .72s var(--ease) both; }
.result-aside.is-revealing { animation: reveal-copy .55s .24s var(--ease) both; }

@keyframes smoke-rise {
  0% { opacity: 0; transform: translateY(80px) scale(.65) rotate(8deg); }
  32% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-190px) translateX(55px) scale(1.45) rotate(-26deg); }
}
@keyframes sigil-turn { to { transform: rotate(360deg); } }
@keyframes text-pulse { 50% { opacity: .48; } }
@keyframes reveal-card {
  from { opacity: 0; transform: perspective(1000px) rotateY(110deg) rotate(-8deg) scale(.86); }
  to { opacity: 1; transform: perspective(1000px) rotateY(0) rotate(-1.2deg) scale(1); }
}
@keyframes reveal-copy {
  from { opacity: 0; transform: translateX(25px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 820px) {
  .oracle-atmosphere {
    background-position: 50% top;
    background-size: auto 58rem;
  }
  .oracle-main { width: min(100% - 1.2rem, 690px); padding-top: .8rem; }
  .oracle-intro { margin-bottom: 1.65rem; }
  .oracle-view--ask,
  .oracle-view--result { grid-template-columns: 1fr; }
  .question-panel {
    padding: 2rem 1.4rem 1.7rem 2.1rem;
    border-right: 0;
    border-bottom: 3px solid var(--ink);
  }
  .deck-panel { min-height: 430px; padding: 2rem 1rem; }
    .result-card { margin-bottom: 1.4rem; }
  .result-card__art { height: min(95vw, 430px); }
  .result-aside { border-left: 0; border-top: 3px solid var(--ink); padding: 2rem 1.4rem 2.4rem 2.1rem; }
}

@media (max-width: 560px) {
  .oracle-nav { width: calc(100% - 1.2rem); min-height: 60px; }
  .oracle-brand { width: 7.4rem; }
  .oracle-day { display: none; }
  .oracle-home { font-size: .66rem; }
  .oracle-main { padding-bottom: 11rem; }
  .oracle-lead br { display: none; }
  .oracle-machine { box-shadow: 7px 9px 0 rgba(0,0,0,.55); }
  .oracle-machine__edge { display: none; }
  .question-panel { padding: 1.6rem 1rem; }
  .seal { width: 3rem; height: 3rem; }
  .question-box textarea { min-height: 8.1rem; padding-inline: .8rem; }
  .question-actions { align-items: stretch; }
  .draw-button, .restore-button { width: 100%; }
  .deck-panel { min-height: 360px; }
  .result-card { width: calc(100% - 1.4rem); }
  .result-aside { padding: 1.5rem 1rem 2rem; }
  .share-button { width: 100%; }
  .copy-button, .again-button { flex: 1; }
  .oracle-steam {
    bottom: max(.45rem, env(safe-area-inset-bottom));
    width: calc(100% - .8rem);
    min-height: 96px;
    padding: .5rem;
  }
  .oracle-steam > div { display: block; padding-left: .2rem; }
  .oracle-steam img { width: 5.5rem; }
  .oracle-steam p { max-width: 11rem; margin-top: .15rem; font-size: .58rem; line-height: 1.35; }
  .oracle-steam a { min-width: 9.4rem; padding: .55rem .65rem .48rem; }
  .oracle-steam a span { font-size: .74rem; }
  .oracle-steam a small { font-size: .52rem; }
}

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


/* ===============================================================
   THE CARD HOLDER
   A 签筒 that holds a deck rather than bamboo sticks — so the
   things inside are real card backs, and the barrel is sized and
   shaped to take them.

   JS drives four custom properties on #shaker; CSS does the rest:
     --e     0..1   how charged the shake is
     --tilt  deg    barrel lean, spring-damped toward the drag
     --jx/--jy px   per-frame rattle, scaled by --e
     --jr    deg    rattle, as rotation

   Layer order matters: cards are painted before the barrel so the
   barrel's front wall hides their lower half, and the elliptical
   mouth sits over them — which is what sells "inside the tube".
   =============================================================== */
.shaker {
  --e: 0;
  --tilt: 0deg;
  --jx: 0px;
  --jy: 0px;
  --jr: 0deg;
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 1.15rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;                 /* we own the drag; stop the page scrolling under it */
  -webkit-tap-highlight-color: transparent;
}
.shaker[data-state='locked'] { cursor: not-allowed; }
.shaker[data-state='shaking'] { cursor: grabbing; }
.shaker[data-state='ejecting'] { cursor: default; }
.shaker:focus-visible { outline: 3px solid #F5B32E; outline-offset: 12px; border-radius: 4px; }

.shaker__rig {
  position: relative;
  display: block;
  width: clamp(11rem, 21vw, 15rem);
  aspect-ratio: 4 / 5;
  transform: rotate(var(--tilt)) translate(var(--jx), var(--jy));
  will-change: transform;
}

/* Altar light behind the holder; swells as the shake charges. */
.shaker__glow {
  position: absolute;
  left: 50%; top: 58%;
  width: 160%; aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(calc(.5 + var(--e) * .55));
  background: radial-gradient(circle, rgba(242,185,64,calc(.14 + var(--e) * .46)), transparent 60%);
  opacity: calc(.4 + var(--e) * .6);
  pointer-events: none;
}

/* ---------- the barrel ---------- */
.shaker__tube {
  position: absolute;
  left: 50%;
  bottom: 2%;
  z-index: 2;                          /* over the cards: they sit inside it */
  width: 74%;
  height: 52%;
  transform: translateX(-50%);
  filter: drop-shadow(7px 9px 0 rgba(11,10,15,.5));
}

/* Front wall. The three-stop gradient is the cylinder: dark edge, lit
   quarter-turn, dark edge again. */
.shaker__body {
  position: absolute;
  inset: 7% 0 0;
  border: 4px solid #0B0A0F;
  border-radius: 4px 4px 14px 14px;
  background:
    radial-gradient(circle, rgba(0,0,0,.3) 1.1px, transparent 1.2px) 0 0 / 5px 5px,
    linear-gradient(90deg,
      #4d1009 0%, #7d1f16 13%, #b8382b 32%,
      #d15a43 44%, #a82c20 62%, #6d1a12 84%, #3f0c07 100%);
  box-shadow:
    inset 0 -18px 26px rgba(0,0,0,.5),
    inset 0 6px 12px rgba(0,0,0,.4);
}
/* Specular streak — one narrow highlight is what makes it read as lacquer. */
.shaker__body::after {
  content: '';
  position: absolute;
  left: 26%; top: 6%;
  width: 9%; height: 84%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,225,200,.5), rgba(255,205,170,.12) 65%, transparent);
  filter: blur(1.5px);
}
.shaker__seal {
  position: absolute;
  left: 50%; top: 54%;
  z-index: 2;
  transform: translate(-50%, -50%);
  color: rgba(246,236,210,.92);
  font-family: var(--f-cn);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0,0,0,.55), 0 0 18px rgba(242,185,64,.35);
}

/* The mouth: an ellipse, not a rectangle. Without the curve the whole thing
   reads as a flat card, not a barrel you could put something into. */
.shaker__mouth {
  position: absolute;
  left: -3%; top: 0;
  z-index: 3;
  width: 106%; height: 15%;
  border: 4px solid #0B0A0F;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 140%, #1b0a07 42%, transparent 62%),
    linear-gradient(180deg, #F7DE96, #E0A43A 46%, #9c6518);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.3);
}
/* Gold foot band, mirrored. */
.shaker__foot {
  position: absolute;
  left: -3%; bottom: -3%;
  z-index: 3;
  width: 106%; height: 13%;
  border: 4px solid #0B0A0F;
  border-radius: 50% / 60%;
  background: linear-gradient(180deg, #F7DE96, #E0A43A 42%, #8a5714);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.32);
}

/* ---------- the deck inside ---------- */
/* Anchored at the mouth line and fanned by index, so they hinge from inside
   the barrel the way a held hand does. */
.shaker__fan {
  position: absolute;
  left: 50%;
  bottom: 46%;
  z-index: 1;
  width: 34%;
  aspect-ratio: 580 / 810;
  transform: translateX(-50%);
}
.shaker__fan i {
  position: absolute;
  inset: 0;
  transform-origin: 50% 96%;
  transform:
    rotate(calc(var(--n) * 13deg + var(--jr) * .7))
    translateY(calc(var(--e) * -7%));
  filter: drop-shadow(3px 4px 0 rgba(11,10,15,.4));
}
.shaker__fan i img,
.shaker__pick img {
  display: block;
  width: 100%; height: 100%;
  border: 3px solid #0B0A0F;
  border-radius: 7px;
  object-fit: cover;
}
/* Depth: the outer cards sit further back. */
.shaker__fan i:nth-child(1) { filter: brightness(.72) drop-shadow(3px 4px 0 rgba(11,10,15,.4)); }
.shaker__fan i:nth-child(2) { filter: brightness(.86) drop-shadow(3px 4px 0 rgba(11,10,15,.4)); }
.shaker__fan i:nth-child(3) { filter: brightness(.86) drop-shadow(3px 4px 0 rgba(11,10,15,.4)); }
.shaker__fan i:nth-child(4) { filter: brightness(.72) drop-shadow(3px 4px 0 rgba(11,10,15,.4)); }

/* The card that comes out. Climbs out of the mouth as --e rises. */
.shaker__pick {
  position: absolute;
  left: 50%;
  bottom: 44%;
  z-index: 1;
  width: 37%;
  aspect-ratio: 580 / 810;
  transform-style: preserve-3d;
  transform:
    translateX(-50%)
    translateY(calc(var(--e) * -34%))
    rotate(calc(var(--e) * -4deg + var(--jr)));
  filter: drop-shadow(5px 7px 0 rgba(11,10,15,.5));
}
/* Two faces on one card. The front is pre-turned, so a rotateY of 180 in the
   eject keyframe swaps which one is looking at you — the card is face-down
   until it is in the air, which is the whole point of drawing it. */
.pface {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.pface--front { transform: rotateY(180deg); }
.pface img { display: block; width: 100%; height: 100%; }

.play-card--flying {
  width: 100%;
  height: 100%;
  border-width: 4px;
  border-radius: 8px;
  box-shadow: none;
}
.play-card--flying .play-card__rank { font-size: 2.4rem; }
.play-card--flying .play-card__suit { font-size: 1.7rem; }

/* ---------- charge meter ---------- */
.shaker__meter {
  position: relative;
  width: clamp(11rem, 21vw, 15rem);
  height: 11px;
  border: 3px solid rgba(246,236,210,.5);
  border-radius: 999px;
  overflow: hidden;
  opacity: calc(.35 + var(--e) * .65);
  transition: opacity .2s;
}
.shaker__meter i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--e) * 100%);
  background: linear-gradient(90deg, #C8452F, #E0A43A 55%, #F7DE96);
}
.shaker[data-state='locked'] .shaker__meter { opacity: .16; }

/* ---------- states ---------- */
.shaker[data-state='locked'] .shaker__rig { filter: grayscale(.6) brightness(.7); }
.shaker[data-state='ready'] .shaker__rig { animation: tube-idle 3.8s ease-in-out infinite; }

.shaker[data-state='ejecting'] .shaker__pick {
  /* The arc brings it back down across the barrel; it has to land in front of
     the tube, not disappear behind it. */
  z-index: 4;
  animation: tube-eject var(--edur, 1.45s) cubic-bezier(.3,.05,.2,1) forwards;
}
.shaker[data-state='ejecting'] .shaker__rig { animation: tube-recoil .5s ease-out; }
.shaker[data-state='ejecting'] .shaker__fan i {
  transform: rotate(calc(var(--n) * 13deg));
}

@keyframes tube-idle {
  0%,100% { transform: rotate(var(--tilt)) translateY(0); }
  50%     { transform: rotate(calc(var(--tilt) - 1.4deg)) translateY(-6px); }
}
@keyframes tube-recoil {
  0%   { transform: rotate(var(--tilt)) translateY(0); }
  26%  { transform: rotate(calc(var(--tilt) + 6deg)) translateY(10px); }
  100% { transform: rotate(var(--tilt)) translateY(0); }
}
/* Every toss is rolled fresh in JS and handed over as custom properties, so
   the same keyframe never plays the same arc twice. Defaults here are only a
   safety net for the case where the roll never ran. */
.shaker {
  --ex1: 0%;   --ex2: 8%;   --ex3: 16%;
  --eh: -185%;
  --elean: -22deg;
  --espin: 372deg;
  --escale: 1.16;
}
/* The turn happens on the way up: edge-on at the apex, face showing by the
   time it starts to fall. perspective() is inline so the 3D reads without
   putting a perspective on an ancestor that everything else would inherit. */
@keyframes tube-eject {
  0%   { transform: perspective(1000px) translateX(-50%) translateY(-34%)
                    rotate(-4deg) rotateY(0deg) scale(1); opacity: 1; }
  34%  { transform: perspective(1000px) translateX(calc(-50% + var(--ex1))) translateY(var(--eh))
                    rotate(var(--elean)) rotateY(90deg) scale(var(--escale)); opacity: 1; }
  68%  { transform: perspective(1000px) translateX(calc(-50% + var(--ex2))) translateY(-100%)
                    rotate(calc(var(--espin) * .58)) rotateY(180deg)
                    scale(calc(var(--escale) + .06)); opacity: 1; }
  100% { transform: perspective(1000px) translateX(calc(-50% + var(--ex3))) translateY(36%)
                    rotate(var(--espin)) rotateY(180deg) scale(.5); opacity: 0; }
}

.motion-ask {
  position: relative;
  z-index: 2;
  margin-top: -.4rem;
  padding: .45rem .9rem .38rem;
  border: 2px dashed rgba(246,236,210,.5);
  border-radius: 4px;
  color: rgba(246,236,210,.8);
  font-family: var(--f-label);
  font-size: .7rem;
  letter-spacing: .1em;
  cursor: pointer;
}
.motion-ask:hover { border-color: rgba(246,236,210,.9); color: #F6ECD2; }

/* Nobody should have to shake anything to use this page. With reduced motion
   the tube stops animating and a single press draws. */
@media (prefers-reduced-motion: reduce) {
  .shaker__rig,
  .shaker[data-state='ready'] .shaker__rig,
  .shaker[data-state='ejecting'] .shaker__rig,
  .shaker[data-state='ejecting'] .shaker__pick { animation: none; transform: none; }
  .shaker__glow { transform: translate(-50%,-50%); }
}

/* ===============================================================
   THE DRAWN CARD
   The lot names a god; the card is what was actually dealt. Scored
   the way the game scores — nine is the ceiling, face cards bust.
   =============================================================== */
.card-draw {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 2px dashed rgba(11,10,15,.18);
}
.play-card {
  flex: none;
  display: grid;
  place-content: center;
  gap: .05rem;
  width: 3.1rem;
  aspect-ratio: 5 / 7;
  border: 3px solid var(--ink, #0B0A0F);
  border-radius: 6px;
  background: #FBF6E7;
  box-shadow: 3px 4px 0 rgba(11,10,15,.5);
  line-height: 1;
  text-align: center;
}
.play-card__rank { font-family: var(--f-title); font-size: 1.5rem; }
.play-card__suit { font-size: 1.05rem; }
/* Suit colour is the deck's, not the site palette's: red suits red, black black. */
.play-card[data-suit='hearts'],
.play-card[data-suit='diamonds'] { color: #C8352A; }
.play-card[data-suit='spades'],
.play-card[data-suit='clubs'] { color: #17161C; }

.card-draw__read { min-width: 0; }
.card-draw__read > span {
  display: block;
  margin-bottom: .28rem;
  font-family: var(--f-label);
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .58;
}
.card-draw__read p {
  font-family: var(--f-body);
  font-size: .82rem;
  line-height: 1.45;
}
.card-draw__read p + p { margin-top: .2rem; opacity: .72; }

/* ---------------------------------------------------------------
   SHARE SHEET
   --------------------------------------------------------------- */
.share-sheet { margin-top: 1.15rem; }
.share-sheet--follow { margin-top: .95rem; }
/* The aside sits on the light paper card, not on the dark chrome — these were
   cream-on-cream and effectively invisible. */
.share-sheet__label {
  margin-bottom: .5rem;
  font-family: var(--f-label);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: .62;
}
.share-targets { display: flex; flex-wrap: wrap; gap: .45rem; }
.schip {
  display: grid;
  place-items: center;
  width: 2.35rem;
  aspect-ratio: 1;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .14s, background-color .14s, color .14s, box-shadow .14s;
}
.schip:hover {
  transform: translate(-2px,-2px);
  background: var(--gold, #F5B32E);
  box-shadow: 4px 4px 0 var(--ink);
}
.schip:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.sicon { width: 15px; height: 15px; fill: currentColor; }

.follow-links { display: flex; flex-wrap: wrap; gap: .42rem; }
.fchip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .36rem .68rem .3rem;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--f-label);
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .14s, background-color .14s;
}
.fchip:hover { transform: translateY(-2px); background: var(--gold, #F5B32E); }
.fchip .sicon { width: 13px; height: 13px; }

/* Copy-the-image affordance, next to the two existing text buttons. */
.image-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.copy-image-button {
  padding: .42rem .8rem .36rem;
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--f-label);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy-image-button:hover { background: var(--gold, #F5B32E); }
.copy-image-button:disabled { opacity: .45; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .schip:hover, .fchip:hover { transform: none; }
}
