/* The Night Carnival — fx-smooth.css
 * Lớp phủ làm mượt animation, KHÔNG sửa carnival.css gốc.
 * Nguyên tắc: chỉ animate transform + opacity (GPU), tránh filter/box-shadow/background-position.
 * Kích hoạt giảm tải tự động qua html.fx-low (do fx-smooth.js gắn khi máy yếu / tiết kiệm data).
 */

/* 0. Trang Thể lệ: card cách nhau top 5px (mobile + PC) */
#s-rules .card + .card { margin-top: 5px; }

/* 1. GPU hint + cô lập paint cho các lớp nền động */
.sky, .sky .stars, .sky .aurora, .sky .beam, .sky .bokeh, .sky::after,
body::before, body::after, .colophon, .colophon::before,
.poster-hero h1, .poster-frame, .foot-bulb-strip {
  transform: translateZ(0);
  backface-visibility: hidden;
}
.sky { contain: strict; }
.sky .aurora, .sky .beam { will-change: transform, opacity; contain: strict; }
.sky .stars, .sky .bokeh, .sky::after { will-change: transform, opacity; }
body::before, body::after { will-change: transform; }
.poster-frame::after { will-change: transform, opacity; }

/* 2. Bulb flicker: chỉ nháy opacity, giữ box-shadow tĩnh để khỏi repaint liên tục */
@keyframes bulbFlickerSmooth { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
@keyframes bulbFlickerPinkSmooth { 0%,100% { opacity: 1 } 50% { opacity: .5 } }
.foot-bulb-strip span { animation-name: bulbFlickerSmooth; }
.foot-bulb-strip span:nth-child(even) { animation-name: bulbFlickerPinkSmooth; }

/* 3. H1 neon + poster glow: bỏ animation filter drop-shadow (rất đắt),
 * thay bằng glow tĩnh + nháy opacity nhẹ trên chính element. */
.poster-hero h1, .poster-hero h1 em { animation: h1OpacitySmooth 4s ease-in-out infinite alternate; will-change: opacity; }
@keyframes h1OpacitySmooth { from { opacity: .94 } to { opacity: 1 } }
.poster-frame img { filter: drop-shadow(0 0 14px rgba(255,43,194,.5)); }/*animation: none !important*/
.poster-frame::after { animation-duration: 6s; }

/* 4. Footer glow: chỉ opacity, đã nhẹ — giữ nhưng chậm lại để ít composite hơn */
.colophon, .colophon::before { animation-duration: 8s; }

/* 5. Reveal on scroll mượt: dùng transform+opacity.
 * Không dùng contain: content / paint trên .rv để tránh xén/cắt dấu tiếng Việt (mũ, ngã, hỏi, sắc trên chữ hoa như HỖ, ĐỔI, VÉ...). */
.rv { will-change: transform, opacity; }
h1, h2, h3, h4, h5, h6, .screen>h1, .screen>h2, .sec-head h2 {
  contain: none !important;
  overflow: visible !important;
}
.tier-card, .step, .ledger, .box-office, .count-strip, .ticket-block {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

/* 6. Hover/active dùng transform-only, tránh layout shift */
.tier-card, .btn-ticket, .btn-primary, .bo-go, .btn { will-change: transform; }

/* 7. Tạm dừng toàn bộ sky khi tab ẩn / fx tắt (giữ nền tĩnh tại chỗ để
 * toggle Bật/Tắt thấy ngay, không làm nền biến mất gây nhảy layout) */
html.fx-paused .sky *, html.fx-paused .sky::after,
html.fx-paused body::before, html.fx-paused body::after {
  animation-play-state: paused !important;
}

/* 8. Chế độ máy yếu (html.fx-low): tắt lớp nặng nhất, giữ bố cục */
html.fx-low .sky .a3, html.fx-low .sky .b2, html.fx-low .sky .b3,
html.fx-low .sky .bokeh, html.fx-low .sky::after,
html.fx-low body::after, html.fx-low .colophon::before {
  display: none !important;
}
html.fx-low .sky .aurora { filter: blur(24px); opacity: .4; }
html.fx-low .sky .beam { filter: blur(24px); opacity: .22; }
html.fx-low .foot-bulb-strip span { animation-duration: 2.4s; }
html.fx-low .poster-hero h1, html.fx-low .poster-hero h1 em,
html.fx-low .poster-frame::after, html.fx-low .colophon {
  animation: none !important;
}
html.fx-low .poster-hero h1 { filter: drop-shadow(0 3px 0 rgba(90,8,60,.9)) drop-shadow(0 0 22px rgba(255,43,194,.4)); }

/* 8b. FX tắt (html.rm — trạng thái mặc định, không còn nút bật):
 * ẩn các lớp nền nặng nhất y như chế độ máy yếu để nhẹ paint khi load/cuộn,
 * giữ bố cục và nền tĩnh đẹp. */
html.rm .sky .a3, html.rm .sky .b2, html.rm .sky .b3,
html.rm .sky .bokeh, html.rm .sky::after,
html.rm body::after, html.rm .colophon::before {
  display: none !important;
}
html.rm .sky .aurora { filter: blur(24px); opacity: .4; }
html.rm .sky .beam { filter: blur(24px); opacity: .22; }

/* 9. Mobile: blur lớn là nguyên nhân drop frame — hạ blur, tắt tia phụ */
@media (max-width: 768px) {
  .sky .aurora { filter: blur(28px); }
  .sky .beam { filter: blur(28px); width: 150px; }
  .sky .b2, .sky .b3, .sky .bokeh, .sky::after { display: none; }
  body::after { display: none; }
  .poster-hero h1, .poster-hero h1 em { animation-duration: 6s; }
}

/* 11. Tracking timeline dọc theo T&C (B1 đăng ký nhu cầu → B2 giữ chỗ → B3 hoàn tất → B4 nhận vé)
 * Gốc bundle: 4 node dàn ngang chen nhau. Override: timeline dọc, vòng tròn trên
 * trục line, nội dung nằm thẻ riêng — bao nhiêu bước cũng đẹp. */
.track-stepper-card { padding: 26px 28px; }
.stepper-header-row { gap: 12px; flex-wrap: wrap; }
/* GỐC carnival.css:376 ép .track-stepper-track thành grid 4 cột → phải trả về block,
 * nếu không .stepper-nodes-row bị nhét vào 1 ô grid và mọi override timeline vô tác dụng. */
.track-stepper-track { display: block; }
.stepper-connecting-line { display: none; } /* dùng line vẽ bằng CSS dưới đây */
.stepper-nodes-row { display: flex; flex-direction: column; align-items: stretch; }
.step-node {
  position: relative;
  display: flex; flex-direction: row; align-items: flex-start; text-align: left;
  gap: 14px; background: none; border: 0; padding: 0 0 12px;
}
.step-node:last-child { padding-bottom: 2px; }
.node-circle-wrap { margin-bottom: 0; flex: none; }
.node-text-col {
  flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px;
  text-align: left;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 10px 14px;
}
.step-node.node-done .node-text-col { border-color: rgba(139,53,255,.5); }
.step-node.node-active .node-text-col { border-color: var(--magenta); box-shadow: 0 0 14px rgba(255,43,194,.25); }
.step-node.node-killed .node-text-col { border-color: rgba(255,68,85,.55); }
/* Tím hóa vòng tròn + badge (node lỗi giữ đỏ để giữ ngữ nghĩa) */
.step-node .node-circle {
  background: rgba(139,53,255,.16); border-color: var(--violet); color: #d9bfff;
  box-shadow: 0 0 16px rgba(139,53,255,.45), inset 0 0 8px rgba(139,53,255,.25);
}
.step-node.node-active .node-circle {
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  border-color: #fff; color: #fff;
}
.step-node.node-killed .node-circle {
  background: rgba(61,10,30,.6); border-color: #ff5b7f; color: #ff8ba3;
  box-shadow: 0 0 16px rgba(255,91,127,.4);
}
.node-text-col { background: linear-gradient(160deg, rgba(59,7,92,.55), rgba(35,4,63,.35)); }
.step-node.node-done .node-step-badge, .step-node.node-active .node-step-badge,
.step-node.node-upcoming .node-step-badge { color: #cfa8ff; }
.step-node.node-killed .node-step-badge { color: #ff6b81; }
/* Hàng 1: "Bước 01 · Tên bước" in đậm — badge bỏ kiểu pill, gộp chung hàng với title */
.node-text-col .node-step-badge {
  display: inline-block; white-space: nowrap; background: none !important; border: 0 !important;
  padding: 0; margin: 0; font-size: 14px; font-weight: 800;
  letter-spacing: 0; text-transform: capitalize; color: #fff;
}
.step-node.node-done .node-step-badge { color: #4ade80; }
.step-node.node-active .node-step-badge { color: #ff8ad4; }
.step-node.node-killed .node-step-badge { color: #ff6b81; }
.node-text-col .node-title { display: inline-block; white-space: nowrap; font-size: 14px; margin: 0; }
.node-text-col .node-title::before { content: "· "; opacity: .6; }
/* Hàng 2: mô tả bên dưới */
.node-text-col .node-desc { display: block; flex: 0 0 100%; margin-top: 4px; }
/* flex item chứa chữ nowrap phải được co lại, nếu không sẽ đẩy tràn card */
.step-node .node-text-col { min-width: 0; }
@media (max-width: 640px) {
  .track-stepper-card { padding: 18px 14px; }
  .stepper-header-row { flex-direction: column; align-items: flex-start; }
  .step-node { gap: 12px; }
  .node-circle { width: 38px; height: 38px; }
  .node-text-col { padding: 10px 12px; }
  .node-text-col .node-step-badge, .node-text-col .node-title { font-size: 13px; }
  .node-desc { font-size: 11px; }
}
/* 13. Mobile #track: chống vỡ card — ô tìm kiếm xếp dọc, chữ dài tự wrap */
.search-row input { min-width: 0; }
.stepper-order-title, .mono-code, .meta-value, .ticket-guest-name,
.p-title, .node-title { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .search-row { flex-direction: column; align-items: stretch; }
  .search-row .bo-go { width: 100%; }
  .ticket-guest-name { font-size: 26px; }
  .stepper-order-title { font-size: 20px; }
}
@media (max-width: 380px) {
  /* Máy rất nhỏ: cho phép hàng "Bước · tên" xuống dòng thay vì tràn card */
  .node-text-col .node-step-badge, .node-text-col .node-title { white-space: normal; }
}
/* 14. Bảng #rules (A. Thông tin chung, E. Điểm đổi vé): gốc min-width 560px +
 * scroll ngang khiến mobile tưởng mất nội dung → xếp chồng thành thẻ. */
@media (max-width: 640px) {
  #s-rules .scroll { overflow: visible; border: 0; background: none; margin-top: 12px; }
  #s-rules .scroll table, #s-rules .scroll tbody,
  #s-rules .scroll tr, #s-rules .scroll td { display: block; width: 100%; min-width: 0; }
  #s-rules .scroll thead { display: none; }
  #s-rules .scroll tr {
    border: 1px solid var(--line-soft); border-radius: 12px;
    margin-bottom: 8px; background: rgba(0,0,0,.3); overflow: hidden;
  }
  #s-rules .scroll tr:last-child { margin-bottom: 0; }
  #s-rules .scroll td { border-bottom: 0; padding: 6px 12px; }
  #s-rules .scroll td:first-child { padding-top: 10px; color: var(--gold); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
  #s-rules .scroll td:last-child { padding-bottom: 10px; }
}

/* 12b. Honeypot chống bot: đẩy khỏi màn hình (không display:none để bot vẫn thấy) */
.hp-trap { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* 12. Icon SVG chuyên nghiệp theo theme (thay emoji AI) — line 2px, bo tròn,
 * màu lấy từ tokens: gold điểm nhấn, magenta CTA/vé, cyan thông tin. */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.ic-gold { color: var(--gold); }
.ic-mag { color: var(--magenta); }
.ic-cyan { color: #4FE3F5; }
.ic-ok { color: #4ADE80; }
.ic-bad { color: #FF7189; }
.ic-mut { color: var(--muted); }
.meta-chip .ic { font-size: 19px; }
.step .step-icon .ic { font-size: 22px; }
.sic .ic, .support-list .ic { font-size: 20px; }
h3 .ic { margin-right: 2px; }
.check-seal .ic { width: 20px; height: 20px; }
.btn-download-ticket .ic { margin-right: 5px; }
.toggle-perks-table-btn .ic { font-size: 17px; }
.tier-name .ic { margin-right: 6px; font-size: 1em; }
.ticket-security-note .ic { font-size: 15px; margin-top: 2px; }
.foot-note .ic { font-size: 16px; }
.node-circle .ic { width: 18px; height: 18px; }
/* Icon đồng hồ (node chờ) phải nằm giữa vòng tròn: bỏ vertical-align, flex căn giữa */
.node-emoji-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.node-emoji-icon .ic { width: 18px; height: 18px; vertical-align: 0; }
/* Vé hủy: tem đè giữa vé (absolute), vé xám mờ — gốc thiếu position nên tem
 * chui vào grid, vỡ layout 3 cuống. */
.track-ticket-showcase-box .concert-ticket-pass { position: relative; }
.pass-voided { filter: grayscale(.55) brightness(.78); }
.stamp-voided-mark {
  position: absolute; z-index: 5; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  background: rgba(20,2,10,.6); text-align: center; white-space: nowrap;
  pointer-events: none; box-shadow: 0 0 24px rgba(255,91,127,.35);
}
@media (max-width: 640px) {
  .stamp-voided-mark { padding: 4px 10px; font-size: 14px; }
  .stamp-voided-mark .stamp-sub { font-size: 11px; }
}
.dl-ic .ic { width: 15px; height: 15px; vertical-align: -.25em; margin-right: 5px; }
.btn-wallet-add .ic { width: 15px; height: 15px; vertical-align: -.25em; margin-right: 5px; }
.alert-icon .ic { width: 22px; height: 22px; }
.p-ic-circle .ic { width: 17px; height: 17px; }
/* Toast phản hồi nút hiệu ứng */
.fx-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 9999;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,4,38,.95); border: 1px solid var(--line); color: var(--text);
  padding: 10px 22px; border-radius: 999px; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.fx-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 15. Compressed WebP backgrounds (desktop + mobile), preloaded by home.blade.php.
 * nên không tốn GPU khi cuộn. Phủ gradient tím để chữ luôn đọc được. */
.photo-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("/source/assets/neon_pc_1.webp") center / cover no-repeat;
  filter: blur(5px);
  transform: scale(1.06) translateZ(0);
}
.photo-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,5,44,.68) 0%, rgba(28,7,58,.75) 45%, rgba(14,3,32,.88) 100%);
}
@media (max-width: 640px) {
  .photo-bg { background-image: url("/source/assets/neon_mb_1.webp"); background-position: center top; filter: blur(5px); }
}

/* 10. Tôn trọng giảm chuyển động + tab ẩn — nhưng lựa chọn Bật thủ công
 * (html.fx-explicit) luôn thắng setting OS để toggle không bao giờ "chết". */
@media (prefers-reduced-motion: reduce) {
  html:not(.fx-explicit) .sky *, html:not(.fx-explicit) body::before, html:not(.fx-explicit) body::after, html:not(.fx-explicit) .colophon, html:not(.fx-explicit) .colophon::before,
  html:not(.fx-explicit) .poster-hero h1, html:not(.fx-explicit) .poster-frame::after, html:not(.fx-explicit) .foot-bulb-strip span {
    animation: none !important;
  }
}
