/* 不可能的按钮 · 样式
   画面只有三样东西：倒计时环、一个按钮、一行字。
   背景是真实的中控室照片，压暗到只当底子。 */

:root {
  --txt: #eafff1;
  --dim: #14301c;
  --lit: #37e56d;
  --line: rgba(80, 220, 130, .30);
}

* { box-sizing: border-box; }

/* .end 这类元素自带 display，会盖掉 [hidden] 的默认值 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: #040605;
  color: var(--txt);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei UI", system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- 背景 ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  filter: brightness(.55) saturate(.8) contrast(1.05);
}

.vig {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(66% 58% at 50% 46%, rgba(0, 0, 0, 0) 0%, rgba(2, 8, 4, .45) 58%, rgba(1, 4, 2, .94) 100%),
    linear-gradient(180deg, rgba(2, 8, 4, .72) 0%, rgba(2, 8, 4, .18) 28%, rgba(2, 8, 4, .34) 70%, rgba(1, 4, 2, .92) 100%);
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .34;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .30) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
}

/* ---------- 舞台 ---------- */

#app {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
}

.stage {
  grid-area: 1 / 1;
  position: relative;
  width: min(94vmin, 760px);
  aspect-ratio: 1;
  transition: opacity .45s ease;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(55, 220, 110, .26) 0%, rgba(28, 140, 66, .10) 55%, rgba(0, 0, 0, 0) 74%);
  filter: blur(16px);
}

.btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 74%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  background:
    radial-gradient(58% 38% at 50% 15%, rgba(215, 255, 225, .50) 0%, rgba(140, 255, 175, .10) 62%, rgba(0, 0, 0, 0) 74%),
    radial-gradient(118% 118% at 50% 30%, #2fbf5c 0%, #1c8f40 38%, #10682c 68%, #073615 100%);
  box-shadow:
    inset 0 0 0 3px rgba(175, 255, 195, .34),
    inset 0 14px 30px rgba(205, 255, 215, .26),
    inset 0 -24px 48px rgba(0, 0, 0, .58),
    0 0 90px rgba(35, 200, 95, .26),
    0 24px 60px rgba(0, 0, 0, .55);
  transition: transform .09s ease, filter .16s ease, box-shadow .18s ease;
}

/* 参考视频里按钮正中有一个小白点 */
.btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 8px rgba(255, 255, 255, .5);
}

.btn.down {
  transform: translate(-50%, -50%) scale(.975);
  filter: brightness(1.14);
  box-shadow:
    inset 0 0 0 3px rgba(195, 255, 210, .45),
    inset 0 18px 34px rgba(220, 255, 230, .30),
    inset 0 -18px 40px rgba(0, 0, 0, .50),
    0 0 130px rgba(45, 225, 110, .38),
    0 12px 40px rgba(0, 0, 0, .55);
}

.btn:focus-visible {
  outline: 2px solid rgba(190, 255, 210, .8);
  outline-offset: 6px;
}

/* ---------- 文字 ---------- */

.line {
  grid-area: 1 / 1;
  z-index: 5;
  width: min(94vmin, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 8%;
  pointer-events: none;
  text-align: center;
}

.txt {
  margin: 0;
  color: #fff;
  font-size: clamp(17px, 3.6vmin, 28px);
  line-height: 1.55;
  letter-spacing: .02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .9), 0 0 30px rgba(0, 0, 0, .7);
  opacity: 0;
  transition: opacity .32s ease;
}
.txt.in { opacity: 1; }
.txt.now { opacity: 1; transition: none; }
.txt.long { font-size: clamp(15px, 3.1vmin, 24px); }
.txt.longer { font-size: clamp(14px, 2.7vmin, 21px); }

.next {
  pointer-events: auto;
  font: inherit;
  font-size: 14px;
  letter-spacing: .08em;
  color: #bdf5cf;
  padding: 9px 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 40, 22, .55);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}
.next.on { opacity: 1; transform: none; }
.next:hover { background: rgba(16, 60, 32, .8); }

/* ---------- 模式 ---------- */

body[data-mode="plain"] .stage { opacity: 0; pointer-events: none; }
body[data-mode="end"] .stage,
body[data-mode="end"] .line { opacity: 0; pointer-events: none; }

