#case-opening-inventory-view,
#case-opening-key-view,
#case-opening-ready-view {
  color: rgba(248, 251, 255, 0.94);
}

/* 炼金与开箱一致：固定外层工作区，所有材料在列表内滚动，不以页面滚动条承载内容。 */
html.alchemy-mode-active,
body.alchemy-mode-active {
  overflow: hidden !important;
}

@media (min-width: 901px) {
  body.alchemy-mode-active .app-shell,
  body.alchemy-mode-active .app-main {
    height: 100vh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.alchemy-mode-active .app-shell {
    padding-bottom: 18px !important;
  }

  body.alchemy-mode-active .app-main {
    display: flex;
    flex-direction: column;
  }

  body.alchemy-mode-active .app-main > .global-status-strip {
    flex: 0 0 auto;
  }

  body.alchemy-mode-active #draw-page,
  body.alchemy-mode-active #draw-page .main-card.shell-card,
  body.alchemy-mode-active #alchemy-mode-view,
  body.alchemy-mode-active #alchemy-mode-view .mode-page-shell,
  body.alchemy-mode-active #alchemy-mode-view .alchemy-ready-layout,
  body.alchemy-mode-active #alchemy-mode-view .alchemy-warehouse {
    min-height: 0 !important;
  }

  body.alchemy-mode-active #draw-page {
    flex: 1 1 auto;
    height: auto !important;
  }

  body.alchemy-mode-active #draw-page .main-card.shell-card,
  body.alchemy-mode-active #alchemy-mode-view,
  body.alchemy-mode-active #alchemy-mode-view .mode-page-shell {
    height: 100% !important;
  }

  body.alchemy-mode-active #draw-page .main-card.shell-card,
  body.alchemy-mode-active #alchemy-mode-view .mode-page-shell,
  body.alchemy-mode-active #alchemy-mode-view .alchemy-ready-layout,
  body.alchemy-mode-active #alchemy-mode-view .alchemy-warehouse {
    display: flex;
    flex-direction: column;
  }

  body.alchemy-mode-active #alchemy-mode-view .alchemy-ready-layout,
  body.alchemy-mode-active #alchemy-mode-view .alchemy-warehouse {
    flex: 0 0 auto;
    height: auto !important;
  }

  body.alchemy-mode-active #alchemy-mode-view .mode-page-shell {
    flex: 0 0 auto;
    height: auto !important;
  }

  body.alchemy-mode-active #alchemy-mode-view .alchemy-warehouse {
    overflow: hidden;
  }

}

html.case-opening-active,
body.case-opening-active {
  overflow: hidden !important;
}

