:root{
  color-scheme:dark;
  font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;
  background:#091727;
  color:#eef7ff}
*{
  box-sizing:border-box}
body{
  margin:0;
  min-height:100dvh;
  overflow:hidden;
  background:radial-gradient(ellipse at 50% 25%,#254964 0,#0e2438 45%,#081421 80%);
  touch-action:manipulation}
button,input,select{
  font:inherit}
button{
  cursor:pointer;
  border:0;
  touch-action:manipulation}
button:focus-visible{
  outline:3px solid #fff;
  outline-offset:2px}
button:disabled{
  cursor:default}
button:active{
  filter:brightness(1.2)}
[hidden]{
  display:none!important}
#game{
  width:540px;
  height:960px;
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%) scale(var(--scale,1));
  transform-origin:center;
  border:1px solid #63768c;
  overflow:hidden;
  background:#102338;
  box-shadow:0 28px 100px #0009;
  border-radius:18px}
#hud{
  height:60px;
  display:flex;
  align-items:center;
  padding:6px 15px;
  gap:12px;
  background:linear-gradient(180deg,#243b54,#10233b);
  border-bottom:1px solid #8c806d;
  position:relative;
  z-index:3}
.phase-number{
  background:#101d30;
  border:1px solid #67768a;
  border-radius:8px;
  padding:0 12px}
.phase-number b{
  font-size:32px;
  color:#ffdd8c}
.phase-number span{
  font-size:13px;
  margin-left:3px;
  color:#b5c4d4}
.phase-info{
  flex:1}
.phase-info strong{
  font-size:19px;
  display:block;
  letter-spacing:1px}
.phase-info small{
  display:block;
  font-size:13px;
  color:#bbccdf;
  margin-top:1px}
.icon-button{
  height:48px;
  width:56px;
  border:1px solid #7796b4;
  border-radius:8px;
  background:#264565;
  color:#def5ff;
  font-weight:900;
  font-size:26px}
.mode-label{
  font-size:12px;
  color:#ffda81;
  background:#6e371f;
  padding:5px;
  border-radius:4px}
#battle{
  height:516px;
  position:relative;
  background:#b0caca;
  overflow:hidden}
canvas{
  display:block;
  width:540px;
  height:516px}
#battle-tip{
  position:absolute;
  top:16px;
  left:50%;
  transform:translateX(-50%);
  text-align:center;
  max-width:90%;
  width:max-content;
  border:1px solid #e6d3a55e;
  border-radius:18px;
  padding:6px 14px;
  background:#0e213bcb;
  font-size:14px;
  color:#fff2c9;
  pointer-events:none;
  opacity:1;
  transition:opacity .3s}
#castle{
  position:absolute;
  bottom:11px;
  left:82px;
  right:82px;
  background:#0e203ce8;
  border:1px solid #9eb9d9;
  border-radius:9px;
  padding:6px 11px;
  box-shadow:0 3px 16px #0006}
.castle-label{
  display:flex;
  justify-content:space-between;
  font-size:14px;
  line-height:21px}
