:root {
  --ba-cyan: #00b8ff;
  --ba-blue: #128bff;
  --ba-navy: #16243b;
  --ba-navy-glass: rgba(18, 32, 56, 0.76);
  --ba-white-glass: rgba(255, 255, 255, 0.88);
  --ba-white-strong: rgba(255, 255, 255, 0.95);
  --ba-coral: #ff5988;
  --ba-gold: #ffbc2c;
  --ba-mint: #0fd1a3;
  --ba-violet: #7f63ff;
  --ba-border: rgba(255, 255, 255, 0.72);
  --ba-cyan-border: rgba(0, 184, 255, 0.55);
  --shadow-lg: 0 12px 32px rgba(12, 28, 58, 0.24);
  --shadow-cyan: 0 6px 22px rgba(0, 184, 255, 0.35);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d1829;
  color: var(--ba-navy);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

/* Portrait Rotate Guide */
#rotate-hint { display: none; }
@media (orientation: portrait) and (max-width: 680px) {
  #rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: linear-gradient(160deg, #0f203c 0%, #193b68 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px;
    gap: 12px;
  }
}

#game-viewport {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}
#game-viewport.shake {
  animation: camShake 0.38s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes camShake {
  10%, 90% { transform: translate3d(-3px, 2px, 0); }
  20%, 80% { transform: translate3d(5px, -3px, 0); }
  30%, 50%, 70% { transform: translate3d(-7px, 4px, 0); }
  40%, 60% { transform: translate3d(6px, -2px, 0); }
}

/* Dynamic Fullscreen Background Layer */
#bg-stage {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  background-size: cover;
  background-position: center center;
  transition: background-image 0.45s ease, transform 0.2s ease-out, filter 0.35s ease;
  animation: bgKenBurns 22s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes bgKenBurns {
  from { transform: scale(1.01) translate3d(0, 0, 0); }
  to   { transform: scale(1.055) translate3d(-0.8%, -0.5%, 0); }
}

#bg-sunlight-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.34) 0%, rgba(0, 195, 255, 0.08) 38%, transparent 68%),
    linear-gradient(180deg, rgba(14, 28, 54, 0.18) 0%, transparent 24%, transparent 74%, rgba(10, 22, 44, 0.42) 100%);
  z-index: 1;
}

#vfx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* Screen Transition White Flash */
#white-flash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 900;
  transition: opacity 0.35s ease-out;
}
#white-flash.active {
  opacity: 0.92;
  transition: none;
}

/* Skew Utility (Blue Archive Geometric Style) */
.skew-box {
  transform: skewX(-10deg);
}
.skew-box > .unskew {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: skewX(10deg);
}

/* Screens */
.screen {
  position: absolute;
  inset: 0;
  padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  display: none;
  z-index: 5;
}
.screen.active {
  display: flex;
}

/* =========================================================
   1. TITLE SCREEN (TOUCH TO START)
   ========================================================= */
#screen-title {
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.title-top-tag {
  align-self: flex-start;
  background: var(--ba-navy-glass);
  color: #fff;
  padding: 5px 14px;
  border-left: 4px solid var(--ba-cyan);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
}
.title-hero-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: auto;
  margin-bottom: auto;
}
.title-halo-ring {
  width: 210px;
  height: 210px;
  position: absolute;
  top: -58px;
  opacity: 0.85;
  animation: haloSpin 26s linear infinite;
  pointer-events: none;
}
@keyframes haloSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.title-logo-card {
  position: relative;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid #ffffff;
  box-shadow: 0 16px 44px rgba(10, 32, 72, 0.25), 0 0 0 3px rgba(0, 184, 255, 0.35);
  padding: 18px 42px;
  border-radius: 10px;
  transform: skewX(-10deg);
  backdrop-filter: blur(12px);
}
.title-logo-inner {
  transform: skewX(10deg);
}
.title-sub-en {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3.5px;
  color: var(--ba-blue);
}
.title-main-ko {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--ba-navy);
  line-height: 1.05;
  margin-top: 2px;
}
.title-main-ko span {
  color: var(--ba-cyan);
  text-shadow: 0 2px 12px rgba(0, 184, 255, 0.35);
}
.title-tagline {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #465b7d;
}
.touch-start-bar {
  margin-bottom: 18px;
  background: linear-gradient(90deg, transparent 0%, rgba(16, 30, 56, 0.82) 22%, rgba(16, 30, 56, 0.82) 78%, transparent 100%);
  color: #fff;
  padding: 10px 64px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 3px;
  animation: pulseGlow 1.7s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0.96; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.985); }
}