@media (min-width: 901px) {
  body.case-opening-active .app-shell {
    height: 100vh !important;
    min-height: 0 !important;
    padding-bottom: 18px !important;
    overflow: hidden !important;
  }

  body.case-opening-active .app-main {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
}

/* 桌面低高度：工作区超过可视范围时改用整页纵向滚动。 */
@media (min-width: 901px) and (max-height: 1100px) {
  html.alchemy-mode-active,
  body.alchemy-mode-active,
  html.box-mode-active,
  body.box-mode-active,
  html.case-opening-active,
  body.case-opening-active {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.alchemy-mode-active .app-shell,
  body.box-mode-active .app-shell,
  body.case-opening-active .app-shell {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  body.alchemy-mode-active .app-main,
  body.alchemy-mode-active #draw-page,
  body.alchemy-mode-active #draw-page .main-card.shell-card,
  body.alchemy-mode-active #alchemy-mode-view,
  body.alchemy-mode-active #alchemy-mode-view .mode-page-shell,
  body.box-mode-active .app-main,
  body.box-mode-active #draw-page,
  body.box-mode-active #draw-page .main-card.shell-card,
  body.box-mode-active #box-mode-view,
  body.box-mode-active #box-mode-view .mode-page-shell,
  body.case-opening-active .app-main,
  body.case-opening-active #draw-page,
  body.case-opening-active #draw-page .main-card.shell-card,
  body.case-opening-active #case-opening-inventory-view,
  body.case-opening-active #case-opening-key-view,
  body.case-opening-active #case-opening-ready-view {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
}

.case-opening-shell {
  position: relative;
  --case-preview-row-height: 158px;
  --case-preview-gap: 10px;
  --case-preview-padding: 12px;
  --case-preview-height: 520px;
  --case-panel-padding: 16px;
  --case-content-padding: 12px;
  --case-back-offset: 14px;
  height: 1024px;
  min-height: 1024px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(126, 146, 180, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 28% 12%, rgba(79, 99, 150, 0.20), transparent 34%),
    radial-gradient(circle at 76% 8%, rgba(67, 44, 116, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(18, 23, 34, 0.94), rgba(8, 13, 23, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 22px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

@media (min-width: 901px) {
  #case-opening-inventory-view .case-opening-shell,
  #case-opening-key-view .case-opening-shell {
    height: clamp(1024px, calc(100vh - 230px), 1210px);
    min-height: clamp(1024px, calc(100vh - 230px), 1210px);
  }
}

#case-opening-ready-view .case-opening-shell {
  height: auto;
  min-height: 0;
}

.case-opening-shell > * {
  position: relative;
  z-index: 1;
}

.case-opening-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 0 0 14px;
  overflow: visible;
}

.case-opening-header .mode-page-title {
  margin: 0;
  color: #f5f7fb;
  font-size: 30px;
  line-height: 42px;
  font-weight: 1000;
}

#case-opening-inventory-view .mode-page-back,
#case-opening-key-view .mode-page-back,
#case-opening-ready-view .mode-page-back {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(141, 187, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.040)),
    rgba(255, 255, 255, 0.060);
  color: rgba(248, 251, 255, 0.86);
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 24px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

#case-opening-key-view .case-opening-back-previous,
#case-opening-ready-view .case-opening-back-previous {
  position: absolute;
  top: var(--case-back-offset);
  left: var(--case-back-offset);
  z-index: 2;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 6px;
  font-size: 12px;
}

#case-opening-inventory-view .mode-page-back:hover,
#case-opening-key-view .mode-page-back:hover,
#case-opening-ready-view .mode-page-back:hover {
  border-color: rgba(141, 187, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.110), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 26px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

#case-opening-inventory-view .mode-page-back:active,
#case-opening-key-view .mode-page-back:active,
#case-opening-ready-view .mode-page-back:active {
  border-color: rgba(141, 187, 255, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.064), rgba(255, 255, 255, 0.036)),
    rgba(255, 255, 255, 0.052);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 20px rgba(0, 0, 0, 0.14);
  transform: translateY(0);
}

#case-opening-inventory-view .mode-page-back:focus-visible,
#case-opening-key-view .mode-page-back:focus-visible,
#case-opening-ready-view .mode-page-back:focus-visible {
  outline: none;
  border-color: rgba(141, 187, 255, 0.42);
  box-shadow:
    0 0 0 2px rgba(141, 187, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 12px 26px rgba(0, 0, 0, 0.18);
}

.case-opening-panel {
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
  padding: var(--case-panel-padding);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(123, 143, 174, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(15, 21, 32, 0.82), rgba(8, 13, 22, 0.88)),
    rgba(7, 11, 18, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 0 0 1px rgba(255, 255, 255, 0.018);
}

.case-opening-panel--ready {
  flex: 0 0 auto;
  gap: 16px;
}

.case-opening-panel--key .case-opening-scroll {
  max-height: none;
}

.case-opening-panel--key {
  gap: 12px;
}

.case-opening-scroll,
.case-ready-preview-shell {
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: var(--case-content-padding);
  border: 1px solid rgba(111, 130, 160, 0.14);
  border-radius: 10px;
  background: rgba(4, 8, 15, 0.62);
}

.case-open-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
}

.case-open-grid--keys {
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
}

.case-open-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(87, 104, 150, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 25, 50, 0.94), rgba(9, 15, 30, 0.98)),
    #0b1020;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 12px 28px rgba(0, 0, 0, 0.24);
}

.case-open-item-media {
  position: relative;
  aspect-ratio: 1 / 0.88;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  border: 1px solid rgba(120, 139, 184, 0.25);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 82%, rgba(102, 78, 160, 0.34), transparent 46%),
    linear-gradient(180deg, rgba(28, 35, 60, 0.90), rgba(16, 21, 40, 0.98));
  overflow: hidden;
}

.case-open-item-quantity {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  min-width: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 214, 110, 0.42);
  border-radius: 999px;
  background: rgba(12, 17, 30, 0.88);
  color: #ffe4a0;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.case-open-item--key .case-open-item-media {
  background:
    radial-gradient(circle at 54% 88%, rgba(153, 55, 74, 0.32), transparent 48%),
    linear-gradient(180deg, rgba(20, 27, 51, 0.92), rgba(12, 17, 35, 0.98));
}

.case-open-item-media img {
  width: 90%;
  height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.34));
}

.case-open-item-name {
  min-height: 22px;
  margin: 0 0 8px;
  color: rgba(246, 249, 255, 0.92);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 900;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-open-item-btn {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(115, 136, 183, 0.28);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(47, 60, 90, 0.98), rgba(34, 46, 74, 0.98));
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.case-open-item-btn:hover {
  border-color: rgba(159, 181, 225, 0.45);
  background: linear-gradient(180deg, rgba(59, 76, 114, 0.98), rgba(42, 57, 90, 0.98));
}

.case-open-empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  color: rgba(220, 228, 242, 0.78);
  font-size: 16px;
  line-height: 1.7;
  text-align: center;
}

