/* ═════════════════ 🧭 ทัวร์สอนใช้ (tour.js) ═════════════════ */
.tour-root {
    position: fixed; inset: 0; z-index: 70;
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease;
}
.tour-root.tour-show { opacity: 1; pointer-events: auto; }
html.tour-open { overflow: hidden; }

/* วงไฟ: เจาะรูบนพื้นมืดด้วยเงาขนาดใหญ่ แล้วเลื่อนไปจุดถัดไปแบบนุ่มๆ */
.tour-spot {
    position: fixed;
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(2, 6, 23, .78);
    transition: left .45s cubic-bezier(.2, .8, .2, 1), top .45s cubic-bezier(.2, .8, .2, 1),
                width .45s cubic-bezier(.2, .8, .2, 1), height .45s cubic-bezier(.2, .8, .2, 1), opacity .3s;
    pointer-events: none;
}
.tour-spot.tour-spot-off { opacity: 0; }
.tour-root.tour-show .tour-spot.tour-spot-off { box-shadow: 0 0 0 9999px rgba(2, 6, 23, .85); opacity: 1; width: 0 !important; height: 0 !important; }
.tour-ring {
    position: absolute; inset: -3px; border-radius: inherit;
    border: 2px solid rgba(34, 211, 238, .9);
    box-shadow: 0 0 24px rgba(34, 211, 238, .55), inset 0 0 18px rgba(139, 92, 246, .35);
    animation: tour-ring 1.6s ease-in-out infinite;
}
.tour-spot-off .tour-ring { display: none; }
@keyframes tour-ring {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.025); opacity: .65; }
}

/* กล่องคำอธิบาย */
.tour-tip {
    position: fixed;
    padding: 18px 18px 14px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(30, 27, 75, .97), rgba(15, 23, 42, .97));
    border: 1px solid rgba(167, 139, 250, .35);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, .7), 0 0 40px -10px rgba(139, 92, 246, .5);
    color: #e2e8f0;
    transition: left .45s cubic-bezier(.2, .8, .2, 1), top .45s cubic-bezier(.2, .8, .2, 1);
    opacity: 0; transform: translateY(8px) scale(.97);
}
.tour-tip.tour-tip-in { animation: tour-tip-in .45s cubic-bezier(.2, .9, .3, 1.2) forwards; }
@keyframes tour-tip-in { to { opacity: 1; transform: none; } }