/* =========================================================
   2. GLOBAL TOP HUD (Lobby & Battle)
   ========================================================= */
#top-hud {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  height: 46px;
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  pointer-events: none;
}
#top-hud.visible { display: flex; }
#top-hud > * { pointer-events: auto; }

.hud-profile-plate {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ba-navy-glass);
  color: #fff;
  padding: 5px 16px 5px 10px;
  border-radius: 8px;
  border-left: 4px solid var(--ba-cyan);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  transform: skewX(-10deg);
}
.hud-lv-circle {
  transform: skewX(10deg);
  background: var(--ba-cyan);
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
}
.hud-owner-meta {
  transform: skewX(10deg);
  display: flex;
  flex-direction: column;
}
.hud-owner-name {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}
.hud-tier-text {
  font-size: 10px;
  color: #8ce0ff;
  font-weight: 700;
}

.hud-right-pills {
  display: flex;
  align-items: center;
  gap: 7px;
}
.ba-pill {
  background: var(--ba-white-strong);
  border: 1.5px solid #ffffff;
  box-shadow: 0 4px 14px rgba(12, 28, 56, 0.16);
  border-radius: 7px;
  padding: 5px 12px;
  transform: skewX(-10deg);
  font-size: 12px;
  font-weight: 900;
  color: var(--ba-navy);
}
.ba-pill > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transform: skewX(10deg);
}
.ba-icon-btn {
  background: var(--ba-white-strong);
  border: 1.5px solid #fff;
  border-radius: 7px;
  padding: 6px 11px;
  transform: skewX(-10deg);
  font-size: 11px;
  font-weight: 900;
  color: var(--ba-navy);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(12, 28, 56, 0.16);
}
.ba-icon-btn.online {
  background: rgba(15, 209, 163, 0.92);
  color: #fff;
  border-color: #8affdf;
}
.ba-icon-btn > span { display: inline-block; transform: skewX(10deg); }

/* =========================================================
   3. BLUE ARCHIVE MEMORIAL / DUTY LOBBY
   ========================================================= */
#screen-lobby {
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 58px;
}

.lobby-character-anchor {
  position: absolute;
  left: 24%;
  bottom: -14px;
  transform: translateX(-50%);
  height: 94%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 6;
  cursor: pointer;
}
.char-halo-svg {
  position: absolute;
  top: 2%;
  width: 150px;
  height: 54px;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(0, 195, 255, 0.75));
  animation: haloFloat 3.2s ease-in-out infinite;
}
@keyframes haloFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-7px) scale(1.03); }
}
.lobby-standing-img {
  height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(14, 30, 62, 0.28));
  animation: partnerBreathe 3.4s ease-in-out infinite;
  transform-origin: bottom center;
}
.lobby-standing-img.hop {
  animation: touchHop 0.42s cubic-bezier(0.22, 1.4, 0.36, 1);
}
@keyframes partnerBreathe {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50% { transform: scaleY(1.014) translateY(-3px); }
}
@keyframes touchHop {
  0% { transform: scale(1) translateY(0); }
  35% { transform: scale(1.04, 0.97) translateY(-14px); }
  70% { transform: scale(0.99, 1.01) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}

/* Speech Bubble in Lobby */
.lobby-speech-box {
  position: absolute;
  left: 41%;
  bottom: 24%;
  max-width: 300px;
  background: rgba(255, 255, 255, 0.92);
  border-left: 4px solid var(--ba-cyan);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  z-index: 12;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.speech-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--ba-blue);
  margin-bottom: 4px;
}
.speech-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--ba-navy);
  line-height: 1.42;
}

/* Left Bottom Menu Dock */
.lobby-left-dock {
  position: relative;
  z-index: 15;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ba-dock-btn {
  background: var(--ba-white-strong);
  border: 1.5px solid #fff;
  border-bottom: 3px solid var(--ba-cyan);
  border-radius: 9px;
  padding: 9px 14px;
  transform: skewX(-10deg);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  font-weight: 900;
  font-size: 12px;
  color: var(--ba-navy);
  transition: transform 0.12s ease;
}
.ba-dock-btn:active {
  transform: skewX(-10deg) scale(0.95);
}
.ba-dock-btn > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transform: skewX(10deg);
}

