@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Noto+Sans+TC:wght@400;700;900&family=Newsreader:ital,wght@0,600;0,700;1,600&family=Space+Grotesk:wght@400;600;700&family=Manrope:wght@400;600;700&display=swap');
body {
  font-family: 'Manrope', 'Noto Sans TC', sans-serif;
  background-color: #131315;
  color: #e5e1e4;
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior-y: none;
}

#game-scaler {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100dvh;
  background-color: #131315;
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 450px;
  height: 800px;
  background-color: #131315;
  transform-origin: center center;
  flex-shrink: 0;
}

.dice-btn {
  clip-path: none;
  background: transparent;
  border: none;
  box-shadow: none;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dice-btn:active { transform: scale(0.85); }

.pop-anim { animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes pop {
  0% { transform: scale(1) rotate(45deg); }
  50% { transform: scale(1.15) rotate(45deg); }
  100% { transform: scale(1) rotate(45deg); }
}

@keyframes diceRerollCombined {
  0%   { transform: rotate(0deg); }
  10%  { transform: rotate(-12deg); }
  25%  { transform: rotate(14deg); }
  40%  { transform: rotate(-13deg); }
  55%  { transform: rotate(12deg); }
  70%  { transform: rotate(-8deg); }
  85%  { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}

.dice-rerolling {
  animation: diceRerollCombined 0.3s ease-out forwards;
  will-change: transform;
}

.pulse-border { animation: pulseBorder 0.6s infinite alternate; }
@keyframes pulseBorder {
  0% { border-color: #475569; color: #64748b; }
  100% { border-color: #cbd5e1; color: #f8fafc; }
}

.damage-text { animation: floatDamage 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; pointer-events: none; }
@keyframes floatDamage {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 50px)) scale(1.2); }
}

.shake-hard { animation: shakeHard 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shakeHard {
  0%, 100% { transform: translate3d(0, 0, 0); }
  10%, 90% { transform: translate3d(-2px, -2px, 0); }
  20%, 80% { transform: translate3d(4px, 4px, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, -4px, 0); }
  40%, 60% { transform: translate3d(6px, 2px, 0); }
}

.glitch-effect { filter: hue-rotate(90deg) contrast(200%) saturate(150%); }

.flash-red-anim { animation: flashRed 0.5s ease-out forwards; }
@keyframes flashRed {
  0% { background-color: rgba(220, 38, 38, 0.4); }
  100% { background-color: transparent; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

.toast-enter { animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes toastIn {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.8); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.deep-sea-anim { animation: deepSeaFade 1s linear forwards; }
@keyframes deepSeaFade {
  0%, 100% { opacity: 1; }
  10%, 90% { opacity: 0; }
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* --- Title Screen --- */
@keyframes title-breathing {
  0%, 100% { transform: scale(1.0); }
  50%       { transform: scale(1.05); }
}

#title-screen {
  background: none; /* 背景改由 ::before / ::after 偽元素承載 */
  overflow: hidden;
}

/* 背景插畫層（呼吸縮放動畫） */
#title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../img/home_bg.webp');
  background-size: cover;
  background-position: center;
  animation: title-breathing 10s ease-in-out infinite;
  z-index: -2;
  pointer-events: none;
}

/* 漸層蒙層：保留原輝光並添加漸暗 Scrim 提升可讀性 */
#title-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(122, 59, 245, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 95%, rgba(0, 219, 233, 0.08) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.65) 80%);
  z-index: -1;
  pointer-events: none;
}

/* 首頁按鈕：紫水晶玻璃擬態 (Crystal Glassmorphism) */
#title-screen .btn-primary {
  background: rgba(80, 40, 120, 0.85);
  border: 2px solid rgba(180, 130, 255, 0.9);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  color: #eee4ff;
}
#title-screen .btn-primary:hover {
  background: rgba(122, 59, 245, 0.4);
  border: 1px solid rgba(167, 139, 250, 0.6);
  box-shadow: 0 0 25px rgba(122, 59, 245, 0.5);
  transform: translateY(-2px);
}

#title-screen .btn-secondary {
  background: rgba(30, 30, 50, 0.85);
  border: 2px solid rgba(120, 100, 180, 0.8);
  transition: all 0.3s ease;
  color: #b5a8c8;
}
#title-screen .btn-secondary:hover {
  background: rgba(60, 55, 75, 0.6);
  border-color: rgba(167, 139, 250, 0.4);
  color: #d0c3e8;
  transform: translateY(-1px);
}

/* --- 沉浸式開場動畫 --- */
.intro-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.intro-fade-in {
  animation: ui-fade-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  pointer-events: auto;
}
@keyframes ui-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

