* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  font-family: 'Noto Sans SC', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 18% 14%, rgba(212, 175, 95, 0.16) 0%, transparent 44%),
    radial-gradient(circle at 82% 86%, rgba(20, 184, 166, 0.22) 0%, transparent 48%),
    linear-gradient(160deg, #0b2c35 0%, #071b22 55%, #040f14 100%);
  color: #f7f2e4;
  overflow: hidden;
}
.font-serif-sc { font-family: 'Noto Serif SC', "Songti SC", "STSong", "Noto Serif CJK SC", serif; }
.font-calligraphy { font-family: 'Ma Shan Zheng', "Kaiti SC", "STKaiti", 'Noto Serif SC', serif; }
.phone-frame {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow:
    0 0 70px rgba(212, 175, 95, 0.22),
    0 0 40px rgba(45, 212, 191, 0.18),
    0 24px 80px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1.5px rgba(232, 193, 106, 0.58),
    inset 0 0 0 4px rgba(13, 44, 50, 0.88);
}
/* Guofeng Carved Rosewood & Ink-Lacquer Scroll */
.glass-jade {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(218, 174, 102, 0.14) 0%, transparent 62%),
    linear-gradient(180deg, rgba(28, 19, 14, 0.94) 0%, rgba(15, 10, 7, 0.97) 100%);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 169, 98, 0.56);
  border-radius: 6px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 236, 194, 0.16),
    inset 0 -2px 6px rgba(0, 0, 0, 0.55);
}
/* Guofeng Imperial Cinnabar-Bronze Lacquer */
.glass-gold {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 185, 86, 0.20) 0%, transparent 62%),
    linear-gradient(180deg, rgba(56, 33, 14, 0.95) 0%, rgba(28, 16, 7, 0.98) 100%);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(235, 190, 108, 0.72);
  border-radius: 6px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 240, 200, 0.26),
    inset 0 -2px 6px rgba(0, 0, 0, 0.50);
}
/* Cinnabar Seal Stamp */
.gf-seal {
  background: linear-gradient(180deg, #b82520 0%, #831715 60%, #5e0f0e 100%);
  border: 1px solid rgba(245, 208, 130, 0.72);
  color: #fef3c7;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(90, 14, 14, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 0.04em;
}
/* Collectible Card Base */
.gf-card {
  position: relative;
  background:
    radial-gradient(circle at 50% 18%, rgba(212, 169, 98, 0.10) 0%, transparent 72%),
    linear-gradient(180deg, rgba(28, 20, 15, 0.94) 0%, rgba(16, 11, 8, 0.98) 100%);
  border: 1px solid rgba(212, 169, 98, 0.42);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 236, 194, 0.10);
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.14s ease, box-shadow 0.14s ease;
}
.gf-card:hover { border-color: rgba(245, 208, 130, 0.80); }
.gf-card:active { transform: scale(0.97); }
.gf-card-mythic {
  background:
    radial-gradient(circle at 50% 18%, rgba(220, 58, 78, 0.22) 0%, transparent 72%),
    linear-gradient(180deg, rgba(58, 18, 22, 0.95) 0%, rgba(28, 9, 12, 0.99) 100%);
  border: 1px solid rgba(244, 114, 132, 0.68);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(160, 18, 45, 0.36), inset 0 1px 0 rgba(253, 224, 135, 0.22);
}
.card-tier-low { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(120, 210, 190, 0.18); }
.card-tier-mid { box-shadow: 0 4px 14px rgba(56, 189, 248, 0.22), inset 0 0 0 1px rgba(125, 211, 252, 0.26); }
.card-tier-high { box-shadow: 0 4px 16px rgba(245, 185, 86, 0.32), inset 0 0 10px rgba(245, 185, 86, 0.16); }
.card-tier-mythic { box-shadow: 0 4px 18px rgba(244, 114, 182, 0.42), inset 0 0 12px rgba(244, 114, 182, 0.22); }
.gf-icon-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55)); }
/* Ornamental Gold Hairline Divider */
.gf-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(224, 180, 102, 0.72) 50%, transparent 100%);
}
.gf-hairline { border-bottom: 1px solid rgba(212, 169, 98, 0.18); }
/* Seamless Top Ink-Wash Curtain (No Floating Boxes) */
.gf-top-curtain {
  background: linear-gradient(180deg, rgba(14, 10, 7, 0.94) 0%, rgba(22, 15, 10, 0.86) 76%, rgba(22, 15, 10, 0) 100%);
  position: relative;
}
.gf-top-curtain::after {
  content: ''; position: absolute; left: 6%; right: 6%; bottom: 2px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 180, 102, 0.55), transparent);
  pointer-events: none;
}
/* Tapered Ink-Wash Toast Ribbon */
.gf-ink-ribbon {
  background: linear-gradient(90deg, transparent 0%, rgba(22, 14, 9, 0.92) 18%, rgba(22, 14, 9, 0.92) 82%, transparent 100%);
  border-top: 1px solid rgba(224, 180, 102, 0.55);
  border-bottom: 1px solid rgba(224, 180, 102, 0.55);
}
/* Carved Horizontal Hanging Nameplate Plaque (深紫檀真9-Slice横幅匾额，永不拉伸) */
.gf-nameplate {
  background: none;
  border-style: solid;
  border-width: 10px 18px;
  border-image-source: url('ui/tablet_wood_btn.png');
  border-image-slice: 28 54 28 54 fill;
  border-image-repeat: stretch;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.85));
}
/* Chinese Hanging Scroll Modal with Rosewood & Jade Rollers (古风挂轴弹窗) */
.gf-scroll-modal {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(218, 174, 102, 0.14) 0%, transparent 62%),
    linear-gradient(180deg, rgba(28, 19, 14, 0.97) 0%, rgba(16, 10, 7, 0.99) 100%);
  border-left: 1.5px solid rgba(218, 174, 102, 0.65);
  border-right: 1.5px solid rgba(218, 174, 102, 0.65);
  border-radius: 2px;
  margin-top: 16px;
  margin-bottom: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85), inset 0 0 24px rgba(0, 0, 0, 0.45);
}
.gf-scroll-modal::before, .gf-scroll-modal::after {
  content: '';
  position: absolute;
  left: -12px; right: -12px; height: 28px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.75));
}
.gf-scroll-modal::before { top: -18px; background-image: url('ui/scroll_rod_top.png'); }
.gf-scroll-modal::after { bottom: -18px; background-image: url('ui/scroll_rod_bot.png'); }
/* Flush Carved Rosewood Scroll Panel & Temple Bottom Dock */
.gf-scroll-panel {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(218, 174, 102, 0.12) 0%, transparent 58%),
    linear-gradient(180deg, rgba(26, 17, 12, 0.95) 0%, rgba(16, 10, 7, 0.98) 100%);
  border-top: 1.5px solid rgba(224, 180, 102, 0.72);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 240, 200, 0.16);
}
.gf-bottom-dock {
  background: linear-gradient(180deg, #241710 0%, #120b07 100%);
  border-top: 1.5px solid rgba(224, 180, 102, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.16);
}
.gf-combat-bar {
  background: linear-gradient(180deg, rgba(24, 16, 11, 0.96) 0%, rgba(14, 9, 6, 0.98) 100%);
  border-color: rgba(224, 180, 102, 0.55);
}
.gf-combo-text {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 14px rgba(245, 158, 11, 0.75);
}
/* Ornate Chinese Fretwork Corner Frame */
.gf-corner-frame {
  background-color: rgba(18, 12, 8, 0.97);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M2 16V4h12v3H7v4h4v-2' fill='none' stroke='%23e8be6a' stroke-width='1.4' stroke-opacity='0.78'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M16 16V4H4v3h7v4H7v-2' fill='none' stroke='%23e8be6a' stroke-width='1.4' stroke-opacity='0.78'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M2 2v12h12v-3H7V7h4v2' fill='none' stroke='%23e8be6a' stroke-width='1.4' stroke-opacity='0.78'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M16 2v12H4v-3h7V7H7v2' fill='none' stroke='%23e8be6a' stroke-width='1.4' stroke-opacity='0.78'/%3E%3C/svg%3E");
  background-position: 4px 4px, calc(100% - 4px) 4px, 4px calc(100% - 4px), calc(100% - 4px) calc(100% - 4px);
  background-size: 15px 15px;
  background-repeat: no-repeat;
}

/* Handcrafted Traditional Chinese Buttons — True 9-Slice & Locked Aspect Ratios (严禁拉伸) */
.btn-title-plaque {
  width: 100%; max-width: 340px; aspect-ratio: 640 / 171;
  margin-left: auto; margin-right: auto;
  background: url('ui/title_plaque_btn.png') center / contain no-repeat;
  border: none;
  padding: 0 52px;
  text-shadow: 0 1px 0 rgba(255, 246, 214, 0.55);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.78));
  transition: transform 0.09s cubic-bezier(0.22, 1, 0.36, 1), filter 0.12s ease;
}
.btn-title-plaque:active { transform: translateY(2px) scale(0.97); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65)) brightness(1.06); }
.btn-jade, .btn-gold, .btn-sky, .btn-rose {
  background: none;
  border-style: solid;
  border-width: 9px 14px;
  border-image-slice: 28 52 28 52 fill;
  border-image-repeat: stretch;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  transition: transform 0.09s cubic-bezier(0.22, 1, 0.36, 1), filter 0.12s ease;
}
.btn-jade { border-image-source: url('ui/btn_carved_jade.png'); color: #fffbeb; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92); }
.btn-jade:active { transform: translateY(2px) scale(0.97); filter: brightness(1.08); }
.btn-gold { border-image-source: url('ui/btn_carved_gold.png'); color: #241004; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.45); }
.btn-gold:active { transform: translateY(2px) scale(0.97); filter: brightness(1.06); }
.btn-sky { border-image-source: url('ui/btn_carved_indigo.png'); color: #f0f9ff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92); }
.btn-sky:active { transform: translateY(2px) scale(0.97); filter: brightness(1.08); }
.btn-purple {
  background: linear-gradient(180deg, #9d68c9 0%, #632b96 50%, #3d1861 100%);
  border: 1px solid rgba(233, 213, 255, 0.52);
  border-radius: 5px;
  box-shadow: 0 3px 0 #260d3d, 0 5px 14px rgba(61, 24, 97, 0.55), inset 0 0 0 1px rgba(255, 244, 214, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  transition: transform 0.09s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.09s ease;
}
.btn-purple:active { transform: translateY(2px) scale(0.97); box-shadow: 0 1px 0 #260d3d; }
.btn-rose { border-image-source: url('ui/btn_carved_crimson.png'); color: #fff1f2; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92); }
.btn-rose:active { transform: translateY(2px) scale(0.97); filter: brightness(1.08); }
.gf-sub-btn {
  background: none;
  border-style: solid;
  border-width: 8px 14px;
  border-image-source: url('ui/tablet_wood_btn.png');
  border-image-slice: 28 54 28 54 fill;
  border-image-repeat: stretch;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
  transition: transform 0.08s ease, filter 0.14s ease;
}
.gf-sub-btn:hover { filter: drop-shadow(0 3px 8px rgba(212, 169, 98, 0.35)) brightness(1.08); }
.gf-sub-btn:active { transform: translateY(1.5px) scale(0.97); }
/* Compact Lacquer & Burnished Gold Chip Buttons for Small Tabs/Pills (永不变形) */
.gf-chip-btn {
  background: linear-gradient(180deg, #3c2415 0%, #24140b 65%, #160c06 100%);
  border: 1px solid rgba(224, 180, 102, 0.62);
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 236, 194, 0.18);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.92);
  transition: transform 0.08s ease, border-color 0.14s ease, filter 0.14s ease;
}
.gf-chip-btn:hover { border-color: rgba(245, 208, 130, 0.9); }
.gf-chip-btn:active { transform: scale(0.95); }
.gf-chip-gold {
  background: linear-gradient(180deg, #f7d674 0%, #d89b32 58%, #a66914 100%);
  border: 1px solid rgba(254, 243, 199, 0.88);
  border-radius: 5px;
  color: #241004;
  box-shadow: 0 2px 8px rgba(217, 155, 50, 0.40), inset 0 1px 0 rgba(255, 250, 224, 0.65);
  text-shadow: 0 1px 0 rgba(255, 245, 210, 0.45);
  transition: transform 0.08s ease, filter 0.14s ease;
}
.gf-chip-gold:active { transform: scale(0.95); }
.gf-bar-gloss { position: relative; overflow: hidden; }
.gf-bar-gloss::after {
  content: ''; position: absolute; inset: 0 0 50% 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.32), rgba(255,255,255,0.04));
  pointer-events: none;
}

@keyframes sheenSweep {
  0%, 72% { transform: translateX(-140%) skewX(-20deg); opacity: 0; }
  82% { opacity: 0.42; }
  100% { transform: translateX(240%) skewX(-20deg); opacity: 0; }
}
.btn-sheen { position: relative; overflow: hidden; }
.btn-sheen::after {
  content: ''; position: absolute; inset: 0; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: sheenSweep 3.8s ease-in-out infinite; pointer-events: none;
}

@keyframes floatPop {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.76); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.12); }
  78% { opacity: 1; transform: translate(-50%, -34px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58px) scale(0.92); }
}
.float-popup {
  animation: floatPop 0.96s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.98), 0 0 2px rgba(0, 0, 0, 1);
}