/* Right Bottom Campaign / Operation Cluster */
.lobby-right-campaign {
  position: relative;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.quick-sub-banners {
  display: flex;
  gap: 8px;
}
.ba-sub-banner {
  background: var(--ba-navy-glass);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 9px;
  padding: 8px 15px;
  transform: skewX(-10deg);
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 800;
}
.ba-sub-banner > span { display: inline-block; transform: skewX(10deg); }

.ba-campaign-btn {
  background: linear-gradient(135deg, #00c6ff 0%, #0078ff 100%);
  color: #fff;
  border: 2px solid #ffffff;
  border-radius: 12px;
  padding: 14px 34px;
  transform: skewX(-10deg);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 132, 255, 0.45);
  transition: transform 0.12s ease;
}
.ba-campaign-btn:active {
  transform: skewX(-10deg) scale(0.96);
}
.ba-campaign-inner {
  transform: skewX(10deg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.ba-campaign-en {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.5px;
  opacity: 0.9;
}
.ba-campaign-ko {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* =========================================================
   4. HOLOGRAM ARC BATTLE ARENA (#screen-table)
   ========================================================= */
#screen-table {
  flex-direction: column;
  justify-content: space-between;
  padding-top: 54px;
}

/* Fever Banner Aura */
#fever-border-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 48px rgba(255, 188, 44, 0.65), inset 0 0 18px rgba(255, 89, 136, 0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 4;
}
#fever-border-glow.active { opacity: 1; }

/* Top Dealer / Boss Holo Stage */
.arena-top-dealer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 10;
}

.dealer-holo-plate {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ba-navy-glass);
  color: #fff;
  padding: 6px 16px 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 195, 255, 0.45);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}
