:root {
  color-scheme: light;
  --bg: #fff5fb;
  --ink: #5b4b69;
  --muted: #8e7da0;
  --panel-bg: rgba(255, 255, 255, 0.9);
  --line: rgba(123, 97, 145, 0.2);
  --hud-btn-bg: #92d8a6;
  --hud-btn-ink: #fffdf8;
  --stage-a: #d8f1df;
  --stage-b: #cfead6;
  --glow-a: rgba(255, 255, 255, 0.26);
  --glow-b: rgba(245, 202, 233, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overscroll-behavior: none;
}

.hidden,
[hidden],
.app.hidden,
.entry-screen.hidden {
  display: none !important;
}

.entry-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.14), transparent 20%),
    linear-gradient(180deg, #45ab4a 0%, #389a3f 100%);
}

.entry-shell {
  width: min(760px, 100%);
  display: grid;
  justify-items: center;
}

.entry-float {
  position: absolute;
  color: rgba(214, 248, 216, 0.36);
  font-weight: 700;
  font-size: 72px;
  line-height: 1;
  pointer-events: none;
}

.entry-float--left {
  left: 14%;
  top: 12%;
}

.entry-float--right {
  right: 11%;
  top: 30%;
}

.entry-float--bottom {
  right: 17%;
  bottom: 24%;
}

.entry-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: #ecfff0;
}

.entry-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 16px rgba(18, 78, 27, 0.22);
}

.entry-card {
  width: min(640px, 100%);
  border-radius: 20px;
  padding: 22px;
  border: 2px solid rgba(220, 255, 220, 0.35);
  background: linear-gradient(180deg, rgba(171, 228, 174, 0.34), rgba(141, 211, 147, 0.28));
  box-shadow: 0 20px 44px rgba(20, 84, 28, 0.2);
}

.entry-brand h1 {
  margin: 0;
  font-size: 58px;
  letter-spacing: 0.02em;
}

.entry-slogan {
  margin: 4px 0 0;
  color: rgba(233, 255, 236, 0.9);
  font-size: 34px;
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.field-label {
  color: #e7ffe9;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.field-row select {
  width: 100%;
  height: 58px;
  border-radius: 14px;
  border: 2px solid rgba(220, 255, 226, 0.72);
  background: rgba(255, 255, 255, 0.9);
  color: #31563d;
  padding: 0 14px;
  font-size: 27px;
  font-weight: 700;
  outline: none;
}

.field-row select:focus {
  border-color: rgba(145, 224, 165, 0.95);
  box-shadow: 0 0 0 3px rgba(162, 234, 181, 0.28);
}

.field-row select option,
.field-row select optgroup {
  color: #2f4f39;
  background: #f3fff4;
}

.entry-checks {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 40px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e5ffe7;
  font-size: 30px;
  font-weight: 700;
}

.check-item input {
  width: 26px;
  height: 26px;
}

.btn-start {
  margin-top: 22px;
  min-width: 280px;
  padding: 14px 36px;
  position: relative;
  overflow: hidden;
  border-radius: 40px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, #9b5cff 0%, #7a33db 100%);
  color: #fdf8ff;
  font-size: 45px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(81, 31, 153, 0.34);
  animation: startLightning 1.8s ease-in-out infinite;
}

.btn-start::after {
  content: "";
  position: absolute;
  inset: -30% -60%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.52) 50%, rgba(255, 255, 255, 0) 60%);
  transform: translateX(-120%) rotate(8deg);
  animation: startSweep 2.1s ease-in-out infinite;
  pointer-events: none;
}

.app {
  height: 100vh;
}

.stage-wrap {
  position: relative;
  height: 100%;
  overflow: hidden;
}

#stage {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background:
    radial-gradient(circle at 70% 16%, var(--glow-a), transparent 30%),
    radial-gradient(circle at 16% 74%, var(--glow-b), transparent 28%),
    linear-gradient(180deg, var(--stage-a) 0%, var(--stage-b) 100%);
}

.top-hud {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.pill {
  border-radius: 16px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, rgba(171, 223, 186, 0.96), rgba(147, 211, 168, 0.96));
  color: #fffef9;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(118, 162, 131, 0.24);
}

.pill strong {
  margin-left: 6px;
  font-size: 1.14em;
}

.pause-fab {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  z-index: 12;
  border-radius: 18px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  background: linear-gradient(180deg, rgba(186, 230, 198, 0.98), rgba(145, 205, 162, 0.98));
  color: #fffef9;
  font-size: 23px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(108, 153, 122, 0.32);
  cursor: pointer;
}