.animate-flash {
  display: block !important;
  animation: flash-bang 0.8s ease-out forwards;
}
@keyframes flash-bang {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

.game-logo {
  font-family: 'Newsreader', 'Cinzel Decorative', 'Noto Sans TC', serif;
}

.dice-pips-deco {
  display: flex;
  gap: 6px;
  justify-content: center;
  opacity: 0.2;
  font-size: 20px;
  letter-spacing: 2px;
}

.title-enter {
  animation: titleEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes titleEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.btn-primary {
  position: relative;
  overflow: visible;
  background: linear-gradient(135deg, #5600c9 0%, #7a3bf5 50%, #5600c9 100%);
  background-size: 200% 100%;
  color: #eee4ff;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(122, 59, 245, 0.35), inset 0 1px 0 rgba(208, 188, 255, 0.18);
  border: 1px solid rgba(208, 188, 255, 0.25);
  transition: background-position 0.4s, box-shadow 0.3s, transform 0.15s;
  cursor: pointer;
}
.btn-primary:hover {
  background-position: 100% 0;
  box-shadow: 0 0 40px rgba(122, 59, 245, 0.55), inset 0 1px 0 rgba(208, 188, 255, 0.3);
  transform: translateY(-2px);
}
.btn-primary:active { transform: scale(0.97) translateY(0); }

.btn-secondary {
  position: relative;
  background: rgba(19, 19, 21, 0.75);
  border: 1px solid rgba(100, 116, 139, 0.28);
  color: #958da1;
  font-weight: 700;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
  cursor: pointer;
}
.btn-secondary:hover {
  border-color: rgba(208, 188, 255, 0.35);
  color: #ccc3d8;
  background: rgba(42, 42, 44, 0.9);
}
.btn-secondary:active { transform: scale(0.97); }

.title-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(100, 116, 139, 0.3);
  font-size: 14px;
  margin: 2px 0;
}
.title-divider::before,
.title-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(100, 116, 139, 0.22), transparent);
}

/* === Abyssal Surface System ===
   Overrides blue-tinted slate palette → neutral purple-dark */

header {
    background: rgba(13, 13, 15, 0.98) !important;
    border-bottom-color: #2a2a2c !important;
}

.card-enemy {
    background: linear-gradient(160deg, rgba(45, 18, 18, 0.97) 0%, rgba(28, 27, 29, 0.97) 55%) !important;
    border-color: rgba(127, 29, 29, 0.5) !important;
    box-shadow: inset 0 1px 0 rgba(255, 180, 171, 0.04), 0 4px 20px rgba(0,0,0,0.4);
}
.card-board {
    background-image: none;
    background-color: rgba(22, 13, 40, 0.97) !important;
    border-color: rgba(74, 68, 85, 0.38) !important;
    box-shadow: inset 0 1px 0 rgba(208, 188, 255, 0.05), 0 4px 20px rgba(0,0,0,0.4);
}
.card-score {
    background: linear-gradient(180deg, rgba(20, 14, 38, 0.97) 0%, rgba(28, 27, 29, 0.97) 60%) !important;
    border-color: rgba(74, 68, 85, 0.38) !important;
    box-shadow: inset 0 1px 0 rgba(208, 188, 255, 0.05), 0 4px 20px rgba(0,0,0,0.4);
}

.stage-layer-badge { font-size: 0.7em; font-weight: 700; color: #94A3B8; margin-right: 4px; flex-shrink: 0; }
.shackle-title-badge { font-size: 0.75em; font-weight: 900; color: #C084FC; margin-right: 4px; flex-shrink: 0; }
.enemy-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mythic-suppressed { opacity: 0.4; filter: grayscale(1); position: relative; }
.mythic-suppress-icon { position: absolute; top: 2px; right: 2px; font-size: 0.85em; pointer-events: none; }

#final-damage-preview {
    background: linear-gradient(160deg, #100e18 0%, #0e0e10 60%);
    border: 1px solid rgba(122, 59, 245, 0.22);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px 14px;
    box-shadow: inset 0 0 40px rgba(122, 59, 245, 0.06);
}

#final-score-value.score-hot {
    color: #fbbf24;
    fill: #fbbf24;
    text-shadow: 0 0 28px rgba(251, 191, 36, 0.65), 0 0 8px rgba(251, 191, 36, 0.4);
    transition: color 0.3s, fill 0.3s, text-shadow 0.3s;
}
#final-score-value.score-normal {
    color: #ffffff;
    fill: #ffffff;
    text-shadow: none;
    transition: color 0.3s, fill 0.3s, text-shadow 0.3s;
}

#final-score-value {
    max-width: 100%;
    white-space: nowrap;
}

#final-score-value.damage-digits-long {
    font-size: clamp(32px, 8.2vw, 56px) !important;
}

#final-score-value.damage-digits-xl {
    font-size: clamp(26px, 6.4vw, 46px) !important;
}

#final-score-value.damage-digits-xxl {
    font-size: clamp(20px, 5.2vw, 36px) !important;
}

/* Modal panels */
#rules-modal > div,
#history-modal > div,
#collection-modal > div,
#settings-modal > div,
#souls-modal > div,
#fusion-replace-modal > div,
#dev-modal > div {
    background: #1c1b1d !important;
    border-color: #4a4455 !important;
}
#rules-modal .bg-slate-900,
#history-modal .bg-slate-900,
#collection-modal .bg-slate-900,
#settings-modal .bg-slate-900,
#souls-modal .bg-slate-900 {
    background: #0e0e10 !important;
    border-color: #2a2a2c !important;
}
#settings-modal .bg-slate-800 {
    background: #1c1b1d !important;
}

