* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: #15127a; color: #fff; font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; touch-action: manipulation; overscroll-behavior: none; }
.app { max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 6px) 10px calc(env(safe-area-inset-bottom, 0px) + 16px); }

.spr { background-image: url(images/gen/gptimg_1795598676_look.png); background-repeat: no-repeat; border: 0; padding: 0; display: block; }
.title { width: 92%; margin: 0 auto; aspect-ratio: 600 / 170; background-size: 256% auto; background-position: 49.15% 2.34%; animation: flick 0.9s steps(1) 1; }
@keyframes flick { 0% { opacity: 0; } 20% { opacity: 1; } 35% { opacity: 0; } 55% { opacity: 1; } 70% { opacity: 0.3; } 100% { opacity: 1; } }

.board { margin-top: 4px; border: 4px solid #2aa8f0; background: #0a0b3f; box-shadow: 0 0 0 3px #08093a; }
.hud { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-weight: 900; font-size: 16px; color: #ffe600; text-shadow: 2px 2px 0 #000; border-bottom: 3px solid #2aa8f0; }
.hud b { color: #fff; font-size: 18px; font-variant-numeric: tabular-nums; }
.hearts { display: flex; align-items: center; gap: 4px; }
.heart { width: 22px; aspect-ratio: 56 / 48; background-size: 2742.86% auto; background-position: 36.15% 22.54%; }
.cwrap { position: relative; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; touch-action: none; }
.tip { position: absolute; left: 0; right: 0; bottom: 20%; text-align: center; font-weight: 900; font-size: 18px; color: #ffe600; text-shadow: 2px 2px 0 #000; pointer-events: none; }

.btns { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.bstart { flex: 432 1 0; aspect-ratio: 432 / 150; background-size: 355.56% auto; background-position: 28.8% 93.25%; }
.bpause { flex: 385 1 0; aspect-ratio: 385 / 155; background-size: 398.96% auto; background-position: 72.11% 93.78%; }
.bstart:active, .bpause:active, .bad:active { transform: translateY(3px); }
.bad { width: 100%; max-width: 340px; margin: 14px auto 0; aspect-ratio: 420 / 200; background-size: 365.71% auto; background-position: 96.95% 72.82%; animation: glow 1.4s steps(2) infinite; }
@keyframes glow { 50% { filter: brightness(1.22); } }

.rank { margin-top: 16px; border: 4px solid #7a5af0; background: #0f0f52; }
.rhead { width: 100%; aspect-ratio: 405 / 90; background-size: 379.26% auto; background-position: 96.37% 21.41%; }
.rank ol { list-style: none; margin: 0; padding: 4px 10px 8px; }
.rank li { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 2px solid #24247a; font-weight: 800; font-size: 15px; }
.rank li:last-child { border-bottom: 0; }
.rank .n { width: 30px; text-align: center; color: #ffe600; }
.rank li:nth-child(2) .n { color: #cfe3ff; }
.rank li:nth-child(3) .n { color: #ff9a3c; }
.rank .nm { flex: 1; color: #9fd8ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .sc { font-variant-numeric: tabular-nums; }
.rank .empty { justify-content: center; color: #9fa8ff; }

.layer { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 5, 40, 0.8); }
.layer[hidden], .toast[hidden] { display: none; }
.dlg { width: 100%; max-width: 340px; padding: 16px; text-align: center; background: #15127a; border: 4px solid #2aa8f0; box-shadow: 6px 6px 0 #000; }
.dlg h2 { margin: 0 0 10px; font-size: 26px; color: #ffe600; text-shadow: 2px 2px 0 #000; }
.dlg p { margin: 8px 0; }
.big { font-size: 34px; color: #ffe600; text-shadow: 2px 2px 0 #000; }
.sub { color: #9fd8ff; min-height: 20px; font-weight: 700; }
.row { display: flex; gap: 10px; margin-top: 14px; }
.pbtn { flex: 1; font: inherit; font-weight: 900; font-size: 16px; padding: 12px 8px; color: #000; border: 4px solid #000; box-shadow: 0 4px 0 #000; cursor: pointer; }
.pbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.pbtn.y { background: #ffb81c; }
.pbtn.b { background: #3db8ff; }
.pbtn:disabled { opacity: 0.55; }

.adtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 900; color: #ffe600; }
.adtop span:first-child { flex: 1; text-align: left; }
.cd { width: 34px; height: 34px; line-height: 28px; text-align: center; border: 3px solid #ffe600; background: #0a0b3f; color: #ffe600; }
.x { width: 34px; height: 34px; padding: 0; font-size: 20px; font-weight: 900; line-height: 1; color: #fff; background: #d92c2c; border: 3px solid #fff; }
.x:disabled { background: #555; border-color: #999; color: #aaa; }
.adbody { margin-top: 12px; padding: 14px; border: 3px dashed #ffb81c; background: #0a0b3f; cursor: pointer; }
.gift { width: 96px; margin: 0 auto; aspect-ratio: 145 / 150; background-size: 1059.31% auto; background-position: 80.52% 70.37%; }
#adImg { display: block; margin: 0 auto; max-width: 100%; max-height: 150px; }
#adImg[hidden] { display: none; }
#adReward { margin: 10px 0 0; font-weight: 800; color: #ffe600; }

.toast { position: fixed; left: 50%; top: 12%; transform: translateX(-50%); z-index: 20; padding: 10px 16px; font-weight: 900; color: #000; background: #ffe600; border: 4px solid #000; box-shadow: 4px 4px 0 #000; white-space: nowrap; }
