/* tickmi.com/lucky-draw — bổ sung cho stage.css (copy nguyên từ Tickmi Studio). Studio đặt 4 khối bằng position:absolute
   theo % (bố cục kéo thả); bản public xếp theo cột flex để tự co giãn mọi màn hình, kể cả điện thoại 375px. */

/* --- sân khấu nằm dưới thanh trên của site, toàn màn hình khi bấm Fullscreen --- */
.ld-stage.stage { width: 100%; height: auto; min-height: max(640px, calc(100svh - 68px)); padding: 70px 30px 16px; }
.ld-stage.stage:fullscreen { min-height: 100vh; height: 100vh; padding-top: 70px; }
.ld-stage .ld-canvas { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.ld-stage .ld-canvas > .title, .ld-stage .ld-canvas > .content, .ld-stage .ld-canvas > .roller, .ld-stage .ld-canvas > .controls { position: relative; top: auto; left: auto; right: auto; }
.ld-stage h1.title { margin: 0 auto; width: 100%; color: var(--text); font-family: inherit; font-size: clamp(30px, 3.6vw, 60px); }
.ld-stage h1.title small { font-weight: 800; }
/* ✦ hai bên đặt quanh dòng chữ chính (không quanh cả khối có dòng nhỏ phía trên) để tiêu đề cân giữa */
.ld-stage h1.title:before, .ld-stage h1.title:after { content: none; }
.ld-stage .ld-title:before, .ld-stage .ld-title:after { content: "✦"; color: var(--accent); font-size: .42em; vertical-align: middle; margin: 0 .5em; filter: drop-shadow(0 0 10px var(--accent)); }
.ld-stage .ld-content { flex: 1 1 auto; height: auto; min-height: 240px; }
.ld-stage .ld-content > .single { min-height: 240px; height: auto; }
/* Lưới nhiều người trúng: Studio chia hàng theo 10% chiều cao (màn chiếu lớn, tới 100 ô) — bản web dùng chiều cao tối thiểu mỗi thẻ. */
.ld-stage .ld-content > .multi { height: auto; min-height: 240px; width: min(1400px, 100%); }
.ld-stage .multi .grid { grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr)); grid-auto-rows: minmax(58px, auto); align-content: center; height: auto; width: min(100%, calc(var(--cols, 10) * 260px)); margin: 0 auto; }
.ld-stage .multi .card { min-height: 58px; }
.ld-stage .multi .grid.ld-few { gap: 12px; grid-auto-rows: minmax(86px, auto); }
.ld-stage .multi .ld-few .card { padding: 12px 14px 12px 52px; border-radius: 16px; }
.ld-stage .multi .ld-few .seq { left: 12px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; font-size: 13px; }
.ld-stage .multi .ld-few .card-name { font-size: clamp(16px, 1.5vw, 24px); }
.ld-stage .multi .ld-few .card-ticket { font-size: clamp(12px, .9vw, 15px); }
.ld-stage .ld-roller { flex: 0 0 auto; }