/* History modal: PB sticky / list scroll */
#history-content {
    overflow-y: auto !important;
    overflow-x: hidden;
    flex-grow: 1;
    min-height: 0;
    padding: 0 !important;
}
.history-pb-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1c1b1d;
    padding: 0.5rem;
    border-bottom: 1px solid #2a2a2c;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .history-pb-sticky { padding: 1rem; }
}
.history-list-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}
@media (min-width: 768px) {
    .history-list-section { padding: 1rem; padding-top: 0.5rem; }
}

#owned-relics-area {
    border-top-color: #2a2a2c !important;
}
#owned-relics-area > div:first-child {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* Scrollbar: Abyssal tint */
::-webkit-scrollbar-thumb { background: #4a4455; }
::-webkit-scrollbar-thumb:hover { background: #7a3bf5; }

/* --- Typography role assignments --- */
#player-hp,
#enemy-hp-text,
#final-score-value,
#rolls-left-badge,
#turns-left,
#stage-info {
  font-family: 'Space Grotesk', 'Noto Sans TC', monospace;
}

#enemy-hp-text {
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-shadow: none;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  height: fit-content;
  line-height: normal;
  z-index: 2;
}

/* --- In-game card accents --- */
.card-enemy { border-top: 2px solid rgba(239, 68, 68, 0.7) !important; }
.card-board  { border-top: 2px solid rgba(122, 59, 245, 0.65) !important; }
.card-score  { border-top: 2px solid rgba(129, 140, 248, 0.6) !important; }

/* Shop next-stage button hidden by design */
#btn-next-stage { display: none !important; }

/* --- Shop screen --- */
#shop-overlay {
  background: linear-gradient(160deg, #16131f 0%, #131315 60%, #0e0e10 100%);
}

/* --- End / Game Over screen --- */
#end-overlay {
  background: radial-gradient(ellipse at 50% 20%, rgba(120, 15, 15, 0.98) 0%, rgba(6, 4, 10, 0.99) 65%);
}
.end-logo {
  font-family: 'Newsreader', 'Cinzel Decorative', 'Noto Sans TC', serif;
  letter-spacing: 0.02em;
}
.shock-enter {
  animation: shockEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes shockEnter {
  from { opacity: 0; transform: scale(1.3); filter: blur(8px); }
  to   { opacity: 1; transform: scale(1);   filter: blur(0);  }
}

/* --- Phase A Task 1: Damage preview bar --- */
.damage-preview-bar {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 100, 50, 0.75) 0%, rgba(255, 30, 30, 0.9) 100%);
  box-shadow: 0 0 8px 2px rgba(255, 60, 60, 0.7), inset 0 0 4px rgba(255, 200, 200, 0.4);
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  animation: dmg-preview-blink 0.7s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

@keyframes dmg-preview-blink {
  from { opacity: 0.65; }
  to   { opacity: 1.0; }
}

/* Kill-shot: entire HP bar pulses */
.hp-bar-killshot {
  animation: hp-bar-killshot-pulse 0.4s ease-in-out infinite alternate !important;
}

@keyframes hp-bar-killshot-pulse {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* --- Phase A Task 3: Enemy countdown visual --- */
.enemy-countdown {
  font-size: 1.5em;
  font-weight: bold;
  color: #FF3333;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.8),
    0 0 16px rgba(255, 0, 0, 0.6);
  background: rgba(180, 0, 0, 0.2) !important;
  border: 1px solid rgba(255, 50, 50, 0.6) !important;
  border-radius: 6px;
}

@keyframes countdown-pulse {
  0%, 100% {
    color: #FF3333;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(255, 0, 0, 0.6);
    box-shadow: 0 0 4px rgba(255, 50, 50, 0.4);
    background: rgba(180, 0, 0, 0.2);
  }
  50% {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 1.0), 0 0 24px rgba(255, 50, 50, 1.0);
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.8), 0 0 15px rgba(255, 0, 0, 0.8);
    background: rgba(220, 20, 20, 0.4);
  }
}
.countdown-urgent {
  animation: countdown-pulse 0.5s ease-in-out infinite;
}

/* --- Phase B: Drunk shackle --- */
@keyframes drunk-shake {
  0%   { transform: translateX(0px);  filter: blur(0px); }
  25%  { transform: translateX(-2px); filter: blur(0.4px); }
  50%  { transform: translateX(2px);  filter: blur(0.8px); }
  75%  { transform: translateX(-1px); filter: blur(0.4px); }
  100% { transform: translateX(0px);  filter: blur(0px); }
}
.damage-drunk {
  animation: drunk-shake 0.3s ease-in-out infinite;
  color: #FFD700;
}
.damage-preview-bar.drunk {
  animation: dmg-preview-blink 0.3s ease-in-out infinite alternate;
}