.case-open-empty--compact {
  min-height: 160px;
  grid-column: 1 / -1;
}

.case-opening-pair-strip {
  position: relative;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(131, 154, 199, 0.18);
  background:
    radial-gradient(circle at 48% 100%, rgba(97, 83, 155, 0.20), transparent 48%),
    linear-gradient(180deg, rgba(24, 31, 48, 0.92), rgba(13, 19, 32, 0.96)),
    rgba(11, 16, 27, 0.92);
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 30px rgba(0, 0, 0, 0.18);
}

.case-opening-pair-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.case-opening-pair-strip img {
  width: 118px;
  height: 78px;
  margin: 0 -30px 0 -34px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.32));
}

.case-opening-pair-strip strong {
  color: rgba(214, 224, 246, 0.76);
}

.case-ready-hero {
  position: relative;
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(132, 154, 198, 0.18);
  isolation: isolate;
  background: rgba(8, 12, 22, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    inset 0 -34px 70px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition: height 720ms cubic-bezier(0.07, 0.80, 0.25, 1);
}

.case-ready-hero::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: -14px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 16, 28, 0.42), rgba(8, 13, 23, 0.72)),
    url('../main/img/bg.jpg') center / cover no-repeat,
    radial-gradient(circle at 50% 78%, rgba(77, 83, 132, 0.34), transparent 44%),
    radial-gradient(circle at 50% 24%, rgba(244, 187, 70, 0.11), transparent 28%),
    linear-gradient(180deg, rgba(28, 35, 54, 0.94), rgba(12, 18, 31, 0.98)),
    rgba(8, 12, 22, 0.96);
  transition: transform 720ms cubic-bezier(0.07, 0.80, 0.25, 1), filter 720ms cubic-bezier(0.07, 0.80, 0.25, 1);
}

.case-ready-hero .case-ready-case-image {
  position: relative;
  z-index: 1;
  width: min(380px, 50vw);
  max-height: 198px;
  object-fit: contain;
  filter: drop-shadow(0 26px 26px rgba(0, 0, 0, 0.34));
  will-change: transform, filter, opacity;
}

.case-ready-case-flash {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: min(380px, 50vw);
  max-height: 198px;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  filter: brightness(0) saturate(0) invert(1);
  transform: translate(-50%, -50%) scale(1.38);
  will-change: transform, opacity;
}

.case-ready-hero .case-ready-case-image.is-falling {
  opacity: 0;
}

.case-ready-dust {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 72px;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.case-ready-dust i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--dust-size);
  height: calc(var(--dust-size) * 0.52);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(225, 209, 169, 0.92) 0%, rgba(171, 149, 106, 0.52) 48%, transparent 74%);
  opacity: 0;
  transform: translate3d(-50%, 0, 0) scale(0.25);
}

.case-ready-dust.is-impact i {
  animation: case-ready-dust-burst 800ms cubic-bezier(0.1, 0.72, 0.24, 1) var(--dust-delay) both;
}

.case-opening-roulette {
  --case-roulette-card-width: 220px;
  --case-roulette-card-height: 220px;
  --case-roulette-blur-gap: 18px;
  /* 大圆内的可见卡间距也按 1.14 / 1.04 的放大比例递增，避免只放大卡片本体。 */
  --case-roulette-focus-gap: 40.9px;
  --case-roulette-blur-scale: 1.04;
  --case-roulette-focus-scale: 1.14;
  --case-roulette-focus-size: min(560px, 56vw);
  --case-roulette-focus-radius: min(280px, 28vw);
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(1160px, calc(100% - 48px));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  will-change: opacity, filter;
}

.case-roulette-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
}

.case-roulette-layer--blur {
  z-index: 1;
  /* 模糊层只负责放大圆外区域；圆内必须完整让位给聚焦层，避免独立节距后小卡从大卡间隙漏出。 */
  -webkit-mask-image:
    radial-gradient(circle var(--case-roulette-focus-radius) at 50% 50%, transparent calc(100% - 1px), #000 100%),
    linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle var(--case-roulette-focus-radius) at 50% 50%, transparent calc(100% - 1px), #000 100%),
    linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
  mask-composite: intersect;
}

.case-roulette-layer--blur .card-face-art-wrap {
  filter: blur(2px);
}

.case-roulette-layer--blur .case-roulette-card {
  transform: scale(var(--case-roulette-blur-scale));
  transform-origin: center;
}

.case-roulette-layer--focus {
  z-index: 3;
  clip-path: circle(var(--case-roulette-focus-radius) at 50% 50%);
}

.case-roulette-track {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  align-items: center;
  gap: var(--case-roulette-blur-gap);
  width: max-content;
  will-change: transform;
}

.case-roulette-layer--focus .case-roulette-track {
  gap: var(--case-roulette-focus-gap);
}

.case-roulette-card {
  flex: 0 0 var(--case-roulette-card-width);
  width: var(--case-roulette-card-width);
  height: var(--case-roulette-card-height);
  gap: 0;
  padding: 10px;
  border-radius: 10px;
}

.case-roulette-card::before {
  animation: none !important;
}

.case-roulette-card .card-face-art-wrap {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  aspect-ratio: auto;
  border-radius: 7px;
}

.case-roulette-card .card-face-art {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
}

/* 金色特殊物品卡完整复用结果底光、芒星射线和白色过曝光核。 */
#case-opening-ready-view .case-card-special-glow {
  --case-result-accent: var(--card-face-accent);
  z-index: 0;
  top: 50%;
  width: 125%;
}

