/* towers 模組的樣式：塔面板（傷害、瞄準、專精）、專精選擇、卡片稀有度 */

/* ---------- 塔面板 ---------- */
.tw-x { display: grid; gap: 16px; margin: -4px 0 22px; }
.tw-dmg { display: flex; align-items: baseline; gap: 14px; font-size: 32px; color: var(--sub); flex-wrap: wrap; }
.tw-dmg b { color: var(--ink); font: 700 38px/1.1 "Arial Rounded MT Bold", "Arial Black", sans-serif; margin-right: 18px; font-variant-numeric: tabular-nums; }
.tw-aim { display: grid; grid-template-columns: auto repeat(4, 1fr); gap: 8px; align-items: center; background: #f3e7d8; border-radius: 30px; padding: 8px; }
.tw-aim > span { font-size: 30px; font-weight: 700; color: var(--sub); padding: 0 14px 0 16px; }
.tw-aim button {
  appearance: none; border: 0; border-radius: 24px; height: 76px; font-size: 32px; font-weight: 700; color: var(--sub); background: transparent;
  transition: background .25s var(--ease), color .25s var(--ease), transform .2s var(--spring);
}
.tw-aim button:active { transform: scale(.94); }
.tw-aim button[aria-checked="true"] { background: #fffaf2; color: var(--ink); box-shadow: 0 4px 0 var(--ink), inset 0 0 0 4px var(--ink); }
.tw-spec { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 16px; align-items: center; font-size: 30px; color: var(--sub); background: #fff; border: 4px dashed var(--line); border-radius: 30px; padding: 12px 22px; }
.tw-spec em { font-style: normal; font-size: 44px; line-height: 1; }
.tw-spec.on { border: 4px solid var(--ink); background: color-mix(in srgb, var(--c) 16%, #fff); }
.tw-spec.on b { font-size: 36px; color: var(--ink); background: var(--c); border: 3px solid var(--ink); border-radius: 20px; padding: 0 14px; line-height: 1.35; white-space: nowrap; }
.tw-spec.on span { line-height: 1.3; }
.tw-pick { height: 96px; animation: tw-glow 1.4s ease-in-out infinite; }
@keyframes tw-glow { 50% { box-shadow: 0 8px 0 var(--ink), 0 0 0 14px rgba(255, 182, 39, .4); } }
.stats i { font-style: normal; }

/* ---------- 專精選擇 ---------- */
.spec-box h2 { font-size: 64px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin: 34px 0 26px; }
.sp {
  appearance: none; position: relative; display: grid; justify-items: center; align-content: start; gap: 10px; padding: 26px 22px 30px; text-align: center;
  border: 5px solid var(--ink); border-radius: 40px; background: linear-gradient(color-mix(in srgb, var(--c) 22%, #fff), #fff 58%);
  box-shadow: 0 10px 0 var(--ink); transition: transform .22s var(--spring), box-shadow .22s var(--ease);
  animation: sp-in .55s var(--spring) both;
}
.sp + .sp { animation-delay: .09s; }
@keyframes sp-in { from { transform: translateY(60px) scale(.9); opacity: 0; } }
.sp:hover { transform: translateY(-6px); }
.sp:active { transform: translateY(8px); box-shadow: 0 2px 0 var(--ink); }
.sp .pic { position: relative; width: 210px; height: 210px; border-radius: 50%; background: radial-gradient(#fff 52%, color-mix(in srgb, var(--c) 40%, #fff)); border: 5px solid var(--ink); display: grid; place-items: center; overflow: hidden; }
.sp .pic img { width: 200px; height: 200px; margin-top: 10px; }
.sp .pic em { position: absolute; right: 8px; bottom: 6px; font-style: normal; font-size: 46px; line-height: 1; filter: drop-shadow(0 2px 0 #fff); }
.sp b { font-size: 54px; line-height: 1.2; background: var(--c); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; border-radius: 26px; padding: 0 26px; }
.sp .d { font-size: 33px; color: var(--ink); line-height: 1.35; font-weight: 600; }
.sp small { font-size: 28px; color: var(--sub); }
.later { height: 96px; font-size: 34px; padding: 0 44px; }

/* ---------- 卡片稀有度 ---------- */
.cd { position: relative; overflow: hidden; animation: cd-in .45s var(--spring) both; animation-delay: var(--d, 0ms); }
@keyframes cd-in { from { transform: translateY(40px) scale(.94); opacity: 0; } }
.cd b { display: flex; align-items: center; gap: 16px; }
.cd .rt { font: 800 24px/1.5 "PingFang TC", sans-serif; font-style: normal; color: #fff; background: #b39a84; border-radius: 16px; padding: 0 14px; letter-spacing: .08em; }
.cd.r-c { border-color: var(--ink); }
.cd.r-r { border-color: #2f7fd8; box-shadow: 0 8px 0 #1f5aa0; background: linear-gradient(100deg, #eef6ff, #fff 60%); }
.cd.r-r .ic { background: #dcecff; }
.cd.r-r .rt { background: #2f7fd8; }
.cd.r-l { border-color: #d48a00; box-shadow: 0 8px 0 #8a5600, 0 0 34px rgba(255, 190, 40, .55); background: linear-gradient(100deg, #fff3c4, #fffaf0 55%, #ffe9a8); }
.cd.r-l .ic { background: linear-gradient(135deg, #ffe680, #ffb020); }
.cd.r-l .rt { background: linear-gradient(90deg, #ff9f1c, #ff5fa2, #ff9f1c); }
.cd.r-l::after {   /* 傳說：一道光掃過去 */
  content: ""; position: absolute; inset: -20% auto -20% -40%; width: 30%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); transform: skewX(-20deg);
  animation: cd-shine 2.2s var(--ease) infinite;
}
@keyframes cd-shine { 0% { left: -40%; } 60%, 100% { left: 130%; } }
.cd.r-l .ic { animation: cd-twinkle 1.6s ease-in-out infinite; }
@keyframes cd-twinkle { 50% { transform: scale(1.08) rotate(-4deg); } }
.reroll { margin-top: 26px; height: 100px; font-size: 36px; padding: 0 46px; }
.card-box.re .cards { animation: cd-flip .4s var(--ease); }
@keyframes cd-flip { from { transform: rotateX(70deg); opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
  .cd.r-l::after { display: none; }
}
