/* 王者专属视觉。原画保持原样，动态由透明光层和 transform 实现。 */
.king-scene[hidden],
.king-hero[hidden],
.king-header-name[hidden] {
  display: none;
}

#game-detail-view.is-king-theme {
  position: relative;
  isolation: isolate;
  background: #081326;
}

.king-scene {
  position: fixed;
  z-index: 0;
  inset: 0 auto 0 50%;
  width: min(100%, 390px);
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
  background: #0b1c32;
}

.king-scene-wallpaper {
  position: absolute;
  inset: -18px;
  background: url("king-assets/gongsunli-memory-official.jpg") 54% center / cover no-repeat;
  opacity: 0.62;
  animation: king-wallpaper-drift 28s ease-in-out infinite alternate;
}

.king-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 18, 35, 0.35), rgba(7, 18, 35, 0.28) 32%, rgba(7, 18, 35, 0.82));
}

.king-scene-aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse at 18% 23%, rgba(67, 158, 208, 0.28), transparent 43%),
    radial-gradient(ellipse at 84% 72%, rgba(155, 137, 240, 0.22), transparent 36%);
  animation: king-aurora-drift 19s ease-in-out infinite alternate;
}

.king-scene-lights {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.king-scene-lights i {
  position: absolute;
  bottom: -24px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d1f3ff;
  box-shadow: 0 0 9px rgba(152, 215, 255, 0.7);
  opacity: 0;
  animation: king-light-float 19s linear infinite;
}

.king-scene-lights i:nth-child(1) { left: 8%; animation-delay: -4s; }
.king-scene-lights i:nth-child(2) { left: 24%; animation-delay: -13s; animation-duration: 23s; }
.king-scene-lights i:nth-child(3) { left: 41%; animation-delay: -9s; width: 2px; height: 2px; }
.king-scene-lights i:nth-child(4) { left: 60%; animation-delay: -17s; animation-duration: 25s; }
.king-scene-lights i:nth-child(5) { left: 74%; animation-delay: -6s; width: 2px; height: 2px; }
.king-scene-lights i:nth-child(6) { left: 88%; animation-delay: -15s; animation-duration: 21s; }
.king-scene-lights i:nth-child(7) { left: 96%; animation-delay: -2s; width: 2px; height: 2px; }

#game-detail-view.is-king-theme .delta-page {
  z-index: 1;
  flex-basis: min(100%, 390px);
  width: min(100%, 390px);
  padding: 0 20px 38px;
  background: transparent;
  color: #eff5ff;
}

[data-game="king"].delta-page::before,
[data-game="king"] .delta-brand,
[data-game="king"] .delta-title-bg,
[data-game="king"] .delta-back img,
[data-game="king"] .notice-frame,
[data-game="king"] .notice-speaker,
[data-game="king"] .category-heading-wrap,
[data-game="king"] .sort-button img {
  display: none;
}

[data-game="king"] .delta-header {
  height: 68px;
  gap: 8px;
}

[data-game="king"] .delta-header::before {
  flex-basis: 29px;
  width: 29px;
}

[data-game="king"] .delta-back {
  top: 12px;
  left: -9px;
}

[data-game="king"] .delta-back::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-left: 2px solid #dcecff;
  border-bottom: 2px solid #dcecff;
  transform: rotate(45deg);
}

.king-logo-frame { display: contents; }

[data-game="king"] .king-logo-frame {
  position: relative;
  display: block;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(213, 231, 255, 0.38);
  border-radius: 50%;
  background: rgba(174, 186, 229, 0.15);
}

[data-game="king"] .delta-logo {
  position: absolute;
  top: -12%;
  left: -27.5%;
  width: 155%;
  height: 155%;
  filter: none;
  opacity: 1;
}

.king-header-name {
  color: #eaf2ff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

[data-game="king"] .delta-title-capsule {
  top: 23px;
  width: 128px;
  height: 24px;
  border-left: 1px solid rgba(220, 236, 255, 0.22);
}

[data-game="king"] .delta-title-label {
  color: #b1c7dc;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.king-hero {
  position: relative;
  min-height: 248px;
  margin: 0 -20px 18px;
  padding: 42px 28px 38px;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  background: #132b41;
}

.king-hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 34%;
  animation: king-hero-breathe 24s ease-in-out infinite alternate;
}

.king-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 20, 38, 0.86), rgba(8, 22, 39, 0.58) 32%, transparent 80%),
    linear-gradient(0deg, rgba(8, 22, 39, 0.45), transparent 38%);
}

.king-hero-copy {
  position: relative;
  z-index: 1;
}

.king-hero-eyebrow {
  display: inline-block;
  margin-bottom: 15px;
  color: #bddbec;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.king-hero h1 {
  margin: 0;
  color: #f4f9ff;
  font-size: 39px;
  font-weight: 650;
  line-height: 1.16;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 24px rgba(4, 19, 39, 0.32);
}

