@font-face {
  font-family: Immortal;
  src: local("STKaiti"), local("KaiTi");
}
* {
  box-sizing: border-box;
}
:root {
  color-scheme: dark;
  --gold: #d6ba7d;
  --ink: #0c2627;
  --paper: #f3e8d0;
  --muted: #a5b4aa;
}
body {
  margin: 0;
  background: #081e20;
  color: var(--paper);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(
      90deg,
      rgba(4, 22, 24, 0.97),
      rgba(5, 24, 26, 0.75) 48%,
      rgba(3, 24, 26, 0.18)
    ),
    url("art/immortal-mountain.png") center/cover;
}
body:after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #061d20, transparent 50%);
  pointer-events: none;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: 0;
  background: transparent;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid #ffe1a2;
  outline-offset: 5px;
}
button:hover {
  filter: brightness(1.18);
}
[hidden] {
  display: none !important;
}
#app {
  max-width: 1120px;
  padding: 0 48px;
  margin: auto;
}
header {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d6ba7d33;
}
.brand {
  color: var(--paper);
  text-decoration: none;
  font:
    30px Immortal,
    serif;
  letter-spacing: 5px;
}
.brand span {
  font-size: 18px;
  color: var(--gold);
  margin-left: 8px;
}
nav {
  display: flex;
  gap: 25px;
  color: #dfd2b5;
  font-size: 12px;
}
nav button {
  padding: 10px 0;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--gold);
  margin: 0 0 15px;
}
#intro {
  min-height: 680px;
  height: calc(100vh - 165px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.intro-copy h1 {
  font:
    clamp(44px, 5vw, 70px)/1.35 Immortal,
    "STKaiti",
    serif;
  letter-spacing: 5px;
  margin: 20px 0;
}
.intro-copy h1 span {
  color: var(--gold);
}
.intro-text {
  color: #b8c8bc;
  line-height: 2;
  font-size: 15px;
  letter-spacing: 2px;
  margin: 24px 0 32px;
}
.primary {
  background: linear-gradient(110deg, #e5d09a, #c1a261);
  color: #202c25;
  min-height: 58px;
  padding: 15px 30px;
  font-weight: bold;
  letter-spacing: 3px;
  border: 1px solid #f0d9a6;
  box-shadow: 0 5px 30px #0003;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 55px;
}
.primary span {
  font-size: 13px;
  letter-spacing: 2px;
}
.small {
  font-size: 11px;
  color: #a2b4a9;
  margin-top: 20px;
  letter-spacing: 1px;
}
.intro-seal {
  margin-right: 9%;
  margin-top: 200px;
  display: grid;
  justify-items: center;
  color: var(--gold);
  text-shadow: 0 2px 20px #000;
}
.intro-seal strong {
  font:
    100px Immortal,
    serif;
  border: 1px solid #d6ba7d88;
  border-radius: 50%;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 12px #d6ba7d11;
  margin: 20px;
}
.intro-seal span {
  font-size: 12px;
  letter-spacing: 6px;
}
footer {
  border-top: 1px solid #d6ba7d33;
  padding: 20px 0;
  color: #a9b6a8;
  font:
    16px Immortal,
    serif;
  display: flex;
  justify-content: space-between;
}
footer span {
  font:
    11px "Microsoft YaHei",
    sans-serif;
  letter-spacing: 2px;
}
#game {
  max-width: 760px;
  margin: 35px auto 45px;
}
.chapter {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chapter h1 {
  font:
    34px Immortal,
    serif;
  letter-spacing: 4px;
  margin: 0 0 15px;
}
.chapter .eyebrow {
  margin-bottom: 6px;
}
.turn-count b {
  font:
    42px Georgia,
    serif;
  color: var(--gold);
}
.turn-count span {
  font-size: 12px;
  color: var(--muted);
}
#rail {
  display: flex;
  gap: 8px;
  margin: 10px 0 26px;
}
#rail i {
  height: 4px;
  flex: 1;
  background: #65807955;
}
#rail i.done {
  background: var(--gold);
}
#rail i.now {
  background: #f2e1ba;
  box-shadow: 0 0 10px #ecd09688;
}
.machine {
  border: 1px solid #bda56d88;
  background: linear-gradient(120deg, #112e2eeb, #0a2023f5);
  padding: 16px;
  box-shadow:
    0 20px 60px #0004,
    inset 0 0 0 5px #c9ae6f0b;
}
.machine-top,
.machine-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
}
.machine-top {
  margin-bottom: 18px;
}
.reels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.reel {
  text-align: center;
  min-width: 0;
}
.reel-label {
  font-size: 13px;
  color: #d8ccaf;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.window {
  height: 135px;
  border: 1px solid #b5b38244;
  background: linear-gradient(#0008, #173a36 45%, #0007);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.window:before,
.window:after {
  content: "✦";
  position: absolute;
  font-size: 22px;
  color: #92ada133;
  left: 0;
  right: 0;
  line-height: 1;
}
.window:before {
  top: 6px;
}
.window:after {
  bottom: 6px;
}
.gain {
  font:
    32px Georgia,
    serif;
  text-shadow: 0 0 20px currentColor;
}
.reel-value {
  margin-top: 12px;
  font:
    24px Georgia,
    serif;
  color: var(--paper);
}
.reel-value small {
  font: 9px sans-serif;
  color: #a5b4aa;
}
.reel-grade {
  font-size: 10px;
  color: #9bad9e;
  min-height: 18px;
}
.machine-bottom {
  gap: 8px;
  justify-content: flex-start;
  margin-top: 16px;
  font-size: 10px;
  letter-spacing: 0;
}
.machine-bottom #total {
  margin-left: auto;
}
.t0 {
  color: #7b8d89;
}
.t1 {
  color: #e4ebdf;
}
.t2 {
  color: #6ebeee;
}
.t3 {
  color: #89d6a6;
}
.t4 {
  color: #f39487;
}
.t5 {
  color: #ffcf70;
}
.t6 {
  color: #f0b7ed;
  text-shadow: 0 0 14px #d78ab8;
}
.reel.landing .window {
  animation: land 0.45s;
}
.rolling .gain {
  animation: tumble 0.16s infinite;
}
.locked .window {
  opacity: 0.4;
}
.locked .gain {
  font: 18px serif;
  letter-spacing: 1px;
}
.locked .reel-value {
  font-size: 14px;
}
.machine.rush {
  border-color: #f2a5bf;
  box-shadow: 0 0 35px #df98b92b;
}
.machine.freeze {
  animation: moon 2s infinite;
}
.status {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin: 16px 0;
}
.status b {
  color: #dfd3b9;
  margin-left: 6px;
}
#message {
  min-height: 48px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #dfd3b9;
  font-size: 13px;
  margin: 18px 0;
}
.spin {
  width: 100%;
  font-size: 18px;
}
.under-spin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #8fa89c;
  margin-top: 9px;
}
.under-spin button {
  font-size: 11px;
}
.journal {
  border-top: 1px solid #bda56d44;
  margin-top: 24px;
  font-size: 12px;
  color: #b1bfb1;
}
.journal summary {
  cursor: pointer;
  padding: 13px 0;
  letter-spacing: 2px;
}
.journal ol {
  padding-left: 23px;
}
.journal li {
  padding: 5px 0;
}
.journal summary span {
  float: right;
  color: var(--gold);
}
dialog {
  color: var(--paper);
  background: #102c2dfc;
  border: 1px solid #c4ab76;
  width: min(520px, calc(100vw - 24px));
  max-height: 88vh;
  padding: 35px;
  box-shadow: 0 30px 100px #0009;
}
dialog::backdrop {
  background: #020f12bd;
  backdrop-filter: blur(7px);
}
dialog h2 {
  font:
    30px Immortal,
    serif;
  color: var(--gold);
  margin: 10px 0 16px;
  letter-spacing: 3px;
}
dialog p {
  color: #bac9bc;
  font-size: 13px;
}
.close {
  position: absolute;
  right: 12px;
  top: 5px;
  font-size: 24px;
  color: #9cae9f;
}
.choices {
  display: grid;
  gap: 12px;
  margin-top: 25px;
}
.choice {
  border: 1px solid #a38d5b99;
  text-align: left;
  padding: 15px 18px;
  display: grid;
  background: #e6d59b08;
}
.choice strong {
  font-size: 17px;
  font-family: Immortal, serif;
  letter-spacing: 2px;
  color: #ecdbb1;
}
.choice small {
  color: #aebfae;
  margin-top: 4px;
}
.event-list {
  list-style: none;
  padding: 0;
}
.event-list li {
  border-bottom: 1px solid #b1ad7933;
  padding: 9px 0;
  color: #9aac9f;
  font-size: 13px;
}
.event-list .win {
  color: #dfce98;
}
.event-list .fail {
  color: #df9f96;
}
.event-list span {
  float: right;
}
.portrait {
  background-image: url("art/companions.png");
  background-size: 400% 300%;
  background-position: var(--px) var(--py);
  background-color: #213f3c;
  aspect-ratio: 1/1;
  border: 1px solid #d3ba7d66;
}
.vow-portrait {
  width: 130px;
  float: right;
  margin: 0 0 12px 18px;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.album-card {
  padding: 0;
  text-align: center;
}
.album-card .portrait {
  display: block;
  width: 100%;
}
.album-card small {
  display: block;
  color: #95ab9e;
  font-size: 10px;
}
.album-card .name {
  font-size: 13px;
  display: block;
}
.album-card.unseen .portrait {
  filter: grayscale(1) brightness(0.4);
}
.album-card.unseen .name {
  color: #a8b5a7;
}
.rate {
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #c3b07422;
  padding: 5px 0;
}
.result-card {
  max-width: 720px;
  margin: 40px auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  border: 1px solid #c9ae70;
  background: #0b2728e8;
  padding: 22px;
  gap: 30px;
}
.result-card h1 {
  font:
    42px Immortal,
    serif;
  letter-spacing: 3px;
  margin: 8px 0;
  color: var(--gold);
}
.result-card h2 {
  font:
    18px Immortal,
    serif;
  letter-spacing: 3px;
  margin: 8px 0;
}
.result-card blockquote {
  color: #edcfab;
  font:
    20px/1.8 Immortal,
    serif;
  margin: 20px 0;
}
.result-card p {
  color: #aebfb0;
  font-size: 12px;
}
.result-card .memory {
  padding-top: 14px;
  border-top: 1px solid #d6ba7d44;
  color: #ddcba2;
}
.result-actions {
  max-width: 720px;
  margin: 0 auto 40px;
  display: flex;
  gap: 12px;
}
.result-actions button {
  flex: 1;
}
.secondary {
  border: 1px solid #b89f69;
  padding: 15px;
  letter-spacing: 2px;
}
#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  background: #eedab6;
}
#flash.go {
  animation: flash 0.8s;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: #172e2c;
  border: 1px solid #bba36f;
  padding: 10px 24px;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  font-size: 13px;
}
#toast.on {
  opacity: 1;
}
@keyframes tumble {
  0% {
    transform: translateY(-40px);
    filter: blur(2px);
  }
  100% {
    transform: translateY(40px);
    filter: blur(3px);
  }
}
@keyframes land {
  0% {
    transform: translateY(-8px);
  }
  40% {
    transform: translateY(4px);
    background: #b59a5933;
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes flash {
  0% {
    opacity: 0.65;
  }
  100% {
    opacity: 0;
  }
}
@keyframes moon {
  50% {
    box-shadow: 0 0 70px #b5ccdb66;
  }
}
@media (max-width: 650px) {
  #app {
    padding: 0 18px;
  }
  header {
    height: 78px;
  }
  nav {
    gap: 16px;
  }
  .brand {
    font-size: 24px;
  }
  .brand span {
    font-size: 14px;
  }
  #intro {
    min-height: 650px;
    align-items: flex-start;
    padding-top: 65px;
    height: calc(100svh - 130px);
  }
  body:before {
    background-position: 65% center;
  }
  .intro-copy h1 {
    font-size: 46px;
  }
  .intro-seal {
    display: none;
  }
  .intro-text {
    font-size: 13px;
  }
  footer span {
    font-size: 9px;
    letter-spacing: 0;
  }
  #game {
    margin-top: 25px;
  }
  .reels {
    gap: 5px;
  }
  .machine {
    padding: 12px 8px;
  }
  .reel-label {
    font-size: 11px;
    letter-spacing: 1px;
  }
  .window {
    height: 110px;
  }
  .gain {
    font-size: 25px;
  }
  .reel-value {
    font-size: 21px;
  }
  .reel-grade {
    font-size: 9px;
  }
  .machine-top {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .status {
    font-size: 10px;
  }
  .result-card {
    grid-template-columns: 1fr;
    max-width: 430px;
    padding: 18px;
    gap: 15px;
  }
  .result-card .portrait {
    max-height: 370px;
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 280px;
    margin: auto;
  }
  .result-card h1 {
    font-size: 36px;
  }
  .result-card blockquote {
    font-size: 18px;
    margin: 15px 0;
  }
  dialog {
    padding: 28px 22px;
  }
  .result-actions {
    max-width: 430px;
  }
  .chapter h1 {
    font-size: 30px;
  }
  #rail {
    gap: 5px;
  }
  .locked .gain {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.result-card > .portrait {
  align-self: center;
}