.castle-label span{
  color:#b4eaff}
.meter{
  height:9px;
  background:#081324;
  border-radius:8px;
  overflow:hidden;
  border:1px solid #6a7c9560}
.meter i{
  display:block;
  width:100%;
  height:100%;
  background:linear-gradient(90deg,#45cadc,#88eaff);
  border-radius:8px;
  transition:width .1s linear}
#castle-fill{
  background:linear-gradient(90deg,#29b5bc,#75ebd0)}
#boss-bar{
  position:absolute;
  top:10px;
  left:80px;
  right:80px;
  background:#251329ec;
  border:1px solid #c86e7b;
  padding:6px 10px;
  border-radius:8px}
#boss-bar>div:first-child{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  margin-bottom:4px}
#boss-fill{
  background:linear-gradient(90deg,#d93648,#ff8e7d)}
#fusion-flash{
  position:absolute;
  left:0;
  right:0;
  top:150px;
  height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  pointer-events:none;
  text-shadow:0 3px 5px #180718;
  background:linear-gradient(90deg,transparent,#122c42e8 20%,#291b32ec 80%,transparent);
  border-block:1px solid #ffd789bb;
  animation:flash-in .9s both}
#fusion-flash span{
  font-size:15px;
  letter-spacing:10px;
  color:#ddf8ff}
#fusion-flash strong{
  font-size:34px;
  letter-spacing:3px;
  color:#ffe496}
#fusion-flash b{
  font-size:19px;
  color:#ffd9ac;
  margin-top:4px}
@keyframes flash-in{
  0%{
  opacity:0;
  transform:scaleX(.3)}
15%,75%{
  opacity:1;
  transform:scaleX(1)}
100%{
  opacity:0}
}
#controls{
  height:384px;
  padding:0 12px 8px;
  background:linear-gradient(160deg,#243850,#142339 55%,#1b3048);
  border-top:2px solid #c3a166;
  position:relative}
.energy-row{
  height:39px;
  display:flex;
  align-items:center;
  gap:9px;
  font-size:13px}
.energy-row>span{
  color:#cbe4f1}
.energy-row .meter{
  flex:1;
  height:7px}
.energy-row b{
  font-size:12px;
  width:59px;
  color:#c5e9ff}
.energy-row button{
  color:#adbfcd;
  font-size:12px;
  border:1px solid #53677b;
  background:#1b3046;
  border-radius:5px;
  height:27px;
  width:40px}
#energy-fill{
  width:0;
  background:linear-gradient(90deg,#7974e9,#e7b7ff)}
#fusion-cards{
  display:flex;
  gap:8px;
  height:89px}
.fusion-card{
  width:50%;
  height:89px;
  border-radius:10px;
  border:1px solid #92764f;
  color:#fff;
  background:linear-gradient(120deg,#493d35,#202d43 65%);
  display:flex;
  align-items:center;
  padding:0 4px;
  position:relative;
  text-align:left;
  overflow:hidden}
.fusion-card.guardian{
  border-color:#518f9c;
  background:linear-gradient(120deg,#244652,#1d2d44)}
.fusion-card .art{
  flex:none;
  width:78px;
  height:78px}
.fusion-copy{
  padding-right:3px;
  min-width:0}
.fusion-copy strong{
  font-size:17px;
  display:block;
  white-space:nowrap;
  color:#ffe0a2}
.guardian .fusion-copy strong{
  color:#aff3f2}
.fusion-copy small{
  display:block;
  font-size:11px;
  color:#cbd9e2;
  white-space:normal;
  height:29px;
  line-height:14px;
  margin-top:2px}
.fusion-copy b{
  display:block;
  font-size:13px;
  color:#b1c4d4;
  margin-top:2px}
.fusion-card.ready{
  border:2px solid #ffdb8a;
  box-shadow:0 0 17px #ffb24155;
  background:linear-gradient(125deg,#854026,#3a2741)}
.guardian.ready{
  border-color:#91fff5;
  box-shadow:0 0 17px #62eceb44;
  background:linear-gradient(125deg,#237375,#253a4c)}
.ready .fusion-copy b{
  color:#ffdf7d}
.guardian.ready .fusion-copy b{
  color:#a1fff2}
.fusion-card.used{
  filter:grayscale(.75);
  opacity:.65}
#dice-row{
  height:63px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px}
.dice-group{
  display:flex;
  gap:9px}
.die{
  width:43px;
  height:43px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(3,1fr);
  padding:7px;
  background:linear-gradient(140deg,#fff,#c4dfff);
  border:1px solid #92c1ed;
  border-radius:9px;
  box-shadow:0 3px 0 #698ca8,0 0 14px #63b7fc26}
.die i{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#237cc5;
  box-shadow:inset 0 1px 1px #001b5990;
  align-self:center;
  justify-self:center}
.die.rolling{
  animation:shake .12s infinite alternate}
@keyframes shake{
  from{
  transform:rotate(-10deg) translateY(-2px)}
to{
  transform:rotate(12deg) translateY(1px)}
}
.dice-copy strong{
  display:block;
  font-size:18px;
  color:#ffdc83}
.dice-copy small{
  font-size:12px;
  color:#adbed4;
  display:block;
  margin-top:3px}
.gold-button{
  position:relative;
  background:linear-gradient(180deg,#ffe8ab,#ffd27c 50%,#e7ad4d);
  border:1px solid #fff0c6;
  border-bottom:3px solid #9d6f31;
  border-radius:11px;
  color:#53351a;
  box-shadow:0 3px 12px #020e2280;
  font-weight:900;
  text-align:center;
  overflow:hidden}
.gold-button>strong{
  position:relative;
  z-index:1;
  font-size:23px;
  display:block;
  letter-spacing:3px}
.gold-button>span{
  position:relative;
  z-index:1;
  display:block;
  font-size:12px;
  font-weight:500;
  letter-spacing:1px;
  margin-top:2px}
.gold-button:disabled{
  background:linear-gradient(180deg,#344e64,#273e53);
  border-color:#567088;
  border-bottom-color:#0b1c2d;
  color:#c1d5e2}
#roll{
  height:69px;
  width:100%;
  margin-top:1px}
#cooldown-fill{
  position:absolute;
  bottom:0;
  left:0;
  height:4px;
  background:#73d5f7;
  width:100%;
  pointer-events:none}
#selection{
  height:108px;
  padding-top:9px}
#idle-hint{
  height:90px;
  border:1px dashed #70899c5c;
  border-radius:10px;
  text-align:center;
  display:flex;
  flex-direction:column;
  justify-content:center;
  color:#bacad9}
#idle-hint strong{
  font-size:16px;
  color:#d8e0e8}
#idle-hint span{
  font-size:13px;
  margin-top:6px}
#candidates{
  display:flex;
  gap:8px;
  height:90px}
.candidate{
  display:flex;
  align-items:center;
  text-align:left;
  flex:1;
  min-width:0;
  border-radius:10px;
  background:linear-gradient(135deg,#334f68,#1c324b);
  border:1px solid var(--element,#629bdd);
  color:#fff;
  padding:3px;
  position:relative}
.candidate .art{
  width:77px;
  height:77px;
  flex:none}
.candidate strong{
  font-size:16px;
  display:block}
.candidate .stars{
  font-size:12px;
  color:#ffdd82;
  margin-left:3px}
.candidate small{
  font-size:12px;
  display:block;
  margin-top:4px;
  color:#c1d7e5}
.candidate em{
  font-style:normal;
  font-size:11px;
  color:#8fffdd;
  display:block;
  margin-top:3px}
.candidate::after{
  content:'召唤';
  position:absolute;
  right:7px;
  bottom:5px;
  color:#e0ca8e;
  font-size:11px}
#replacement{
  height:95px}
#replacement>div:first-child{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:24px;
  font-size:13px;
  color:#ffe3ad}
#cancel-replace{
  color:#afcee2;
  font-size:13px;
  background:transparent}
#replace-list{
  display:flex;
  gap:5px;
  height:68px}
.replace-unit{
  background:#203b54;
  border:1px solid #7291a8;
  border-radius:8px;
  height:68px;
  flex:1;
  color:#fff;
  font-size:11px;
  padding:0;
  position:relative}
.replace-unit .art{
  width:42px;
  height:42px;
  display:block;
  margin:auto}
.replace-unit .mini-bar{
  height:3px;
  background:#061727;
  display:block;
  margin:0 5px}
.mini-bar i{
  height:100%;
  background:#72e3b4;
  display:block}
.replace-unit:disabled{
  opacity:.5;
  filter:grayscale(.5)}
.art{
  display:inline-block;
  background-image:url('assets/beasts-atlas.png');
  background-size:400% 400%;
  background-repeat:no-repeat;
  aspect-ratio:1;
  flex-shrink:0}
.overlay{
  position:absolute;
  inset:0;
  z-index:10}
.overlay button{
  min-height:66px}
#cover{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:51px 35px 20px;
  background:linear-gradient(180deg,#091e36c9,#0f263882 35%,#0b2232f5 60%,#102235),url('assets/crystal-bridge.png') center/cover}
.cover-kicker{
  font-size:14px;
  letter-spacing:4px;
  color:#cee7fa}
h1{
  font-size:57px;
  line-height:1.25;
  text-align:center;
  font-weight:1000;
  letter-spacing:5px;
  margin:21px 0 0;
  transform:rotate(-3deg);
  text-shadow:0 3px 0 #103b64,0 6px 22px #050d2d}
h1 em{
  font-style:normal;
  background:linear-gradient(#fff0b9,#ffc663);
  color:#ffda8b;
  background-clip:text;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 3px #532f1c)}
.cover-art{
  position:relative;
  width:450px;
  height:286px;
  margin-top:-3px}
.cover-art .champion{
  position:absolute;
  width:278px;
  height:278px;
  left:83px;
  top:0;
  filter:drop-shadow(0 0 23px #55afff44)}
.side-beast{
  position:absolute;
  width:152px;
  height:152px;
  left:0;
  top:107px;
  transform:rotate(-8deg);
  filter:drop-shadow(0 5px 8px #0007)}
.side-beast.right{
  left:auto;
  right:0;
  transform:rotate(7deg)}
.cover-tag{
  margin:0 0 26px;
  text-align:center;
  line-height:1.8;
  color:#c2d5e7;
  font-size:17px}
.cover-tag strong{
  color:#ecf6ff;
  font-weight:500}
.preset-buttons{
  display:flex;
  width:100%;
  gap:10px;
  margin-bottom:16px}
.preset{
  flex:1;
  background:#173a51;
  border:1px solid #3c657e;
  border-radius:10px;
  color:#cedfeb;
  padding:9px}
.preset strong{
  display:block;
  font-size:19px;
  letter-spacing:1px}
.preset small{
  display:block;
  font-size:12px;
  margin-top:4px}
.preset.selected{
  background:linear-gradient(160deg,#475349,#254456);
  border-color:#edcc86;
  color:#ffdf9c;
  box-shadow:inset 0 0 10px #ffd17213}
#start{
  width:100%;
  height:76px;
  font-size:25px;
  letter-spacing:2px}
#tutorial{
  margin-top:9px;
  width:100%;
  min-height:48px!important;
  font-size:15px}
.quiet-button{
  background:transparent;
  color:#b9d4e7;
  font-size:15px}
.seed-label{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-top:8px;
  color:#a5bdce;
  font-size:12px}
.seed-label input{
  background:#0c263b;
  border:1px solid #41627a;
  border-radius:6px;
  padding:9px;
  color:#fff;
  width:235px;
  font-size:12px}
.version{
  margin-top:auto;
  color:#839caf;
  letter-spacing:1px;
  font-size:11px}
.modal{
  background:#061525d9;
  backdrop-filter:blur(5px);
  display:flex;
  align-items:center;
  justify-content:center}
.modal-box{
  width:435px;
  background:linear-gradient(145deg,#294659,#172b43);
  border:1px solid #98a699;
  border-radius:19px;
  padding:34px 30px;
  text-align:center;
  box-shadow:0 20px 80px #0009}
.eyebrow{
  font-size:13px;
  letter-spacing:3px;
  color:#ffda94}
.modal-box h2{
  font-size:31px;
  line-height:1.5;
  margin:13px 0;
  color:#fce4ae}
.modal-box p{
  color:#c4d8e7;
  font-size:14px;
  line-height:1.7}
.setting{
  height:66px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  text-align:left;
  border-bottom:1px solid #59758b44}
.setting input{
  accent-color:#55d2de;
  width:24px;
  height:24px}
.modal-box>.gold-button{
  width:100%;
  height:72px;
  margin-top:25px;
  font-size:22px}
.modal-box>.quiet-button{
  display:block;
  width:100%;
  margin-top:5px;
  min-height:53px}
.result-box{
  padding:33px 28px}
#result-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin:25px 0 17px}
#result-stats div{
  background:#10283f;
  padding:14px 7px;
  border-radius:8px;
  border:1px solid #58728755}
#result-stats b{
  display:block;
  font-size:24px;
  color:#ffe1a3}
#result-stats span{
  display:block;
  font-size:12px;
  color:#a9c3d6;
  margin-top:5px}
.result-seed{
  font-size:11px!important;
  color:#8eacc1!important;
  word-break:break-all}
#debug-panel{
  z-index:20;
  position:absolute;
  left:10px;
  right:10px;
  top:72px;
  padding:14px;
  border:1px solid #e8b68a;
  border-radius:10px;
  background:#101e32f5;
  box-shadow:0 10px 40px #0009;
  font-size:13px;
  max-height:820px;
  overflow:auto}
#debug-panel header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  color:#ffd4a0}
#debug-panel label{
  display:flex;
  gap:6px;
  align-items:center;
  padding:7px 0;
  flex-wrap:wrap}
#debug-panel input,#debug-panel select{
  background:#294057;
  border:1px solid #607d96;
  color:white;
  border-radius:5px;
  padding:5px;
  min-height:37px}
#debug-panel input[type=number]{
  width:64px}
#debug-panel button{
  min-height:47px;
  padding:5px 11px;
  color:#fff3d7;
  background:#3b5368;
  border-radius:6px;
  border:1px solid #6e8394}
#debug-panel .debug-row{
  display:flex;
  gap:7px;
  padding:7px 0;
  flex-wrap:wrap}
#debug-panel pre{
  font-size:11px;
  color:#b5d3e4;
  white-space:pre-wrap;
  max-height:130px;
  overflow:auto;
  background:#0c192b;
  padding:10px}
#debug-seed{
  width:140px}
#debug-unit{
  width:165px}
#debug-target{
  width:170px}
@media(prefers-reduced-motion:reduce){
  .die.rolling{
  animation:none}
#fusion-flash{
  animation:none}
}


h1 em{
  text-shadow:none}


body{
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}

#game{
  position:fixed}