/* 结果页光效缩进小卡后需要提高线宽和亮度，避免芒星被像素采样吃掉。 */
#case-opening-ready-view .case-card-special-glow::before {
  inset: 2%;
  background:
    repeating-conic-gradient(
      from 0deg,
      transparent 0deg 18deg,
      color-mix(in srgb, var(--case-result-accent) 28%, white 72%) 19deg 26deg,
      transparent 27deg 45deg
    ),
    repeating-conic-gradient(
      from 4deg,
      transparent 0deg 7deg,
      color-mix(in srgb, var(--case-result-accent) 68%, white 32%) 8deg 10deg,
      transparent 11deg 20deg
    );
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.9) 28%, transparent 69%);
  mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.9) 28%, transparent 69%);
  filter: blur(0.4px) drop-shadow(0 0 3px color-mix(in srgb, var(--case-result-accent) 58%, transparent));
}

#case-opening-ready-view .case-card-special-glow::after {
  width: 38%;
  background: rgba(255, 255, 255, 0.96);
  filter: blur(8px);
}

.case-roulette-layer--focus .case-roulette-card {
  transform: scale(var(--case-roulette-focus-scale));
  transform-origin: center;
}

.case-roulette-focus-disc {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: var(--case-roulette-focus-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.40);
  transform: translate(-50%, -50%);
}

.case-roulette-center-line {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: 3px;
  height: calc(var(--case-roulette-card-height) + 28px);
  border-radius: 999px;
  background: #f4d63c;
  box-shadow: 0 0 12px rgba(244, 214, 60, 0.58);
  transform: translate(-50%, -50%);
}

.case-opening-result-placeholder {
  position: absolute;
  z-index: 8;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: #080d17;
  transition: opacity 360ms ease, visibility 0s linear 360ms;
}

.case-opening-result-placeholder::after {
  content: '';
  position: absolute;
  z-index: 6;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}

.case-result-stage {
  --case-result-accent: #b0c3d9;
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
  border-radius: inherit;
  color: #fff;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--case-result-accent) 28%, transparent) 0%, transparent 34%),
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--case-result-accent) 16%, transparent) 0%, transparent 38%),
    radial-gradient(circle at 84% 76%, color-mix(in srgb, var(--case-result-accent) 13%, transparent) 0%, transparent 36%),
    linear-gradient(145deg, #0c1322 0%, #090e19 48%, #070b13 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.28);
}

