/* Card Alchemist film stage (五疼遊戲). Glass window on the left, the duelist on the right. */
.card-alchemist-scene { overflow: hidden; background: #1b1030; }
.card-alchemist-film {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 30%; pointer-events: none;
}
.card-alchemist-banner {
  position: absolute; top: 12px; right: 12px; z-index: 4; display: grid; justify-items: end; gap: 0; padding: 6px 14px 7px;
  border-radius: 14px; border: 1px solid rgb(255 255 255 / 60%);
  background: linear-gradient(135deg, rgb(255 255 255 / 52%), rgb(214 196 255 / 32%));
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 6px 20px rgb(40 10 80 / 30%), inset 0 1px 0 rgb(255 255 255 / 80%);
  font-family: var(--glass-font, 'Microsoft JhengHei', sans-serif); pointer-events: none;
}
.card-alchemist-role { font-size: 11px; letter-spacing: .12em; color: #4a3a6e; }
.card-alchemist-name {
  font-size: 20px; line-height: 1.15; letter-spacing: .06em; color: #fff;
  background: linear-gradient(#ffe9a8, #e0a43a 55%, #b5701c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #5b2a8a) drop-shadow(0 0 6px rgb(170 90 255 / 70%));
}
.card-alchemist-scene { --alchemist-window-w: min(400px, 56%); }
/* Rant text flies from his mouth toward the player; above the window, never interactive. */
.card-alchemist-lines { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.card-alchemist-fly {
  position: absolute; white-space: nowrap; will-change: transform, opacity, filter;
  font: 900 clamp(20px, 2.6vw, 30px)/1 var(--glass-font, 'Microsoft JhengHei', sans-serif); letter-spacing: .02em;
  color: #fff; -webkit-text-stroke: 1.5px #2a1040; paint-order: stroke fill;
  text-shadow: 0 2px 0 #2a1040, 0 0 10px rgb(190 110 255 / 90%), 0 0 22px rgb(150 70 255 / 60%);
}
.card-alchemist-fly-final {
  color: #ffd85a; -webkit-text-stroke: 2px #5a1010; font-size: clamp(24px, 3.2vw, 36px);
  text-shadow: 0 3px 0 #5a1010, 0 0 12px rgb(255 200 80 / 95%), 0 0 28px rgb(255 120 40 / 70%);
}
.card-alchemist-scene.card-alchemist-quake { animation: forge-quake-strong .6s cubic-bezier(.36, .07, .19, .97); }

/* Liquid glass over the film (scoped to the card alchemist scene; other services keep Game UI Glass V1).
   Clearer, brighter glass than the default 58% fill so the film reads through without a muddy tint. */
#game .card-alchemist-scene .window.card-synthesis-window {
  border: 1px solid rgb(255 255 255 / 70%) !important; border-radius: 22px;
  background: linear-gradient(160deg, rgb(255 255 255 / 54%), rgb(250 252 255 / 34%) 45%, rgb(235 242 255 / 40%)) !important;
  -webkit-backdrop-filter: blur(26px) saturate(135%) brightness(1.08); backdrop-filter: blur(26px) saturate(135%) brightness(1.08);
  box-shadow: 0 18px 44px rgb(20 10 50 / 32%), inset 0 1px 0 rgb(255 255 255 / 95%), inset 0 0 0 1px rgb(255 255 255 / 22%),
    inset 0 -18px 30px rgb(255 255 255 / 10%) !important;
}
#game .card-alchemist-scene .window.card-synthesis-window > .titlebar {
  margin: 8px 8px 0; min-height: 34px; padding: 0 6px 0 14px; border: 0; border-radius: 14px;
  background: linear-gradient(rgb(120 160 225 / 70%), rgb(70 110 185 / 66%)) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 60%), 0 3px 10px rgb(30 60 120 / 22%);
}
#game .card-alchemist-scene .town-service-close {
  width: 26px; height: 26px; border-radius: 50% !important; border: 1px solid rgb(255 255 255 / 70%) !important;
  background: rgb(255 255 255 / 28%) !important; color: #fff !important;
}
#game .card-alchemist-scene .card-synthesis-pools {
  margin: 10px 12px 8px; padding: 3px; border-radius: 14px; border: 1px solid rgb(255 255 255 / 55%);
  background: rgb(255 255 255 / 22%); box-shadow: inset 0 1px 2px rgb(20 30 60 / 12%);
}
#game .card-alchemist-scene .card-synthesis-window .card-synthesis-pools .card-synthesis-pool[aria-selected="true"] {
  border-radius: 11px !important; background: rgb(255 255 255 / 92%) !important; color: #1f4f9a !important; text-shadow: none !important;
  box-shadow: 0 3px 10px rgb(20 30 70 / 18%), inset 0 1px 0 #fff !important;
}
#game .card-alchemist-scene .card-synthesis-row {
  min-height: 46px; border-radius: 14px; border: 1px solid rgb(255 255 255 / 45%);
  background: linear-gradient(rgb(255 255 255 / 48%), rgb(255 255 255 / 32%));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%), 0 1px 4px rgb(20 30 60 / 8%);
}
#game .card-alchemist-scene .card-synthesis-picked {
  border-color: rgb(111 154 214 / 75%); background: linear-gradient(rgb(255 255 255 / 75%), rgb(225 236 255 / 62%));
}
#game .card-alchemist-scene .card-synthesis-step,
#game .card-alchemist-scene .card-synthesis-autofill,
#game .card-alchemist-scene .card-synthesis-most {
  border: 1px solid rgb(255 255 255 / 75%) !important; background: linear-gradient(rgb(255 255 255 / 78%), rgb(255 255 255 / 52%)) !important;
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgb(20 30 60 / 14%) !important; color: var(--glass-ink, #1c2a3a) !important;
}
#game .card-alchemist-scene .card-synthesis-step:disabled { opacity: .45; box-shadow: none !important; }
#game .card-alchemist-scene .card-synthesis-footer {
  margin: 0 8px 8px; border: 1px solid rgb(255 255 255 / 55%); border-radius: 16px;
  background: linear-gradient(rgb(255 255 255 / 50%), rgb(255 255 255 / 34%));
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%);
}
#game .card-alchemist-scene .card-synthesis-window .card-synthesis-submit.card-synthesis-submit {
  background: linear-gradient(#7ea8e4, #3f69a8) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 55%), 0 6px 16px rgb(40 80 150 / 34%) !important;
}
#game .card-alchemist-scene .card-synthesis-window .card-synthesis-submit.card-synthesis-submit:disabled {
  background: linear-gradient(rgb(150 175 215 / 75%), rgb(110 140 190 / 70%)) !important; opacity: .7;
}
#game .card-alchemist-scene .card-synthesis-name { color: #17222f; font-weight: 600; }
#game .card-alchemist-scene .card-synthesis-qty { color: #2a3a4c; font-weight: 600; }
/* Desktop (Kafra layout): window on the left sized to its content, the duelist framed on the right. */
@media (min-width: 521px) {
  .card-alchemist-scene .town-service-window.card-synthesis-window {
    left: 12px; transform: none; width: var(--alchemist-window-w); height: auto; max-height: calc(100% - 24px);
  }
  .card-alchemist-film { object-position: 80% 20%; }
}
/* Phone (Kafra layout): film strip on top, the window directly below at its natural height, and a
   blurred still of the same film behind the glass; the service area grows to fit, so nothing is left blank. */
@media (max-width: 520px) {
  .service-entry-host:has(.card-alchemist-scene) { height: auto; min-height: 0; overflow: visible; }
  .service-entry-host:has(.card-alchemist-scene) .town-service-surface { position: relative; inset: auto; height: auto; overflow: hidden; }
  .card-alchemist-scene.town-service-scene {
    position: relative; height: auto; padding-bottom: 8px;
    background: linear-gradient(rgb(27 12 45 / 35%), rgb(27 12 45 / 55%)),
      url('/assets/ui-themes/card-alchemist/wuteng-poster.23e0ff8b215e87a1.jpg') 70% 30% / cover no-repeat !important;
  }
  .card-alchemist-film { position: relative; inset: auto; display: block; height: 240px; object-position: 74% 18%; }
  .card-alchemist-scene .town-service-window.card-synthesis-window {
    position: relative; top: auto; left: auto; bottom: auto; transform: none; width: calc(100% - 16px); margin: -20px 8px 0;
    height: auto; max-height: none;
  }
  .card-alchemist-scene .card-synthesis-holdings { max-height: 46vh; }
  .card-alchemist-scene > .service-audio { top: 72px; right: 8px; }
  .card-alchemist-banner { top: 8px; right: 8px; }
}