/* --- Phase B: Relic step animation --- */
.relic-active {
  box-shadow: 0 0 12px 4px rgba(255, 215, 0, 0.85) !important;
  transform: scale(1.12) !important;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

@keyframes damage-multiply-flash {
  0%   { transform: scale(1.0);  color: #FFD700; }
  40%  { transform: scale(1.25); color: #FFF176; }
  100% { transform: scale(1.0);  color: #FFD700; }
}
.damage-multiply {
  animation: damage-multiply-flash 0.25s ease-out;
}

@keyframes bonus-float {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-24px); }
}
.damage-bonus-popup {
  position: absolute;
  color: #A8FF78;
  font-size: 0.85em;
  font-weight: bold;
  pointer-events: none;
  animation: bonus-float 0.4s ease-out forwards;
  z-index: 10;
}

/* --- Lethal preview bar (damage >= enemy HP) --- */
.damage-preview-bar--lethal {
  background: rgba(147, 51, 234, 0.75) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
  animation: lethal-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes lethal-pulse {
  from { opacity: 0.6; }
  to   { opacity: 1.0; }
}

/* --- Zone highlight during step animation --- */
.zone-active {
  box-shadow: 0 0 14px 4px rgba(56, 189, 248, 0.9) !important;
  transform: scale(1.08) !important;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  border-color: #38BDF8 !important;
}

@keyframes zone-multiply-flash {
  0%   { transform: scale(1.0);  color: #38BDF8; }
  40%  { transform: scale(1.25); color: #BAE6FD; }
  100% { transform: scale(1.0);  color: #38BDF8; }
}
.zone-multiply {
  animation: zone-multiply-flash 0.25s ease-out;
}

/* --- Dice sum fly animation --- */
.dice-sum-fly {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-weight: 900;
  color: #FFD700;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.9),
    0 0 20px rgba(255, 215, 0, 0.8);
  transform: translate(-50%, -50%) scale(1.0);
  transition:
    left 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    top  0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.35s ease,
    opacity 0.15s ease;
  will-change: left, top, transform, opacity;
}

@keyframes dice-fly-arrive {
  0%   { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.0); opacity: 0; }
}
.dice-sum-fly--arrive {
  animation: dice-fly-arrive 0.15s ease-out forwards;
}

/* ===== Tutorial System ===== */
.tutorial-highlight {
  position: relative !important;
  z-index: 196 !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.9), 0 0 20px rgba(139, 92, 246, 0.5) !important;
  border-radius: 8px;
  pointer-events: auto !important;
  animation: tutorial-pulse 1.8s ease-in-out infinite;
}
@keyframes tutorial-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.9), 0 0 20px rgba(139, 92, 246, 0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(167, 139, 250, 1.0), 0 0 30px rgba(139, 92, 246, 0.7); }
}

.tutorial-tooltip {
  background: linear-gradient(145deg, #1e1b2e, #1a1a2e);
  border: 2px solid #7c3aed;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.45), 0 8px 32px rgba(0,0,0,0.6);
  animation: tutorial-fade-in 0.25s ease-out;
}
@keyframes tutorial-fade-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Board Background: Shackle States ===== */
.board-shackled {
  background: radial-gradient(ellipse at center, rgba(80,0,60,0.85) 0%, rgba(30,0,40,0.95) 100%);
  box-shadow: inset 0 0 40px rgba(160,0,100,0.3);
  animation: shackle-breathe 3s ease-in-out infinite;
}
@keyframes shackle-breathe {
  0%,100% { box-shadow: inset 0 0 40px rgba(160,0,100,0.3); }
  50%     { box-shadow: inset 0 0 70px rgba(160,0,100,0.55); }
}
.board-shackled-boss {
  background: radial-gradient(ellipse at center, rgba(100,0,0,0.9) 0%, rgba(10,0,0,0.98) 100%);
  box-shadow: inset 0 0 60px rgba(200,0,0,0.4);
  animation: boss-breathe 2s ease-in-out infinite;
}
@keyframes boss-breathe {
  0%,100% { box-shadow: inset 0 0 60px rgba(200,0,0,0.4); }
  50%     { box-shadow: inset 0 0 100px rgba(200,0,0,0.7); }
}

/* ===== Shackle Stage Intro ===== */
.shackle-seal-overlay {
  position: fixed;
  inset: 0;
  z-index: 98;
  pointer-events: auto;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(127, 29, 29, 0.22) 0%, rgba(2, 6, 23, 0.78) 48%, rgba(0, 0, 0, 0.92) 100%);
  animation: shackleOverlayIn 1.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shackle-seal-vignette {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(circle at center, transparent 0 30%, rgba(88, 28, 135, 0.22) 48%, rgba(0, 0, 0, 0.88) 76%),
    repeating-linear-gradient(90deg, rgba(248, 113, 113, 0.05) 0 2px, transparent 2px 9px);
  animation: shackleVignettePulse 1.45s ease-out forwards;
}

.shackle-chain {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(205vw, 1520px);
  height: clamp(122px, 25vw, 224px);
  transform-origin: center;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 18px rgba(239, 68, 68, 0.72)) drop-shadow(0 12px 22px rgba(0, 0, 0, 0.9));
}

.shackle-chain::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90%;
  height: 30%;
  border-radius: 999px;
  border: 2px solid rgba(248, 113, 113, 0.75);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: shackleChainShock 1.45s ease-out forwards;
}

.shackle-link {
  position: relative;
  flex: 0 0 clamp(106px, 19vw, 190px);
  width: clamp(106px, 19vw, 190px);
  height: clamp(62px, 11.5vw, 116px);
  border-radius: 999px;
  border: clamp(9px, 1.8vw, 18px) solid rgba(226, 232, 240, 0.94);
  background:
    linear-gradient(135deg, #f8fafc 0%, #94a3b8 18%, #111827 36%, #e5e7eb 54%, #475569 76%, #f8fafc 100%) border-box;
  box-shadow:
    inset 0 3px 7px rgba(255, 255, 255, 0.9),
    inset 0 -8px 12px rgba(0, 0, 0, 0.62),
    0 4px 8px rgba(255, 255, 255, 0.22),
    0 10px 18px rgba(0, 0, 0, 0.9);
  margin-left: clamp(-68px, -7.4vw, -34px);
}

.shackle-link:first-child {
  margin-left: 0;
}

.shackle-link::before {
  content: "";
  position: absolute;
  inset: clamp(3px, 0.8vw, 8px) clamp(6px, 1vw, 12px) auto;
  height: 28%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  filter: blur(1px);
}

.shackle-link::after {
  content: "";
  position: absolute;
  inset: clamp(12px, 2vw, 22px) clamp(22px, 4vw, 40px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.92));
  box-shadow:
    inset 0 5px 9px rgba(0, 0, 0, 0.92),
    inset 0 -2px 5px rgba(255, 255, 255, 0.16);
}

.shackle-link-long {
  transform: rotate(-8deg);
  z-index: 2;
}

.shackle-link-cross {
  transform: rotate(82deg) scale(0.92);
  z-index: 3;
}

.shackle-chain-a {
  transform: translate(-50%, -50%) rotate(39deg) translateX(-160vw);
  animation: shackleChainA 1.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shackle-chain-b {
  transform: translate(-50%, -50%) rotate(-39deg) translateX(160vw);
  animation: shackleChainB 1.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shackle-seal-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(104px, 24vw, 178px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.25);
  border: 5px solid rgba(248, 113, 113, 0.92);
  background:
    radial-gradient(circle, rgba(254, 202, 202, 0.98) 0 10%, rgba(220, 38, 38, 0.9) 12% 25%, rgba(30, 41, 59, 0.88) 26% 100%);
  box-shadow:
    0 0 32px rgba(239, 68, 68, 0.86),
    0 0 90px rgba(127, 29, 29, 0.75),
    inset 0 0 22px rgba(0, 0, 0, 0.85);
  opacity: 0;
  animation: shackleSealCore 1.45s ease-out forwards;
}

.shackle-seal-core::before,
.shackle-seal-core::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62%;
  height: 10%;
  border-radius: 999px;
  background: #fee2e2;
  box-shadow: 0 0 18px rgba(254, 226, 226, 0.85);
}

.shackle-seal-core::before { transform: translate(-50%, -50%) rotate(45deg); }
.shackle-seal-core::after { transform: translate(-50%, -50%) rotate(-45deg); }

.shackle-seal-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(254, 202, 202, 0.75) 0%, rgba(239, 68, 68, 0.24) 18%, transparent 42%);
  opacity: 0;
  animation: shackleSealFlash 1.45s ease-out forwards;
}

