:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #05090b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: radial-gradient(circle at 50% 20%, #1b2b30, #05090b 70%); }
body { display: grid; place-items: center; touch-action: none; user-select: none; }

#app {
  position: relative;
  width: min(100vw, calc(100vh * .45));
  height: min(100vh, calc(100vw / .45));
  max-width: 540px;
  max-height: 1200px;
  overflow: hidden;
  background: #101718;
  box-shadow: 0 0 0 1px #324148, 0 24px 80px #000b;
}

#game { display: block; width: 100%; height: 100%; }

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 32px max(54px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #05111844 10%, #07111655 43%, #030709ed 82%);
}
.screen.active { display: flex; }
.screen.modal { justify-content: center; padding: 24px; background: #020506c9; backdrop-filter: blur(2px); }

.brand { width: 100%; text-align: center; margin-bottom: 34px; text-shadow: 0 4px 18px #000; }
.eyebrow { margin: 0 0 7px; color: #8eeaff; font-size: 12px; font-weight: 900; letter-spacing: .2em; }
h1, h2 { margin: 0; font-style: italic; font-weight: 1000; line-height: 1; }
h1 { font-size: clamp(42px, 11vw, 68px); color: #effcff; letter-spacing: -.08em; filter: drop-shadow(0 3px #00749a) drop-shadow(0 0 12px #00b7ff); }
h2 { font-size: 45px; color: #fff; }
.brand p:last-child { margin: 14px 0 0; color: #d9e4e6; font-weight: 800; }

button { font: inherit; cursor: pointer; border: 0; }
.primary {
  width: min(100%, 340px);
  min-height: 62px;
  padding: 12px 28px;
  color: #f4feff;
  font-size: 24px;
  font-weight: 1000;
  font-style: italic;
  letter-spacing: .04em;
  border: 2px solid #a8ecff;
  border-radius: 6px;
  background: linear-gradient(#168fc2, #075171 52%, #032f49);
  box-shadow: inset 0 0 0 3px #081921, inset 0 0 20px #6ce5ff77, 0 5px 0 #021b28, 0 0 26px #00b7ff55;
}
.primary:active { transform: translateY(3px); box-shadow: inset 0 0 0 3px #081921, inset 0 0 20px #6ce5ff77, 0 2px 0 #021b28; }
.hint { max-width: 320px; margin: 20px 0 0; color: #a8b7bb; font-size: 13px; line-height: 1.6; text-align: center; }

.panel { width: 100%; padding: 28px 22px 22px; text-align: center; border: 1px solid #58727b; border-radius: 12px; background: linear-gradient(165deg, #17252bea, #071014f2); box-shadow: 0 20px 70px #000, inset 0 0 34px #5ba8c51c; }
.panel.danger { border-color: #9b4141; }
.panel.reward-panel { border-color: #d3a93b; box-shadow: 0 20px 70px #000, inset 0 0 46px #ffb92d22, 0 0 35px #ffb52b22; }
.panel p:not(.eyebrow):not(.fine) { color: #d0dcdf; font-weight: 800; }
.fine { margin: 16px 0 0; color: #83a0a8; font-size: 12px; }
.ghost { margin-top: 15px; padding: 10px 20px; color: #b9c9cd; background: transparent; font-weight: 800; }

.reward-choices { display: grid; gap: 10px; margin-top: 19px; }
.reward-card {
  width: 100%; min-height: 70px; padding: 10px 14px; color: #fff; text-align: left;
  border: 1px solid #79dfff; border-radius: 9px;
  background: linear-gradient(110deg, #102c3d, #07131b);
  box-shadow: inset 0 0 18px #51cfff1c;
}
.reward-card strong { display: block; color: #ffe36b; font-size: 18px; font-weight: 1000; }
.reward-card small { display: block; margin-top: 4px; color: #b8d2d9; font-size: 12px; }
.reward-card:active { transform: scale(.98); border-color: #ffe36b; }

.support {
  position: absolute;
  z-index: 10;
  right: 14px;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: 90px;
  min-height: 92px;
  padding: 8px 5px;
  color: white;
  border: 2px solid #ffb835;
  border-radius: 15px;
  background: radial-gradient(circle at 50% 15%, #e36b28, #671719 60%, #28090d);
  box-shadow: inset 0 0 18px #ffbe4477, 0 6px 18px #000c;
  display: none;
}
.support.visible { display: grid; place-items: center; }
.support:disabled { filter: grayscale(.75); opacity: .72; }
.support-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #ff9a24; font-size: 28px; font-weight: 1000; line-height: 1; }
.support strong { font-size: 15px; }
.support small { font-size: 10px; color: #ffd7a1; }

.icon-btn { position: absolute; z-index: 11; top: max(16px, env(safe-area-inset-top)); left: 14px; width: 43px; height: 43px; color: white; font-size: 21px; border: 2px solid #d9f5ff; border-radius: 9px; background: #102d3dcc; box-shadow: 0 4px 12px #0008; }

#rotateHint { display: none; position: fixed; inset: 0; z-index: 99; place-items: center; background: #05090b; color: white; font-size: 22px; font-weight: 900; }
@media (orientation: landscape) and (max-height: 700px) { #rotateHint { display: grid; } }
