:root {
  --cream: #fde6b0;
  --cream-deep: #f3d78a;
  --ink-green: #3a5a1c;
  --olive: #6a9634;
  --olive-dark: #2a3d14;
  --coral: #ed7576;
  --teal: #5eb3ae;
  --gold: #ffb121;
  --text-cream: #fff4d2;
  --home-sub: #8a6b14;
  --ink: #1c1a14;
  --sheet: #fff8e6;
  --title: "ZCOOL QingKe HuangYou", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--olive-dark);
  color: var(--ink);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

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

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

.stage {
  width: min(430px, 100vw);
  height: 100dvh;
  max-height: 932px;
  position: relative;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 24px 60px rgba(0, 0, 0, 0.35);
}

@media (max-width: 480px) {
  .stage {
    width: 100vw;
    max-height: none;
    box-shadow: none;
  }
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
}

.screen.is-active {
  display: block;
}

.screen.home.is-active,
.screen.rules.is-active {
  background: var(--cream);
}

.screen[hidden] {
  display: none !important;
}

.shot-frame {
  position: absolute;
  inset: 0;
}

.shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
}

.hits {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.hit {
  position: absolute;
  left: 14%;
  width: 72%;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.001);
  z-index: 5;
}

.hit:active {
  background: rgba(255, 255, 255, 0.1);
}

.hit-red { top: 22.5%; height: 14.5%; }
.hit-green { top: 37.3%; height: 14.5%; }
.hit-yellow { top: 52.2%; height: 14.5%; }

.hit-rules {
  left: 22%;
  width: 56%;
  top: 67.5%;
  height: 9%;
}

.hit-back {
  left: 68%;
  width: 26%;
  top: 69%;
  height: 16%;
}

.play {
  color: var(--text-cream);
  cursor: pointer;
  touch-action: manipulation;
}

.play-bg {
  position: absolute;
  inset: 0;
  background-color: inherit;
  background-size: cover;
  background-position: center;
}

.play-art {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(78%, 320px);
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  background: transparent;
  mix-blend-mode: normal;
}

.close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 10px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-cream);
  font-size: 28px;
  line-height: 40px;
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer;
  pointer-events: auto;
}

.time-track {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 58px;
  right: 18px;
  z-index: 4;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-track .bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.time-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  transform-origin: left center;
}

.time-track span {
  min-width: 2ch;
  font-family: var(--title);
  font-size: 22px;
  line-height: 1;
}

.play-main {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(72px + env(safe-area-inset-top)) 28px 150px;
  text-align: center;
  overflow: auto;
}

.play-title {
  margin: 0;
  font-family: var(--title);
  font-size: clamp(44px, 13vw, 60px);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.play-prompt {
  margin: 28px 0 0;
  font-family: var(--title);
  font-size: clamp(32px, 9vw, 42px);
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-wrap: balance;
}

.play-rules {
  margin: 22px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.04em;
  text-wrap: pretty;
}

.play-count {
  margin-top: auto;
  font-family: var(--title);
  font-size: clamp(140px, 42vw, 200px);
  line-height: 0.85;
  letter-spacing: 0;
  animation: pop 0.45s ease;
}

.play-qa {
  width: 100%;
  margin-top: 18px;
  text-align: left;
}

.play-qa .q {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.65;
  text-wrap: pretty;
}

.play-qa ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.play-qa li {
  margin: 4px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.play-qa .ans {
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  opacity: 0.92;
}

.play.is-qa .play-title {
  font-size: clamp(28px, 8vw, 36px);
}

.play.is-qa .play-main {
  padding-bottom: 120px;
}

.play.is-qa .play-art {
  width: min(56%, 220px);
  opacity: 0.95;
}

.timesup {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(16, 10, 8, 0.28);
  color: var(--text-cream);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.timesup.is-on {
  display: flex;
}

.timesup strong {
  font-family: var(--title);
  font-size: 64px;
  letter-spacing: 0.16em;
}

.timesup span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.play.is-ended .play-main,
.play.is-ended .play-art,
.play.is-ended .time-track {
  visibility: hidden;
}

@keyframes pop {
  from { transform: scale(0.72); opacity: 0.35; }
  to { transform: scale(1); opacity: 1; }
}

@media (min-height: 780px) {
  .play-main { padding-bottom: 170px; }
}