.shackle-seal-exit {
  animation: shackleOverlayOut 0.26s ease-in forwards;
}

@keyframes shackleOverlayIn {
  0% { opacity: 0; }
  12%, 88% { opacity: 1; }
  100% { opacity: 1; }
}

@keyframes shackleOverlayOut {
  to { opacity: 0; }
}

@keyframes shackleVignettePulse {
  0% { transform: scale(1.1); opacity: 0; }
  22% { opacity: 1; }
  56% { transform: scale(0.96); opacity: 1; }
  100% { transform: scale(1); opacity: 0.82; }
}

@keyframes shackleChainA {
  0% { transform: translate(-50%, -50%) rotate(39deg) translateX(-160vw); }
  48% { transform: translate(-50%, -50%) rotate(39deg) translateX(0); }
  56% { transform: translate(-50%, -50%) rotate(39deg) translateX(-12px); }
  64%, 100% { transform: translate(-50%, -50%) rotate(39deg) translateX(0); }
}

@keyframes shackleChainB {
  0% { transform: translate(-50%, -50%) rotate(-39deg) translateX(160vw); }
  48% { transform: translate(-50%, -50%) rotate(-39deg) translateX(0); }
  56% { transform: translate(-50%, -50%) rotate(-39deg) translateX(12px); }
  64%, 100% { transform: translate(-50%, -50%) rotate(-39deg) translateX(0); }
}

@keyframes shackleChainShock {
  0%, 44% { opacity: 0; transform: translate(-50%, -50%) scaleX(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scaleX(1.02); }
  68%, 100% { opacity: 0; transform: translate(-50%, -50%) scaleX(1); }
}

@keyframes shackleSealCore {
  0%, 42% { opacity: 0; transform: translate(-50%, -50%) scale(0.25) rotate(-22deg); }
  54% { opacity: 1; transform: translate(-50%, -50%) scale(1.16) rotate(5deg); }
  66% { transform: translate(-50%, -50%) scale(0.92) rotate(-2deg); }
  84%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes shackleSealFlash {
  0%, 44% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1); }
  72%, 100% { opacity: 0; transform: scale(1.45); }
}