.pause-fab:disabled {
  opacity: 0.46;
  filter: grayscale(0.2);
  cursor: not-allowed;
  box-shadow: 0 4px 8px rgba(108, 153, 122, 0.14);
}

.assist-btn {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(120px, calc(env(safe-area-inset-bottom) + 108px));
  z-index: 12;
  border-radius: 999px;
  padding: 12px 20px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, rgba(255, 171, 223, 0.98), rgba(255, 143, 205, 0.98));
  color: #fff7fe;
  font-size: 19px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(203, 103, 166, 0.3);
  cursor: pointer;
  animation: assistPulse 1.25s ease-in-out infinite;
}

.combo-fx {
  position: absolute;
  right: max(24px, env(safe-area-inset-right));
  top: 190px;
  z-index: 12;
  min-width: 180px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.94);
}

.combo-fx.show {
  animation: comboPop 660ms cubic-bezier(0.22, 0.84, 0.35, 1);
}

.combo-fx[data-tier="super"] .combo-title,
.combo-fx[data-tier="super"] .combo-value,
.combo-fx[data-tier="super"] .combo-bonus {
  filter: saturate(1.08);
}

.combo-fx[data-tier="hot"] .combo-title,
.combo-fx[data-tier="hot"] .combo-value,
.combo-fx[data-tier="hot"] .combo-bonus {
  filter: saturate(1.18);
}

.combo-fx[data-tier="hot"] .combo-value {
  color: #ffeb47;
  text-shadow:
    0 6px 0 #f29f00,
    0 12px 0 #ffc122,
    0 0 30px rgba(255, 235, 71, 0.8);
}

.combo-fx[data-tier="legend"] .combo-title,
.combo-fx[data-tier="legend"] .combo-value,
.combo-fx[data-tier="legend"] .combo-bonus {
  filter: saturate(1.3);
}

.combo-fx[data-tier="legend"] .combo-title {
  color: #fff8e4;
  text-shadow:
    0 4px 0 #49b552,
    0 12px 24px rgba(54, 146, 61, 0.55),
    0 0 22px rgba(255, 248, 228, 0.45);
}

.combo-fx[data-tier="legend"] .combo-value {
  color: #fff061;
  text-shadow:
    0 7px 0 #f59b00,
    0 14px 0 #ffbf1b,
    0 0 36px rgba(255, 240, 97, 0.9);
}

.combo-fx[data-tier="legend"] .combo-bonus {
  color: #75e86d;
  text-shadow:
    0 4px 0 #41ad48,
    0 10px 20px rgba(45, 133, 54, 0.52),
    0 0 18px rgba(117, 232, 109, 0.55);
}

.combo-title {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #f7f8f5;
  text-shadow:
    0 4px 0 #3dac44,
    0 10px 22px rgba(42, 131, 49, 0.45);
}

.combo-value {
  margin-top: 4px;
  font-size: 98px;
  font-weight: 900;
  line-height: 0.9;
  color: #ffe65a;
  text-shadow:
    0 5px 0 #f5a408,
    0 10px 0 #ffc22d,
    0 0 24px rgba(255, 230, 90, 0.72);
}

.combo-bonus {
  margin-top: 2px;
  font-size: 54px;
  font-weight: 900;
  color: #5bd05a;
  text-shadow:
    0 3px 0 #3ea548,
    0 8px 16px rgba(38, 120, 46, 0.4);
}

.bottom-hud {
  position: absolute;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(500px, calc(100% - 32px));
  z-index: 10;
}

.cards {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.action-card {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, rgba(255, 211, 231, 0.96), rgba(255, 191, 221, 0.96));
  color: #705577;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.action-card .icon {
  font-size: 32px;
  line-height: 1;
}

.action-card .txt {
  font-size: 14px;
  font-weight: 700;
}

.progress-wrap {
  margin-top: 10px;
}

.progress-track {
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb8de, #d8b9ff, #bce3ff);
  transition: width 180ms ease;
}

.progress-text {
  margin-top: -24px;
  text-align: center;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 16px;
}

.minor {
  margin-top: 8px;
  text-align: center;
  color: #7a668c;
  font-weight: 600;
}