@keyframes phenBurst {
  0% { opacity: 0; transform: scale(1.65); filter: blur(8px); }
  20% { opacity: 1; transform: scale(1); filter: blur(0); }
  78% { opacity: 1; transform: scale(1.04); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.12); filter: blur(5px); }
}
.animate-phen { animation: phenBurst 2.1s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes danmakuSlide {
  0% { transform: translateX(106%); opacity: 0.96; }
  100% { transform: translateX(-130%); opacity: 0.88; }
}
.danmaku-item {
  position: absolute; white-space: nowrap;
  animation: danmakuSlide 6.0s linear forwards; pointer-events: none;
}

@keyframes bellPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.8); }
  50% { box-shadow: 0 0 16px 4px rgba(251, 191, 36, 0.95); }
}
.bell-ready { animation: bellPulse 1.25s ease-in-out infinite; }

@keyframes frenzyGlow {
  0%, 100% { border-color: rgba(251, 191, 36, 0.95); box-shadow: 0 0 18px rgba(251, 191, 36, 0.55); }
  50% { border-color: rgba(244, 114, 182, 0.95); box-shadow: 0 0 26px rgba(192, 132, 252, 0.78); }
}
.frenzy-ring { animation: frenzyGlow 1.1s ease-in-out infinite; }

@keyframes heatPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
  50% { box-shadow: 0 0 14px 3px rgba(244, 63, 94, 0.9); }
}
.overheat-pulse { animation: heatPulse 0.85s ease-in-out infinite; }