.case-result-stage--industrial { --case-result-accent: #5e98d9; }
.case-result-stage--military { --case-result-accent: #4b69ff; }
.case-result-stage--restricted { --case-result-accent: #8847ff; }
.case-result-stage--classified { --case-result-accent: #d32ce6; }
.case-result-stage--commemorative { --case-result-accent: #e4ae39; }
.case-result-stage--mythic { --case-result-accent: #eb4b4b; }

.case-result-stage::before,
.case-result-stage::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: -24%;
  pointer-events: none;
}

.case-result-stage::before {
  background:
    radial-gradient(ellipse at 30% 42%, color-mix(in srgb, var(--case-result-accent) 29%, transparent) 0%, transparent 33%),
    radial-gradient(ellipse at 68% 56%, color-mix(in srgb, var(--case-result-accent) 23%, transparent) 0%, transparent 36%),
    radial-gradient(ellipse at 52% 26%, rgba(255, 255, 255, 0.09) 0%, transparent 24%);
  filter: blur(42px);
  transform: translate3d(-3%, -2%, 0) scale(1.04);
  animation: case-result-diffuse-drift 8s ease-in-out infinite alternate;
}

.case-result-stage::after {
  background: conic-gradient(
    from 20deg at 50% 50%,
    transparent 0deg,
    color-mix(in srgb, var(--case-result-accent) 16%, transparent) 42deg,
    transparent 78deg,
    transparent 188deg,
    color-mix(in srgb, var(--case-result-accent) 11%, transparent) 232deg,
    transparent 278deg
  );
  mix-blend-mode: screen;
  filter: blur(24px);
  animation: case-result-flow-rotate 16s linear infinite;
}

.case-result-aurora {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}

.case-result-aurora i {
  position: absolute;
  width: 52%;
  aspect-ratio: 1.7;
  border-radius: 50%;
  opacity: 0.26;
  background: color-mix(in srgb, var(--case-result-accent) 78%, white 22%);
  filter: blur(62px);
  animation: case-result-aurora-float 7.5s ease-in-out infinite alternate;
}

.case-result-aurora i:nth-child(1) { top: 10%; left: -8%; }
.case-result-aurora i:nth-child(2) { right: -10%; bottom: 6%; animation-delay: -3.2s; animation-direction: alternate-reverse; }
.case-result-aurora i:nth-child(3) { top: 34%; left: 34%; width: 34%; opacity: 0.16; animation-delay: -5.4s; }

.case-result-tech-network {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0.84;
  mix-blend-mode: screen;
}

.case-result-item-glow {
  position: absolute;
  z-index: 2;
  top: 42%;
  left: 50%;
  width: min(620px, 64vw, 78vh);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at center,
      rgba(255, 255, 255, 0.88) 0%,
      color-mix(in srgb, var(--case-result-accent) 82%, white 18%) 7%,
      color-mix(in srgb, var(--case-result-accent) 54%, transparent) 22%,
      color-mix(in srgb, var(--case-result-accent) 18%, transparent) 42%,
      transparent 70%);
  filter: blur(3px);
  mix-blend-mode: screen;
  transform: translate(-50%, -50%) scale(0.92);
  animation: case-result-core-glow 3.8s ease-in-out infinite alternate;
}

.case-result-item-glow::before,
.case-result-item-glow::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.case-result-item-glow::before {
  inset: -38%;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 4deg,
    transparent 0deg 8deg,
    color-mix(in srgb, var(--case-result-accent) 23%, transparent) 9deg 10deg,
    transparent 11deg 21deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.72) 28%, transparent 69%);
  mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.72) 28%, transparent 69%);
  opacity: 0.48;
  filter: blur(1.5px);
  animation: case-result-glow-rays 7s ease-in-out infinite alternate;
}

.case-result-item-glow::after {
  top: 50%;
  left: 50%;
  width: 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  filter: blur(22px);
  transform: translate(-50%, -50%);
  animation: case-result-glow-core 3.8s ease-in-out infinite alternate;
}

.case-result-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(860px, 100%);
  text-align: center;
}

.case-result-item-image {
  width: min(620px, 72vw);
  height: min(330px, 42vh);
  object-fit: contain;
  filter:
    drop-shadow(0 26px 34px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 32px color-mix(in srgb, var(--case-result-accent) 48%, transparent));
}

.case-result-item-name {
  max-width: 100%;
  margin: 8px 0 0;
  color: #fff;
  font-size: clamp(24px, 2.3vw, 34px);
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.52);
}

.case-result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

#case-opening-ready-view .case-result-action {
  width: 230px;
  min-width: 0;
  margin: 0;
  padding: 0 24px;
  font-size: 16px;
}

@keyframes case-result-surface-flash {
  0% { opacity: 0; }
  18% { opacity: 0.96; }
  42% { opacity: 0.88; }
  100% { opacity: 0; }
}

@keyframes case-result-stage-enter {
  0% { opacity: 0; filter: brightness(2.1) blur(10px); }
  44% { opacity: 0.62; filter: brightness(1.4) blur(4px); }
  100% { opacity: 1; filter: brightness(1) blur(0); }
}