.dealer-portrait-ring {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  border: 2px solid var(--ba-cyan);
  overflow: hidden;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.dealer-portrait-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.guard-pips {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
}
.guard-pip {
  width: 12px;
  height: 8px;
  transform: skewX(-15deg);
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(0, 210, 255, 0.6);
}
.guard-pip.filled {
  background: var(--ba-cyan);
  box-shadow: 0 0 8px var(--ba-cyan);
}
.fever-tag {
  background: linear-gradient(90deg, #ffbc2c, #ff5988);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
}

.dealer-hand-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Rivals Side Floatinghud Plates */
.arena-middle-field {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.rivals-wing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 28%;
}
.rival-chip-plate {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 32, 56, 0.74);
  color: #fff;
  padding: 6px 11px;
  border-radius: 11px;
  border-left: 3px solid var(--ba-cyan);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
}
.rival-chip-plate.turn {
  border-left-color: var(--ba-coral);
  box-shadow: 0 0 0 2px rgba(255, 89, 136, 0.55);
}
.rival-mini-ava {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  object-position: top center;
  background: rgba(255,255,255,0.18);
}

/* Center Player Focal Hand & Holo Ring */
.player-focal-stage {
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.holo-bet-ring {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 30, 58, 0.66);
  border: 1.5px solid rgba(0, 200, 255, 0.55);
  box-shadow: 0 0 24px rgba(0, 184, 255, 0.25);
  border-radius: 999px;
  padding: 4px 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.total-meter-orb {
  min-width: 58px;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00c6ff, #0078ff);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  text-align: center;
  box-shadow: var(--shadow-cyan);
}
.total-meter-orb.gold21 {
  background: linear-gradient(135deg, #ffca3a, #ff5988);
  box-shadow: 0 0 18px rgba(255, 190, 44, 0.8);
}
.total-meter-orb.bust {
  background: linear-gradient(135deg, #ff4769, #9c1c39);
}

/* High-Quality 3D Flip Playing Cards */
.hand-fan {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lux-card-slot {
  width: 64px;
  height: 92px;
  margin-left: -10px;
  perspective: 900px;
  animation: dealFlyIn 0.32s cubic-bezier(0.18, 1.15, 0.36, 1) backwards;
}
.lux-card-slot:first-child { margin-left: 0; }
.lux-card-slot.sm {
  width: 48px;
  height: 68px;
  margin-left: -8px;
}
.lux-card-slot.xs {
  width: 32px;
  height: 45px;
  margin-left: -7px;
}
@keyframes dealFlyIn {
  from {
    opacity: 0;
    transform: translate3d(0, -65px, 0) scale(0.55) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
}

.lux-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.lux-card-inner.flipped {
  transform: rotateY(180deg);
}
.lux-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(8, 20, 46, 0.32);
}
.lux-front {
  background: linear-gradient(160deg, #ffffff 0%, #f1f6fd 100%);
  border: 2px solid #d9e6fa;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.lux-front.foil21 {
  border-color: #ffca3a;
  box-shadow: 0 0 18px rgba(255, 202, 58, 0.65);
}
.lux-front.red { color: #e83862; }
.lux-front.black { color: #17253d; }
.lux-corner {
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.lux-card-slot.sm .lux-corner { font-size: 11px; }
.lux-card-slot.xs .lux-corner { font-size: 9px; }
.lux-center-suit {
  align-self: center;
  font-size: 26px;
  opacity: 0.9;
  line-height: 1;
}
.lux-card-slot.sm .lux-center-suit { font-size: 18px; }
.lux-card-slot.xs .lux-center-suit { font-size: 13px; }

.lux-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #00b8ff 0%, #1c58f2 52%, #ff5988 100%);
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1px;
}

/* =========================================================
   5. TACTICAL BOTTOM HUD (Cost Bar + Gear + Actions + Dual EX Cards)
   ========================================================= */
.arena-bottom-hud {
  position: relative;
  z-index: 15;
  display: grid;
  grid-template-columns: 1.15fr 1.6fr 1.1fr;
  align-items: end;
  gap: 10px;
}

/* Left: Cost Gauge + Tactical Gear Chips */
.tactical-left-deck {
  background: var(--ba-navy-glass);
  border: 1px solid rgba(0, 195, 255, 0.42);
  border-radius: 12px;
  padding: 7px 10px;
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cost-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
}
.cost-segments {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}
.cost-seg {
  height: 8px;
  transform: skewX(-14deg);
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}
.cost-seg.on {
  background: linear-gradient(90deg, #00e1ff, #00a2ff);
  box-shadow: 0 0 6px rgba(0, 215, 255, 0.8);
}
.gear-row {
  display: flex;
  gap: 5px;
}
.gear-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(0, 210, 255, 0.55);
  color: #fff;
  border-radius: 7px;
  padding: 5px 6px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.gear-btn:disabled { opacity: 0.38; pointer-events: none; }

/* Center: Action Command Console */
.tactical-center-actions {
  background: var(--ba-white-strong);
  border: 2px solid #ffffff;
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.battle-log-line {
  font-size: 11px;
  font-weight: 800;
  color: #354c70;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-btn-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.ba-cmd-btn {
  flex: 1;
  padding: 9px 10px;
  border-radius: 8px;
  border: none;
  transform: skewX(-10deg);
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  color: #fff;
  background: #2b3f63;
  box-shadow: 0 4px 10px rgba(15, 30, 58, 0.18);
}
.ba-cmd-btn > span { display: inline-block; transform: skewX(10deg); }
.ba-cmd-btn.cyan { background: linear-gradient(135deg, #00c6ff, #0078ff); }
.ba-cmd-btn.coral { background: linear-gradient(135deg, #ff5988, #ff336b); }
.ba-cmd-btn.mint { background: linear-gradient(135deg, #0fd1a3, #099c78); }
.ba-cmd-btn.violet { background: linear-gradient(135deg, #8b68ff, #623cea); }
.ba-cmd-btn:disabled { opacity: 0.36; pointer-events: none; }

/* Right: Blue Archive Style Dual EX Skill Portrait Cards */
.ex-cards-cluster {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.ex-skill-card {
  position: relative;
  width: 108px;
  height: 76px;
  border-radius: 10px;
  transform: skewX(-10deg);
  overflow: hidden;
  border: 2px solid #ffffff;
  background: linear-gradient(155deg, #1b3560 0%, #0d1d38 100%);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s ease, filter 0.14s ease;
}
.ex-skill-card:hover:not(:disabled) {
  transform: skewX(-10deg) translateY(-4px);
}
.ex-skill-card:disabled {
  filter: grayscale(0.75) brightness(0.68);
  pointer-events: none;
}
.ex-card-portrait {
  position: absolute;
  right: -8px;
  top: -4px;
  height: 125%;
  transform: skewX(10deg);
  pointer-events: none;
}
.ex-cost-diamond {
  position: absolute;
  top: 5px;
  left: 6px;
  background: var(--ba-cyan);
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.ex-role-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  background: rgba(255, 89, 136, 0.9);
}
.ex-role-tag.special { background: rgba(0, 184, 255, 0.9); }
.ex-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, rgba(10, 20, 40, 0.95) 0%, rgba(10, 20, 40, 0.0) 100%);
  color: #fff;
  padding: 14px 6px 5px;
  font-size: 10px;
  font-weight: 900;
  text-align: left;
}

/* =========================================================
   6. FULLSCREEN DIAGONAL EX SKILL CUT-IN & CENTER BANNERS
   ========================================================= */
#ex-cutin-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 18, 38, 0.62);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}
#ex-cutin-overlay.active { display: flex; }

.cutin-slash-band {
  position: relative;
  width: 120vw;
  height: 220px;
  background: linear-gradient(90deg, #00c6ff 0%, #ffffff 48%, #ff5988 100%);
  transform: rotate(-7deg);
  border-top: 5px solid #fff;
  border-bottom: 5px solid #fff;
  box-shadow: 0 0 60px rgba(0, 198, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: slashExpand 0.88s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slashExpand {
  0% { transform: rotate(-7deg) scaleY(0.05); opacity: 0; }
  18% { transform: rotate(-7deg) scaleY(1); opacity: 1; }
  82% { transform: rotate(-7deg) scaleY(1); opacity: 1; }
  100% { transform: rotate(-7deg) scaleY(0.02); opacity: 0; }
}
.cutin-char-img {
  height: 360px;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(10,25,60,0.45));
  animation: cutinSlide 0.88s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cutinSlide {
  0% { transform: translateX(-140px) scale(1.12); opacity: 0; }
  22% { transform: translateX(0px) scale(1); opacity: 1; }
  80% { transform: translateX(18px) scale(1.02); opacity: 1; }
  100% { transform: translateX(120px) scale(1.08); opacity: 0; }
}
.cutin-text-block {
  margin-left: 18px;
  color: var(--ba-navy);
  text-shadow: 0 2px 0 #fff;
}
.cutin-skill-tag {
  display: inline-block;
  background: var(--ba-navy);
  color: #fff;
  text-shadow: none;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 2px;
}
.cutin-skill-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-top: 4px;
}
.cutin-skill-quote {
  font-size: 13px;
  font-weight: 800;
  color: #20375c;
}

/* Center Impact Callout (BLANC 21 / GUARD BREAK / BUST) */
#impact-banner {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) skewX(-10deg) scale(0.5);
  z-index: 450;
  padding: 10px 38px;
  border-radius: 10px;
  border: 2px solid #fff;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 36px rgba(0,0,0,0.38);
}
#impact-banner.show {
  animation: impactPop 1.05s cubic-bezier(0.18, 1.3, 0.32, 1) forwards;
}
@keyframes impactPop {
  0% { opacity: 0; transform: translate(-50%, -50%) skewX(-10deg) scale(0.4); }
  22% { opacity: 1; transform: translate(-50%, -50%) skewX(-10deg) scale(1.08); }
  75% { opacity: 1; transform: translate(-50%, -50%) skewX(-10deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) skewX(-10deg) scale(0.95); }
}

/* =========================================================
   7. ACRYLIC MODALS & VISUAL NOVEL STAGE
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 20, 40, 0.62);
  backdrop-filter: blur(7px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.modal-backdrop.open { display: flex; }

.modal-panel {
  width: min(820px, 95vw);
  max-height: 89dvh;
  background: rgba(248, 251, 255, 0.96);
  border: 2px solid #ffffff;
  border-top: 5px solid var(--ba-cyan);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  box-shadow: 0 22px 54px rgba(6, 16, 36, 0.42);
}

.op-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.op-card {
  background: #ffffff;
  border: 1.5px solid #d7e5fa;
  border-left: 5px solid var(--ba-cyan);
  border-radius: 12px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 12px rgba(15, 35, 70, 0.07);
}
.op-card:active { transform: scale(0.97); }

/* Visual Novel Stage with Real Salon Background */
#vn-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background-image: url("./art/bg_lobby.jpg");
  background-size: cover;
  background-position: center;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
}
#vn-overlay.open { display: flex; }
.vn-dim-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,26,48,0.12) 0%, rgba(14,26,48,0.48) 100%);
}
.vn-stage {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 9%;
  pointer-events: none;
  z-index: 2;
}
.vn-actor {
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(10, 22, 46, 0.35));
  transition: filter 0.22s ease, transform 0.22s ease;
}
.vn-actor.dim {
  filter: brightness(0.62) saturate(0.8);
  transform: scale(0.96);
}
.vn-box {
  position: relative;
  z-index: 5;
  margin: 10px 18px 14px;
  background: rgba(20, 34, 60, 0.90);
  color: #fff;
  border: 1.5px solid rgba(0, 198, 255, 0.65);
  border-left: 6px solid var(--ba-cyan);
  border-radius: 14px;
  padding: 13px 18px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}
.vn-choices {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  flex-wrap: wrap;
}