/* 新增：乘數標籤的彈出閃爍動畫 */
.multiplier-pop {
  animation: popScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popScale {
  0% { transform: scale(1); background-color: rgba(139, 92, 246, 0.2); }
  50% { transform: scale(1.1); background-color: rgba(139, 92, 246, 0.6); box-shadow: 0 0 15px rgba(139, 92, 246, 0.8); }
  100% { transform: scale(1); background-color: rgba(139, 92, 246, 0.2); }
}

/* ===== Button Enhancement Pack ===== */

/* --- Fix 1: 商店刷新按鈕（補上金色主題） --- */
#shop-reroll-btn {
  background: linear-gradient(135deg, #b45309 0%, #d97706 50%, #b45309 100%);
  background-size: 200% 100%;
  border-bottom-color: #92400e;
  color: #fef3c7;
  box-shadow: 0 0 16px rgba(217, 119, 6, 0.25), inset 0 1px 0 rgba(254, 243, 199, 0.12);
  transition: background-position 0.4s, box-shadow 0.3s, transform 0.1s, border-bottom-width 0.1s;
}
#shop-reroll-btn:hover:not(:disabled) {
  background-position: 100% 0;
  box-shadow: 0 0 28px rgba(217, 119, 6, 0.55), inset 0 1px 0 rgba(254, 243, 199, 0.2);
}
#shop-reroll-btn:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 1px;
}
#shop-reroll-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Fix 2: 攻擊按鈕脈動光暈（可用時閃爍） --- */
@keyframes attack-ready-pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(127, 29, 29, 0.6), 0 0 10px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(127, 29, 29, 0.6), 0 0 28px rgba(239, 68, 68, 0.8), 0 0 8px rgba(252, 165, 165, 0.4);
  }
}
.btn-attack-ready {
  animation: attack-ready-pulse 1.4s ease-in-out infinite;
}

/* --- Fix 3: 重骰按鈕骰子震動 hover --- */
.btn-roll .btn-roll-icon {
  display: inline-block;
  transition: transform 0.15s;
}

@keyframes dice-idle-sway {
  0%   { transform: rotate(-8deg) scale(0.95); }
  50%  { transform: rotate(8deg)  scale(1.05); }
  100% { transform: rotate(-8deg) scale(0.95); }
}

.btn-roll:not(:disabled) .btn-roll-icon {
  animation: dice-idle-sway 1.8s ease-in-out infinite;
}

.btn-roll:disabled .btn-roll-icon {
  animation: none;
  transform: none;
}

/* --- Fix 4: 標題「開始新遊戲」3D 立體按壓感 --- */
#title-screen .btn-primary {
  border-bottom: 4px solid rgba(180, 130, 255, 0.9) !important;
}
#title-screen .btn-primary:active {
  transform: translateY(3px) !important;
  border-bottom-width: 1px !important;
  box-shadow: 0 0 10px rgba(122, 59, 245, 0.25) !important;
}

/* --- Fix 5: 標題次要按鈕左邊紫色 accent 線 --- */
#title-screen .btn-secondary {
  border-left: 2px solid rgba(139, 92, 246, 0.35) !important;
}
#title-screen .btn-secondary:hover {
  border-left-color: rgba(167, 139, 250, 0.7) !important;
}

/* --- Fix 6-pre: 語系選單邊框與背景 --- */
#lang-select,
#title-screen select {
  border: 2px solid rgba(150, 100, 255, 0.8) !important;
  background: rgba(30, 25, 60, 0.9) !important;
}

/* --- Fix 6: Modal 關閉按鈕圓形 hover --- */
button[id^="btn-close"] {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
button[id^="btn-close"]:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ===== Crystal Border System ===== */

/* 金色邊框：主要按鈕 */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  border: 1.5px solid rgba(180, 130, 20, 0.7);
  pointer-events: none;
  z-index: 2;
}

/* 銀色邊框：次要按鈕 */
.btn-secondary::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  border: 1px solid rgba(90, 110, 130, 0.5);
  pointer-events: none;
  z-index: 2;
}

/* 攻擊按鈕：金色水晶邊框 */
.btn-attack-ready {
  position: relative;
}
.btn-attack-ready::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  border: 1.5px solid rgba(180, 130, 20, 0.7);
  pointer-events: none;
  z-index: 2;
}

/* 重骰按鈕：銀色水晶邊框 */
.btn-roll::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  border: 1px solid rgba(90, 110, 130, 0.5);
  pointer-events: none;
  z-index: 2;
}

/* ===== Button Opacity & Border Enhancement ===== */

/* 攻擊按鈕：暖紅/金色系不透明漸層 + 立體邊框 */
.btn-attack-ready {
  background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 50%, #7f1d1d 100%) !important;
  background-size: 200% 100%;
  border: 2px solid rgba(252, 165, 165, 0.6) !important;
  border-bottom: 4px solid rgba(127, 29, 29, 0.95) !important;
}

