/* 城堡主页 */
.home { position: absolute; inset: 0; z-index: 75; overflow: hidden; color: #fff8ea; }
.hm-bg { position: absolute; inset: -2%; background: url(../img/castle.webp) center / cover no-repeat; animation: drift 40s ease-in-out infinite alternate; }
.hm-bg.near { background-image: url(../img/castle_near.webp); filter: blur(3px) brightness(0.8); animation: none; }
@keyframes drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.08) translate(-1.2%, -0.8%); } }
.hm-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30, 15, 45, 0.45) 0%, rgba(30, 15, 45, 0) 28%, rgba(30, 15, 45, 0) 55%, rgba(30, 15, 45, 0.7) 100%); }
.hm-shade.deep { background: rgba(30, 15, 45, 0.55); }
.home.leaving .hm-bg { animation: none; transition: transform 1.1s cubic-bezier(0.5, 0, 0.9, 0.5), filter 1.1s; transform: scale(2.6) translate(0, 4%); filter: brightness(1.6); }
.home.leaving { transition: opacity 0.5s 0.6s; opacity: 0; }
.home.leaving .hm-title, .home.leaving .hm-nav, .home.leaving .hm-houses { transition: opacity 0.3s; opacity: 0; }

.hm-title { position: absolute; left: 0; right: 0; top: 56px; text-align: center; }
.hm-k { font: 700 26px/1 var(--title); letter-spacing: 3px; color: #ffe7a3; text-shadow: 0 2px 10px rgba(30, 10, 40, 0.6); }
.hm-title h1 { margin: 14px 0 0; font: 900 104px/1.1 var(--title); letter-spacing: 10px; color: #fff8ea; text-shadow: 0 5px 0 #8a5bd6, 0 0 50px rgba(255, 210, 255, 0.8), 0 10px 30px rgba(30, 10, 40, 0.6); animation: popIn 0.9s cubic-bezier(0.3, 1.4, 0.5, 1) both; }

.hm-houses { position: absolute; top: 262px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; }
.hm-houses div { display: flex; align-items: center; gap: 8px; padding: 9px 18px 9px 12px; border-radius: 99px; background: rgba(255, 248, 236, 0.9); color: var(--cd); }
.hm-houses .ic { width: 24px; height: 24px; fill: var(--c); }
.hm-houses span { font: 700 20px/1 var(--title); }
.hm-houses b { font: 800 24px/1 var(--sans); }

.hm-nav { position: absolute; left: 60px; right: 60px; bottom: 54px; display: grid; grid-template-columns: 1.5fr repeat(5, 1fr); gap: 16px; }
.hm-tile { height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 248, 236, 0.16); backdrop-filter: blur(10px); color: #fff8ea; text-align: center; transition: transform 0.2s, background 0.2s; animation: rise 0.7s cubic-bezier(0.2, 1, 0.3, 1) both; }
.hm-tile:nth-child(2) { animation-delay: 0.06s; } .hm-tile:nth-child(3) { animation-delay: 0.12s; } .hm-tile:nth-child(4) { animation-delay: 0.18s; } .hm-tile:nth-child(5) { animation-delay: 0.24s; } .hm-tile:nth-child(6) { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
.hm-tile:hover { transform: translateY(-6px); background: rgba(255, 248, 236, 0.28); }
.hm-tile .hm-ic { width: 54px; height: 54px; color: #ffe7a3; }
.hm-tile b { font: 800 30px/1 var(--title); }
.hm-tile span { font: 500 17px/1.3 var(--sans); color: rgba(255, 248, 234, 0.85); padding: 0 12px; }
.hm-tile.main { background: linear-gradient(160deg, #ffd96a, #f4a93a); border-color: #fff3c4; color: #5a3400; box-shadow: 0 0 40px rgba(255, 200, 90, 0.6); }
.hm-tile.main .hm-ic { color: #5a3400; width: 64px; height: 64px; }
.hm-tile.main b { font-size: 38px; }
.hm-tile.main span { color: #6e4510; font-weight: 700; }
body.lite .hm-tile { backdrop-filter: none; background: rgba(60, 35, 70, 0.6); }
body.lite .hm-bg { animation: none; }

.hm-back { position: absolute; left: 40px; top: 36px; z-index: 2; height: 56px; padding: 0 24px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.45); background: rgba(255, 248, 236, 0.18); color: #fff8ea; font: 800 22px/1 var(--title); }
.hp { position: absolute; inset: 120px 80px 60px; display: flex; flex-direction: column; }
.hp h2 { margin: 0; font: 900 64px/1 var(--title); text-align: center; text-shadow: 0 4px 0 #8a5bd6, 0 0 40px rgba(255, 210, 255, 0.6); }
.hp-sub { margin: 18px 0 30px; text-align: center; font: 600 22px/1.5 var(--sans); color: rgba(255, 248, 234, 0.85); }
.hp-foot { margin-top: auto; text-align: center; }
.hm-btn { height: 58px; padding: 0 30px; border-radius: 14px; border: 0; background: #ffd34d; color: #5a3400; font: 800 22px/1 var(--title); }

/* 荣誉墙 */
.honor { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.hn { position: relative; padding: 26px 22px 22px; border-radius: 22px; background: rgba(255, 248, 236, 0.95); color: var(--ink); border-top: 8px solid var(--c); animation: rise 0.6s cubic-bezier(0.2, 1, 0.3, 1) both; }
.hn:nth-child(2) { animation-delay: 0.08s; } .hn:nth-child(3) { animation-delay: 0.16s; } .hn:nth-child(4) { animation-delay: 0.24s; }
.hn-rank { position: absolute; right: 20px; top: 16px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font: 900 26px/1 var(--sans); }
.hn-h { display: flex; align-items: center; gap: 10px; }
.hn-h .ic { width: 40px; height: 40px; fill: var(--c); }
.hn-h b { font: 900 34px/1 var(--title); color: var(--cd); }
.hn-h span { display: none; }
.hn-flags { display: flex; flex-wrap: wrap; gap: 6px 2px; min-height: 260px; align-content: flex-start; margin: 22px 0 14px; }
.hn-flags i { width: 46px; height: 46px; color: var(--c); animation: popIn 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.hn-flags .ic { width: 100%; height: 100%; color: var(--c); }
.hn-bar { height: 12px; border-radius: 99px; background: #efe4d2; overflow: hidden; }
.hn-bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.hn-n { margin-top: 14px; font: 600 19px/1.4 var(--sans); color: var(--ink-2); }
.hn-n b { font: 900 40px/1 var(--sans); color: var(--cd); }

/* 星空 */
.hm-skybg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, #4a2a6e 0%, #1c1238 45%, #0b0820 100%); }
.hm-skybg::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), radial-gradient(1.2px 1.2px at 40% 70%, #fff, transparent), radial-gradient(1px 1px at 85% 60%, #fff, transparent), radial-gradient(1.3px 1.3px at 10% 80%, #fff, transparent), radial-gradient(1px 1px at 55% 45%, #fff, transparent); background-size: 300px 260px; opacity: 0.55; }
.skymap { position: absolute; inset: 0; width: 1920px; height: 1080px; }
.sc polyline { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 1.5; stroke-dasharray: 5 7; }
.sc circle { fill: rgba(255, 255, 255, 0.22); }
.sc text { fill: rgba(255, 255, 255, 0.25); font: 700 22px var(--title); text-anchor: middle; }
.sc.on polyline { stroke: rgba(255, 238, 190, 0.75); stroke-width: 2.4; stroke-dasharray: none; }
.sc.on circle { fill: #fff6d6; filter: drop-shadow(0 0 10px #ffd98a); animation: twinkle 3s ease-in-out infinite; }
.sc.on text { fill: #ffe7a3; }
.sky-info { position: absolute; right: 70px; bottom: 60px; width: 560px; padding: 30px 34px; border-radius: 22px; background: rgba(255, 248, 236, 0.1); border: 1px solid rgba(255, 255, 255, 0.25); }
.sky-info h2 { margin: 0 0 12px; font: 900 52px/1 var(--title); color: #ffe7a3; }
.sky-info p { margin: 8px 0; font: 500 21px/1.55 var(--sans); }
.sky-info p b { color: #ffe7a3; font-size: 28px; }
.sky-bar { height: 14px; margin: 16px 0 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.sky-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd36a, #f7a8e6, #9fc8ff); }
.sky-n { color: rgba(255, 248, 234, 0.8); }
.sky-r b { font-size: 22px !important; }

/* 档案馆 */
.gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.gal section { padding: 22px; border-radius: 20px; background: rgba(255, 248, 236, 0.95); border-top: 8px solid var(--c); }
.gal h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font: 900 30px/1 var(--title); color: var(--cd); }
.gal h3 .ic { width: 34px; height: 34px; fill: var(--c); }
.gal-n { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gal-n button { height: 60px; border-radius: 14px; border: 0; background: color-mix(in srgb, var(--cl) 60%, #fff); color: var(--cd); font: 800 24px/1 var(--title); }
.gal-n button:hover { background: var(--c); color: #fff; }

/* 商店 */
.shopw { display: flex; flex-direction: column; gap: 14px; }
.sw-tier { display: flex; align-items: center; gap: 22px; padding: 16px 22px; border-radius: 18px; background: rgba(255, 248, 236, 0.95); color: var(--ink); animation: rise 0.5s cubic-bezier(0.2, 1, 0.3, 1) both; }
.sw-p { width: 110px; flex: none; text-align: center; }
.sw-p b { display: block; font: 900 50px/1 var(--sans); color: var(--gold-deep); }
.sw-p span { font: 700 17px/1 var(--sans); color: var(--ink-2); }
.sw-items { display: flex; flex-wrap: wrap; gap: 10px; }
.sw-it { padding: 14px 22px; border-radius: 14px; background: #fff3d6; font: 800 24px/1 var(--title); }
.hn-deco { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hn-deco span { padding: 5px 10px; border-radius: 99px; background: #efe4d2; color: #a8987f; font: 600 14px/1 var(--sans); }
.hn-deco span.on { background: var(--c); color: #fff; }