/* ---------- 卡片 ---------- */

.card {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: 5%;
  transform: translateX(-50%);
  width: min(86vw, 520px);
  padding: 16px 20px;
  border: 1px solid rgba(80, 220, 130, .22);
  border-radius: 12px;
  background: rgba(6, 18, 10, .88);
  color: #cdeed9;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  opacity: 0;
  transition: opacity .35s ease;
}
.card.on { opacity: 1; }
.card b {
  display: block;
  margin-bottom: 6px;
  color: #eafff1;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* ---------- 结局 ---------- */

.end {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 12vh 9vw;
  background: rgba(1, 4, 2, .95);
  text-align: center;
}

.end-line {
  margin: 0;
  color: #eafff1;
  font-size: clamp(17px, 3.2vmin, 25px);
  line-height: 1.8;
  letter-spacing: .03em;
  opacity: 0;
  transition: opacity .5s ease;
}
.end-line.in { opacity: 1; }
.end-line.out { opacity: 0; }

.hint {
  position: fixed;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: 9vh;
  margin: 0;
  color: #9fd8b4;
  font-size: 14px;
  letter-spacing: .08em;
  text-align: center;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.hint.on { opacity: 1; }

/* ---------- 特效 ---------- */

.fx {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.fx-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .10);
  animation: flashOut .42s ease-out forwards;
}
.fx-flash.ok {
  background: radial-gradient(circle at 50% 50%, rgba(60, 255, 130, .28) 0%, rgba(20, 180, 80, .10) 55%, rgba(0, 0, 0, 0) 76%);
}
.fx-flash.bad {
  background: radial-gradient(circle at 50% 50%, rgba(255, 70, 55, .30) 0%, rgba(150, 20, 10, .12) 55%, rgba(0, 0, 0, 0) 78%);
}
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }

/* 猫：白色剪影，站在按钮下沿 */
.cat {
  position: absolute;
  bottom: 9%;
  width: 13%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 1;
  z-index: 6;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, .55)) drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
  z-index: 3;
}
.cat svg {
  display: block;
  width: 100%;
  height: auto;
  fill: #fff;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, .5));
}
.cat.walk { animation: catWalk 2.4s linear forwards; }
@keyframes catWalk {
  from { transform: translateX(-70px); }
  to { transform: translateX(calc(100vw + 130px)); }
}
.cat.pop {
  left: 50%;
  top: 56%;
  bottom: auto;
  width: 96px;
  height: 72px;
  margin-left: -48px;
  animation: catPop .5s ease-out forwards;
}
@keyframes catPop {
  0% { transform: scale(.4); opacity: 0; }
  40% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* 文字抖 */
.jitter { animation: jitterIt .12s steps(2) infinite; }
@keyframes jitterIt {
  0% { transform: translate(0, 0); }
  50% { transform: translate(1px, -1px); }
  100% { transform: translate(-1px, 1px); }
}

@keyframes shakeIt {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 3px); }
  40% { transform: translate(6px, -4px); }
  60% { transform: translate(-5px, -2px); }
  80% { transform: translate(4px, 3px); }
}
body.shake { animation: shakeIt .38s ease-in-out; }

/* 转场：每换一幕闪一下黑 */
.fade {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: #020604;
  opacity: 0;
}
.fade.go { animation: cutIn .34s ease-out; }
@keyframes cutIn { 0% { opacity: .82; } 100% { opacity: 0; } }

/* ---------- 右上角 ---------- */

.ui {
  position: fixed;
  z-index: 6;
  top: 0;
  right: 0;
  display: flex;
  gap: 6px;
  padding: 12px 14px;
}

.ico {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(120, 220, 150, .22);
  border-radius: 50%;
  background: rgba(8, 24, 14, .55);
  color: #bfe8cd;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, opacity .2s ease;
}
.ico:hover { background: rgba(14, 40, 24, .85); }
.ico.off { opacity: .40; }

/* ---------- 小屏 ---------- */

@media (max-height: 560px) {
  .stage { width: min(92vmin, 520px); }
  .txt { font-size: clamp(15px, 4.2vmin, 21px); }
  .line { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .fade.go, body.shake, .fx-flash { animation: none; }
  .btn, .txt, .next { transition-duration: .01s; }
}