/* 重骰按鈕：冷紫色系不透明漸層 + 立體邊框 */
.btn-roll {
  background: linear-gradient(135deg, #2e1065 0%, #4c1d95 50%, #2e1065 100%) !important;
  background-size: 200% 100%;
  border: 2px solid rgba(167, 139, 250, 0.55) !important;
  border-bottom: 4px solid #1e1040 !important;
}

/* disabled 狀態：背景保持不透明，只降低 opacity */
.btn-roll:disabled {
  background: linear-gradient(135deg, #2e1065 0%, #4c1d95 50%, #2e1065 100%) !important;
  opacity: 0.4;
}

/* ===== UI Fixes & Visual Upgrade ===== */

/* Fix 1: 水平捲軸 — 鎖住各區塊橫向溢出 */
#battle-area, #score-area, #main-container {
  overflow-x: hidden;
}

/* Fix 2: Controls 按鈕最低高度，防止被截斷 */
#controls-container {
  min-height: 96px;
}
#controls-container button {
  min-height: 44px;
}

/* Fix 3: ABCD 區牌型名稱允許換行（最多 2 行），解決英文太長問題 */
.zone-tag-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.15;
  word-break: break-word;
  hyphens: auto;
}

/* Fix 4: 遺物欄 cursor 提示可橫向拖動 */
#inventory-grid {
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
#inventory-grid:active {
  cursor: grabbing;
}
#inventory-grid > * {
  scroll-snap-align: start;
}

/* Fix 5: 骰子視覺升級 — 多層發光 */
.dice-glow-A {
  filter: drop-shadow(0 0 8px rgba(96,165,250,0.95)) drop-shadow(0 0 18px rgba(59,130,246,0.65));
}
.dice-glow-B {
  filter: drop-shadow(0 0 8px rgba(244,114,182,0.95)) drop-shadow(0 0 18px rgba(236,72,153,0.65));
}
.dice-glow-C {
  filter: drop-shadow(0 0 8px rgba(192,132,252,0.95)) drop-shadow(0 0 18px rgba(168,85,247,0.65));
}
.dice-glow-D {
  filter: drop-shadow(0 0 8px rgba(45,212,191,0.95)) drop-shadow(0 0 18px rgba(20,184,166,0.65));
}
.dice-glow-locked {
  filter: drop-shadow(0 0 7px rgba(52,211,153,0.9)) drop-shadow(0 0 14px rgba(16,185,129,0.6));
}
.dice-glow-idle {
  filter: drop-shadow(0 0 4px rgba(122,59,245,0.35));
  transition: filter 0.2s;
}
.dice-glow-idle:hover {
  filter: drop-shadow(0 0 8px rgba(122,59,245,0.6));
}

/* Fix 6: 傷害數字 glow 加強 */
#final-score-value {
  fill: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
#final-score-value.score-hot {
  fill: #fbbf24;
  text-shadow:
    0 0 24px rgba(251,191,36,0.9),
    0 0 50px rgba(251,191,36,0.45),
    0 2px 12px rgba(0,0,0,0.6);
}

/* Fix 7: ABCD 區塊視覺強化 */
#zone-box-A, #zone-box-B, #zone-box-C, #zone-box-D {
  min-height: 64px;
}
#zone-box-A { box-shadow: inset 0 0 20px rgba(59,130,246,0.08); }
#zone-box-B { box-shadow: inset 0 0 20px rgba(236,72,153,0.08); }
#zone-box-C { box-shadow: inset 0 0 20px rgba(168,85,247,0.08); }
#zone-box-D { box-shadow: inset 0 0 20px rgba(20,184,166,0.08); }

/* Fix 8: 盤面骰子格整體底色微調，增加深度感 */
#dice-container {
  background: radial-gradient(ellipse at center, rgba(40,20,70,0.4) 0%, rgba(10,10,15,0.2) 100%);
  border-radius: 8px;
  padding: 6px 4px;
  will-change: transform;
  contain: layout;
  overflow: hidden;
}

/* ===== Board Panel 石板紋理系統 ===== */
/* 用 CSS custom property 讓 JS 能動態切換，同時以 !important 覆蓋 .card-board 的 !important gradient */
#score-display {
  min-height: 140px;
}

#board-panel {
  overflow: hidden;
  contain: layout paint;
  position: relative;
  --board-texture-url: url('../img/board_stone_blue.webp');
  background-image: var(--board-texture-url) !important;
  background-size: cover !important;
  background-position: center !important;
}

/* 半透明遮罩層，讓紋理不搶骰子視覺焦點 */
#board-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(12, 8, 32, 0.55);
  pointer-events: none;
  z-index: 0;
}

/* 確保板面所有子元素顯示在遮罩上方 */
#board-panel > * {
  position: relative;
  z-index: 1;
}

.damage-float--epic {
  animation-duration: 1.8s !important;
  font-size: 2.2em !important;
  color: #fbbf24 !important;
  text-shadow: 0 0 20px rgba(251,191,36,0.8), 0 0 40px rgba(251,191,36,0.4) !important;
  filter: drop-shadow(0 0 8px rgba(251,191,36,0.6)) !important;
}

/* ===== 可拖曳橫向滾動列 ===== */
.scrollable-row {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,0.5) transparent;
  cursor: grab;
  user-select: none;
}
.scrollable-row:active {
  cursor: grabbing;
}
.scrollable-row::-webkit-scrollbar {
  height: 4px;
}
.scrollable-row::-webkit-scrollbar-track {
  background: transparent;
}
.scrollable-row::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,0.5);
  border-radius: 2px;
}

