/**
 * Field-update detail pages — category accents + cleaner step / CTA layout.
 */

:root,
.page-intro--update-detail,
.update-guide {
  --update-accent: var(--brand-accent);
  --update-bg: rgba(177, 163, 248, 0.14);
  --update-soft: rgba(177, 163, 248, 0.06);
}

body[data-update-category="dbd"],
body[data-update-category="dbd"] .page-intro--update-detail,
body[data-update-category="dbd"] .update-guide {
  --update-accent: #ef4444;
  --update-bg: rgba(239, 68, 68, 0.16);
  --update-soft: rgba(239, 68, 68, 0.07);
}

body[data-update-category="pokemon"],
body[data-update-category="pokemon"] .page-intro--update-detail,
body[data-update-category="pokemon"] .update-guide {
  --update-accent: #facc15;
  --update-bg: rgba(250, 204, 21, 0.16);
  --update-soft: rgba(250, 204, 21, 0.07);
}

body[data-update-category="stream"],
body[data-update-category="stream"] .page-intro--update-detail,
body[data-update-category="stream"] .update-guide {
  --update-accent: #3b82f6;
  --update-bg: rgba(59, 130, 246, 0.16);
  --update-soft: rgba(59, 130, 246, 0.07);
}

/* ── Intro (matches /updates/ page-intro language) ── */
.page-intro--update-detail {
  text-align: left;
  padding: 14px 16px;
  border-color: color-mix(in srgb, var(--update-accent) 34%, var(--border));
  background:
    radial-gradient(circle at 100% 0%, var(--update-bg), transparent 46%),
    linear-gradient(160deg, var(--update-soft), transparent 58%),
    var(--panel);
}

.page-intro--update-detail .update-detail-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.page-intro--update-detail .update-detail-copy h1,
.page-intro--update-detail .update-detail-copy p {
  margin: 0;
}

.page-intro--update-detail .update-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.page-intro--update-detail .update-card-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--update-accent) 40%, transparent);
  background: color-mix(in srgb, var(--update-accent) 14%, transparent);
  color: var(--update-accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-intro--update-detail h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
  color: #fff;
  background: linear-gradient(
    115deg,
    #ffffff 8%,
    color-mix(in srgb, var(--update-accent) 78%, #ffffff) 52%,
    var(--update-accent) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-intro--update-detail > p:not(.updates-tip),
.page-intro--update-detail .update-detail-copy > p:not(.updates-tip) {
  margin: 0;
  max-width: 52rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}

.page-intro--update-detail .updates-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--update-accent) 28%, var(--border));
  background: color-mix(in srgb, var(--update-accent) 10%, rgba(255, 255, 255, 0.03));
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  justify-self: start;
  width: max-content;
}

.page-intro--update-detail.has-thumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 16px;
}

.page-intro--update-detail.has-thumb .update-detail-thumb {
  flex: 0 0 156px;
  width: 156px;
  height: 156px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--update-accent) 22%, var(--border));
}

.page-intro--update-detail.has-thumb .update-detail-thumb--soon {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--update-accent) 12%, rgba(0, 0, 0, 0.35));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.page-intro--update-detail.has-thumb .update-detail-copy {
  flex: 1 1 220px;
}

@media (max-width: 720px) {
  .page-intro--update-detail.has-thumb .update-detail-thumb {
    width: min(100%, 156px);
    height: auto;
    aspect-ratio: 1;
    flex-basis: min(100%, 156px);
  }
}

/* ── Guide panel ── */
.update-guide {
  width: 100%;
  margin: 0 0 22px;
  padding: clamp(20px, 3vw, 28px);
  border-color: color-mix(in srgb, var(--update-accent) 26%, var(--border));
}

.update-guide > h1,
.update-guide > .logo-link,
.update-guide > .etsy-banner,
.update-guide > .etsy-footer,
.update-guide > .subtitle {
  display: none !important;
}

.update-guide-steps {
  position: relative;
  display: grid;
  gap: 14px;
}