/* thanh cuộn: mảnh, trong suốt theo tông sân khấu (mặc định của trình duyệt là khối xám sáng, lệch hẳn nền tối) */
.ld-stage, .ld-stage * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--p2) 45%, transparent) transparent; }
.ld-stage ::-webkit-scrollbar { width: 8px; height: 8px; }
.ld-stage ::-webkit-scrollbar-track { background: transparent; }
.ld-stage ::-webkit-scrollbar-thumb { border-radius: 8px; border: 2px solid transparent; background: color-mix(in srgb, var(--p2) 45%, transparent) padding-box; }
.ld-stage ::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--p2) 70%, transparent); }
html:has(.ld-page) { scrollbar-width: thin; scrollbar-color: #c9c9cf transparent; }

/* xung đột tên class với CSS chung của site (.footer, .card, .reveal) */
.ld-stage .footer { background: none; border: 0; padding: 0; font-size: 11px; }
.ld-stage .card { flex-direction: row; scroll-margin-top: 0; }
.ld-stage .single.ld-reveal .single-inner { animation: stage-heroIn .8s cubic-bezier(.2, .9, .24, 1.15); }
.ld-stage button { font-family: inherit; }

/* --- nút góc màn hình --- */
.ld-corner { position: absolute; top: 18px; z-index: 50; display: flex; gap: 8px; transition: opacity .3s; }
.ld-corner-l { left: 18px; }
.ld-corner-r { right: 18px; }
.ld-cbtn { height: 40px; min-width: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; color: rgba(255, 255, 255, .82); cursor: pointer; font-size: 14px; font-weight: 700; }
.ld-cbtn:hover, .ld-cbtn:focus-visible { color: #fff; }
.ld-cbtn svg { width: 18px; height: 18px; }
.ld-cbtn .ld-ico-min, .ld-stage:fullscreen .ld-cbtn .ld-ico-max { display: none; }
.ld-stage:fullscreen .ld-cbtn .ld-ico-min { display: block; }
.ld-stage.ld-idle-hide .ld-corner { opacity: 0; pointer-events: none; }
.ld-keyhint { opacity: .7; }
/* dòng thương hiệu ở giữa chân sân khấu: "Tickmi.com · Nền tảng vé và trải nghiệm người tham gia" (chữ nhỏ, đủ đọc) */
.ld-stage .footer { position: relative; justify-content: center; }
.ld-stage .footer > .ld-keyhint { position: absolute; left: 0; }
.ld-stage .footer > .hint.ld-brand { display: block; margin: 0 auto; opacity: 1; font-size: 12px; font-weight: 500; letter-spacing: .02em; color: rgba(255, 255, 255, .62); text-align: center; text-shadow: 0 1px 6px rgba(0, 0, 0, .45); max-width: calc(100% - 300px); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-brand a { color: inherit; font-weight: inherit; text-decoration: none; }
.ld-brand a:hover { color: var(--accent); }
@media (max-width: 640px) { .ld-stage .footer > .hint.ld-brand { max-width: calc(100% - 72px); white-space: normal; font-size: 11px; line-height: 1.4; } .ld-stage .footer { height: auto; min-height: 22px; } }

.ld-toast { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 60; max-width: min(560px, calc(100% - 140px)); padding: 9px 16px; border-radius: 12px; border: 1px solid rgba(255, 210, 96, .45); background: rgba(20, 8, 2, .78); color: #ffe7a8; font-size: 14px; backdrop-filter: blur(10px); text-align: center; }

/* trạng thái chưa có danh sách */
.ld-empty-btn { display: none; margin: 18px auto 0; padding: 12px 22px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--p2) 60%, white 14%); background: linear-gradient(135deg, var(--p1), var(--p2)); color: #fff; font-weight: 800; font-size: 16px; cursor: pointer; box-shadow: 0 10px 30px var(--glow); }
.ld-stage.ld-empty .ld-empty-btn { display: inline-block; }
.ld-stage.ld-empty .draw { opacity: .55; }

/* --- lịch sử: dùng .recent-drawer-live/.open của Studio; neo trong sân khấu (absolute) để không phủ phần nội dung bên dưới --- */
.ld-stage .ld-history, .ld-stage .ld-backdrop { position: absolute; }
.ld-stage .ld-history { max-height: min(480px, calc(100% - 90px)); }
.ld-history-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }

/* --- bảng cài đặt (panel trượt phải, cùng ngôn ngữ glass của sân khấu) --- */
.ld-settings { position: absolute; z-index: 95; top: 12px; right: 12px; bottom: 12px; width: min(440px, calc(100% - 24px)); border-radius: 22px; display: flex; flex-direction: column; color: var(--text); background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)), var(--panel2) !important; transform: translateX(calc(100% + 24px)); visibility: hidden; transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility .32s; }
.ld-stage.ld-show-settings .ld-settings { transform: none; visibility: visible; }
/* nút "Liên hệ nhanh" nổi của site đè lên nút Xong — ẩn khi đang mở Cài đặt hoặc toàn màn hình */
body:has(.ld-stage.ld-show-settings) .qc, body:has(.ld-stage:fullscreen) .qc { display: none; }
.ld-set-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; font-size: 18px; }
.ld-set-head button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); color: var(--text); font-size: 20px; cursor: pointer; }
.ld-set-body { flex: 1; overflow-y: auto; padding: 4px 18px 16px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.ld-set-body h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.ld-set-body h2 span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #1a0d00; font-size: 12px; letter-spacing: 0; }
.ld-hint { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ld-settings textarea, .ld-settings input:not([type=checkbox]):not([type=range]), .ld-settings select { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .28); color: var(--text); font: inherit; font-size: 15px; padding: 10px 12px; outline: none; }
.ld-settings textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
.ld-settings textarea:focus, .ld-settings input:focus, .ld-settings select:focus { border-color: var(--p2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p2) 25%, transparent); }
.ld-settings select option { background: #1b1b22; color: #fff; }
.ld-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.ld-count { font-weight: 800; color: var(--text); }
.ld-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.ld-field output { color: var(--text); font-weight: 800; }
.ld-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
/* điều khiển gốc của trình duyệt (spinner, select, checkbox) theo nền tối */
.ld-settings { color-scheme: dark; }
/* ô số: bỏ nút tăng/giảm mặc định của trình duyệt (màu sáng, không theo theme) → nút −/+ riêng */
.ld-stepper { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; width: 100%; max-width: 160px; height: 44px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .28); }
.ld-stepper:focus-within { border-color: var(--p2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p2) 25%, transparent); }
.ld-settings .ld-stepper input { border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; text-align: center; font-weight: 800; min-width: 0; width: 100% !important; -moz-appearance: textfield; appearance: textfield; padding: 10px 4px !important; }
.ld-stepper input::-webkit-inner-spin-button, .ld-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ld-stepper button { border: 0; background: color-mix(in srgb, var(--p1) 22%, transparent); color: var(--accent); font-size: 20px; font-weight: 800; cursor: pointer; transition: background .15s; }
.ld-stepper button:hover { background: color-mix(in srgb, var(--p1) 45%, transparent); }
.ld-stepper button:active { background: var(--p1); color: #fff; }
.ld-settings input[type=range] { width: 100%; margin: 0; accent-color: var(--accent); height: 44px; }
.ld-check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.ld-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.ld-swatches { display: flex; gap: 10px; }
.ld-swatches button { width: 40px; height: 40px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.ld-swatches button[aria-pressed=true] { border-color: #fff; box-shadow: 0 0 0 3px var(--accent); }
.ld-link { border: 0; background: none; padding: 4px 0; color: var(--p2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ld-danger { color: #ff8a8a; }
.ld-upsell { display: block; padding: 14px 16px; border-radius: 16px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: rgba(255, 214, 90, .07); color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.45; }
.ld-upsell b { display: block; color: var(--accent); margin-bottom: 4px; }
.ld-upsell span { display: block; color: var(--muted); }
.ld-upsell ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.ld-upsell li { position: relative; padding-left: 22px; color: var(--text); font-size: 13.5px; }
.ld-upsell li:before { content: ""; position: absolute; left: 2px; top: 5px; width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.ld-upsell em { display: inline-block; margin-top: 8px; font-style: normal; font-weight: 800; color: #fff; }
.ld-set-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.ld-apply { min-width: 120px; padding: 11px 20px; border-radius: 12px; border: 0; background: linear-gradient(135deg, var(--p1), var(--p2)); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; }

/* --- điện thoại / màn hẹp --- */
@media (max-width: 1100px) {
  .ld-stage .controls { grid-template-columns: 1fr 1fr; }
  .ld-stage .controls .draw { grid-column: 1 / -1; min-height: 64px; }
}
@media (max-width: 900px) {
  .ld-stage .controls { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 640px) {
  .ld-stage.stage { height: auto; min-height: calc(100svh - 60px); max-height: none; padding: 66px 14px 14px; }
  .ld-canvas { gap: 12px; }
  .ld-stage .title { font-size: 30px; }
  .ld-stage .title:before, .ld-stage .title:after { margin: 0 8px; }
  .ld-stage .title small { letter-spacing: .2em; font-size: 10px; }
  .ld-content { min-height: 200px; flex: 0 0 auto; }
  .ld-stage .single { min-height: 200px; width: 100%; border-radius: 22px; }
  .ld-stage .roller { height: 104px; border-radius: 18px; }
  .ld-stage .roller .r-item:nth-child(-n+2), .ld-stage .roller .r-item:nth-child(n+6) { display: none; }
  .ld-stage .roller-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ld-stage .multi .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-stage .controls { grid-template-columns: 1fr; gap: 10px; }
  .ld-stage .prize, .ld-stage .mode-note { min-height: 64px; }
  .ld-stage .mode-note b { font-size: 15px; }
  .ld-cbtn-main span { display: none; }
  .ld-keyhint { display: none; }
  .ld-settings { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; }
  .ld-grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ld-settings { transition: none; }
}

/* --- phần nội dung dưới công cụ (nền sáng của site) --- */
.ld-seo .lp-crumb { margin-bottom: 18px; }
.ld-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.ld-steps li { position: relative; padding: 24px; border-radius: 22px; border: 1px solid var(--line); background: #fff; box-shadow: 0 10px 30px rgba(24, 24, 27, .05); }
.ld-steps li > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; margin-bottom: 12px; }
.ld-steps h3, .ld-uses h3 { margin: 0 0 6px; font-size: 18px; }
.ld-steps p, .ld-uses p { margin: 0; color: var(--muted); }
.ld-uses { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ld-h2 { font-size: clamp(22px, 2.4vw, 28px); margin: 40px 0 16px; }
.ld-feats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.ld-feats li { display: flex; gap: 10px; align-items: flex-start; }
.ld-feats svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--brand-dark); margin-top: 2px; }
.ld-studio { padding: clamp(24px, 4vw, 44px); border-radius: 30px; background: radial-gradient(circle at 90% 0, rgba(255, 92, 64, .12), transparent 45%), #fff7f4; border: 1px solid rgba(255, 92, 64, .18); }
.ld-studio .section-head p { color: var(--muted); max-width: 760px; }
.ld-table { overflow-x: auto; margin: 22px 0 26px; }
.ld-table table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; background: #fff; border-radius: 16px; overflow: hidden; }
.ld-table th, .ld-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ld-table thead th { background: #18181b; color: #fff; font-size: 14px; }
.ld-table thead th:last-child { background: var(--brand-dark); }
.ld-table tbody th { font-weight: 700; width: 24%; }
.ld-table td:last-child { font-weight: 600; }
.ld-related { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.ld-related a { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.ld-related a svg { width: 16px; height: 16px; }
@media (max-width: 900px) {
  .ld-steps, .ld-uses { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .ld-steps, .ld-uses, .ld-feats, .ld-related { grid-template-columns: 1fr; }
  /* bảng so sánh → thẻ xếp dọc, không kéo ngang trên điện thoại */
  .ld-table { overflow: visible; }
  .ld-table table, .ld-table tbody, .ld-table tr, .ld-table th, .ld-table td { display: block; min-width: 0; width: auto; }
  .ld-table table { background: none; }
  .ld-table thead { display: none; }
  .ld-table tr { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
  .ld-table tbody th { width: auto; padding: 0 0 8px; border: 0; font-size: 16px; }
  .ld-table td { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 6px 0; border: 0; border-top: 1px dashed var(--line); }
  .ld-table td:before { content: attr(data-label); color: var(--muted); font-weight: 600; font-size: 13px; }
  .ld-table td:last-child:before { color: var(--brand-dark); }
}