@keyframes valPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); color: #fef08a; }
  100% { transform: scale(1); }
}
.val-pop { display: inline-block; animation: valPop 0.28s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes overheatVignette {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.85; }
}
#overheatVignette {
  background: radial-gradient(ellipse at center, transparent 54%, rgba(225, 29, 72, 0.38) 100%);
  animation: overheatVignette 1.0s ease-in-out infinite;
}

@keyframes tutPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.95), 0 0 22px 6px rgba(251, 191, 36, 0.65); }
  50% { box-shadow: 0 0 0 5px rgba(94, 234, 212, 0.95), 0 0 30px 10px rgba(94, 234, 212, 0.75); }
}
.tut-highlight { position: relative; z-index: 62 !important; animation: tutPulse 1.1s ease-in-out infinite; }

.custom-scroll::-webkit-scrollbar { width: 4px; height: 4px; }
.custom-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(94,234,212,0.42); border-radius: 4px; }
canvas#stageCanvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }

/* Ornate Chinese Xianxia Plaque & Medallion Chrome */
.gf-plaque {
  position: relative;
  border: 1.5px solid rgba(232, 193, 106, 0.72);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.68),
    inset 0 0 0 1px rgba(254, 243, 199, 0.16),
    inset 0 2px 10px rgba(232, 193, 106, 0.08);
}
.gf-plaque::before {
  content: '';
  position: absolute;
  top: 0; left: 16%; right: 16%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(254, 240, 138, 0.92), transparent);
  pointer-events: none;
}
.gf-btn-ornate {
  position: relative;
  border-radius: 4px;
}
.gf-rail-medallion {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 9999px;
  background: url('ui/medallion_jade.png') center / contain no-repeat;
  border: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.72));
  transition: transform 0.1s cubic-bezier(0.22, 1, 0.36, 1), filter 0.15s ease;
}
.gf-rail-medallion::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(16, 10, 7, 0.90) 56%, rgba(16, 10, 7, 0.30) 100%);
  pointer-events: none;
  z-index: 0;
}
.gf-rail-medallion > * { position: relative; z-index: 1; }
.gf-rail-medallion:hover { filter: drop-shadow(0 3px 9px rgba(245, 208, 130, 0.45)) brightness(1.08); }
.gf-rail-medallion:active { transform: scale(0.92); }
.gf-rail-label {
  background: rgba(12, 8, 6, 0.86);
  border: 1px solid rgba(224, 180, 102, 0.48);
  border-radius: 9999px;
  padding: 1px 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.75);
}
.gf-nav-pill {
  position: relative;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), color 0.15s ease;
}
.gf-nav-pill-active {
  color: #fef3c7;
  transform: translateY(-3px);
}
.gf-nav-pill-active::before {
  content: '';
  position: absolute;
  inset: 2px 10%;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(245, 185, 86, 0.34) 0%, transparent 72%);
  pointer-events: none;
}
.gf-nav-pill-active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 25%; right: 25%; height: 2px;
  background: linear-gradient(90deg, transparent, #fde047, transparent);
  box-shadow: 0 0 8px #fde047;
}
.gf-ui-icon { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.72)); }
