/* POPNIX Flood - /3d/ page. Same tokens and surfaces as water.css; full-viewport MapLibre canvas with floating glass panels. */
/* no Bootstrap reboot on this page: make the hidden attribute win over component display rules */
.v3d [hidden] { display: none !important; }
body.ww.v3d { padding-bottom: 0; height: 100dvh; overflow: hidden; background: var(--bg); }
.v3d #map3d { position: fixed; inset: 0; background: var(--bg); }
.v3d .maplibregl-canvas { outline: none; }
.c-crit { color: var(--crit); } .c-warn { color: var(--warn); }

.v3-panel { position: fixed; z-index: 20; border-radius: 24px; background: var(--glass); border: 1px solid var(--glass-line);
    box-shadow: var(--inset), 0 20px 44px -22px var(--shadow-c); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); }

.v3-top { position: fixed; z-index: 20; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.v3-top > * { pointer-events: auto; }
.v3-head { position: relative; padding: 16px 20px 18px; max-width: 360px; }
.v3-head .brand { font-size: .95rem; margin: 0 0 10px; }
.v3-head h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; letter-spacing: -.01em; }
.v3-head .live { margin: 10px 0 0; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; font-size: .9rem; }
.v3-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.v3-stats div { padding: 10px 12px; border-radius: 16px; background: var(--shell); }
.v3-stats dt { font-weight: 400; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.v3-stats dd { margin: 0; font-size: 1.7rem; font-weight: 700; line-height: 1.1; }

.v3-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none !important; }
.v3-right > * { pointer-events: auto; }
.v3-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 700px; }
.v3-layers { display: contents; }   /* กลุ่มชั้นข้อมูล (ไว้บอก screen reader) จัดวางเหมือนอยู่ในแถวเดียวกัน */
.v3-chip, .v3-icon { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; text-decoration: none;
    border: 1px solid var(--glass-line); background: var(--glass); color: var(--muted); font: inherit; font-size: .95rem;
    box-shadow: var(--inset), 0 12px 28px -18px var(--shadow-c); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    transition: color .3s var(--ease), background-color .3s var(--ease), transform .4s var(--ease); }
