/* elevatia.cn v3: the page is one turn of LAST HIT. See DESIGN.md. Palette and type come from the game's battle UI. */

/* 獅尾四季春 Swei Spring CJK SC: the game's own faces (Black for display, Medium for text), subset at build time. */
@font-face {
  font-family: "Swei Spring";
  src: url("/assets/swei-black-322a1bfdcb.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Swei Spring";
  src: url("/assets/swei-medium-f5e4130cb2.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --night: #17131f;
  --night-2: #201a2b;
  --vellum: #ebddbb;
  --vellum-dim: #c9bc9c;
  --gilt: #c9a35b;
  --teal: #5cc9cf;
  --ember: #e2672f;
  --umber: #2b2018;
  --strike: cubic-bezier(0.2, 0.9, 0.1, 1);
  --display: "Swei Spring", "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  --text: "Swei Spring", "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  --edge: clamp(20px, 5.5vw, 88px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night);
  color: var(--vellum);
  scrollbar-color: #4a4058 var(--night);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 400 1.0625rem/1.75 var(--text);
}

img,
video {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
}

::selection {
  background: var(--gilt);
  color: var(--umber);
}

:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 4px;
}

.skip {
  z-index: 200;
  background: var(--vellum);
  color: var(--umber);
  padding: 10px 16px;
  position: fixed;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
}

.skip:focus {
  transform: none;
}

.display {
  letter-spacing: -0.01em;
  text-wrap: balance;
  word-break: keep-all;
  font-family: var(--display);
  font-size: clamp(2.5rem, 5.2vw, 5.4rem);
  font-weight: 900;
  line-height: 1.08;
}

.display span {
  display: block;
}

html[lang="en"] .display {
  letter-spacing: -0.025em;
  line-height: 1;
}

/* ---------- Bar ---------- */

.bar {
  z-index: 50;
  align-items: center;
  gap: 28px;
  padding: 16px var(--edge);
  transition: background-color 0.4s ease, padding 0.4s var(--strike);
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

/* Opaque: a translucent bar let headlines show through and turned grey over the vellum chapter. */
.bar.solid {
  background: var(--night);
  padding-block: 10px;
  box-shadow: 0 1px 0 #c9a35b2e;
}

.mark {
  align-items: center;
  gap: 12px;
  text-decoration: none;
  display: flex;
}

.mark img {
  width: 36px;
  height: 36px;
}

.mark span {
  letter-spacing: 0.1em;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 900;
}

.nav {
  gap: 30px;
  margin-left: auto;
  display: flex;
}

.nav a,
.full {
  text-decoration: none;
  position: relative;
}

.nav a:after,
.full:after {
  content: "";
  background: var(--gilt);
  transform-origin: 100% 50%;
  height: 1px;
  transition: transform 0.35s var(--strike);
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  transform: scaleX(0);
}

@media (hover: hover) and (pointer: fine) {
  .nav a:hover:after,
  .full:hover:after {
    transform-origin: 0 50%;
    transform: none;
  }
}

.lang {
  gap: 4px;
  display: flex;
}

.lang button {
  opacity: 0.55;
  min-width: 34px;
  min-height: 34px;
  font-size: 0.875rem;
  transition: opacity 0.2s ease;
}

.lang button[aria-pressed="true"] {
  opacity: 1;
  color: var(--gilt);
}

/* ---------- 1. Dawn ---------- */

.dawn {
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  position: relative;
  overflow: hidden;
}

.dawn-art img {
  object-fit: cover;
  object-position: 50% 28%;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  animation: dawn-in 1.6s var(--strike) both, breathe 16s 1.6s ease-in-out infinite alternate;
}

.dawn:after {
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, #17131fa6, #17131f00 20%),
    linear-gradient(90deg, #17131fe0 0%, #17131f8c 30%, #17131f00 56%),
    linear-gradient(0deg, var(--night) 0%, #17131f00 26%);
  position: absolute;
  inset: 0;
}

.dawn-copy {
  z-index: 1;
  width: min(540px, 88vw);
  position: absolute;
  bottom: 11vh;
  left: var(--edge);
}

.logo {
  filter: drop-shadow(0 10px 30px #000a);
  width: min(430px, 66vw);
  height: auto;
  margin-left: -2%;
  animation: logo-slam 0.7s 0.25s var(--strike) both;
}

.dawn-line {
  font-family: var(--display);
  margin-top: 18px;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.4;
}

.dawn-sub {
  color: var(--vellum-dim);
  max-width: 30em;
  margin-top: 10px;
}

.dawn-line,
.dawn-sub,
.dawn-links {
  animation: rise 0.8s var(--strike) both;
}

.dawn-line {
  animation-delay: 0.55s;
}

.dawn-sub {
  animation-delay: 0.62s;
}

.dawn-links {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
  display: flex;
  animation-delay: 0.7s;
}

/* Cut-corner buttons, the shape of the game's own UI plates. The fill floods in from the left on hover. */
.go,
.mail {
  --cut: 10px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  text-decoration: none;
  background: linear-gradient(90deg, var(--vellum) 50%, var(--gilt) 50%) 100% 0 / 202% 100%;
  color: var(--umber);
  align-items: center;
  min-height: 48px;
  padding: 12px 26px;
  font-weight: 600;
  transition: background-position 0.45s var(--strike);
  display: inline-flex;
}

.go + .go {
  background: linear-gradient(90deg, var(--vellum) 50%, #ebddbb1f 50%) 100% 0 / 202% 100%;
  color: var(--vellum);
  transition: background-position 0.45s var(--strike), color 0.3s ease;
}

.go span,
.mail span {
  transition: transform 0.45s var(--strike);
}

@media (hover: hover) and (pointer: fine) {
  .go:hover,
  .mail:hover {
    background-position: 0 0;
  }

  .go + .go:hover {
    color: var(--umber);
  }

  .go:hover span,
  .mail:hover span {
    transform: translateX(4px);
  }
}

@keyframes dawn-in {
  from {
    filter: brightness(1.5) saturate(0.6);
    transform: scale(1.12);
  }
  to {
    filter: none;
    transform: scale(1.02);
  }
}

@keyframes breathe {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.06) translateY(-1%);
  }
}

@keyframes logo-slam {
  0% {
    opacity: 0;
    transform: scale(1.35);
  }
  60% {
    opacity: 1;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 2. The hand ---------- */

.hand-chapter {
  overflow-x: clip;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: 5vw;
  padding: 16vh var(--edge) 12vh;
  display: grid;
}

.hand-copy p:not(.note) {
  color: var(--vellum-dim);
  max-width: 31em;
  margin-top: 30px;
}

.note {
  color: #8f8573;
  margin-top: 26px;
  font-size: 0.875rem;
}

.hand {
  perspective: 1400px;
  height: clamp(380px, 40vw, 580px);
  position: relative;
}

.card {
  --x: 0%;
  --r: 0deg;
  --lift: 0%;
  transform-origin: 50% 118%;
  width: clamp(140px, 13.5vw, 214px);
  transition: transform 0.55s var(--strike), filter 0.3s ease;
  position: absolute;
  bottom: 12%;
  left: calc(50% - clamp(140px, 13.5vw, 214px) / 2);
  transform: translateX(var(--x)) translateY(var(--lift)) rotate(var(--r));
}

.card img {
  filter: drop-shadow(0 24px 28px #000b);
  width: 100%;
  height: auto;
}

.card:nth-of-type(1) {
  --x: -104%;
  --r: -13deg;
}

.card:nth-of-type(2) {
  --x: -54%;
  --r: -6.5deg;
}

.card:nth-of-type(3) {
  z-index: 1;
}

.card:nth-of-type(4) {
  --x: 54%;
  --r: 6.5deg;
}

.card:nth-of-type(5) {
  --x: 104%;
  --r: 13deg;
}

/* Dealt fast from below when the hand scrolls in. */
.js .hand:not(.dealt) .card {
  transform: translateX(0) translateY(70%) rotate(0deg);
  transition: none;
}

.hand.dealt .card {
  transition-delay: calc(var(--d, 0) * 1ms);
}

.card.played {
  --lift: -16%;
  z-index: 2;
}

.card.played img {
  filter: drop-shadow(0 0 18px #c9a35b99) drop-shadow(0 24px 28px #000b);
}

@media (hover: hover) and (pointer: fine) {
  .hand.dealt .card:hover {
    --lift: -16%;
    z-index: 3;
    transition-delay: 0ms;
  }
}

/* The WebGL hand (hand3d.js) draws over the buttons, which stay for keyboard and screen readers. The canvas bleeds out
   of the hand box: lifted cards, halos and sparks. Pointer input is read on the page, so nothing under it is blocked. */
.hand-gl {
  pointer-events: none;
  width: 128%;
  height: 140%;
  position: absolute;
  top: -32%;
  left: -14%;
}

.card {
  transition: transform 0.55s var(--strike), filter 0.3s ease, opacity 0.35s ease;
}

.hand.gl .card {
  opacity: 0;
  pointer-events: none;
}

body.over-card {
  cursor: pointer;
}

.hand-hint {
  text-align: center;
  color: #8f8573;
  font-size: 0.875rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.hint-touch,
.touch .hint-fine {
  display: none;
}

.touch .hint-touch {
  display: inline;
}

/* ---------- 3. Chains ---------- */

.chains {
  padding: 10vh var(--edge) 8vh;
}

.chains-head {
  grid-template-columns: 1.1fr 1fr;
  align-items: end;
  gap: 6vw;
  display: grid;
}

.chains-head p {
  color: var(--vellum-dim);
  max-width: 30em;
}

.stage {
  aspect-ratio: 16 / 9;
  background: #000;
  margin-top: 7vh;
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 90px #0009;
}

.stage video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.stage video[hidden] {
  display: none;
}

.styles {
  align-items: flex-end;
  gap: 18px;
  margin-top: 26px;
  display: flex;
}

/* The chosen style reads like a selected card in hand: raised, gilt-lit, underlined; the rest sit back at half strength. */
.style {
  opacity: 0.5;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  transition: opacity 0.3s ease;
  display: flex;
  position: relative;
}

.style img {
  filter: drop-shadow(0 10px 14px #0009) grayscale(0.6);
  width: 54px;
  height: auto;
  transition: transform 0.45s var(--strike), filter 0.3s ease;
}

.style span {
  font-family: var(--display);
  color: var(--vellum);
  font-size: 1.2rem;
  font-weight: 900;
  position: relative;
}

.style span:after {
  content: "";
  background: var(--gilt);
  transform-origin: 0 50%;
  height: 2px;
  transition: transform 0.4s var(--strike);
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  transform: scaleX(0);
}

.style[aria-checked="true"] {
  opacity: 1;
}

.style[aria-checked="true"] img {
  filter: drop-shadow(0 0 3px var(--gilt)) drop-shadow(0 0 16px #c9a35baa) drop-shadow(0 10px 14px #0009);
  transform: translateY(-10px) rotate(-4deg);
}

.style[aria-checked="true"] span:after {
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .style:hover {
    opacity: 0.85;
  }

  .style:hover img {
    filter: drop-shadow(0 10px 14px #0009);
    transform: translateY(-10px) rotate(-4deg);
  }
}

.full {
  color: var(--gilt);
  margin-left: auto;
  padding: 10px 0;
  font-size: 0.95rem;
}

/* ---------- 4. The road (the game map's dotted route) ---------- */

.road {
  background: linear-gradient(180deg, var(--night), var(--night-2) 40%, var(--night));
  padding: 10vh var(--edge) 14vh;
}

.route {
  margin-top: 8vh;
  position: relative;
}

.route-line {
  pointer-events: none;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  overflow: visible;
}

.route-dots {
  fill: none;
  stroke: var(--gilt);
  stroke-width: 5px;
  stroke-linecap: round;
  stroke-dasharray: 0 17;
}

.route-mask {
  fill: none;
  stroke: #fff;
  stroke-width: 24px;
}

.stops {
  gap: 11vh;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.stop {
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 10vw;
  display: grid;
  position: relative;
}

.stop:nth-child(2n) img {
  order: 2;
}

.stop img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  height: auto;
  transition: clip-path 0.9s var(--strike), filter 0.9s ease;
  box-shadow: 0 30px 70px #000a;
}

.js .stop:not(.reached) img {
  clip-path: inset(0 0 0 100%);
  filter: brightness(1.6);
}

.js .stop:nth-child(2n):not(.reached) img {
  clip-path: inset(0 100% 0 0);
}

.stop-text h3 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 900;
  line-height: 1.2;
}

.stop-text p {
  color: var(--vellum-dim);
  max-width: 22em;
  margin-top: 10px;
}

/* The pins are the route's nodes, ringed like the map's. */
.pin {
  z-index: 1;
  background: var(--night);
  border: 3px solid var(--gilt);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
  position: absolute;
  top: calc(50% - 11px);
  left: calc(50% - 11px);
}

.stop.reached .pin {
  background: var(--gilt);
  box-shadow: 0 0 0 6px #c9a35b33;
}

/* ---------- 5. Studio ---------- */

.studio {
  background: var(--vellum);
  color: var(--umber);
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
  gap: 6vw;
  padding: 18vh var(--edge);
  display: grid;
}

.studio .display {
  font-size: clamp(2.5rem, 5.6vw, 5.4rem);
}

/* The drifting cards (studio3d.js) behind the text; faded out toward the section's top and bottom edges. */
.studio {
  isolation: isolate;
  position: relative;
  overflow: hidden;
}

.studio > * {
  z-index: 1;
  position: relative;
}

.studio > .studio-gl {
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#0000, #000 14%, #000 86%, #0000);
  mask-image: linear-gradient(#0000, #000 14%, #000 86%, #0000);
  z-index: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.studio-text p {
  max-width: 32em;
  font-size: 1.125rem;
  line-height: 1.95;
}

.studio-text p + p {
  margin-top: 1.4em;
}

.studio ::selection {
  background: var(--umber);
  color: var(--vellum);
}

.studio :focus-visible {
  outline-color: var(--umber);
}

/* ---------- 6. The last hit ---------- */

.finale {
  background: radial-gradient(circle at 26% 50%, #e2672f2e, #e2672f00 42%), var(--night);
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7vw;
  min-height: 100vh;
  padding: 16vh var(--edge);
  display: grid;
  overflow: hidden;
}

.finale-dial {
  --dial: clamp(220px, 24vw, 340px);
  text-align: center;
  position: relative;
}

.finale-hint {
  color: var(--vellum-dim);
  margin-top: 22px;
  font-size: 0.95rem;
}

/* 战斗胜利 stamps across the spent dial, a banner like the game's victory screen. */
.victory {
  z-index: 1;
  font-family: var(--display);
  color: var(--vellum);
  letter-spacing: 0.14em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, #b8401f00, #b8401f 16%, #cf5a2c 50%, #b8401f 84%, #b8401f00);
  padding: 0.1em 1.1em 0.14em 1.24em;
  font-size: clamp(2.6rem, 4.4vw, 4.4rem);
  font-weight: 900;
  line-height: 1.2;
  position: absolute;
  top: calc(var(--dial) / 2);
  left: 50%;
  transform: translate(-50%, -50%) rotate(-7deg) scale(1.8);
  text-shadow: 0 3px 0 #5a1c0c, 0 0 30px #e2672f;
}

.finale.won .victory {
  animation: victory 0.6s 0.3s var(--strike) forwards;
}

@keyframes victory {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-7deg) scale(1.8);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-7deg) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-7deg);
  }
}

.finale-copy > p {
  color: var(--vellum-dim);
  max-width: 31em;
  margin-top: 26px;
}

.finale-copy .territory {
  color: var(--gilt);
  margin-top: 18px;
}

.mail {
  margin-top: 34px;
}

/* After the win the contact button floods once, vellum to gilt, the same motion as its hover (Shu 10-28: the white
   light sweep that was here looked wrong). backwards: the hover still works afterwards. */
.finale.won .mail {
  animation: cta-flood 0.9s 0.7s var(--strike) backwards;
}

@keyframes cta-flood {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 100% 0;
  }
}

.mail-plain {
  color: #8f8573;
  user-select: all;
  margin-top: 12px;
  font-size: 0.875rem;
}

/* ---------- The dial (the game's LAST HIT button) ---------- */

.dial {
  border-radius: 50%;
  place-items: center;
  width: clamp(220px, 24vw, 340px);
  height: clamp(220px, 24vw, 340px);
  transition: transform 0.4s var(--strike);
  display: grid;
  position: relative;
}

.dial svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  overflow: visible;
  transform: rotate(-90deg);
}

/* Gilt furniture after the in-game button: outer rim with four gems, tick ring, inner bead line. */
.dial-rim {
  fill: none;
  stroke: var(--gilt);
  stroke-width: 1.2px;
}

.dial-track {
  fill: #1d1727;
  stroke: #c9a35b55;
  stroke-width: 3px;
}

.dial-ticks {
  fill: none;
  stroke: #c9a35b8c;
  stroke-width: 3px;
  stroke-dasharray: 0.5 4.5;
}

.dial-inner {
  fill: none;
  stroke: #c9a35b59;
  stroke-width: 0.8px;
}

.dial-gems {
  fill: var(--gilt);
  transition: fill 0.4s ease;
}

.dial-corner .dial-ticks,
.dial-corner .dial-inner {
  display: none;
}

.dial.ready .dial-gems {
  fill: var(--ember);
}

.dial-charge {
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-width: 6px;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.5s var(--strike), stroke 0.4s ease;
}

.dial-face {
  text-align: center;
  font-family: var(--display);
  color: var(--gilt);
  letter-spacing: 0.02em;
  font-size: clamp(2.2rem, 3.4vw, 3.4rem);
  font-weight: 900;
  line-height: 0.92;
  position: relative;
}

.dial.ready .dial-charge {
  stroke: var(--ember);
}

.dial.ready .dial-face {
  color: var(--vellum);
  text-shadow: 0 0 22px #e2672fcc;
}

.dial.ready {
  animation: ready 1.8s ease-in-out infinite;
}

@media (hover: hover) and (pointer: fine) {
  .dial:hover {
    transform: scale(1.04);
  }
}

.dial:active {
  transform: scale(0.96);
}

@keyframes ready {
  0%,
  to {
    box-shadow: 0 0 0 0 #e2672f00, 0 0 40px 4px #e2672f40;
  }
  50% {
    box-shadow: 0 0 0 10px #e2672f1f, 0 0 60px 10px #e2672f66;
  }
}

/* Spent: the ring turns gilt, the face dims under the banner, one shock ring leaves the button. */
.dial-big:after {
  content: "";
  pointer-events: none;
  opacity: 0;
  border: 3px solid var(--ember);
  border-radius: 50%;
  position: absolute;
  inset: 0;
}

.finale.won .dial-big {
  animation: none;
  box-shadow: 0 0 70px 12px #e2672f40;
}

.finale.won .dial-big:after {
  animation: shock 0.9s 0.3s var(--strike);
}

.finale.won .dial-big .dial-charge {
  stroke: var(--gilt);
}

.finale.won .dial-big .dial-face {
  opacity: 0.2;
}

@keyframes shock {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: scale(1.9);
  }
}

.dial-corner {
  z-index: 45;
  width: 78px;
  height: 78px;
  transition: transform 0.45s var(--strike), opacity 0.3s ease;
  position: fixed;
  bottom: 22px;
  right: 22px;
}

.dial-corner .dial-face {
  font-size: 0.82rem;
}

.dial-corner.tucked {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.6);
}

.dial-count {
  font-family: var(--display);
  color: var(--teal);
  background: var(--night);
  border: 1px solid #5cc9cf66;
  border-radius: 10px;
  min-width: 30px;
  padding: 0 7px;
  font-size: 0.78rem;
  line-height: 20px;
  position: absolute;
  top: -6px;
  left: -10px;
}

.dial.ready .dial-count {
  color: var(--ember);
  border-color: #e2672f88;
}

.dial-tip {
  z-index: 45;
  background: var(--night-2);
  color: var(--vellum);
  opacity: 0;
  pointer-events: none;
  max-width: 260px;
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.6;
  transition: opacity 0.25s ease, transform 0.35s var(--strike);
  position: fixed;
  bottom: 112px;
  right: 22px;
  transform: translateY(8px);
  box-shadow: 0 14px 30px #0008;
}

.dial-tip.on {
  opacity: 1;
  transform: none;
}

/* Damage numbers, popped where a card was played. */
.pop {
  z-index: 60;
  pointer-events: none;
  font-family: var(--display);
  color: var(--teal);
  font-size: 2rem;
  font-weight: 900;
  position: fixed;
  text-shadow: 0 2px 12px #000c;
  animation: pop 0.95s var(--strike) forwards;
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.6);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -26px) scale(1.15);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -70px) scale(1);
  }
}

/* ---------- The cut-in ---------- */

/* The WebGL blow (lasthit3d.js) draws here; the .cutin markup below is its fallback. */
.fx3d {
  z-index: 100;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
  display: none;
  position: fixed;
  inset: 0;
}

.fx3d.on {
  display: block;
}

.cutin {
  z-index: 100;
  pointer-events: none;
  display: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.cutin.on {
  display: block;
}

.cut {
  width: 31vw;
  height: 140vh;
  position: absolute;
  top: -20vh;
  overflow: hidden;
  transform: skewX(-13deg) translateX(130vw);
  box-shadow: 0 0 0 3px var(--night);
}

.cut img {
  object-fit: cover;
  object-position: 50% 12%;
  width: 150%;
  max-width: none;
  height: 78%;
  margin: 24vh 0 0 -25%;
  transform: skewX(13deg);
}

.cut-1 {
  background: #b8401f;
  left: -6vw;
}

.cut-2 {
  background: #1f3e4a;
  left: 20vw;
}

.cut-3 {
  background: #b8401f;
  left: 46vw;
}

.cut-4 {
  background: #1f3e4a;
  left: 72vw;
}

.cutin.on .cut {
  animation: cut-in 0.42s var(--strike) forwards;
}

.cutin.on .cut-2 {
  animation-delay: 0.07s;
}

.cutin.on .cut-3 {
  animation-delay: 0.14s;
}

.cutin.on .cut-4 {
  animation-delay: 0.21s;
}

.cutin-logo {
  filter: drop-shadow(0 12px 40px #000);
  opacity: 0;
  width: min(620px, 74vw);
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

.cutin.on .cutin-logo {
  animation: stamp 0.5s 0.55s var(--strike) forwards;
}

/* The hit lands as a warm burst from the button you pressed (--bx/--by), settling to night under the finale. */
.cutin-flash {
  clip-path: circle(0 at var(--bx, 50%) var(--by, 50%));
  background: radial-gradient(
    circle at var(--bx, 50%) var(--by, 50%),
    #fff1cf 0,
    #f3a052 7%,
    var(--ember) 17%,
    #6e2414 38%,
    var(--night) 66%
  );
  position: absolute;
  inset: 0;
}

.cutin.on .cutin-flash {
  animation: burst 0.7s 1.35s var(--strike) forwards;
}

@keyframes cut-in {
  to {
    transform: skewX(-13deg) translateX(0);
  }
}

@keyframes stamp {
  0% {
    opacity: 0;
    transform: scale(1.7) rotate(-4deg);
  }
  55% {
    opacity: 1;
    transform: scale(0.94) rotate(0deg);
  }
  70% {
    transform: scale(1.02) translateX(-6px);
  }
  85% {
    transform: scale(1) translateX(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes burst {
  to {
    clip-path: circle(150vmax at var(--bx, 50%) var(--by, 50%));
  }
}

/* ---------- Phone ---------- */

@media (width<=760px) {
  body {
    font-size: 1rem;
  }

  .display,
  .studio .display {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .bar {
    gap: 14px;
    padding: 12px 16px;
  }

  .mark span {
    display: none;
  }

  .nav {
    gap: 16px;
    font-size: 0.9rem;
  }

  .lang button {
    min-width: 30px;
  }

  .dawn-art img {
    object-position: 50% 20%;
  }

  .dawn:after {
    background:
      linear-gradient(180deg, #17131fa6, #17131f00 16%),
      linear-gradient(0deg, var(--night) 0%, #17131fd9 34%, #17131f00 62%);
  }

  .dawn-copy {
    bottom: 8vh;
  }

  .dawn-line {
    font-size: 1.3rem;
  }

  .go {
    padding-inline: 20px;
  }

  .hand-chapter,
  .chains-head,
  .studio,
  .finale {
    grid-template-columns: 1fr;
  }

  .hand-chapter {
    gap: 6vh;
    padding-top: 10vh;
  }

  .hand {
    height: 82vw;
  }

  .card {
    width: 25vw;
    left: calc(50% - 12.5vw);
    bottom: 14%;
  }

  .card:nth-of-type(1) {
    --x: -90%;
    --r: -12deg;
  }

  .card:nth-of-type(2) {
    --x: -47%;
    --r: -6deg;
  }

  .card:nth-of-type(4) {
    --x: 47%;
    --r: 6deg;
  }

  .card:nth-of-type(5) {
    --x: 90%;
    --r: 12deg;
  }

  .chains-head {
    gap: 22px;
  }

  .stage {
    margin-inline: calc(-1 * var(--edge));
    margin-top: 5vh;
  }

  .styles {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 8px 14px;
    display: grid;
  }

  .style {
    gap: 10px;
  }

  .style img {
    width: 40px;
  }

  .style span {
    white-space: nowrap;
    font-size: 1.05rem;
  }

  /* Full width, but the text stays clear of the corner dial's column. */
  .full {
    text-align: left;
    grid-column: 1 / -1;
    margin-left: 0;
    padding-right: 84px;
  }

  .route {
    margin-top: 6vh;
  }

  .stops {
    gap: 8vh;
  }

  /* Heading first, then the screenshot, so each pin sits beside its own heading. */
  .stop {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-left: 44px;
  }

  .stop-text {
    order: -1;
  }

  .stop:nth-child(2n) img {
    order: 0;
  }

  .pin {
    top: 5px;
    left: 0;
  }

  .studio {
    gap: 5vh;
    padding-block: 12vh;
  }

  .finale {
    text-align: left;
    gap: 6vh;
    padding-block: 12vh;
  }

  .finale-dial {
    --dial: 200px;
    justify-self: center;
  }

  .dial {
    width: 200px;
    height: 200px;
  }

  .dial-corner {
    width: 62px;
    height: 62px;
    bottom: 16px;
    right: 16px;
  }

  .dial-corner .dial-face {
    font-size: 0.66rem;
  }

  .dial-tip {
    bottom: 92px;
    right: 16px;
  }

  .cut {
    width: 46vw;
  }

  .cut-1 {
    left: -14vw;
  }

  .cut-2 {
    left: 16vw;
  }

  .cut-3 {
    left: 46vw;
  }

  .cut-4 {
    left: 76vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  :before,
  :after {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }

  .js .hand:not(.dealt) .card {
    transform: translateX(var(--x)) rotate(var(--r));
  }

  .js .stop:not(.reached) img {
    clip-path: none;
    filter: none;
  }

  .finale.won .victory {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-7deg);
  }
}

/* The 2026-10-12 footer, unchanged: its rules lifted from the old stylesheet and given the old variables. */
.footer{--paper:#eeede9;--ink:#1c1d18;--red:#bc3c2b;--muted:#57594f;--line:#c9c9bf;--gutter:max(6vw,calc((100vw - 1440px)/2));--font:"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",Arial,sans-serif;--ease:cubic-bezier(.22,1,.36,1);color:var(--ink);font-family:var(--font);line-height:1.5}.footer a{color:inherit;text-decoration:none}.footer p{margin:0}.footer img{display:inline-block}.footer .arrow{flex-shrink:0;width:24px;height:24px}@media (width<=760px){.footer{--gutter:24px}}
.footer{padding:61px var(--gutter) 25px;background:#deddd7}.footer-top{align-items:center;gap:35px;padding-bottom:36px;display:flex}.footer-wordmark{letter-spacing:-.04em;gap:8px;font:800 clamp(2rem,4vw,4rem)/1 Arial,sans-serif;display:flex}.footer-wordmark>span{letter-spacing:0;padding-top:6px;font-size:12px;font-weight:400}.footer-top>p{color:#66665e;font-size:.875rem}.to-top{border:1px solid #aaa99f;border-radius:50%;place-items:center;width:45px;height:45px;margin-left:auto;display:grid}.to-top .arrow{transform:rotate(-90deg)}.footer-middle{border-top:1px solid #bab9af;justify-content:space-between;gap:35px;padding:31px 0 40px;display:flex}.footer-middle p{font-size:.875rem;line-height:1.8}.footer-middle p+p{color:#6b6b62;margin-top:4px;font-size:.75rem}.footer-contact>span{letter-spacing:.06em;color:#65655d;margin-bottom:10px;font-size:.625rem;display:block}.footer-contact>a{word-break:break-word;align-items:center;gap:30px;font-size:1rem;display:flex}.footer-contact .arrow{width:17px;height:17px}.footer-bottom{color:#66665f;border-top:1px solid #bab9af;flex-wrap:wrap;align-items:center;gap:20px;padding-top:23px;font-size:.75rem;display:flex}.footer-bottom>p{font-size:.625rem}.police-filing{white-space:nowrap;align-items:center;gap:6px;display:inline-flex}.police-filing img{object-fit:contain;flex-shrink:0;width:20px;height:20px}.legal-links{gap:20px;margin-left:auto;display:flex}.footer a:hover{color:var(--red)}@media (width<=1000px){.footer-top>p{margin-left:auto}.to-top,.legal-links{margin-left:0}}@media (width<=760px){.footer{padding-top:38px}.footer-top{flex-wrap:wrap;gap:16px;padding-bottom:28px}.footer-wordmark{font-size:2.2rem}.footer-top>p{flex-basis:100%;order:3;font-size:.8rem}.to-top{width:36px;height:36px;margin-left:auto}.footer-middle{flex-direction:column;gap:27px;padding:27px 0}.footer-contact>a{gap:20px;font-size:.925rem}.footer-bottom{gap:15px;font-size:.6875rem}.footer-bottom>p{flex-basis:100%}.legal-links{flex-basis:100%;gap:23px;margin-top:3px}}
