:root {
  --night: #080b10;
  --card: rgba(18, 22, 29, 0.82);
  --card-edge: rgba(255, 255, 255, 0.075);
  --text: #e9e5dc;
  --muted: #8e939b;
  --faint: #5f6670;
  --accent: #b8ac8d;
  --accent-soft: rgba(184, 172, 141, 0.12);
}

* { box-sizing: border-box; }

html {
  background: var(--night);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.night-page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 44px 22px 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(93, 104, 121, 0.09), transparent 38%),
    linear-gradient(165deg, #0b0e14 0%, #07090d 58%, #090b10 100%);
}

.night-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: 0.025;
  background-image: radial-gradient(rgba(255,255,255,.7) .45px, transparent .45px);
  background-size: 5px 5px;
  pointer-events: none;
}

.ambient {
  position: absolute;
  z-index: -2;
  width: min(56vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.025);
  border-radius: 50%;
  filter: blur(1px);
}

.ambient-one { top: -34vw; right: -14vw; }
.ambient-two { bottom: -40vw; left: -18vw; transform: scale(.72); }

.shuffle-card {
  width: min(100%, 620px);
  min-height: 666px;
  display: flex;
  flex-direction: column;
  padding: 28px 34px 27px;
  border: 1px solid var(--card-edge);
  border-radius: 30px;
  background: var(--card);
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(22px);
  opacity: .65;
  transition: opacity .7s ease;
}

.shuffle-card.is-ready { opacity: 1; }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #737a84;
  font-size: 12px;
  letter-spacing: .14em;
}

.card-header p { margin: 0; }

.moon-mark {
  position: relative;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #a59b80;
  box-shadow: 0 0 22px rgba(184, 172, 141, 0.16);
}

.moon-mark span {
  position: absolute;
  width: 17px;
  height: 17px;
  top: -3px;
  right: -4px;
  border-radius: 50%;
  background: #13171d;
}

.status-dot {
  width: 4px;
  height: 4px;
  margin-left: auto;
  border-radius: 50%;
  background: #697064;
  box-shadow: 0 0 0 4px rgba(105, 112, 100, .08);
}

.hairline {
  height: 1px;
  margin: 25px 0 0;
  background: linear-gradient(90deg, rgba(255,255,255,.075), rgba(255,255,255,.02) 70%, transparent);
}

.card-content {
  flex: 1;
  padding: 49px 10px 32px;
  animation: settle .6s cubic-bezier(.22,.8,.36,1) both;
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .2em;
}

.mode-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 18px;
  padding: 6px 11px;
  border: 1px solid rgba(184, 172, 141, 0.14);
  border-radius: 999px;
  color: #918975;
  background: rgba(184, 172, 141, 0.045);
  font-size: 11px;
  letter-spacing: .12em;
}

h1 {
  margin: 0;
  color: var(--text);
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-size: clamp(39px, 7vw, 57px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: .02em;
  text-wrap: balance;
}

.rule {
  max-width: 500px;
  margin: 26px 0 0;
  color: #9b9da1;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.9;
  letter-spacing: .025em;
}

.example-block {
  margin-top: 38px;
  padding-left: 18px;
  border-left: 1px solid rgba(184, 172, 141, 0.28);
}

.example-block span {
  display: block;
  margin-bottom: 9px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .14em;
}

.example-block p {
  margin: 0;
  color: #c7c1b3;
  font-family: "Songti SC", STSong, serif;
  font-size: 20px;
  letter-spacing: .035em;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirm-button,
.shuffle-button {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(184, 172, 141, 0.16);
  border-radius: 16px;
  color: #b9b3a6;
  background: var(--accent-soft);
  font-size: 14px;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.confirm-button {
  border-color: rgba(184, 172, 141, 0.25);
  color: #d1c9b8;
  background: rgba(184, 172, 141, 0.18);
}

.confirm-button span {
  color: #aaa087;
  font-size: 15px;
}

.confirm-button:hover:not(:disabled) {
  background: rgba(184, 172, 141, 0.23);
  border-color: rgba(184, 172, 141, 0.34);
}

.confirm-button.is-confirmed {
  border-color: rgba(117, 133, 113, 0.2);
  color: #939d8d;
  background: rgba(105, 121, 101, 0.1);
  cursor: default;
}

.confirm-button.is-confirmed span { color: #798875; }

.shuffle-button span {
  color: #8e8777;
  font-size: 18px;
  transform: translateY(-1px);
}

.shuffle-button:hover {
  background: rgba(184, 172, 141, 0.17);
  border-color: rgba(184, 172, 141, 0.24);
}

.confirm-button:active:not(:disabled),
.shuffle-button:active { transform: scale(.992); }
.confirm-button:focus-visible,
.shuffle-button:focus-visible { outline: 2px solid #746d5d; outline-offset: 3px; }

.quiet-note {
  margin: 17px 0 0;
  color: #5e646d;
  text-align: center;
  font-size: 11px;
  letter-spacing: .07em;
}

.local-note {
  position: absolute;
  bottom: 13px;
  margin: 0;
  color: #3d434c;
  font-size: 10px;
  letter-spacing: .06em;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(8px); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (max-width: 620px) {
  .night-page { padding: 14px; place-items: stretch; }
  .shuffle-card {
    min-height: calc(100svh - 44px);
    padding: 24px 22px 23px;
    border-radius: 25px;
  }
  .card-content { padding: 42px 4px 28px; }
  .example-block { margin-top: 32px; }
  .local-note { display: none; }
}

@media (max-height: 720px) {
  .shuffle-card { min-height: min(640px, calc(100svh - 28px)); }
  .card-content { padding-top: 30px; }
  .example-block { margin-top: 25px; }
}

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