@keyframes case-result-content-enter {
  0% { opacity: 0; transform: scale(1.06); filter: blur(8px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes case-result-diffuse-drift {
  0% { transform: translate3d(-4%, -3%, 0) scale(1.02); }
  55% { transform: translate3d(3%, 1%, 0) scale(1.12); }
  100% { transform: translate3d(-1%, 5%, 0) scale(1.06); }
}

@keyframes case-result-flow-rotate {
  to { transform: rotate(360deg) scale(1.04); }
}

@keyframes case-result-aurora-float {
  0% { transform: translate3d(-5%, -4%, 0) scale(0.92) rotate(-5deg); }
  100% { transform: translate3d(12%, 9%, 0) scale(1.18) rotate(8deg); }
}

@keyframes case-result-core-glow {
  0% { opacity: 0.62; transform: translate(-50%, -50%) scale(0.90); filter: blur(4px) brightness(0.90); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); filter: blur(2px) brightness(1.16); }
}

@keyframes case-result-glow-rays {
  0% { opacity: 0.28; transform: rotate(-2deg) scale(0.92); }
  100% { opacity: 0.62; transform: rotate(3deg) scale(1.08); }
}

@keyframes case-result-glow-core {
  0% { opacity: 0.52; transform: translate(-50%, -50%) scale(0.84); }
  100% { opacity: 0.94; transform: translate(-50%, -50%) scale(1.12); }
}

@keyframes case-ready-dust-burst {
  0% {
    opacity: 0;
    transform: translate3d(-50%, 0, 0) scale(0.2);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--dust-x)), var(--dust-y), 0) scale(2.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-ready-hero .case-ready-case-image.is-falling {
    opacity: 1;
    transform: none !important;
  }

  .case-ready-dust {
    display: none;
  }

  .case-ready-hero,
  .case-ready-hero::before,
  .case-ready-hero .case-ready-case-image,
  .case-ready-case-flash,
  .case-opening-roulette,
  .case-opening-result-placeholder::after,
  .case-result-stage,
  .case-result-content,
  .case-result-stage::before,
  .case-result-stage::after,
  .case-result-aurora i,
  .case-result-item-glow,
  .case-result-item-glow::before,
  .case-result-item-glow::after,
  .case-ready-footer,
  .case-ready-key-state {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

.case-ready-title {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
  text-align: center;
}

.case-ready-preview-shell {
  container-type: inline-size;
  box-sizing: border-box;
  height: var(--case-preview-height);
  min-height: var(--case-preview-height);
  max-height: var(--case-preview-height);
  overflow: auto;
  padding: var(--case-preview-padding);
  border: 1px solid rgba(122, 145, 184, 0.18);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 100%, rgba(80, 72, 135, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(16, 23, 38, 0.92), rgba(7, 12, 22, 0.96)),
    rgba(6, 10, 18, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 0 0 1px rgba(255, 255, 255, 0.018);
}

@media (min-width: 901px) {
  .case-ready-preview-shell {
    --case-preview-row-height: min(158px, calc((100cqw - 70px) / 8 + 20px));
    --case-preview-height: calc(var(--case-preview-row-height) + var(--case-preview-row-height) + var(--case-preview-row-height) + 46px);
  }
}

.case-ready-preview-shell--fit {
  overflow: hidden;
}

.case-ready-preview-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: var(--case-preview-row-height);
  gap: var(--case-preview-gap);
  align-items: stretch;
}

.case-ready-preview-grid .card-face {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  gap: 5px;
  padding: 7px;
  border-radius: 8px;
}

.case-ready-preview-grid .card-face-art-wrap {
  min-height: 0;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
}

.case-ready-preview-grid .card-face-art {
  padding: 0;
  object-fit: cover;
}

.case-ready-preview-grid .card-face-name {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 15px;
  max-height: 15px;
  margin: 0;
  overflow: hidden;
  color: #f7faff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

.case-ready-preview-grid .card-face-name--csitem {
  gap: 0 !important;
  justify-content: center !important;
}

.case-ready-preview-grid .card-face-name--csitem .card-face-csitem-prefix,
.case-ready-preview-grid .card-face-name--csitem .card-face-csitem-main {
  display: inline-flex !important;
  align-items: center;
  min-height: 0 !important;
  max-height: 15px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.case-ready-preview-grid .card-face-csitem-prefix {
  display: inline-flex !important;
  flex: 0 1 auto;
  max-width: 45%;
  min-height: 0;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(236, 242, 252, 0.82);
  font-size: 11px !important;
  font-weight: 500;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-ready-preview-grid .card-face-csitem-prefix::after {
  content: '|';
  margin: 0 3px;
  color: rgba(216, 224, 239, 0.58);
}

.case-ready-preview-grid .card-face-csitem-main {
  display: inline-flex !important;
  flex: 0 1 auto;
  max-width: 55%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #f7faff;
  font-size: 11px !important;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

/* 开箱与炼金共用 .case-ready-preview-grid：集中管理紧凑预览卡的 CS 饰品标题与长名称适配。 */
.case-ready-preview-grid .card-face-name--csitem-tight .card-face-csitem-prefix {
  font-size: 10px !important;
}

.case-ready-preview-grid .card-face-name--csitem-tight .card-face-csitem-main {
  font-size: 10px !important;
}

.case-ready-preview-grid .card-face-name--csitem-extra-tight .card-face-csitem-prefix {
  max-width: 42%;
  font-size: 9px !important;
}

.case-ready-preview-grid .card-face-name--csitem-extra-tight .card-face-csitem-main {
  max-width: 58%;
  font-size: 9px !important;
  letter-spacing: -0.15px;
}

.case-open-preview-item {
  min-width: 0;
}

.case-ready-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 24px;
  min-height: 78px;
  padding: 0;
  transition: opacity 280ms ease;
}

.case-ready-key-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: 400;
  transition: opacity 280ms ease;
}

.case-ready-key-state img {
  width: 74px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.28));
}

.case-ready-key-state--missing-key img {
  width: 118px;
  height: 78px;
  margin-right: -30px;
}

.case-ready-key-state--has-key img {
  margin-left: -16px;
}

.case-ready-key-state strong {
  font-weight: 1000;
}

#case-opening-ready-view .case-ready-open-btn {
  width: min(260px, 100%);
  min-width: 0;
  margin: 0;
  padding: 0 20px;
  font-size: 16px;
}

.case-opening-panel--ready.is-opening-trigger {
  overflow: hidden;
}

.case-opening-panel--ready.is-opening-trigger .case-ready-open-btn {
  animation: case-ready-open-button-press 180ms cubic-bezier(0.22, 0.82, 0.34, 1) both;
}

@keyframes case-ready-open-button-press {
  0% { transform: translateY(0) scale(1); filter: brightness(1); }
  48% { transform: translateY(2px) scale(0.972); filter: brightness(1.16); }
  100% { transform: translateY(0) scale(1); filter: brightness(1.04); }
}

.case-opening-panel--ready.is-opening-copy-fade .case-ready-footer {
  opacity: 0;
  pointer-events: none;
}

.case-opening-panel--ready.is-opening-copy-fade .case-ready-key-state {
  opacity: 0;
}

.case-opening-panel--ready.is-opening-stage .case-opening-back-previous {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 420ms ease, transform 420ms ease;
}

.case-opening-panel--ready.is-opening-stage .case-ready-hero {
  z-index: 3;
  flex: 0 0 auto;
}

.case-opening-panel--ready.is-opening-stage .case-ready-hero::before {
  transform: scale(1.22);
  filter: blur(4px);
}

.case-opening-panel--ready.is-opening-stage .case-ready-case-image {
  transition: transform 720ms cubic-bezier(0.07, 0.80, 0.25, 1);
  transform: scale(1.38);
}

.case-opening-panel--ready.is-opening-box-flash .case-ready-case-image {
  animation:
    case-ready-box-motion 520ms cubic-bezier(0.12, 0.82, 0.18, 1) both,
    case-ready-box-image-exit 520ms linear both;
}

.case-opening-panel--ready.is-opening-box-flash .case-ready-case-flash {
  animation:
    case-ready-box-flash-motion 520ms cubic-bezier(0.12, 0.82, 0.18, 1) both,
    case-ready-box-flash-exit 520ms linear both;
}

.case-opening-panel--ready.is-opening-roulette .case-opening-roulette {
  animation: case-roulette-enter 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.case-opening-panel--ready.is-opening-result-placeholder .case-opening-roulette {
  animation: none;
  opacity: 0;
  filter: none;
  transition: opacity 180ms ease;
}

.case-opening-panel--ready.is-opening-result-placeholder .case-opening-result-placeholder {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 360ms ease;
}

.case-opening-panel--ready.is-opening-result-placeholder .case-opening-result-placeholder::after {
  animation: case-result-surface-flash 560ms cubic-bezier(0.18, 0.82, 0.22, 1) both;
}

.case-opening-panel--ready.is-opening-result-placeholder .case-result-stage {
  animation: case-result-stage-enter 620ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

.case-opening-panel--ready.is-opening-result-placeholder .case-result-content {
  animation: case-result-content-enter 540ms cubic-bezier(0.16, 1, 0.3, 1) 180ms both;
}

@keyframes case-roulette-enter {
  0% {
    opacity: 0;
    filter: brightness(0) saturate(0) invert(1) blur(16px);
  }
  100% {
    opacity: 1;
    filter: brightness(1) saturate(1) invert(0) blur(0);
  }
}

@keyframes case-ready-box-motion {
  0% { transform: scale(1.38); }
  100% { transform: scale(2.12); }
}

@keyframes case-ready-box-flash-motion {
  0% { transform: translate(-50%, -50%) scale(1.38); }
  100% { transform: translate(-50%, -50%) scale(2.12); }
}

@keyframes case-ready-box-image-exit {
  0%, 60% {
    opacity: 1;
    filter: drop-shadow(0 26px 26px rgba(0, 0, 0, 0.34)) blur(0);
  }
  82%, 100% {
    opacity: 0;
    filter: drop-shadow(0 26px 26px rgba(0, 0, 0, 0.34)) blur(16px);
  }
}

@keyframes case-ready-box-flash-exit {
  0% {
    opacity: 0;
    filter: brightness(0) saturate(0) invert(1) blur(0);
  }
  20% {
    opacity: 1;
    filter: brightness(0) saturate(0) invert(1) blur(0);
  }
  60% {
    opacity: 1;
    filter: brightness(0) saturate(0) invert(1) blur(0);
  }
  82%, 100% {
    opacity: 0;
    filter: brightness(0) saturate(0) invert(1) blur(16px);
  }
}

#draw-page .mode-card--case-opening {
  --mode-accent-a: rgba(244, 187, 70, 0.17);
  --mode-accent-b: rgba(108, 126, 255, 0.13);
  --mode-line: rgba(185, 172, 255, 0.20);
  --mode-hover-line: rgba(205, 190, 255, 0.34);
}

@media (max-width: 900px) {
  html.alchemy-mode-active,
  body.alchemy-mode-active,
  html.box-mode-active,
  body.box-mode-active {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.alchemy-mode-active .app-main > .global-status-strip,
  body.box-mode-active .app-main > .global-status-strip {
    display: none !important;
  }

  body.alchemy-mode-active .app-shell,
  body.box-mode-active .app-shell {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  body.alchemy-mode-active .app-main,
  body.alchemy-mode-active #draw-page,
  body.alchemy-mode-active #draw-page .main-card.shell-card,
  body.alchemy-mode-active #alchemy-mode-view,
  body.alchemy-mode-active #alchemy-mode-view .mode-page-shell,
  body.alchemy-mode-active #alchemy-mode-view .alchemy-ready-layout,
  body.alchemy-mode-active #alchemy-mode-view .alchemy-warehouse,
  body.box-mode-active .app-main,
  body.box-mode-active #draw-page,
  body.box-mode-active #draw-page .main-card.shell-card,
  body.box-mode-active #box-mode-view,
  body.box-mode-active #box-mode-view .mode-page-shell {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.alchemy-mode-active #alchemy-mode-view .alchemy-ready-footer {
    position: static;
  }

  body.case-opening-active .app-shell,
  body.case-opening-active .app-main,
  body.case-opening-active #draw-page,
  body.case-opening-active #draw-page .main-card.shell-card,
  body.case-opening-active #case-opening-inventory-view,
  body.case-opening-active #case-opening-key-view,
  body.case-opening-active #case-opening-ready-view {
    height: 100%;
    min-height: 0;
  }

  body.case-opening-active .app-shell {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  body.case-opening-active .app-main,
  body.case-opening-active #draw-page,
  body.case-opening-active #draw-page .main-card.shell-card {
    overflow: hidden !important;
  }

  .case-opening-shell {
    height: 100%;
    padding: 14px;
    min-height: 0;
  }

  #case-opening-ready-view .case-opening-shell {
    height: 100%;
  }

  .case-opening-panel {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    padding: 12px;
    overflow: hidden;
  }

  .case-opening-panel--ready {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .case-opening-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }

  .case-opening-header .mode-page-title {
    min-width: 0;
    font-size: 24px;
    line-height: 38px;
    white-space: nowrap;
  }

  .case-open-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .case-opening-scroll {
    min-height: 0;
    overscroll-behavior: contain;
  }

  .case-opening-pair-strip {
    min-height: 82px;
    padding-top: 48px;
    flex-wrap: wrap;
    font-size: 15px;
  }

  #case-opening-key-view .case-opening-back-previous,
  #case-opening-ready-view .case-opening-back-previous {
    top: 10px;
    left: 10px;
  }

  .case-ready-hero {
    min-height: 168px;
  }

  .case-ready-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 174px;
    gap: 8px;
  }

  .case-ready-preview-shell {
    height: auto;
    min-height: 190px;
    max-height: min(42dvh, 420px);
  }

  .case-ready-preview-grid .card-face-name,
  .case-ready-preview-grid .card-face-csitem-main {
    font-size: 11px;
  }

  .case-ready-preview-grid .card-face-csitem-prefix {
    font-size: 11px;
  }

  .case-ready-open-btn {
    width: 100%;
    min-width: 0;
  }

  .case-ready-footer {
    position: sticky;
    z-index: 5;
    bottom: 0;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(122, 145, 184, 0.18);
    border-radius: 12px;
    background: rgba(7, 12, 22, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .case-result-stage {
    padding: 22px 16px;
  }

  .case-result-item-image {
    width: min(520px, 88vw);
    height: min(270px, 36vh);
  }

  .case-result-actions {
    width: min(480px, 100%);
  }

  #case-opening-ready-view .case-result-action {
    width: min(220px, 100%);
  }
}

@media (max-width: 900px) and (max-height: 700px) {
  body.gacha-mode-active .mobile-nav-toggle,
  body.case-opening-active .mobile-nav-toggle {
    display: none;
  }

  body.gacha-mode-active .app-shell,
  body.case-opening-active .app-shell {
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }

  .case-opening-shell {
    padding: 8px;
  }

  .case-opening-header {
    gap: 6px 8px;
    margin-bottom: 6px;
  }

  .case-opening-panel {
    padding: 8px;
  }

  .case-opening-panel--ready {
    gap: 8px;
  }

  .case-ready-hero {
    min-height: 112px;
    max-height: 24dvh;
  }

  .case-ready-title {
    font-size: 17px;
  }

  .case-ready-preview-shell {
    min-height: 150px;
    max-height: 32dvh;
  }

  .case-ready-preview-grid {
    grid-auto-rows: 152px;
  }

  .case-ready-key-state {
    min-height: 42px;
    font-size: 14px;
  }

  .case-ready-key-state img {
    width: 58px;
    height: 42px;
  }
}

@media (max-width: 340px) {
  .case-ready-preview-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 176px;
  }
}