.toast {
  position: absolute;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  background: rgba(154, 126, 178, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 8px 14px;
  color: #fff9ff;
  font-size: 13px;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 980px) {
  .entry-brand h1 {
    font-size: 42px;
  }

  .entry-slogan {
    font-size: 24px;
  }

  .top-hud {
    width: calc(100% - 20px);
    justify-content: center;
    flex-wrap: wrap;
  }

  .pill {
    font-size: 19px;
    padding: 8px 12px;
  }

  .pause-fab {
    font-size: 20px;
    padding: 10px 16px;
  }

  .assist-btn {
    font-size: 17px;
    padding: 10px 16px;
    bottom: max(110px, calc(env(safe-area-inset-bottom) + 96px));
  }

  .combo-fx {
    right: max(14px, env(safe-area-inset-right));
    top: 170px;
    min-width: 148px;
  }

  .combo-title {
    font-size: 42px;
  }

  .combo-value {
    font-size: 76px;
  }

  .combo-bonus {
    font-size: 40px;
  }

  .action-card {
    width: 84px;
    height: 84px;
  }
}

@media (max-width: 768px) {
  .entry-screen {
    padding: 14px 12px;
  }

  .entry-float {
    font-size: 42px;
  }

  .entry-float--left {
    left: 8%;
    top: 8%;
  }

  .entry-float--right {
    right: 7%;
    top: 16%;
  }

  .entry-float--bottom {
    right: 10%;
    bottom: 22%;
  }

  .entry-card {
    padding: 16px 14px;
    border-radius: 16px;
  }

  .entry-brand h1 {
    font-size: 34px;
  }

  .entry-logo {
    width: 46px;
    height: 46px;
    font-size: 26px;
  }

  .entry-slogan {
    font-size: 18px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 9px;
  }

  .field-label {
    font-size: 18px;
  }

  .field-row select {
    height: 44px;
    font-size: 17px;
    border-radius: 11px;
  }

  .entry-checks {
    justify-content: space-between;
    gap: 10px;
  }

  .check-item {
    font-size: 17px;
  }

  .check-item input {
    width: 18px;
    height: 18px;
  }

  .btn-start {
    min-width: 220px;
    font-size: 30px;
    padding: 10px 24px;
  }

  .top-hud {
    width: calc(100% - 14px);
    gap: 7px;
    top: max(12px, calc(env(safe-area-inset-top) + 2px));
    padding-right: 78px;
  }

  .pill {
    border-radius: 12px;
    font-size: 16px;
    padding: 7px 10px;
  }

  .pause-fab {
    right: max(8px, env(safe-area-inset-right));
    top: max(8px, env(safe-area-inset-top));
    border-radius: 14px;
    font-size: 16px;
    padding: 9px 12px;
  }

  .assist-btn {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(96px, calc(env(safe-area-inset-bottom) + 86px));
    border-radius: 14px;
    font-size: 15px;
    padding: 9px 12px;
  }

  .combo-fx {
    top: 132px;
    right: max(8px, env(safe-area-inset-right));
    min-width: 110px;
  }

  .combo-title {
    font-size: 28px;
  }

  .combo-value {
    font-size: 54px;
  }

  .combo-bonus {
    font-size: 24px;
  }

  .bottom-hud {
    width: calc(100% - 14px);
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .cards {
    gap: 8px;
  }

  .action-card {
    width: 70px;
    height: 70px;
    border-radius: 12px;
  }

  .action-card .icon {
    font-size: 24px;
  }

  .action-card .txt {
    font-size: 11px;
  }

  .progress-track {
    height: 18px;
  }

  .progress-text {
    margin-top: -19px;
    font-size: 12px;
  }

  .minor {
    margin-top: 5px;
    font-size: 12px;
  }

}

@keyframes assistPulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 10px 20px rgba(203, 103, 166, 0.28);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(211, 108, 174, 0.4);
  }
}

@keyframes comboPop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.88);
  }
  22% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }
  72% {
    opacity: 1;
    transform: translateY(-1px) scale(1.01);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
}

@keyframes startLightning {
  0%, 54%, 100% {
    box-shadow: 0 12px 24px rgba(81, 31, 153, 0.32), 0 0 0 rgba(255, 255, 255, 0);
    filter: brightness(1);
  }
  58% {
    box-shadow: 0 14px 30px rgba(107, 42, 200, 0.44), 0 0 24px rgba(201, 171, 255, 0.7);
    filter: brightness(1.12);
  }
  62% {
    box-shadow: 0 14px 30px rgba(107, 42, 200, 0.42), 0 0 16px rgba(201, 171, 255, 0.55);
    filter: brightness(1.08);
  }
}

@keyframes startSweep {
  0%, 56% {
    transform: translateX(-120%) rotate(8deg);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  72% {
    transform: translateX(120%) rotate(8deg);
    opacity: 0.95;
  }
  100% {
    transform: translateX(120%) rotate(8deg);
    opacity: 0;
  }
}