.update-guide .instruction-step {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--update-accent) 6%, transparent), transparent 48%),
    rgba(0, 0, 0, 0.28);
  border: 1px solid color-mix(in srgb, var(--update-accent) 18%, var(--border));
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 0;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.update-guide .instruction-step.is-complete {
  border-color: color-mix(in srgb, #a6e3a1 45%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, #a6e3a1 18%, transparent);
}

.update-guide .instruction-step.is-complete .step-badge {
  background: linear-gradient(135deg, #25d366, #1aa35a);
  color: transparent;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.update-guide .instruction-step.is-complete .step-badge::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  color: #fff;
  background: transparent;
  border-radius: inherit;
}

.update-guide .step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.update-guide .step-badge {
  position: relative;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--update-accent) 88%, #ffffff),
    color-mix(in srgb, var(--update-accent) 55%, #0e2c78)
  );
  color: #0a0a12;
  font-weight: 900;
  width: 34px;
  height: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-size: 0.92rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--update-accent) 35%, transparent);
  z-index: 1;
}

body[data-update-category="dbd"] .update-guide .step-badge,
body[data-update-category="stream"] .update-guide .step-badge {
  color: #fff;
}

.update-guide .instruction-step h3 {
  margin: 0;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 900;
}

.update-guide .instruction-step p {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 600;
  max-width: 52rem;
}

.update-guide .instruction-step p:last-child {
  margin-bottom: 0;
}

.update-guide .instruction-step strong {
  color: #fff;
}

.update-guide .instruction-step code,
.update-guide .instruction-step kbd {
  font-size: 0.9rem;
  color: #facc08;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 700;
}

.update-guide .instruction-step kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 7px;
  border: 1px solid rgba(250, 204, 8, 0.35);
  background: rgba(250, 204, 8, 0.08);
}

.update-guide .btn-container {
  position: relative;
  display: grid;
  gap: 8px;
  width: min(100%, 280px);
  margin-top: 2px;
  overflow: visible;
}

.update-guide .btn-container.copy-choice-grid {
  width: 100%;
  max-width: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.update-guide .copy-choice {
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}

.update-guide .copy-choice h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
}

.update-guide .copy-choice p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

.update-guide .copy-choice--survivor {
  border-color: rgba(52, 211, 153, 0.42);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(0, 0, 0, 0.22));
}

.update-guide .copy-choice--killer {
  border-color: rgba(248, 113, 113, 0.5);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.14), rgba(0, 0, 0, 0.22));
}

.update-guide .btn-container button,
.update-guide button:not(.back-to-top):not(.nav-toggle):not(.hub-select-trigger):not(.updates-chip):not(.updates-clear-btn) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  z-index: 2;
  width: 100%;
  min-height: 40px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--update-accent) 92%, #ffffff),
    color-mix(in srgb, var(--update-accent) 55%, #0e2c78)
  );
  color: #0a0a12;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  padding: 8px 14px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
  box-shadow:
    0 8px 22px color-mix(in srgb, var(--update-accent) 32%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.update-guide .btn-container button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -140%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.38) 45%,
    transparent 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  z-index: 1;
}

.update-guide .btn-container button:hover::after {
  animation: update-btn-shine 0.85s ease;
}

@keyframes update-btn-shine {
  to { left: 160%; }
}

body[data-update-category="dbd"] .update-guide .btn-container button,
body[data-update-category="stream"] .update-guide .btn-container button,
body[data-update-category="dbd"] .update-guide button:not(.back-to-top):not(.nav-toggle),
body[data-update-category="stream"] .update-guide button:not(.back-to-top):not(.nav-toggle) {
  color: #fff;
}

.update-guide .btn-container button:hover,
.update-guide button:not(.back-to-top):not(.nav-toggle):hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--update-accent) 42%, transparent);
}

.update-guide .btn-container button:disabled,
.update-guide button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  filter: none;
}

.update-guide .btn-container button.is-copied {
  color: #fff !important;
  background: linear-gradient(135deg, #25d366, #1aa35a) !important;
  animation: copy-bar-bounce 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    0 12px 28px rgba(18, 140, 126, 0.34),
    0 0 22px rgba(37, 211, 102, 0.28);
}

.update-guide .btn-container button.is-copied:hover {
  transform: none;
  filter: none;
}

.update-guide .btn-container button .copy-bar-mark {
  display: inline-grid;
  place-items: center;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: #fff;
  color: #1aa35a;
  font-size: 0.9em;
  line-height: 1;
  animation: copy-mark-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes copy-bar-bounce {
  0% { transform: scale(0.96); }
  32% { transform: scale(1.04); }
  58% { transform: scale(0.99); }
  100% { transform: scale(1); }
}

@keyframes copy-mark-pop {
  0% { transform: scale(0.4) rotate(-24deg); }
  60% { transform: scale(1.18) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.copy-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 920px;
  height: 380px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: radial-gradient(
    ellipse var(--hole-x, 220px) var(--hole-y, 36px) at 50% 50%,
    transparent 99%,
    #000 100%
  );
  mask-image: radial-gradient(
    ellipse var(--hole-x, 220px) var(--hole-y, 36px) at 50% 50%,
    transparent 99%,
    #000 100%
  );
}

.copy-burst-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  border: 3px solid #25d366;
  border-radius: 50%;
  animation: copy-burst-ring 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.copy-burst-ring--late {
  border-color: rgba(255, 255, 255, 0.85);
  animation-delay: 0.12s;
}

.copy-burst-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) scale(0.55);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  animation: copy-burst-fly 1.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes copy-burst-ring {
  0% {
    transform: translate(-50%, -50%) scale(1.35);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(6.4);
    opacity: 0;
  }
}

@keyframes copy-burst-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) scale(0.55) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot));
  }
}