.king-hero h1 span {
  display: block;
  margin-top: 7px;
  color: #b9d5ef;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.king-hero p {
  margin: 18px 0 0;
  color: #c6d9e9;
  font-size: 10px;
  line-height: 1.5;
}

.king-hero-skin {
  position: absolute;
  z-index: 1;
  right: 19px;
  bottom: 14px;
  color: rgba(226, 242, 255, 0.74);
  font-size: 8px;
  letter-spacing: 0.1em;
}

[data-game="king"] .notice-panel {
  min-height: 0;
  margin: 0;
  padding: 13px 16px 14px;
  border: 1px solid rgba(209, 231, 255, 0.16);
  border-radius: 16px;
  background: rgba(13, 30, 51, 0.76);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: none;
}

[data-game="king"] .notice-toolbar {
  height: 27px;
  border-bottom-color: rgba(195, 219, 248, 0.12);
}

[data-game="king"] .notice-toolbar h1 {
  color: #d9e8f8;
  font-size: 12px;
  font-weight: 500;
}

[data-game="king"] .notice-list {
  gap: 5px;
  padding-left: 19px;
  color: #adbed3;
  font-size: 11px;
  line-height: 1.6;
}

[data-game="king"] .notice-panel:not(.is-expanded) .notice-list li {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

[data-game="king"] .category-section {
  margin-top: 20px;
}

[data-game="king"] .category-list {
  gap: 5px;
  margin-top: 0;
  padding: 5px;
  border: 1px solid rgba(209, 231, 255, 0.16);
  border-radius: 18px;
  background: rgba(11, 28, 48, 0.8);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

[data-game="king"] .category-button {
  min-height: 66px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #b7cade;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

[data-game="king"] .category-button[aria-selected="true"] {
  background: linear-gradient(135deg, #c6e7fa, #96b8e0);
  box-shadow: 0 3px 12px rgba(80, 139, 198, 0.17);
}

[data-game="king"] .category-copy {
  gap: 4px;
  padding: 11px 2px;
}

[data-game="king"] .category-copy strong {
  color: #d9e7f7;
  font-size: 14px;
  font-weight: 500;
}

[data-game="king"] .category-copy span {
  color: #94abc3;
  font-size: 9px;
  line-height: 1.5;
}

[data-game="king"] .category-button[aria-selected="true"] .category-copy strong {
  color: #112a46;
  font-weight: 650;
}

[data-game="king"] .category-button[aria-selected="true"] .category-copy span {
  color: #365977;
}

[data-game="king"] .items-section {
  margin-top: 12px;
}

[data-game="king"] .sort-list {
  height: 34px;
  gap: 7px;
  padding-right: 0;
}

[data-game="king"] .sort-button {
  width: 50px;
  height: 25px;
  border: 1px solid transparent;
  border-radius: 20px;
  color: #94acc5;
  font-size: 10px;
}

[data-game="king"] .sort-button[aria-pressed="true"] {
  border-color: rgba(213, 234, 255, 0.16);
  background: rgba(21, 43, 67, 0.65);
}

[data-game="king"] .sort-button[aria-pressed="true"] span {
  color: #c4ddf3;
  font-weight: 500;
}

[data-game="king"] .item-list {
  gap: 16px;
}

[data-game="king"] .king-billing-switch {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(209, 231, 255, 0.15);
  border-radius: 14px;
  background: rgba(12, 29, 49, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

[data-game="king"] .king-billing-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  color: #92abc5;
  font-size: 12px;
  transition: background 180ms ease, color 180ms ease;
}

[data-game="king"] .king-billing-switch button.is-active {
  color: #eaf5ff;
  background: rgba(126, 175, 219, 0.2);
  font-weight: 600;
}

[data-game="king"] .king-companion-section-heading {
  margin-top: 5px;
  padding: 0 2px 10px;
  border-bottom-color: rgba(206, 226, 252, 0.14);
}

[data-game="king"] .king-companion-section-heading strong {
  color: #dbeaf9;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

[data-game="king"] .king-companion-section-heading span {
  color: #91aac4;
  font-size: 10px;
}

[data-game="king"] .king-companion-card {
  gap: 17px;
  min-height: 0;
  padding: 20px 18px;
  border: 1px solid rgba(216, 234, 255, 0.17);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(25, 48, 76, 0.84), rgba(10, 26, 47, 0.9));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(1, 10, 25, 0.12);
  animation: king-card-enter 440ms cubic-bezier(.2,.7,.3,1) both;
  animation-delay: calc(var(--card-order, 0) * 35ms);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

[data-game="king"] .king-companion-card::after {
  background: linear-gradient(125deg, rgba(214, 235, 255, 0.055), transparent 45%);
}

[data-game="king"] .king-card-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

[data-game="king"] .king-companion-card h3 {
  color: #ebf3ff;
  font-size: 18px;
  font-weight: 550;
  letter-spacing: 0.015em;
}

[data-game="king"] .king-card-caption {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 6px;
  color: #adcce8;
  background: rgba(142, 192, 234, 0.1);
  font-size: 10px;
  line-height: 1.4;
}

[data-game="king"] .king-companion-price-grid {
  gap: 0;
}

[data-game="king"] .king-companion-price-cell {
  gap: 7px;
  padding: 3px 3px 1px;
  border: 0;
  border-left: 1px solid rgba(190, 217, 247, 0.12);
  border-radius: 0;
  background: transparent;
}

[data-game="king"] .king-companion-price-cell:first-child {
  border-left: 0;
}

[data-game="king"] .king-companion-price-cell small {
  color: #9eb5ce;
  font-size: 11px;
}

[data-game="king"] .king-companion-price-cell strong {
  color: #eff7ff;
  font-size: 23px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

[data-game="king"] .king-price-currency {
  margin-left: 2px;
  color: #a9c4df;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

[data-game="king"] .king-companion-unit,
[data-game="king"] .king-companion-unit.is-inline {
  display: block;
  margin-top: 6px;
  color: #92abc6;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

[data-game="king"] .king-companion-price-cell del {
  margin-top: 1px;
  color: #728ba8;
  font-size: 10px;
  font-weight: 400;
}

[data-game="king"] .king-companion-note {
  padding-top: 12px;
  border-top: 1px solid rgba(190, 217, 247, 0.1);
  color: #9eb2ca;
  font-size: 11px;
  line-height: 1.65;
}

[data-game="king"] .king-companion-card.is-extra {
  min-height: 78px;
  gap: 12px;
}

[data-game="king"] .king-companion-card.is-extra h3 {
  font-size: 15px;
}

[data-game="king"] .king-companion-extra-price {
  color: #c3ddf3;
  font-size: 13px;
  font-weight: 500;
}

[data-game="king"] .king-package-rank-picker {
  padding: 9px 13px;
  border-color: rgba(209, 231, 255, 0.15);
  border-radius: 13px;
  color: #a9c0d8;
  background: rgba(13, 29, 49, 0.9);
  font-size: 12px;
}

[data-game="king"] .king-package-rank-picker select {
  min-height: 37px;
  border-color: rgba(209, 231, 255, 0.2);
  border-radius: 9px;
  background: #142b45;
  color: #dcecff;
  font-size: 12px;
}

[data-game="king"] button:focus-visible,
[data-game="king"] select:focus-visible {
  outline: 2px solid #a9d6f4;
  outline-offset: 3px;
}

body[data-app-view="game"][data-active-game="king"] .site-icp-footer {
  position: relative;
  z-index: 1;
  background: #081326;
}

body[data-app-view="game"][data-active-game="king"] .site-icp-footer a {
  color: #91a9c3;
}

@media (hover: hover) {
  [data-game="king"] .king-companion-card:hover {
    border-color: rgba(195, 228, 255, 0.32);
    box-shadow: 0 12px 36px rgba(9, 31, 58, 0.25);
  }
}

@media (max-width: 400px) {
  #game-detail-view.is-king-theme .delta-page { padding-inline: 16px; }
  .king-hero { margin-inline: -16px; padding-left: 24px; }
  [data-game="king"] .king-companion-card { padding: 18px 13px; }
  [data-game="king"] .king-companion-price-cell strong { font-size: 20px; }
}

@media (max-width: 350px) {
  [data-game="king"] .delta-title-capsule { width: 104px; }
  .king-header-name { font-size: 12px; letter-spacing: 0; }
  [data-game="king"] .king-companion-price-cell strong { font-size: 18px; }
  [data-game="king"] .category-copy span { font-size: 8px; }
  .king-hero h1 { font-size: 35px; }
  .king-hero p { font-size: 9px; }
  [data-game="king"] .is-package .king-companion-price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 16px;
  }
  [data-game="king"] .is-package .king-companion-price-cell:nth-child(3) { border-left: 0; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  [data-game="king"] .king-companion-card,
  [data-game="king"] .notice-panel,
  [data-game="king"] .category-list { background: rgba(15, 32, 54, 0.97); }
}

@keyframes king-wallpaper-drift {
  from { transform: scale(1.035) translate3d(-5px, 0, 0); }
  to { transform: scale(1.075) translate3d(5px, -8px, 0); }
}

@keyframes king-hero-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.035) translate3d(-3px, 0, 0); }
}

@keyframes king-aurora-drift {
  from { transform: translate3d(-3%, -2%, 0); opacity: 0.6; }
  to { transform: translate3d(3%, 2%, 0); opacity: 1; }
}

@keyframes king-light-float {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  15% { opacity: 0.4; }
  80% { opacity: 0.3; }
  100% { transform: translate3d(22px, -110vh, 0); opacity: 0; }
}

@keyframes king-card-enter {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .king-scene-wallpaper,
  .king-hero-art,
  .king-scene-aurora,
  .king-scene-lights i,
  [data-game="king"] .king-companion-card { animation: none; }
  [data-game="king"] button,
  [data-game="king"] .king-companion-card { transition: none; }
}