/* --- 牌型名稱浮現特效 --- */
.hand-float-base {
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9998;
  font-weight: 900;
  font-family: inherit;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.05;
  /* left and top are set dynamically via JS to center over dice-container */
}

/* Rarity 1 Common */
.hand-float-common {
  max-width: 90vw;
  white-space: nowrap;
  font-size: clamp(1.4rem, 8vw, 2.0rem);
  color: #e2e8f0;
  text-shadow:
    -2px -2px 0 rgba(0,0,0,0.9),
    2px -2px 0 rgba(0,0,0,0.9),
    -2px 2px 0 rgba(0,0,0,0.9),
    2px 2px 0 rgba(0,0,0,0.9),
    0 0 16px rgba(255,255,255,0.6);
  animation: handFloatCommon 0.9s ease-out forwards;
}
@keyframes handFloatCommon {
  0%   { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
  80%  { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}

/* Rarity 2 Rare */
.hand-float-rare {
  max-width: 90vw;
  white-space: nowrap;
  font-size: clamp(1.6rem, 10vw, 2.6rem);
  color: #93c5fd;
  text-shadow:
    -2px -2px 0 rgba(0,0,0,0.9),
    2px -2px 0 rgba(0,0,0,0.9),
    -2px 2px 0 rgba(0,0,0,0.9),
    2px 2px 0 rgba(0,0,0,0.9),
    0 0 20px rgba(96,165,250,0.9),
    0 0 40px rgba(96,165,250,0.5);
  animation: handFloatRare 0.95s ease-out forwards;
}
@keyframes handFloatRare {
  0%   { opacity: 0; transform: translate(-50%, -40%) scale(0.7); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  50%  { transform: translate(-50%, -50%) scale(1.0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(0.95); }
}

/* Rarity 3 Epic */
.hand-float-epic {
  max-width: 90vw;
  white-space: nowrap;
  font-size: clamp(1.8rem, 12vw, 3.2rem);
  color: #d8b4fe;
  text-shadow:
    -2px -2px 0 rgba(0,0,0,0.9),
    2px -2px 0 rgba(0,0,0,0.9),
    -2px 2px 0 rgba(0,0,0,0.9),
    2px 2px 0 rgba(0,0,0,0.9),
    0 0 28px rgba(192,132,252,0.95),
    0 0 55px rgba(168,85,247,0.6);
  animation: handFloatEpic 1.0s ease-out forwards;
}
@keyframes handFloatEpic {
  0%   { opacity: 0; transform: translate(-50%, -38%) scale(0.6); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  40%  { transform: translate(-50%, -50%) scale(1.05); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(1.0); }
}

/* Rarity 4 Legendary */
.hand-float-legendary {
  max-width: 90vw;
  white-space: nowrap;
  font-size: clamp(2.0rem, 14vw, 3.8rem);
  color: #fde68a;
  text-shadow:
    -2px -2px 0 rgba(0,0,0,0.9),
    2px -2px 0 rgba(0,0,0,0.9),
    -2px 2px 0 rgba(0,0,0,0.9),
    2px 2px 0 rgba(0,0,0,0.9),
    0 0 30px rgba(251,191,36,0.99),
    0 0 65px rgba(251,191,36,0.6);
  animation: handFloatLegendary 1.05s ease-out forwards;
}
@keyframes handFloatLegendary {
  0%   { opacity: 0; transform: translate(-50%, -35%) scale(0.5); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  28%  { transform: translate(-52%, -50%) scale(1.2); }
  40%  { transform: translate(-48%, -50%) scale(1.2); }
  55%  { transform: translate(-50%, -50%) scale(1.1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -68%) scale(1.0); }
}

/* Rarity 5 Mythic */
.hand-float-mythic {
  max-width: 90vw;
  white-space: nowrap;
  font-size: clamp(2.2rem, 16vw, 4.5rem);
  color: #67e8f9;
  text-shadow:
    -2px -2px 0 rgba(0,0,0,0.9),
    2px -2px 0 rgba(0,0,0,0.9),
    -2px 2px 0 rgba(0,0,0,0.9),
    2px 2px 0 rgba(0,0,0,0.9),
    0 0 35px rgba(34,211,238,0.99),
    0 0 75px rgba(6,182,212,0.7);
  animation: handFloatMythic 1.1s ease-out forwards;
}
@keyframes handFloatMythic {
  0%   { opacity: 0; transform: translate(-50%, -32%) scale(0.4); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.45); }
  28%  { transform: translate(-53%, -49%) scale(1.35); }
  40%  { transform: translate(-47%, -51%) scale(1.35); }
  55%  { transform: translate(-50%, -50%) scale(1.2); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1.05); }
}

@keyframes handFloatAway {
  0%   { opacity: 0;   transform: translate(calc(-50% + 0px), -50%) scale(0.8); }
  12%  { opacity: 1;   transform: translate(calc(-50% + 0px), -50%) scale(1.05); }
  75%  { opacity: 1;   transform: translate(calc(-50% + var(--float-x, 0px)), -90%) scale(0.95); }
  100% { opacity: 0;   transform: translate(calc(-50% + var(--float-x, 0px)), -120%) scale(0.9); }
}

.hand-float-away {
  animation: handFloatAway 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