.copy-clipboard-toast {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 64px));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 211, 102, 0.5);
  background: rgba(12, 18, 16, 0.94);
  backdrop-filter: blur(14px);
  box-shadow:
    0 12px 28px rgba(18, 140, 126, 0.28),
    0 0 18px rgba(37, 211, 102, 0.18);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateX(18px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.copy-clipboard-toast.is-on {
  opacity: 1;
  transform: translateX(0);
}

.copy-clipboard-toast-mark {
  display: inline-grid;
  place-items: center;
  width: 1.45em;
  height: 1.45em;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-size: 0.82em;
  line-height: 1;
}

.update-guide .load-error {
  color: #f38ba8;
  font-size: 0.9rem;
  margin-top: 10px;
  font-weight: 700;
}

.update-guide .widget-warning {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(250, 204, 8, 0.35);
  background: rgba(250, 204, 8, 0.08);
  color: #f5e6a8;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 700;
}

.update-guide .widget-warning strong {
  color: #ffe58a;
}

.update-guide-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.update-guide .hub-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--update-accent) 30%, var(--border));
  background: color-mix(in srgb, var(--update-accent) 10%, transparent);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.update-guide .hub-link:hover {
  background: color-mix(in srgb, var(--update-accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--update-accent) 48%, transparent);
  transform: translateY(-1px);
}

/* Related updates (same category) */
.update-related {
  margin: 0 0 22px;
  padding: clamp(18px, 2.5vw, 24px);
}

.update-related-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.update-related-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.update-related-header a {
  color: var(--update-accent, var(--brand-accent));
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.update-related-header a:hover {
  text-decoration: underline;
}

.update-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.update-related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 108px;
  padding: 0 0 12px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--update-accent, var(--brand-accent)) 24%, var(--border));
  background:
    radial-gradient(circle at 100% 0%, var(--update-bg, rgba(177, 163, 248, 0.14)), transparent 50%),
    rgba(0, 0, 0, 0.22);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.update-related-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--update-accent, var(--brand-accent)) 48%, transparent);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--update-accent, var(--brand-purple)) 18%, transparent);
}

.update-related-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 0;
  margin-bottom: 4px;
}

.update-related-card strong {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.25;
  padding: 0 14px;
}

.update-related-card > span:not(.copy-fields-cta) {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.4;
  padding: 0 14px;
}

.update-related-card .copy-fields-cta {
  width: calc(100% - 28px);
  margin: 4px 14px 0;
}

.hidden-data {
  display: none;
}

.update-topbar,
.update-back-nav {
  display: none !important;
}

@media (max-width: 640px) {
  .update-guide .btn-container {
    width: 100%;
  }

  .update-guide .btn-container.copy-choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) {
  .page-intro.page-intro--update-detail {
    padding: 14px 16px;
    border-radius: 22px;
  }

  .page-intro.page-intro--update-detail h1 {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  }

  .page-intro.page-intro--update-detail p,
  .page-intro.page-intro--update-detail .update-detail-copy > p:not(.updates-tip) {
    font-size: 0.92rem;
    max-width: 52rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .update-guide .btn-container button:hover::after,
  .update-guide .btn-container button.is-copied,
  .update-guide .btn-container button .copy-bar-mark {
    animation: none;
  }

  .copy-burst {
    display: none;
  }

  .copy-clipboard-toast,
  .copy-clipboard-toast.is-on {
    transform: none;
    transition: opacity 0.2s ease;
  }
}

.sticky-copy {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
}

.sticky-copy[hidden] {
  display: none !important;
}

.sticky-copy-btn {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-blue));
  color: #0a0a12;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.sticky-copy-btn.is-copied {
  background: #3dd68c;
}

.sticky-copy-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