.v3-icon { width: 44px; padding: 0; justify-content: center; color: var(--strong) !important; }
.v3-chip.on { color: var(--strong); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.v3-chip.on i { color: var(--accent); }
.v3-icon[aria-pressed="true"], .v3-icon[aria-expanded="true"] { color: var(--accent) !important; background: var(--accent-soft); }
.v3-info { display: none; }
.v3-chip:active, .v3-icon:active { transform: scale(.96); }

.v3-legend { left: 16px; bottom: 104px; width: min(300px, calc(100% - 32px)); max-height: calc(100dvh - 380px); overflow-y: auto; padding: 14px 18px; font-size: .9rem; }
.v3-legend .lg-title { color: var(--strong); font-weight: 600; margin: 0; }
/* ย่อเป็นค่าเริ่มต้น (ผู้ใช้แจ้ง 2026-09-30 ว่ากินพื้นที่): ของลอยน้ำ + จำนวน + สีจุดวัด แตะ "คำอธิบายเต็ม" ดูความหมายของหลอด/แท่ง/วงน้ำ มือถือซ่อนทั้งหมดจนกดปุ่ม i */
.v3-legend:not(.show) > :not(.lg-keep):not(.lg-fun):not(.lg-dots):not(.lg-more) { display: none; }
.v3-legend:not(.show) { padding: 12px 16px; }
.v3-legend:not(.show) .lg-fun { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 8px; }
.v3-legend:not(.show) .lg-fun small { display: none; }
.v3-legend:not(.show) .lg-dots { margin: 0; }
.lg-more { display: block; margin: 10px 0 0; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: .84rem; cursor: pointer; }
.lg-more:hover { text-decoration: underline; }
.v3-legend .lg-title + .lg-sub { margin-top: 2px; }
.v3-legend .lg-sub + .lg-title { margin-top: 10px; }
.v3-legend .lg-sub { color: var(--muted); font-size: .84rem; line-height: 1.45; margin: 0; }
.v3-legend ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; margin: 8px 0 12px; color: var(--text); }
.v3-legend ul:last-child { margin-bottom: 0; }
.v3-legend li i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.v3-legend .lg-fun { display: grid; gap: 6px; }
.lg-fun li { display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.lg-fun b { color: var(--strong); font-weight: 600; }
.lg-fun em { font-style: normal; font-size: .74rem; font-weight: 600; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.lg-fun small { display: block; color: var(--muted); font-size: .8rem; }

/* ใกล้คุณ (ใต้แถวปุ่ม) */
.v3-near { position: relative; width: 340px; padding: 8px 14px 10px 18px; }
.nr-head { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.nr-head i { color: var(--accent); }
.nr-x { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.nr-x:hover { background: var(--shell); color: var(--strong); }
.v3-near ul { list-style: none; margin: 2px 0 0; padding: 0; }
.nr-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 8px; align-items: center; width: calc(100% + 16px); padding: 6px 8px; margin: 0 -8px; border: 0; border-radius: 12px;
    background: none; color: var(--text); text-align: left; cursor: pointer; transition: background-color .25s var(--ease); }
.nr-row:hover { background: var(--shell); }
.nr-row > .mzi, .nr-dot { grid-row: span 2; justify-self: center; }
.nr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.nr-name { color: var(--strong); font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-meta { font-size: .8rem; color: var(--muted); }

.v3-tip { position: fixed; z-index: 30; pointer-events: none; max-width: 260px; padding: 10px 14px; border-radius: 14px; background: var(--core); color: var(--text);
    border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .9rem; line-height: 1.45; transform: translate(-50%, calc(-100% - 14px)); }
.v3-tip b { display: block; color: var(--strong); }
.v3d .t-crit { color: var(--crit); } .v3d .t-warn { color: var(--warn); } .v3d .t-ok { color: var(--ok); }
.v3-tip .t-fun { display: block; margin-top: 4px; color: var(--accent); font-weight: 600; }
.v3-note { position: fixed; z-index: 35; left: 50%; bottom: 104px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 16px;
    background: var(--core); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .9rem; text-align: center; }
.v3-err { position: fixed; z-index: 25; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 10px; align-items: center; max-width: calc(100% - 32px);
    padding: 14px 18px; border-radius: 18px; background: var(--core); border: 1px solid color-mix(in srgb, var(--crit) 40%, transparent); color: var(--text); }
.v3-err i { color: var(--crit); }

.v3-dock .dock-more { cursor: default; }
.v3-dock #slider:disabled { opacity: .45; cursor: default; }

/* MapLibre controls to match the glass language */
.v3d .maplibregl-ctrl-group { border-radius: 16px; overflow: hidden; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.v3d .maplibregl-ctrl-group button { width: 38px; height: 38px; }
.v3d .maplibregl-ctrl-group button + button { border-top-color: var(--line); }
.v3d .maplibregl-ctrl-bottom-right { bottom: 130px; }   /* ปุ่มซูม/เข็มทิศ อยู่ที่เดิมหลังย้าย credit ออกไปมุมจอ */
.v3d .maplibregl-ctrl-attrib { background: var(--glass); color: var(--muted); font-size: .72rem; }
.v3d .maplibregl-ctrl-attrib a { color: var(--accent); }
/* ปุ่ม i ของ credit อยู่มุมล่างขวาสุด (desktop ว่าง ไม่ทับ dock) ข้อความเด้งเป็น popover เหนือแนว dock */
.v3d .maplibregl-ctrl-attrib.maplibregl-compact, .v3d .maplibregl-ctrl-attrib.maplibregl-compact-show { position: fixed; right: 12px; bottom: 12px; margin: 0; padding: 0; min-height: 0; width: 24px; height: 24px; border-radius: 50%; }
.v3d .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button { left: auto; right: 0; }
.v3d .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner { position: absolute; right: 0; bottom: 74px; width: max-content; max-width: min(340px, calc(100vw - 24px)); padding: 6px 12px;
    border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); line-height: 1.5; }
@media (prefers-color-scheme: dark) { .v3d .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); } }

@media (max-width: 760px) {
    .v3-top { top: 10px; left: 10px; right: 10px; flex-direction: column; align-items: stretch; }
    .v3-head { max-width: none; padding: 12px 14px 14px; }
    .v3-right { align-items: stretch; gap: 8px; }
    .v3-head .brand { font-size: .82rem; margin-bottom: 4px; } .v3-head .brand img { width: 22px; height: 22px; }
    .v3-head h1 { font-size: 1.45rem; }
    .v3-stats { margin-top: 10px; gap: 6px; } .v3-stats div { padding: 7px 10px; } .v3-stats dd { font-size: 1.3rem; }
    .v3-tools { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; max-width: none; scrollbar-width: none; padding-bottom: 2px;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }   /* ขอบขวาจาง = เลื่อนดูต่อได้ */
    .v3-tools.at-end { -webkit-mask-image: none; mask-image: none; }
    .v3-tools::-webkit-scrollbar { display: none; }
    .v3-chip { padding: 0 13px; flex: none; } .v3-icon { flex: none; }
    .v3-info { display: inline-flex; }
    .v3-legend { display: none; left: 10px; right: 10px; width: auto; bottom: 112px; max-height: calc(100dvh - 430px); }
    .v3-legend.show { display: block; }
    .v3d .maplibregl-ctrl-bottom-right { bottom: 140px; }
    .v3d .maplibregl-ctrl-attrib.maplibregl-compact, .v3d .maplibregl-ctrl-attrib.maplibregl-compact-show { bottom: 108px; }   /* มือถือ dock เต็มความกว้าง: อยู่เหนือ dock ชิดขวา */
    .v3d .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner { bottom: 32px; }
    .v3-near { width: auto; padding: 4px 8px 6px 14px; border-radius: 18px; }
    .nr-row { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 4px 8px; }
    .nr-row > .mzi, .nr-dot { grid-row: auto; }
    .nr-name { font-size: .86rem; } .nr-meta { font-size: .76rem; white-space: nowrap; }
    .v3-note { bottom: 120px; }
}
@media (prefers-reduced-motion: reduce) { .v3-chip, .v3-icon { transition: none; } }

/* ---------- fun layer: sprites ride on top of each water column (JS sets translate/scale per frame; CSS animates inside) ---------- */
.v3d { --mz-water: #66bfe6; --mz-foam: #ffffff; --mz-ink: #182530; --mz-jet: #ff5436; --mz-jet-2: #ffb21f; --mz-hull: #f6fafc; --mz-glass: #9fd9f4;
    --mz-skin: #f1c39c; --mz-vest: #ff8a00; --mz-jeans: #2b4c7e; --mz-helmet: #ffd21f; --mz-duck: #ffd52e; --mz-duck-2: #ffb300; --mz-beak: #ff7a1a;
    --mz-sub: #5f7385; --mz-sub-2: #435566; --mz-sub-3: #9db0c1; }
@media (prefers-color-scheme: dark) { .v3d { --mz-water: #2d8cc2; --mz-sub: #7a91a6; --mz-sub-2: #566c80; --mz-sub-3: #b9cad8; --mz-ink: #0a121a; } }
.v3-fx, .v3-fun { position: absolute; inset: 0; pointer-events: none; }
.v3-fx { width: 100%; height: 100%; }
.v3-fun { overflow: hidden; z-index: 5; }   /* stacking context ของตัวการ์ตูน: ป้ายชื่อ (15) อยู่เหนือ แผงควบคุม (20) อยู่เหนือทั้งคู่ */
.mz { position: absolute; left: 0; top: 0; transform-origin: 0 0; transition: opacity .4s var(--ease); }
.mz.gone, .mz.bye { opacity: 0; }
.mz-pop { position: absolute; width: var(--w); height: var(--h); left: calc(var(--w) / -2); top: calc(var(--h) * var(--ay) * -1); transform-origin: 50% calc(var(--ay) * 100%);
    pointer-events: auto; cursor: pointer; animation: mzPop .7s cubic-bezier(.34, 1.56, .64, 1) both; }
.mz.gone .mz-pop, .mz.bye .mz-pop { pointer-events: none; }
.mz-in, .mz-bob { position: absolute; inset: 0; transform-origin: 50% calc(var(--ay) * 100%); }
.mz svg, .mzi svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mzi { position: relative; display: inline-block; flex: none; height: 24px; }
.mzi .mz-bob { position: absolute; inset: 0; }
.mzi-duck { width: 30px; } .mzi-jet { width: 40px; } .mzi-sub { width: 45px; }
@keyframes mzPop { from { transform: scale(.15) translateY(40%); opacity: 0; } 50% { opacity: 1; } to { transform: none; } }

.w-pool { fill: var(--mz-water); opacity: .92; }
.w-ring, .w-wake, .w-rip, .foam-s, .j-line, .j-bar, .j-legs, .j-vest, .j-arm, .s-mast, .s-shine { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.w-ring, .w-wake, .w-rip { stroke: var(--mz-foam); stroke-width: 1.6; opacity: .8; }
.w-front, .foam { fill: var(--mz-foam); } .foam-s { stroke: var(--mz-foam); stroke-width: 5; }
.j-hull, .j-deck, .j-seat, .j-glass, .j-face, .j-helmet, .d-body, .d-beak, .s-hull, .s-sail, .s-fin { stroke: var(--mz-ink); stroke-width: 1.5; stroke-linejoin: round; }
.j-hull { fill: var(--mz-hull); } .j-deck { fill: var(--mz-jet); } .j-line { stroke: var(--mz-jet-2); stroke-width: 2.4; }
.j-seat, .j-visor { fill: var(--mz-ink); } .j-glass { fill: var(--mz-glass); } .j-bar { stroke: var(--mz-ink); stroke-width: 3.4; }
.j-legs { stroke: var(--mz-jeans); stroke-width: 5.5; } .j-vest { stroke: var(--mz-vest); stroke-width: 10.5; } .j-arm { stroke: var(--mz-skin); stroke-width: 3.6; }
.j-face { fill: var(--mz-skin); } .j-helmet { fill: var(--mz-helmet); }
.d-body { fill: var(--mz-duck); } .d-wing { fill: var(--mz-duck-2); } .d-beak { fill: var(--mz-beak); } .d-eye { fill: var(--mz-ink); } .d-shine { fill: #fff; } .d-cheek { fill: #ff8b7a; opacity: .7; }
.s-hull, .s-sail { fill: var(--mz-sub); } .s-fin { fill: var(--mz-sub-2); } .s-shine { stroke: var(--mz-sub-3); stroke-width: 2; } .s-ink, .s-prop { fill: var(--mz-ink); }
.s-mast { stroke: var(--mz-ink); stroke-width: 1.4; } .s-ghost { fill: var(--mz-sub-2); opacity: .3; }
.s-num { fill: #fff; font-size: 8.4px; font-weight: 700; letter-spacing: .02em; }
.f-r { fill: #e02b35; } .f-w { fill: #fff; } .f-b { fill: #27358f; }

/* motion: ride back and forth and turn around (the hull number turns back so it never reads mirrored) */
.mz-jet .mz-in { --x: 7px; animation: mzPatrol 9s ease-in-out var(--d) infinite; }
.mz-duck .mz-in { --x: 3px; animation: mzPatrol 15s ease-in-out var(--d) infinite; }
.mz-sub .mz-in { --x: 10px; animation: mzPatrol 20s ease-in-out var(--d) infinite; }
.mz-sub .s-num { transform-box: fill-box; transform-origin: 50% 50%; animation: mzFlip 20s ease-in-out var(--d) infinite; }
@keyframes mzPatrol { 0% { transform: translateX(calc(var(--x) * -1)) scaleX(1); } 45% { transform: translateX(var(--x)) scaleX(1); } 50% { transform: translateX(var(--x)) scaleX(-1); }
    95% { transform: translateX(calc(var(--x) * -1)) scaleX(-1); } 100% { transform: translateX(calc(var(--x) * -1)) scaleX(1); } }
@keyframes mzFlip { 0%, 45% { transform: scaleX(1); } 50%, 95% { transform: scaleX(-1); } 100% { transform: scaleX(1); } }
.mz-jet .mz-bob { animation: jetBob .8s ease-in-out var(--d) infinite alternate; }
@keyframes jetBob { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-1.5px) rotate(1.8deg); } }
.mz .j-jump { transform-box: fill-box; transform-origin: 40% 100%; animation: jetJump 5.5s ease-in-out var(--d) infinite; }
@keyframes jetJump { 0%, 70%, 100% { transform: none; } 77% { transform: translateY(-10px) rotate(-9deg); } 85% { transform: translateY(-1px) rotate(3deg); } 89% { transform: none; } }
.mz .j-spray { transform-box: fill-box; transform-origin: 100% 100%; animation: jetSpray .32s ease-in-out infinite alternate; }
@keyframes jetSpray { from { transform: scale(.82); opacity: .7; } to { transform: scale(1.06); opacity: 1; } }
.mz .w-wake { stroke-dasharray: 5 4; animation: wake .5s linear infinite; }
@keyframes wake { to { stroke-dashoffset: 9; } }
.mz-duck .mz-bob { animation: duckBob 2.4s ease-in-out var(--d) infinite; }
@keyframes duckBob { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(5deg) translateY(-1.5px); } }
.mz .w-rip { transform-box: fill-box; transform-origin: 50% 50%; animation: rip 2.6s ease-out var(--d) infinite; }
.mz .w-rip + .w-rip { animation-delay: calc(var(--d) - 1.3s); }
@keyframes rip { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
.mz .s-dive { animation: subDive 13s ease-in-out var(--d) infinite; }
@keyframes subDive { 0%, 46%, 100% { transform: translateY(0); } 56%, 80% { transform: translateY(22px); } 90% { transform: translateY(-2px); } 94% { transform: translateY(0); } }
.mz .s-peri { animation: subPeri 13s ease-in-out var(--d) infinite; }
@keyframes subPeri { 0%, 48%, 88%, 100% { transform: translateY(15px); } 58%, 80% { transform: translateY(0); } }
.mz .s-bubs circle { transform-box: fill-box; animation: bub 2.2s ease-in var(--d) infinite; }
.mz .s-bubs circle:nth-child(2) { animation-delay: calc(var(--d) - .7s); } .mz .s-bubs circle:nth-child(3) { animation-delay: calc(var(--d) - 1.5s); }
@keyframes bub { from { transform: translateY(0); opacity: 0; } 25% { opacity: .95; } to { transform: translateY(-18px); opacity: 0; } }
.mz .s-flag { transform-box: fill-box; transform-origin: 100% 50%; animation: flag 1s ease-in-out infinite alternate; }
@keyframes flag { from { transform: skewY(5deg) scaleX(.93); } to { transform: skewY(-5deg); } }
.mz .s-prop { transform-box: fill-box; transform-origin: 50% 50%; animation: prop .24s linear infinite; }
@keyframes prop { 50% { transform: scaleY(.2); } }

/* คุณอยู่ที่นี่ (เสาแสงกับวงคลื่นวาดบน canvas .v3-fx) */
.mz-me { position: absolute; left: 0; top: 0; z-index: 99999; }
.me-dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.me-tag { position: absolute; left: 0; bottom: 16px; transform: translateX(-50%); white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
    font-size: .8rem; font-weight: 600; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45); }
@media (prefers-reduced-motion: reduce) { .mz, .mz * { animation: none !important; transition: none !important; } }

/* ---------- รุ่น 2026-09-30: ป้ายชื่อไทย, พาชม, เหรียญ ---------- */
.v3-labels { position: absolute; inset: 0; pointer-events: none; z-index: 15; overflow: hidden; font-family: var(--font); }
.v3-lb { position: absolute; left: 0; top: 0; white-space: nowrap; transition: opacity .35s var(--ease); will-change: transform; }
.v3-lb.off { opacity: 0; }
.lb-d { transform-origin: 0 0; margin: -10px 0 0 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--strong); opacity: .55; text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); translate: -50% 0; }
.lb-d.off { opacity: 0; }
.lb-h, .lb-v { translate: -50% -100%; display: flex; flex-direction: column; align-items: center; padding: 4px 9px 5px; border-radius: 10px; background: var(--glass); border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .6); font-size: 12px; line-height: 1.25; }
.lb-h b, .lb-v b { color: var(--strong); font-weight: 600; font-size: 12.5px; } .lb-h span, .lb-v span { color: var(--muted); font-size: 11.5px; }
.lb-h.lv-crit { border-color: color-mix(in srgb, var(--crit) 60%, transparent); } .lb-h.lv-crit span { color: var(--crit); }
.lb-h.lv-warn { border-color: color-mix(in srgb, var(--warn) 60%, transparent); } .lb-h.lv-warn span { color: var(--warn); }
.lb-h::after, .lb-v::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 1.5px; height: 6px; background: var(--glass-line); }
.lb-v { border-color: color-mix(in srgb, var(--accent) 50%, transparent); } .lb-v b::before { content: "แม่น้ำ · "; color: var(--accent); font-weight: 500; } .lb-v.near span { color: var(--warn); }
.v3-tour.on, .v3-tour[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.v3-tourcard { position: absolute; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; width: min(460px, calc(100% - 24px)); padding: 16px 18px 12px; animation: tcIn .5s var(--ease-out) both; }
.v3-tourcard[hidden] { display: none; }
@keyframes tcIn { from { opacity: 0; transform: translate(-50%, 16px); } }
.tc-step { color: var(--accent); font-size: .85rem; font-weight: 600; } .v3-tourcard h3 { font-size: 1.35rem; margin: 2px 0 0; } .tc-sub { color: var(--muted); font-size: .9rem; }
.tc-val { margin-top: 6px; } .tc-val b { font-size: 1.6rem; color: var(--strong); margin-right: 6px; }
.tc-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tc-acts button, .tc-link { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--core); color: var(--strong); font: inherit; font-size: .92rem; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
#tourNext { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tc-bar { height: 3px; border-radius: 3px; background: var(--line); margin-top: 12px; overflow: hidden; } .tc-bar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; animation: tcBar var(--t) linear both 4.2s; }
body.tour-paused .tc-bar { visibility: hidden; }
@keyframes tcBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.lg-badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 6px 0 0; list-style: none; }
.lg-badges li { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; border: 1px dashed var(--line-2); color: var(--faint); font-size: .8rem; }
.lg-badges li.on { border-style: solid; border-color: #e3a82b; color: var(--strong); } .lg-badges li.on i { color: #e3a82b; }
.v3-badge { position: fixed; left: 50%; top: 88px; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: 20px; background: var(--core); border: 1px solid #e3a82b;
    box-shadow: 0 20px 44px -20px rgba(0, 0, 0, .7); transform: translate(-50%, -30px) scale(.9); opacity: 0; transition: transform .6s var(--ease-out), opacity .4s var(--ease); max-width: calc(100% - 24px); }
.v3-badge.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.v3-badge small { display: block; color: #e3a82b; font-size: .8rem; font-weight: 600; } .v3-badge b { display: block; color: var(--strong); } .v3-badge span { display: block; color: var(--muted); font-size: .85rem; }
.bd-medal { width: 48px; height: 48px; flex: none; } .bd-rib { fill: #cc3d3b; } .bd-rib.r { fill: #1f6f99; } .bd-disc { fill: #e3a82b; stroke: #fff3c8; stroke-width: 2; } .bd-star { fill: #fff3c8; }
.v3-badge.show .bd-medal { animation: bdSpin 1.2s var(--ease-out) both; }
@keyframes bdSpin { from { transform: rotateY(360deg) scale(.6); } }
.bd-conf { position: absolute; left: 30px; top: 30px; pointer-events: none; }
.bd-conf i { position: absolute; width: 6px; height: 10px; border-radius: 2px; background: #e3a82b; opacity: 0; }
.v3-badge.show .bd-conf i { animation: bdConf 1.3s var(--ease-out) both; }
.bd-conf i:nth-child(3n) { background: #cc3d3b; } .bd-conf i:nth-child(3n+1) { background: #7cc4e8; }
.v3-badge.show .bd-conf i:nth-child(1) { --dx: 81px; --dy: 0px; --r: 47deg; animation-delay: 0.01s; }
.v3-badge.show .bd-conf i:nth-child(2) { --dx: 56px; --dy: 25px; --r: 94deg; animation-delay: 0.03s; }
.v3-badge.show .bd-conf i:nth-child(3) { --dx: 20px; --dy: 38px; --r: 141deg; animation-delay: 0.04s; }
.v3-badge.show .bd-conf i:nth-child(4) { --dx: -20px; --dy: 38px; --r: 188deg; animation-delay: 0.06s; }
.v3-badge.show .bd-conf i:nth-child(5) { --dx: -56px; --dy: 25px; --r: 235deg; animation-delay: 0.07s; }
.v3-badge.show .bd-conf i:nth-child(6) { --dx: -81px; --dy: 0px; --r: 282deg; animation-delay: 0.09s; }
.v3-badge.show .bd-conf i:nth-child(7) { --dx: -90px; --dy: -30px; --r: 329deg; animation-delay: 0.10s; }
.v3-badge.show .bd-conf i:nth-child(8) { --dx: -81px; --dy: -60px; --r: 16deg; animation-delay: 0.12s; }
.v3-badge.show .bd-conf i:nth-child(9) { --dx: -56px; --dy: -85px; --r: 63deg; animation-delay: 0.14s; }
.v3-badge.show .bd-conf i:nth-child(10) { --dx: -20px; --dy: -98px; --r: 110deg; animation-delay: 0.15s; }
.v3-badge.show .bd-conf i:nth-child(11) { --dx: 20px; --dy: -98px; --r: 157deg; animation-delay: 0.16s; }
.v3-badge.show .bd-conf i:nth-child(12) { --dx: 56px; --dy: -85px; --r: 204deg; animation-delay: 0.18s; }
.v3-badge.show .bd-conf i:nth-child(13) { --dx: 81px; --dy: -60px; --r: 251deg; animation-delay: 0.20s; }
.v3-badge.show .bd-conf i:nth-child(14) { --dx: 90px; --dy: -30px; --r: 298deg; animation-delay: 0.21s; }
@keyframes bdConf { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .v3-tourcard, .tc-bar i, .v3-badge.show .bd-medal, .bd-conf { animation: none !important; } .bd-conf { display: none; } .v3-lb, .v3-badge { transition: none; } }