.tour-arrow {
    position: absolute; width: 14px; height: 14px; margin-left: -7px;
    background: inherit; border: inherit;
    transform: rotate(45deg);
}
.tour-arrow-up   { top: -8px;  border-right: 0; border-bottom: 0; background: #1e1b4b; }
.tour-arrow-down { bottom: -8px; border-left: 0; border-top: 0; background: #0f172a; }

.tour-step  { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #a78bfa; }
.tour-title {
    margin-top: 2px; font-size: 18px; font-weight: 600;
    background: linear-gradient(90deg, #ffffff, #a5f3fc);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tour-text  { margin-top: 6px; font-size: 14px; line-height: 1.6; color: #cbd5e1; }
.tour-body:empty { display: none; }
.tour-body { margin-top: 14px; }

.tour-foot { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots span { width: 6px; height: 6px; border-radius: 9999px; background: rgba(255, 255, 255, .2); transition: width .3s, background .3s; }
.tour-dots span.on { width: 18px; background: linear-gradient(90deg, #8b5cf6, #22d3ee); }
.tour-btns { display: flex; align-items: center; gap: 6px; }
.tour-btns button { white-space: nowrap; border-radius: 10px; padding: 7px 12px; font-size: 13px; transition: background .2s, transform .2s; }
.tour-skip { color: #94a3b8; }
.tour-skip:hover { color: #e2e8f0; }
.tour-prev { color: #cbd5e1; border: 1px solid rgba(255, 255, 255, .12); }
.tour-prev:hover { background: rgba(255, 255, 255, .08); }
.tour-next {
    color: #fff; font-weight: 500;
    background: linear-gradient(90deg, #7c3aed, #06b6d4);
    box-shadow: 0 8px 20px -8px rgba(124, 58, 237, .8);
}
.tour-next:hover { transform: translateY(-1px); filter: brightness(1.1); }

/* ───── ขั้นสุดท้าย: จำลองหน้าแอป Parsec — เคอร์เซอร์เลื่อนไปกดเครื่อง แล้วกด Connect ───── */
.pmock {
    position: relative; overflow: hidden;
    border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1);
    background: #0b0f1a; height: 168px;
    font-size: 12px; color: #cbd5e1;
}
.pmock-bar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #111827; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.pmock-bar i { width: 7px; height: 7px; border-radius: 9999px; background: #334155; display: block; }
.pmock-bar b { margin-left: 6px; font-weight: 600; color: #e2e8f0; letter-spacing: .05em; }
.pmock-list { padding: 10px; display: grid; gap: 7px; }
.pmock-pc {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, .04);
    border: 1px solid transparent;
}
.pmock-pc span { display: flex; align-items: center; gap: 7px; }
.pmock-pc span::before { content: ""; width: 7px; height: 7px; border-radius: 9999px; background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.pmock-pc.dim { opacity: .45; }
.pmock-pc.dim span::before { background: #64748b; box-shadow: none; }
.pmock-target { animation: pmock-select 4.5s ease-in-out infinite; }
@keyframes pmock-select {
    0%, 35%  { border-color: transparent; background: rgba(255, 255, 255, .04); }
    42%, 100%{ border-color: rgba(34, 211, 238, .8); background: rgba(34, 211, 238, .12); }
}
.pmock-connect {
    padding: 4px 10px; border-radius: 7px; font-weight: 600; font-size: 11px;
    background: linear-gradient(90deg, #7c3aed, #06b6d4); color: #fff;
    opacity: 0; transform: scale(.8);
    animation: pmock-btn 4.5s ease-in-out infinite;
}
@keyframes pmock-btn {
    0%, 40%  { opacity: 0; transform: scale(.8); }
    48%, 66% { opacity: 1; transform: scale(1); }
    70%      { transform: scale(.88); box-shadow: 0 0 0 6px rgba(34, 211, 238, .3); }
    76%, 100%{ opacity: 1; transform: scale(1); box-shadow: none; }
}
.pmock-cursor {
    position: absolute; width: 18px; height: 18px; left: 40px; top: 140px;
    animation: pmock-cursor 4.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
}
@keyframes pmock-cursor {
    0%       { left: 40px;  top: 140px; transform: scale(1); }
    30%      { left: 120px; top: 84px;  transform: scale(1); }
    36%      { transform: scale(.82); }
    42%      { left: 120px; top: 84px;  transform: scale(1); }
    62%      { left: calc(100% - 46px); top: 84px; transform: scale(1); }
    68%      { transform: scale(.82); }
    74%, 100%{ left: calc(100% - 46px); top: 84px; transform: scale(1); }
}
.pmock-done {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(2, 6, 23, .82); color: #a5f3fc; font-weight: 600; font-size: 14px;
    opacity: 0; animation: pmock-done 4.5s ease-in-out infinite;
}
@keyframes pmock-done { 0%, 78% { opacity: 0; } 84%, 96% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .tour-spot, .tour-tip { transition: none; }
    .tour-ring, .pmock-target, .pmock-connect, .pmock-cursor, .pmock-done { animation: none; }
    .pmock-connect { opacity: 1; transform: none; }
    .tour-tip.tour-tip-in { animation: none; opacity: 1; transform: none; }
}

/* โหมดสว่าง: พื้นหลังทัวร์ยังมืดเหมือนเดิม (เน้นจุดที่ชี้) */
html.light .tour-tip { color: #e2e8f0; }

/* ปุ่ม "วิธีใช้" มุมขวาของหัวการ์ด */
.tour-help {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    padding: 6px 11px; border-radius: 9999px; font-size: 12px;
    color: #c4b5fd; border: 1px solid rgba(167, 139, 250, .35); background: rgba(139, 92, 246, .1);
    transition: background .2s, border-color .2s, transform .2s;
}
.tour-help:hover { background: rgba(139, 92, 246, .2); border-color: rgba(167, 139, 250, .7); transform: translateY(-1px); }
.tour-help:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }
html.light .tour-help { color: #6d28d9; background: rgba(139, 92, 246, .08); border-color: rgba(109, 40, 217, .3); }
@media (max-width: 420px) { .tour-help span { display: none; } }
.pmock-cursor { color: #0f172a; fill: #ffffff; stroke-width: 1.6; }

/* ═════════════════ 🖥️ เลือกวิธีเข้าเครื่อง (connect-method.js) ═════════════════ */
.method {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .03);
    transition: border-color .3s, background .3s, box-shadow .3s;
}
.method:hover { border-color: rgba(167, 139, 250, .4); }
.method.open {
    border-color: rgba(167, 139, 250, .55);
    background: rgba(139, 92, 246, .06);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, .15), 0 18px 40px -22px rgba(139, 92, 246, .7);
}
.method[data-method="moonlight"].open {
    border-color: rgba(34, 211, 238, .5);
    background: rgba(6, 182, 212, .05);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, .12), 0 18px 40px -22px rgba(6, 182, 212, .6);
}
.method-head {
    display: flex; width: 100%; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: 16px;
}
.method-head:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }
.method-icon {
    display: grid; place-items: center; flex-shrink: 0;
    width: 40px; height: 40px; border-radius: 12px;
    transition: transform .4s cubic-bezier(.4, 1.6, .5, 1);
}
.method-head:hover .method-icon, .method.open .method-icon { transform: scale(1.08) rotate(-4deg); }
.method-badge {
    flex-shrink: 0; border-width: 1px; border-radius: 9999px;
    padding: 2px 9px; font-size: 11px; white-space: nowrap;
}
.method-chevron { flex-shrink: 0; transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.method.open .method-chevron { transform: rotate(180deg); }

/* แผงเลื่อนลง: grid 0fr → 1fr ให้สูงพอดีเนื้อหา ไม่ต้องรู้ความสูงล่วงหน้า */
.method-panel {
    display: grid; grid-template-rows: 0fr;
    visibility: hidden;   /* พับอยู่ = กด Tab เข้าไม่ได้ */
    transition: grid-template-rows .45s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .45s;
}
.method.open .method-panel {
    grid-template-rows: 1fr; visibility: visible;
    transition: grid-template-rows .45s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}
.method-inner { min-height: 0; overflow: hidden; }
.method-body {
    margin: 0 16px; padding: 14px 0 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    opacity: 0; transform: translateY(-10px);
    transition: opacity .3s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
}
.method.open .method-body { opacity: 1; transform: none; transition-delay: .12s; }
.method.no-anim .method-panel, .method.no-anim .method-body, .method.no-anim .method-chevron { transition: none !important; }

.method-step {
    display: grid; place-items: center; flex-shrink: 0;
    width: 22px; height: 22px; border-radius: 9999px;
    font-size: 12px; font-weight: 600;
    color: #a5f3fc; background: rgba(6, 182, 212, .15); border: 1px solid rgba(34, 211, 238, .3);
}

@media (max-width: 420px) {
    .method-head { padding: 12px; gap: 10px; }
    .method-body { margin: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .method-panel, .method-body, .method-chevron, .method-icon { transition: none !important; }
}

html.light .method { border-color: rgba(15, 23, 42, .1); background: rgba(255, 255, 255, .6); }
html.light .method:hover { border-color: rgba(109, 40, 217, .35); }
html.light .method.open { border-color: rgba(109, 40, 217, .45); background: rgba(139, 92, 246, .05); box-shadow: 0 18px 40px -24px rgba(109, 40, 217, .45); }
html.light .method[data-method="moonlight"].open { border-color: rgba(8, 145, 178, .45); background: rgba(6, 182, 212, .05); }
html.light .method-body { border-color: rgba(15, 23, 42, .08); }
html.light .method-step { color: #0e7490; background: rgba(6, 182, 212, .1); border-color: rgba(8, 145, 178, .3); }

/* ───── ทัวร์ช่วยเลือก: ข้อดี-ข้อเสีย + สรุป (อยู่ในกล่องทัวร์ที่เป็นโทนมืดเสมอ) ───── */
.tour-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 400px) { .tour-pc { grid-template-columns: 1fr; } }
.tour-pc-col { border-radius: 12px; padding: 10px 11px; border: 1px solid; opacity: 0; transform: translateY(6px); animation: tour-pc-in .4s ease forwards; }
.tour-con { animation-delay: .15s; }
@keyframes tour-pc-in { to { opacity: 1; transform: none; } }
.tour-pro { background: rgba(16, 185, 129, .08); border-color: rgba(52, 211, 153, .25); }
.tour-con { background: rgba(244, 63, 94, .07); border-color: rgba(251, 113, 133, .22); }
.tour-pc-head { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.tour-pro .tour-pc-head { color: #6ee7b7; }
.tour-con .tour-pc-head { color: #fda4af; }
.tour-pc ul { margin-top: 6px; display: grid; gap: 5px; }
.tour-pc li { position: relative; padding-left: 11px; font-size: 12.5px; line-height: 1.45; color: #cbd5e1; }
.tour-pc li::before { content: ""; position: absolute; left: 0; top: .6em; width: 4px; height: 4px; border-radius: 9999px; background: currentColor; opacity: .6; }

.tour-pick { display: grid; gap: 8px; }
.tour-pick-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 12px;
    background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
    opacity: 0; transform: translateX(-8px); animation: tour-pc-in .4s ease forwards;
}
.tour-pick-row:nth-child(2) { animation-delay: .15s; }
.tour-pick-row b { display: block; font-size: 13.5px; font-weight: 600; color: #f1f5f9; }
.tour-pick-row small { display: block; font-size: 12px; color: #94a3b8; }
.tour-pick-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; }
.tour-pick-icon.is-violet { background: rgba(139, 92, 246, .2); color: #ddd6fe; }
.tour-pick-icon.is-cyan { background: rgba(6, 182, 212, .2); color: #a5f3fc; }
.tour-pick-note { margin-top: 2px; font-size: 12px; color: #a78bfa; text-align: center; }
@media (prefers-reduced-motion: reduce) { .tour-pc-col, .tour-pick-row { animation: none; opacity: 1; transform: none; } }

/* ช่อง "ไม่ต้องแสดงอีก" */
.tour-hide { margin-top: 14px; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #94a3b8; cursor: pointer; user-select: none; }
.tour-hide:hover { color: #cbd5e1; }
.tour-hide input {
    appearance: none; width: 15px; height: 15px; border-radius: 4px; flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .05);
    display: grid; place-items: center; transition: background .2s, border-color .2s; cursor: pointer;
}
.tour-hide input::after { content: ""; width: 4px; height: 8px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .2s; }
.tour-hide input:checked { background: linear-gradient(135deg, #7c3aed, #06b6d4); border-color: transparent; }
.tour-hide input:checked::after { transform: rotate(45deg) scale(1); }
.tour-hide input:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }
.tour-hide + .tour-foot { margin-top: 10px; }

/* ═════════════════ 👆 คำใบ้ตารางคิว (queue-hint.js) ═════════════════ */
.qhint {
    position: absolute; z-index: 40; max-width: min(320px, calc(100vw - 24px));
    display: flex; align-items: center; gap: 10px;
    padding: 10px 10px 10px 14px; border-radius: 14px;
    background: linear-gradient(135deg, #6d28d9, #0891b2);
    color: #fff; font-size: 13.5px; font-weight: 500; line-height: 1.4;
    box-shadow: 0 14px 34px -12px rgba(8, 145, 178, .8), 0 0 0 1px rgba(255, 255, 255, .12) inset;
    animation: qhint-in .5s cubic-bezier(.2, .9, .3, 1.3) both, qhint-bob 2.4s ease-in-out .5s infinite;
}
.qhint-arrow { position: absolute; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: linear-gradient(135deg, #3b6fcf, #1590b8); border-radius: 2px; }
.qhint-close {
    display: grid; place-items: center; flex-shrink: 0;
    width: 22px; height: 22px; border-radius: 9999px;
    background: rgba(255, 255, 255, .18); font-size: 15px; line-height: 1;
}
.qhint-close:hover { background: rgba(255, 255, 255, .3); }
@keyframes qhint-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }
@keyframes qhint-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }

/* วงแตะกะพริบตรงช่องว่างจริง */
.qhint-tap { position: absolute; z-index: 39; width: 0; height: 0; pointer-events: none; }
.qhint-tap span {
    position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 9999px;
    border: 2px solid rgba(103, 232, 249, .95); background: rgba(34, 211, 238, .25);
    animation: qhint-ripple 1.6s ease-out infinite;
}
.qhint-tap span + span { animation-delay: .8s; }
@keyframes qhint-ripple { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(2.1); opacity: 0; } }
.qhint-out { opacity: 0 !important; transition: opacity .3s; animation: none; }

/* แสงวิ่งผ่านแถบเวลาที่จองได้ ระหว่างโชว์คำใบ้ */
.queue-hinting .queue-track[data-pc-id]:not([data-pc-id=""])::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(100deg, transparent 30%, rgba(34, 211, 238, .22) 50%, transparent 70%);
    background-size: 250% 100%;
    animation: queue-sweep 2.2s ease-in-out infinite;
}
.queue-hinting .queue-track[data-pc-id]:not([data-pc-id=""]):nth-child(n) { box-shadow: 0 0 0 1px rgba(34, 211, 238, .25); }
@keyframes queue-sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }

@media (prefers-reduced-motion: reduce) {
    .qhint, .qhint-tap span, .queue-hinting .queue-track::after { animation: none !important; }
}

/* ═════════════════ 🌙 Moonlight: ที่อยู่ + PIN ═════════════════ */
.moon-chip {
    display: inline-flex; align-items: center; border-radius: 9999px; padding: 3px 10px; font-size: 12px;
    color: #a5f3fc; background: rgba(6, 182, 212, .1); border: 1px solid rgba(34, 211, 238, .3); transition: background .2s;
}
.moon-chip:hover { background: rgba(6, 182, 212, .2); }
.moon-address {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    border-radius: 12px; padding: 8px 8px 8px 12px; background: rgba(2, 6, 23, .5); border: 1px solid rgba(34, 211, 238, .25);
}
.moon-address code { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; letter-spacing: .02em; color: #e0f2fe; word-break: break-all; }
.moon-copy {
    display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; border-radius: 9px; padding: 6px 10px; font-size: 12px;
    color: #fff; background: linear-gradient(90deg, #0891b2, #7c3aed); transition: filter .2s;
}
.moon-copy:hover { filter: brightness(1.1); }
.moon-copy.is-done { background: #059669; }
.moon-pin { max-width: 8.5rem; text-align: center; font-size: 20px; font-weight: 600; letter-spacing: .4em; font-family: ui-monospace, monospace; }
/* 🔗 OSLink: รูป QR ที่เครื่องส่งมาให้ลูกค้าสแกน */
.oslink-qr-img { width: 212px; max-width: 100%; aspect-ratio: 1; border-radius: 12px; background: #fff; padding: 10px; image-rendering: pixelated; }
.oslink-view { display: block; }
html.light .moon-chip { color: #0e7490; background: rgba(6, 182, 212, .08); border-color: rgba(8, 145, 178, .3); }
html.light .moon-address { background: #f0f9ff; border-color: rgba(8, 145, 178, .3); }
html.light .moon-address code { color: #0c4a6e; }
