@font-face { font-family: 'ZCOOL KuaiLe'; src: url('../assets/fonts/ZCOOLKuaiLe-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../assets/fonts/NotoSansSC.ttf') format('truetype'); font-display: swap; }
:root { --ink: #2b2f45; --paper: #fff8ea; --orange: #ff8a2a; --gold: #ffd23f; --sky: #8dc3f2; --grass: #7fc65a; --red: #ff5d5d; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #6fb2e8; font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif; color: var(--ink); user-select: none; -webkit-user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: none; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hidden { display: none !important; }
h1, h2, .kuaile { font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif; font-weight: normal; }
/* ---- loading / title ---- */
#loading { background: linear-gradient(#5aa9e6, #cfe9ff); }
#loading .bar { width: 320px; height: 16px; border-radius: 10px; background: rgba(255,255,255,0.5); overflow: hidden; border: 3px solid var(--ink); }
#loading .bar > div { height: 100%; width: 0%; background: var(--orange); transition: width 0.15s; }
#loading .txt { margin-top: 14px; font-size: 18px; color: var(--ink); }
#title { justify-content: flex-start; padding-top: 9vh; }
#title .logo { font-size: clamp(48px, 9vw, 120px); color: #fff; text-shadow: 0 6px 0 var(--ink), 0 0 30px rgba(0,0,0,0.25); letter-spacing: 0.06em; margin: 0; transform: rotate(-3deg); animation: bob 2.2s ease-in-out infinite; }
#title .sub { font-size: clamp(18px, 3vw, 30px); color: var(--paper); text-shadow: 0 3px 0 var(--ink); margin-top: 8px; }
#title .press { margin-top: 40vh; font-size: 26px; color: #fff; background: var(--ink); padding: 10px 28px; border-radius: 40px; animation: blink 1.2s steps(2) infinite; }
#title .credits { position: absolute; bottom: 18px; font-size: 13px; color: rgba(255,255,255,0.85); text-shadow: 0 1px 0 rgba(0,0,0,0.4); }
@keyframes bob { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-10px); } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
/* ---- world map ---- */
#map { background: radial-gradient(ellipse at 50% 30%, #b9e2ff 0%, #6fb2e8 60%, #4f8fd0 100%); }
#map .board { position: relative; width: min(1180px, 96vw); height: min(640px, 82vh); background: linear-gradient(#a8dd7c, #7fc65a); border: 6px solid var(--ink); border-radius: 30px; box-shadow: 0 16px 0 rgba(0,0,0,0.25); overflow: hidden; }
#map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#map .node { position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%; background: var(--paper); border: 5px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: 'ZCOOL KuaiLe'; font-size: 30px; color: var(--ink); transition: transform 0.15s; }
#map .node.locked { background: #b8bcc8; color: #6c7080; }
#map .node.boss { background: var(--red); color: #fff; }
#map .node.selected { transform: scale(1.22); box-shadow: 0 0 0 6px var(--gold); }
#map .node .stars { position: absolute; bottom: -22px; font-size: 14px; letter-spacing: 1px; color: var(--gold); text-shadow: 0 1px 0 var(--ink); white-space: nowrap; }
#map .node .name { position: absolute; top: -30px; font-size: 15px; white-space: nowrap; color: var(--ink); background: rgba(255,248,234,0.9); padding: 2px 8px; border-radius: 10px; font-family: 'Noto Sans SC'; }
#map .rabbit { position: absolute; width: 46px; height: 46px; margin: -70px 0 0 -23px; transition: left 0.35s, top 0.35s; font-size: 40px; text-align: center; line-height: 46px; filter: drop-shadow(0 3px 0 rgba(0,0,0,0.3)); }
#map .info { position: absolute; left: 24px; top: 78px; width: 380px; background: var(--paper); border: 5px solid var(--ink); border-radius: 18px; padding: 12px 18px; font-size: 16px; line-height: 1.5; }
#map .info h2 { margin: 0 0 4px; font-size: 30px; color: var(--orange); }
#map .info .mech { color: #4a6fa5; font-weight: bold; }
#map .totals { position: absolute; right: 24px; top: 16px; background: var(--paper); border: 5px solid var(--ink); border-radius: 18px; padding: 8px 16px; font-size: 20px; font-family: 'ZCOOL KuaiLe'; }
#map .hint { position: absolute; right: 24px; bottom: 20px; font-size: 15px; color: var(--paper); text-shadow: 0 2px 0 var(--ink); text-align: right; line-height: 1.6; }
#map .title { position: absolute; left: 24px; top: 14px; font-size: 40px; color: #fff; text-shadow: 0 4px 0 var(--ink); }
/* ---- HUD ---- */
#hud { position: absolute; inset: 0; }
#hud .tl { position: absolute; left: 22px; top: 18px; display: flex; flex-direction: column; gap: 8px; }
#hud .hearts { display: flex; gap: 6px; }
#hud .heart { width: 42px; height: 42px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 29 4 17a7 7 0 0 1 10-10l2 2 2-2a7 7 0 0 1 10 10z' fill='%23ff5d5d' stroke='%232b2f45' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; transition: transform 0.2s; }
#hud .heart.empty { filter: grayscale(1) brightness(1.6); opacity: 0.5; }
#hud .heart.pop { animation: pop 0.35s; }
#hud .pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,248,234,0.92); border: 4px solid var(--ink); border-radius: 30px; padding: 4px 14px 4px 8px; font-family: 'ZCOOL KuaiLe'; font-size: 24px; color: var(--ink); width: max-content; }
#hud .pill .ico { font-size: 22px; }
#hud .energy { width: 120px; height: 12px; border-radius: 8px; background: #d8d2c4; overflow: hidden; border: 2px solid var(--ink); }
#hud .energy > div { height: 100%; width: 0%; background: var(--orange); transition: width 0.2s; }
#hud .energy.full > div { background: var(--gold); animation: blink 0.5s steps(2) infinite; }
#hud .tr { position: absolute; right: 22px; top: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#hud .starslots { display: flex; gap: 4px; font-size: 30px; filter: drop-shadow(0 2px 0 var(--ink)); }
#hud .starslots .off { filter: grayscale(1); opacity: 0.45; }
#hud .time { font-family: 'ZCOOL KuaiLe'; font-size: 24px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
#hud .bl { position: absolute; left: 22px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
#hud .weapon { display: none; }
#hud .weapon.on { display: inline-flex; }
#hud .ammo { width: 110px; height: 10px; background: #d8d2c4; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
#hud .ammo > div { height: 100%; background: #4fa7ff; }
#hud .huang { display: none; background: var(--gold); }
#hud .huang.on { display: inline-flex; }
#hud .say { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); font-family: 'ZCOOL KuaiLe'; font-size: 34px; color: #fff; text-shadow: 0 3px 0 var(--ink), 0 0 16px rgba(0,0,0,0.3); text-align: center; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
#hud .say.on { opacity: 1; animation: pop 0.3s; }
#hud .tip { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(43,47,69,0.85); color: #fff; padding: 10px 22px; border-radius: 16px; font-size: 18px; opacity: 0; transition: opacity 0.4s; max-width: 80vw; text-align: center; line-height: 1.5; }
#hud .tip.on { opacity: 1; }
#hud .tip b { color: var(--gold); }
#hud .boss { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); width: min(520px, 60vw); display: none; flex-direction: column; align-items: center; gap: 4px; }
#hud .boss.on { display: flex; }
#hud .boss .name { font-family: 'ZCOOL KuaiLe'; font-size: 26px; color: #fff; text-shadow: 0 3px 0 var(--ink); }
#hud .boss .bar { width: 100%; height: 22px; border: 4px solid var(--ink); border-radius: 14px; background: #d8d2c4; overflow: hidden; }
#hud .boss .bar > div { height: 100%; background: var(--red); transition: width 0.3s; }
.floater { position: absolute; font-family: 'ZCOOL KuaiLe'; font-size: 24px; text-shadow: 0 2px 0 var(--ink); white-space: nowrap; transform: translate(-50%, -50%); animation: floatUp 1s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 0; margin-top: 0; transform: translate(-50%, -50%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; margin-top: -60px; transform: translate(-50%, -50%) scale(1); } }
#hud .fade { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity 0.5s; }
/* ---- panels ---- */
.panel { background: var(--paper); border: 6px solid var(--ink); border-radius: 26px; padding: 26px 40px; text-align: center; box-shadow: 0 14px 0 rgba(0,0,0,0.25); animation: pop 0.3s; min-width: 380px; }
.panel h2 { font-size: 44px; margin: 0 0 10px; color: var(--orange); }
.panel .row { font-size: 24px; margin: 6px 0; font-family: 'ZCOOL KuaiLe'; }
.panel .big { font-size: 54px; letter-spacing: 6px; filter: drop-shadow(0 3px 0 var(--ink)); }
.panel .big .off { filter: grayscale(1); opacity: 0.35; }
.menu { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.menu .item { font-family: 'ZCOOL KuaiLe'; font-size: 26px; padding: 8px 20px; border-radius: 14px; color: var(--ink); background: transparent; }
.menu .item.selected { background: var(--orange); color: #fff; box-shadow: 0 4px 0 var(--ink); }
.dim { background: rgba(20, 30, 60, 0.45); }
#results .newbest { color: var(--red); font-size: 20px; }
.ctrl { position: absolute; bottom: 14px; right: 18px; font-size: 13px; color: rgba(255,255,255,0.9); text-shadow: 0 1px 0 rgba(0,0,0,0.5); }

/* player name / cloud save */
#player { position: fixed; top: 14px; right: 16px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; background: var(--paper); border: 4px solid var(--ink); border-radius: 18px; padding: 6px 14px; font: inherit; font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif; color: var(--ink); cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,0.25); }
#player .who { font-size: 20px; }
#player .st { font-size: 13px; opacity: 0.75; }
#player:hover { transform: translateY(-2px); }
#account { z-index: 40; }
#account .panel { max-width: min(560px, 92vw); }
#account .code { font-size: 54px; letter-spacing: 10px; color: var(--orange); font-family: 'Noto Sans SC', monospace; margin: 4px 0 10px; text-shadow: 0 3px 0 var(--ink); }
#account .row.small { font-size: 16px; color: #4a6fa5; }
#account .field { display: flex; gap: 8px; justify-content: center; margin: 8px 0 14px; flex-wrap: wrap; }
#account input { font: inherit; font-size: 22px; padding: 8px 12px; border: 4px solid var(--ink); border-radius: 14px; width: 220px; background: #fff; color: var(--ink); }
#account button { font: inherit; font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif; font-size: 22px; padding: 8px 18px; border: 4px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,0.2); }
#account button.primary { background: var(--orange); color: #fff; }
#account .btns { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }

#account input { user-select: text; -webkit-user-select: text; }
