/* ==========================================================================
   คืนวันเพ็ญริมน้ำ — Private Loy Krathong for Two Friends
   Design Language: Boutique Nocturnal Editorial • 100% Prompt Typography
   ========================================================================== */

:root {
  --ink-night: #060b16;
  --ink-river: #0b1629;
  --surface-glass: rgba(10, 18, 34, 0.64);
  --surface-sheet: rgba(11, 19, 36, 0.94);
  --surface-elevated: rgba(255, 255, 255, 0.045);
  --border-subtle: rgba(246, 239, 226, 0.12);
  --border-strong: rgba(232, 184, 109, 0.48);

  --champagne: #f6efe2;
  --gold-soft: #f3d497;
  --gold-accent: #e0ad5e;
  --celadon: #8cc5d6;

  --text-main: #f5f2eb;
  --text-secondary: #b9c3d4;
  --text-muted: #7e8ba1;

  --font-sans: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sheet: 24px;
  --radius-card: 18px;
  --radius-control: 12px;
  --radius-pill: 999px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--ink-night);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button,
input,
textarea {
  font-family: var(--font-sans);
}

.is-hidden {
  display: none !important;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 1.5px solid var(--gold-soft);
  outline-offset: 2px;
}

/* ==========================================================================
   Full-Viewport Interactive River Scene
   ========================================================================== */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#bgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.river-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
  perspective: 900px;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(243, 212, 151, 0.04) 0%, transparent 55%),
    linear-gradient(180deg, rgba(4, 8, 17, 0.38) 0%, transparent 18%, transparent 80%, rgba(4, 8, 17, 0.68) 100%);
}

/* ==========================================================================
   Editorial Minimal HUD Header
   ========================================================================== */
.hud-header {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: calc(20px + var(--safe-left));
  right: calc(20px + var(--safe-right));
  max-width: 1360px;
  margin: 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
  animation: enterFromTop 0.9s var(--ease-out-expo) both;
}

.hud-brand,
.hud-pair,
.hud-controls {
  pointer-events: auto;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 15px 7px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  border: 1px solid var(--border-subtle);
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(243, 212, 151, 0.08);
  border: 1px solid rgba(243, 212, 151, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--champagne);
  line-height: 1.2;
  white-space: nowrap;
}

.brand-copy p {
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Center 2-Person Status Bar */
.hud-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  border: 1px solid var(--border-subtle);
}

.pair-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--champagne);
  font-size: 0.78rem;
  font-weight: 400;
  max-width: 148px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pair-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pair-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
}

.chip-indicator {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 8px var(--gold-soft);
}

.pair-chip.is-empty {
  color: var(--text-muted);
}

.pair-chip.is-empty .chip-indicator {
  background: rgba(148, 163, 184, 0.38);
  box-shadow: none;
}

.pair-divider {
  width: 16px;
  height: 1px;
  background: rgba(246, 239, 226, 0.18);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.pair-divider.is-joined {
  background: var(--gold-soft);
  box-shadow: 0 0 8px rgba(243, 212, 151, 0.65);
}

/* Right Controls */
.hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  transition:
    transform 0.22s var(--ease-out-expo),
    border-color 0.22s ease,
    background 0.22s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--gold-soft);
}

.icon-btn:hover {
  transform: translateY(-1.5px);
  border-color: var(--border-strong);
  background: rgba(22, 34, 58, 0.78);
}

.icon-btn:active {
  transform: translateY(0) scale(0.97);
}

.icon-btn-accent {
  border-color: rgba(243, 212, 151, 0.34);
  background: rgba(243, 212, 151, 0.1);
}

.icon-btn-round {
  width: 40px;
  padding: 0;
}

.icon-btn-round.sound-active {
  border-color: var(--gold-soft);
  background: rgba(243, 212, 151, 0.16);
}

/* ==========================================================================
   Subtle Guide Pill & Bottom Action Bar
   ========================================================================== */
.guide-pill {
  position: fixed;
  top: calc(76px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  max-width: calc(100% - 32px);
  padding: 5px 15px;
  border-radius: var(--radius-pill);
  background: rgba(8, 15, 28, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: clamp(0.68rem, 1.4vw, 0.76rem);
  font-weight: 300;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.8s ease, transform 0.8s ease;
  animation: fadeIn 1.1s ease 0.35s both;
}

.guide-pill.fade-out {
  opacity: 0;
  transform: translate(-50%, -6px);
}

.bottom-bar {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 28px);
  animation: enterFromBottom 0.9s var(--ease-out-expo) 0.15s both;
}

.btn-main-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 245, 220, 0.65);
  background: linear-gradient(180deg, #f5d89e 0%, #dda859 100%);
  color: #181106;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.48),
    0 0 28px rgba(224, 173, 94, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
}

.btn-main-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(224, 173, 94, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.btn-main-cta:active {
  transform: translateY(0) scale(0.98);
}

.cta-arrow {
  width: 17px;
  height: 17px;
  transition: transform 0.22s var(--ease-out-expo);
}

.btn-main-cta:hover .cta-arrow {
  transform: translateX(3px);
}

.btn-sheen {
  position: absolute;
  top: 0;
  left: -130%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.5) 50%, transparent 80%);
  animation: sheenSweep 4.4s ease-in-out infinite;
}

.btn-sub-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--champagne);
  font-size: 0.86rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.22s var(--ease-out-expo);
}

.btn-sub-cta:hover {
  border-color: var(--border-strong);
  background: rgba(243, 212, 151, 0.12);
  transform: translateY(-1.5px);
}

/* ==========================================================================
   Floating Krathongs & Cinematic 3D Launch Sequence
   ========================================================================== */
.krathong-node {
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  margin-left: -70px;
  margin-top: -106px;
  transform-origin: 70px 106px;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  transition: filter 0.3s ease;
}

.krathong-node:hover,
.krathong-node.is-selected {
  filter: brightness(1.12) drop-shadow(0 0 22px rgba(243, 212, 151, 0.55));
  z-index: 950 !important;
}

.krathong-bob {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: naturalWaveBob var(--bob-duration, 4.4s) ease-in-out infinite;
  animation-delay: var(--bob-delay, 0s);
}

/* WOW 3D Pier-to-River Release Arc */
.krathong-node.just-launched .krathong-bob {
  animation: cinematicReleaseArc 1.55s var(--ease-out-expo) both;
}

.krathong-water-glow {
  position: absolute;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  width: 136px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--glow-color, rgba(243, 212, 151, 0.52)) 0%, transparent 72%);
  filter: blur(6px);
  pointer-events: none;
  animation: waterReflectionBreathe 2.8s ease-in-out infinite alternate;
}

.krathong-selected-ring {
  position: absolute;
  top: 94px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(243, 212, 151, 0.8);
  box-shadow: 0 0 14px rgba(243, 212, 151, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.krathong-node.is-selected .krathong-selected-ring {
  opacity: 1;
  animation: ringExpandPulse 2s ease-in-out infinite;
}

.krathong-svg-wrap {
  position: relative;
  width: 124px;
  height: 118px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.krathong-svg-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.krathong-name-tag {
  margin-top: 3px;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: rgba(8, 15, 28, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(246, 239, 226, 0.2);
  font-size: 0.71rem;
  font-weight: 400;
  color: var(--champagne);
  white-space: nowrap;
  max-width: 146px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38);
}

/* Empty Friend Spot on the Water */
.friend-spot-node {
  position: absolute;
  top: 0;
  left: 0;
  width: 156px;
  margin-left: -78px;
  margin-top: -36px;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 40;
}

.friend-spot-ring {
  width: 106px;
  height: 26px;
  border-radius: 50%;
  border: 1px dashed rgba(243, 212, 151, 0.52);
  background: radial-gradient(ellipse at center, rgba(243, 212, 151, 0.14) 0%, transparent 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
  font-size: 0.9rem;
  font-weight: 300;
  animation: spotBreathe 2.6s ease-in-out infinite;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.friend-spot-label {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(10, 18, 34, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 400;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.friend-spot-node:hover .friend-spot-ring {
  border-color: var(--gold-soft);
  background: radial-gradient(ellipse at center, rgba(243, 212, 151, 0.26) 0%, transparent 72%);
}

.friend-spot-node:hover .friend-spot-label {
  color: var(--champagne);
  border-color: var(--border-strong);
}

/* SVG Animated Sub-Elements */
.svg-flame-outer {
  transform-origin: 0px 0px;
  animation: flameDance 1.3s ease-in-out infinite alternate;
}

.svg-flame-inner {
  transform-origin: 0px 0px;
  animation: flameCore 0.9s ease-in-out infinite alternate;
}

.svg-candle-halo {
  transform-origin: 0px 0px;
  animation: haloBreathe 2.4s ease-in-out infinite alternate;
}

.svg-smoke {
  animation: incenseDrift 3.6s ease-in-out infinite;
}

.svg-smoke-2 {
  animation: incenseDrift 4.1s ease-in-out 1.4s infinite;
}

.svg-sparkle-1 {
  animation: emberFloat 2.9s ease-in-out infinite;
}

.svg-sparkle-2 {
  animation: emberFloat 3.4s ease-in-out 1.2s infinite;
}

/* ==========================================================================
   Live-Tracked Wish Card (Clean Editorial Typography)
   ========================================================================== */
.wish-card {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 45;
  width: min(334px, calc(100vw - 24px));
  padding: 18px 20px;
  border-radius: var(--radius-card);
  background: var(--surface-sheet);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(243, 212, 151, 0.28);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.65);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.94) translateY(8px);
  transition:
    opacity 0.24s var(--ease-out-expo),
    transform 0.24s var(--ease-out-expo),
    visibility 0.24s;
}

.wish-card.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.wish-card-arrow {
  position: absolute;
  width: 11px;
  height: 11px;
  background: var(--surface-sheet);
  border-right: 1px solid rgba(243, 212, 151, 0.28);
  border-bottom: 1px solid rgba(243, 212, 151, 0.28);
  transform: translateX(-50%) rotate(45deg);
  bottom: -6px;
  left: 50%;
  pointer-events: none;
}

.wish-card.arrow-top .wish-card-arrow {
  bottom: auto;
  top: -6px;
  transform: translateX(-50%) rotate(225deg);
}

.card-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.22s var(--ease-out-expo);
}

.card-close svg {
  width: 14px;
  height: 14px;
}

.card-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: rotate(90deg);
}

.wish-card .card-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.wish-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 32px;
  margin-bottom: 10px;
}

.meta-tag {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: rgba(243, 212, 151, 0.12);
  border: 1px solid rgba(243, 212, 151, 0.26);
  color: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 500;
}

.meta-style {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 300;
}

.wish-card-body {
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--champagne);
  margin-bottom: 12px;
  max-height: 118px;
  overflow-y: auto;
  word-break: break-word;
  user-select: text;
}

.wish-card-body.is-locked-note {
  font-size: 0.84rem;
  font-weight: 300;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(243, 212, 151, 0.06);
  border: 1px dashed rgba(243, 212, 151, 0.3);
  color: var(--gold-soft);
}

.wish-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.wish-card-author {
  font-size: 0.77rem;
  font-weight: 300;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wish-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mini-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mini-action-btn svg {
  width: 14px;
  height: 14px;
}

.mini-action-btn:hover {
  color: var(--champagne);
  border-color: var(--border-strong);
  background: rgba(243, 212, 151, 0.12);
}

.btn-cheer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(243, 212, 151, 0.36);
  background: rgba(243, 212, 151, 0.1);
  color: var(--gold-soft);
  font-size: 0.74rem;
  font-weight: 400;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease;
}

.btn-cheer svg {
  width: 13px;
  height: 13px;
}

.btn-cheer:hover {
  background: rgba(243, 212, 151, 0.2);
  transform: scale(1.04);
}

.cheer-count {
  font-weight: 500;
}

/* Floating Golden Star Sparkle on Cheer */
.spark-mote {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 10px var(--gold-soft);
  pointer-events: none;
  z-index: 65;
  animation: sparkRise 0.95s var(--ease-out-expo) forwards;
}

/* ==========================================================================
   Mandatory Room Lobby Gate (Create / Join Room before Floating)
   ========================================================================== */
.lobby-backdrop {
  position: fixed;
  inset: 0;
  z-index: 68;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: rgba(4, 8, 18, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out-expo), visibility 0.35s;
}

.lobby-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lobby-card {
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
  padding: 28px 24px 20px;
  border-radius: 26px;
  background: linear-gradient(168deg, rgba(16, 26, 48, 0.94), rgba(8, 14, 28, 0.96));
  border: 1px solid rgba(243, 212, 151, 0.28);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.38s var(--ease-out-expo);
}

.lobby-backdrop.is-open .lobby-card {
  transform: translateY(0) scale(1);
}

.lobby-emblem {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(243, 212, 151, 0.1);
  border: 1px solid rgba(243, 212, 151, 0.35);
  box-shadow: 0 0 28px rgba(243, 212, 151, 0.18);
}

.lobby-emblem svg {
  width: 28px;
  height: 28px;
}

.lobby-title {
  font-size: clamp(1.22rem, 3.6vw, 1.44rem);
  font-weight: 500;
  color: var(--champagne);
  margin: 4px 0 6px;
  text-wrap: balance;
}

.lobby-desc {
  font-size: 0.81rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-wrap: balance;
}

.lobby-tabs {
  margin-bottom: 16px;
  text-align: left;
}

.lobby-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.lobby-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.lobby-mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.lobby-mode-card:hover {
  border-color: rgba(243, 212, 151, 0.36);
  background: rgba(243, 212, 151, 0.06);
}

.lobby-mode-card.active {
  border-color: var(--gold-soft);
  background: rgba(243, 212, 151, 0.13);
  color: var(--champagne);
  box-shadow: 0 0 0 1px rgba(243, 212, 151, 0.2);
}

.lobby-mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(243, 212, 151, 0.14);
  color: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.lobby-mode-card strong {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--champagne);
}

.lobby-mode-card small {
  font-size: 0.71rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.35;
}

.lobby-mode-card.active small {
  color: var(--text-secondary);
}

.lobby-code-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 12px 14px;
  color: var(--gold-soft);
}

.lobby-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dev-credit-inline {
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.72;
}

.dev-credit {
  position: fixed;
  right: calc(18px + var(--safe-right));
  bottom: calc(14px + var(--safe-bottom));
  z-index: 15;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(246, 239, 226, 0.42);
  pointer-events: none;
  user-select: none;
  transition: opacity 0.25s ease;
}

body.zen-mode .dev-credit,
body.lobby-locked .dev-credit {
  opacity: 0;
}

@media (max-width: 820px) {
  .dev-credit {
    display: none;
  }
}

body.lobby-locked .hud-header,
body.lobby-locked .bottom-bar,
body.lobby-locked .quick-magic-dock,
body.lobby-locked .guide-pill {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

@media (max-width: 420px) {
  .lobby-card {
    padding: 22px 16px 16px;
    border-radius: 22px;
  }

  .lobby-mode-card {
    padding: 10px 10px;
  }

  .lobby-mode-card strong {
    font-size: 0.86rem;
  }

  .lobby-mode-card small {
    font-size: 0.67rem;
  }

  .wish-helper-tools {
    flex-wrap: wrap;
  }
}

@media (max-width: 340px) {
  .lobby-mode-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .lobby-card {
    width: min(500px, 100%);
    padding: 16px 20px 14px;
    border-radius: 20px;
  }

  .lobby-emblem {
    display: none;
  }

  .lobby-desc {
    margin-bottom: 10px;
  }

  .lobby-tabs {
    margin-bottom: 10px;
  }

  .lobby-form {
    gap: 10px;
  }
}

/* ==========================================================================
   Invitation Intro Backdrop (For Friend Opening Link)
   ========================================================================== */
.intro-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 9, 19, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.intro-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.intro-card {
  width: min(440px, 100%);
  padding: 36px 28px 30px;
  border-radius: 26px;
  text-align: center;
  background: linear-gradient(165deg, rgba(16, 27, 50, 0.94) 0%, rgba(9, 15, 30, 0.98) 100%);
  border: 1px solid rgba(243, 212, 151, 0.28);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.72);
  transform: translateY(18px) scale(0.96);
  transition: transform 0.45s var(--ease-out-expo);
}

.intro-backdrop.is-open .intro-card {
  transform: translateY(0) scale(1);
}

.intro-moon-graphic {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-moon-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 212, 151, 0.34) 0%, transparent 72%);
  animation: haloBreathe 2.8s ease-in-out infinite alternate;
}

.intro-moon-disc {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #f5dfb0 65%, #ddb168 100%);
  box-shadow: 0 0 24px rgba(243, 212, 151, 0.55);
}

.intro-kicker {
  display: block;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  margin-bottom: 8px;
  opacity: 0.85;
}

.intro-card h2 {
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--champagne);
  margin-bottom: 10px;
}

.intro-desc {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.intro-cta {
  width: 100%;
}

/* ==========================================================================
   Modal Sheets (Studio & Share/Postcard)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 8, 17, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-sheet {
  position: relative;
  width: min(920px, 100%);
  max-height: min(91dvh, 800px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-sheet);
  background: var(--surface-sheet);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 24px 26px;
  transform: translateY(22px) scale(0.97);
  transition: transform 0.34s var(--ease-out-expo);
}

.modal-overlay.is-open .modal-sheet {
  transform: translateY(0) scale(1);
}

.sheet-handle {
  display: none;
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 12px;
}

.modal-sheet::-webkit-scrollbar {
  width: 5px;
}

.modal-sheet::-webkit-scrollbar-thumb {
  background: rgba(246, 239, 226, 0.2);
  border-radius: 99px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.sheet-header h2 {
  font-size: clamp(1.12rem, 2vw, 1.3rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--champagne);
}

.sheet-sub {
  font-size: 0.79rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 2px;
  text-wrap: balance;
}

/* Clean Segmented 2-Slot Tabs */
.segmented-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 18px;
}

.seg-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.seg-tab:hover {
  color: var(--text-main);
}

.seg-tab.active {
  background: rgba(243, 212, 151, 0.12);
  border-color: rgba(243, 212, 151, 0.34);
  color: var(--champagne);
}

.seg-title {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg-meta {
  font-size: 0.71rem;
  font-weight: 300;
  color: var(--gold-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Studio 2-Column Layout */
.studio-layout {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 22px;
  align-items: stretch;
}

.studio-preview {
  position: relative;
  min-height: 330px;
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 22%, rgba(243, 212, 151, 0.15) 0%, transparent 56%),
    linear-gradient(180deg, #070e1e 0%, #0f1f3d 55%, #091d36 60%, #050d1c 100%);
  border: 1px solid var(--border-subtle);
  padding: 20px 16px 14px;
  transition: transform 0.18s ease-out;
}

.preview-moon {
  position: absolute;
  top: 24px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 224, 0.85) 0%, rgba(243, 212, 151, 0.22) 52%, transparent 74%);
  pointer-events: none;
}

.preview-water {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(243, 212, 151, 0.18) 0%, transparent 66%),
    repeating-linear-gradient(
      180deg,
      rgba(140, 197, 214, 0.04) 0px,
      rgba(140, 197, 214, 0.04) 1.5px,
      transparent 1.5px,
      transparent 10px
    );
  border-top: 1px solid rgba(246, 239, 226, 0.12);
  pointer-events: none;
}

.preview-ring {
  position: absolute;
  top: 32%;
  left: 50%;
  width: 120px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(243, 212, 151, 0.36);
  transform: translate(-50%, -50%) scale(0.5);
  animation: ringRippleOut 3.8s ease-out infinite;
}

.preview-ring-2 {
  animation-delay: 1.9s;
}

.preview-krathong {
  position: relative;
  z-index: 2;
  width: 196px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: naturalWaveBob 4s ease-in-out infinite;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.6));
  transition: transform 0.28s var(--ease-spring);
}

.preview-krathong.pop-refresh {
  transform: scale(1.06);
}

.preview-krathong svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.preview-footer-bar {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-meta-text {
  font-size: 0.74rem;
  font-weight: 300;
  color: var(--champagne);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.preview-meta-text span:first-child,
.preview-meta-text span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-dot {
  opacity: 0.45;
  flex-shrink: 0;
}

.btn-shuffle {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(6, 11, 22, 0.65);
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-shuffle svg {
  width: 13px;
  height: 13px;
  color: var(--gold-soft);
}

.btn-shuffle:hover {
  color: var(--champagne);
  border-color: var(--border-strong);
}

/* Studio Form Controls & Real Miniature SVG Picker */
.studio-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label {
  font-size: 0.77rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.char-counter {
  font-size: 0.71rem;
  font-weight: 300;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Miniature Real SVG Krathong Cards (Zero Emojis!) */
.style-Miniature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.style-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.22s var(--ease-out-expo);
}

.mini-svg-thumb {
  width: 44px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.24s var(--ease-spring);
}

.mini-svg-thumb svg {
  width: 100%;
  height: 100%;
}

.style-mini-card:hover {
  border-color: rgba(243, 212, 151, 0.35);
  color: var(--text-main);
}

.style-mini-card:hover .mini-svg-thumb {
  transform: translateY(-2px) scale(1.07);
}

.style-mini-card.active {
  background: rgba(243, 212, 151, 0.12);
  border-color: var(--gold-soft);
  color: var(--champagne);
}

.chip-group,
.swatch-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.18s ease;
}

.choice-chip:hover {
  border-color: rgba(243, 212, 151, 0.35);
  color: var(--text-main);
}

.choice-chip.active {
  background: rgba(243, 212, 151, 0.14);
  border-color: var(--gold-soft);
  color: var(--champagne);
}

.color-pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.field-input,
.field-textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 10, 20, 0.62);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: text;
}

.field-textarea {
  resize: none;
  line-height: 1.55;
}

.field-input:focus,
.field-textarea:focus {
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(243, 212, 151, 0.12);
}

.field-textarea.has-error {
  border-color: #f87171;
}

.field-error {
  font-size: 0.74rem;
  color: #fca5a5;
  display: none;
}

.field-error.visible {
  display: block;
}

.wish-helper-box {
  margin-top: 4px;
  padding: 10px 11px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(246, 239, 226, 0.09);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wish-helper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.wish-helper-title {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold-soft);
  letter-spacing: 0.02em;
}

.wish-helper-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wish-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.69rem;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.wish-tool-btn svg {
  width: 12px;
  height: 12px;
  color: var(--gold-soft);
}

.wish-tool-btn:hover {
  border-color: var(--border-strong);
  color: var(--champagne);
  background: rgba(243, 212, 151, 0.12);
}

.wish-tool-gold {
  border-color: rgba(243, 212, 151, 0.34);
  background: rgba(243, 212, 151, 0.1);
  color: var(--champagne);
}

.wish-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.wish-cat-btn {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.69rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.16s ease;
}

.wish-cat-btn:hover {
  color: var(--text-main);
}

.wish-cat-btn.active {
  background: rgba(243, 212, 151, 0.15);
  border-color: rgba(243, 212, 151, 0.42);
  color: var(--champagne);
}

.wish-fortune-card {
  width: 100%;
  margin: 0 0 11px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(243, 212, 151, 0.3);
  background: linear-gradient(155deg, rgba(243, 212, 151, 0.12), rgba(14, 24, 46, 0.72));
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.wish-fortune-card:hover {
  border-color: var(--gold-soft);
  background: linear-gradient(155deg, rgba(243, 212, 151, 0.18), rgba(18, 30, 56, 0.85));
  transform: translateY(-1px);
}

.wish-fortune-card.is-invite-shake {
  border-style: dashed;
  background: rgba(243, 212, 151, 0.05);
}

.wish-fortune-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wish-fortune-title {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--gold-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wish-fortune-cta {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--champagne);
  opacity: 0.85;
}

.wish-fortune-snippet {
  font-size: 0.72rem;
  font-weight: 300;
  line-height: 1.45;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fortune-card-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.fortune-card-top .fortune-num {
  margin-bottom: 0;
}

.fortune-owner-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(246, 239, 226, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--champagne);
  font-size: 0.7rem;
  font-weight: 400;
}

.fortune-ornament {
  width: 56px;
  height: 1px;
  margin: 0 auto 12px;
  background: linear-gradient(90deg, transparent, rgba(243, 212, 151, 0.65), transparent);
}

.preset-wishes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.preset-chip {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.71rem;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.18s ease;
}

.preset-chip:hover {
  border-color: var(--border-strong);
  background: rgba(243, 212, 151, 0.1);
  color: var(--champagne);
}

/* Modern Sliding Switch */
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.25);
  transition: background 0.22s ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: transform 0.22s var(--ease-spring), background 0.22s ease;
}

.switch-row input:checked + .switch-track {
  background: var(--gold-accent);
}

.switch-row input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
  background: #181106;
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.switch-copy strong {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--champagne);
}

.switch-copy small {
  font-size: 0.69rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.35;
}

.btn-submit-launch {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 245, 220, 0.65);
  background: linear-gradient(180deg, #f5d89e 0%, #dda859 100%);
  color: #181106;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s ease;
}

.btn-submit-launch:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 14px 34px rgba(224, 173, 94, 0.35);
}

/* ==========================================================================
   Soundscape Mixer Popover, Quick Atmosphere Dock & Zen Cinema Mode
   ========================================================================== */
.sound-control-wrap {
  position: relative;
}

.mixer-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 248px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-sheet);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 11px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.2s var(--ease-out-expo), transform 0.2s var(--ease-out-expo), visibility 0.2s;
  z-index: 60;
}

.mixer-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.mixer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--champagne);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mixer-master-btn {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(243, 212, 151, 0.4);
  background: rgba(243, 212, 151, 0.12);
  color: var(--gold-soft);
  font-size: 0.7rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mixer-master-btn.is-active {
  background: var(--gold-accent);
  color: #181106;
  font-weight: 500;
}

.mixer-layer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 300;
  color: var(--text-secondary);
}

.mixer-layer input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.mixer-layer input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold-soft);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(243, 212, 151, 0.5);
}

/* Quick Magic Atmosphere Dock */
.quick-magic-dock {
  position: fixed;
  left: calc(20px + var(--safe-left));
  bottom: calc(26px + var(--safe-bottom));
  z-index: 26;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100vw - 20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.magic-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(8, 15, 28, 0.56);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s var(--ease-out-expo);
}

.magic-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--gold-soft);
}

.magic-pill:hover {
  color: var(--champagne);
  border-color: var(--border-strong);
  background: rgba(243, 212, 151, 0.12);
  transform: translateY(-1.5px);
}

/* Zen Cinema Mode */
.hud-header,
.bottom-bar {
  transition: opacity 0.45s ease, transform 0.45s var(--ease-out-expo);
}

body.zen-mode .hud-header {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

body.zen-mode .bottom-bar,
body.zen-mode .quick-magic-dock,
body.zen-mode .guide-pill {
  opacity: 0;
  pointer-events: none;
}

.zen-exit-pill {
  position: fixed;
  bottom: calc(22px + var(--safe-bottom));
  right: calc(20px + var(--safe-right));
  z-index: 35;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(8, 15, 28, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zen-exit-pill:hover {
  color: var(--champagne);
  border-color: var(--border-strong);
}

.wish-fortune-pill {
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(243, 212, 151, 0.08);
  border: 1px solid rgba(243, 212, 151, 0.2);
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 300;
}

/* ==========================================================================
   Share Moment Studio & Invite Modal
   ========================================================================== */
.moment-sheet {
  width: min(920px, 100%);
}

.compact-sheet {
  width: min(520px, 100%);
}

.moment-studio-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  align-items: center;
}

.moment-preview-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(4, 8, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 360px;
}

.moment-canvas-stage {
  width: auto;
  max-width: 245px;
  max-height: 390px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(243, 212, 151, 0.28);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  transition: transform 0.2s ease-out;
}

#keepsakeCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 388px;
  object-fit: contain;
}

.moment-controls-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.moment-action-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

.moment-secondary-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.invite-pane-wrap {
  width: 100%;
}

.share-pane {
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.pane-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--champagne);
}

.pane-desc {
  font-size: 0.81rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-secondary);
}

.copy-bar {
  display: flex;
  gap: 8px;
}

.copy-url-input {
  flex: 1;
  min-width: 0;
  font-size: 0.77rem;
  color: var(--gold-soft);
}

.btn-copy {
  flex-shrink: 0;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(255, 245, 220, 0.55);
  background: linear-gradient(180deg, #f5d89e 0%, #dda859 100%);
  color: #181106;
  font-size: 0.81rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.btn-copy:hover {
  transform: translateY(-1px);
}

.sync-status-text {
  font-size: 0.74rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.45;
}

.pane-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 2px 0;
}

.btn-text-danger {
  align-self: flex-start;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-text-danger:hover {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

.active-room-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(243, 212, 151, 0.1);
  border: 1px solid rgba(243, 212, 151, 0.34);
}

.active-room-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--champagne);
}

.active-room-meta {
  display: block;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--gold-soft);
}

.btn-leave-room {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 11, 22, 0.55);
  color: var(--text-secondary);
  font-size: 0.73rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-leave-room:hover {
  color: #fff;
  border-color: var(--border-strong);
}

.invite-personal-preview {
  font-size: 0.72rem;
  font-weight: 300;
  line-height: 1.45;
  color: var(--gold-soft);
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(243, 212, 151, 0.08);
  border: 1px solid rgba(243, 212, 151, 0.24);
}

.join-code-input {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}

.btn-join-code {
  width: auto;
  flex-shrink: 0;
  padding: 0 18px;
}

.pane-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.btn-admin-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-admin-link:hover {
  color: var(--gold-soft);
  background: rgba(243, 212, 151, 0.08);
}

.hud-pair.is-quad .pair-chip {
  max-width: 104px;
  padding: 4px 9px;
  font-size: 0.72rem;
}

.hud-pair.is-quad .pair-divider {
  width: 10px;
}

.hud-pair .pair-group-sep {
  width: 1px;
  height: 16px;
  background: rgba(246, 239, 226, 0.18);
  margin: 0 2px;
}

.btn-outline-gold {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(243, 212, 151, 0.36);
  background: rgba(243, 212, 151, 0.08);
  color: var(--champagne);
  font-size: 0.78rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-gold:hover {
  background: rgba(243, 212, 151, 0.18);
  border-color: var(--gold-soft);
}

/* ==========================================================================
   Let It Go — Burn Away Worries Paper Ritual
   ========================================================================== */
.burn-stage-wrap {
  position: relative;
  width: 100%;
  height: 210px;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.14), rgba(5, 10, 20, 0.92) 70%);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  margin-bottom: 12px;
}

#burnCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.mulberry-paper {
  position: relative;
  z-index: 2;
  width: min(360px, 100%);
  padding: 14px 16px;
  border-radius: 8px;
  background: linear-gradient(165deg, #f5ecd8 0%, #e7d6b5 100%);
  border: 1px solid rgba(180, 140, 80, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transition: opacity 1.3s ease, transform 1.4s ease, filter 1.3s ease;
}

.mulberry-paper.is-burning {
  opacity: 0;
  transform: translateY(-18px) scale(0.93);
  filter: brightness(1.8) sepia(0.9) blur(3px);
  pointer-events: none;
}

.paper-kicker {
  display: block;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #78552b;
  margin-bottom: 6px;
}

.paper-textarea {
  width: 100%;
  border: none;
  background: transparent;
  color: #2c1e0f;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.5;
  resize: none;
  outline: none;
  user-select: text;
}

.paper-textarea::placeholder {
  color: rgba(92, 64, 32, 0.52);
}

.burn-after-msg {
  position: relative;
  z-index: 3;
  text-align: center;
  animation: fadeIn 0.8s ease both;
}

.burn-after-msg p {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gold-soft);
  margin-bottom: 4px;
}

.burn-after-msg small {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-secondary);
}

.burn-presets {
  margin-bottom: 14px;
}

/* ==========================================================================
   Moonlit Fortune Slip (เซียมซีแสงจันทร์) & Lantern Form
   ========================================================================== */
.fortune-stage {
  min-height: 230px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 25%, rgba(243, 212, 151, 0.12), rgba(6, 11, 22, 0.75) 75%);
  border: 1px solid var(--border-subtle);
  padding: 22px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fortune-tube-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.fortune-cylinder {
  position: relative;
  width: 74px;
  height: 122px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transform-origin: center bottom;
}

.fortune-cylinder.is-shaking {
  animation: bambooShake 0.45s ease-in-out 3;
}

.sticks-bundle {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: -8px;
}

.sticks-bundle span {
  width: 5px;
  height: 44px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #f87171 0%, #f5d89e 24%, #cfa05a 100%);
}

.sticks-bundle span:nth-child(2) { height: 52px; transform: rotate(-5deg); }
.sticks-bundle span:nth-child(3) { height: 56px; }
.sticks-bundle span:nth-child(4) { height: 50px; transform: rotate(6deg); }

.tube-body {
  width: 66px;
  height: 82px;
  border-radius: 8px 8px 14px 14px;
  background: linear-gradient(90deg, #5c3a1b 0%, #8c5a2b 48%, #4a2d13 100%);
  border: 1px solid rgba(243, 212, 151, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
  font-size: 0.74rem;
  font-weight: 500;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5);
}

.tube-hint {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-secondary);
}

.fortune-slip-card {
  width: 100%;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(243, 212, 151, 0.11), rgba(15, 25, 46, 0.85));
  border: 1px solid rgba(243, 212, 151, 0.38);
  text-align: center;
  animation: slipUnfold 0.45s var(--ease-out-expo) both;
}

.fortune-num {
  display: inline-block;
  padding: 2px 11px;
  border-radius: var(--radius-pill);
  background: rgba(243, 212, 151, 0.16);
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.fortune-heading {
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--champagne);
  margin-bottom: 8px;
}

.fortune-text {
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-main);
  margin-bottom: 12px;
}

.fortune-tag {
  font-size: 0.73rem;
  font-weight: 400;
  color: var(--gold-soft);
}

.lantern-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   New Interactive Features: QR Card, Mini Replies, Sync Countdown & Live Wishes
   ========================================================================== */
.invite-qr-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(246, 239, 226, 0.12);
}

#inviteQrCanvas {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f6efe2;
  padding: 4px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.invite-qr-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.invite-qr-info strong {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--champagne);
}

.invite-qr-info p {
  font-size: 0.71rem;
  font-weight: 300;
  line-height: 1.45;
  color: var(--text-muted);
}

.btn-qr-dl {
  margin-top: 4px;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.74rem;
  width: auto;
  align-self: flex-start;
}

/* Mini Reply Notes inside Krathong Wish Popover */
.wish-replies-wrap {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.wish-replies-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 82px;
  overflow-y: auto;
}

.wish-replies-list:empty {
  display: none;
}

.wish-reply-item {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  word-break: break-word;
}

.wish-reply-item strong {
  color: var(--gold-soft);
  font-weight: 500;
  margin-right: 4px;
}

.wish-reply-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wish-reply-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 10, 20, 0.65);
  color: var(--text-main);
  font-size: 0.74rem;
  outline: none;
  user-select: text;
}

.wish-reply-input:focus {
  border-color: var(--gold-soft);
}

.wish-reply-send {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(243, 212, 151, 0.4);
  background: rgba(243, 212, 151, 0.14);
  color: var(--champagne);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.wish-reply-send:hover {
  background: rgba(243, 212, 151, 0.26);
  border-color: var(--gold-soft);
}

/* IG-Live Style Floating Wish Composer Tray above Quick Dock */
.float-wish-tray {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px) scale(0.96);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  padding: 11px 12px;
  border-radius: 18px;
  background: var(--surface-sheet);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(243, 212, 151, 0.3);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.68);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out-expo), transform 0.2s var(--ease-out-expo), visibility 0.2s;
  z-index: 40;
}

.float-wish-tray.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.float-tray-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gold-soft);
  letter-spacing: 0.02em;
}

.float-tray-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #86efac;
  box-shadow: 0 0 8px rgba(134, 239, 172, 0.85);
}

.float-wish-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.float-wish-opt {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04);
  color: var(--champagne);
  font-size: 0.71rem;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.float-wish-opt:hover {
  border-color: var(--gold-soft);
  background: rgba(243, 212, 151, 0.16);
  transform: translateY(-1px);
}

.float-wish-opt:active {
  transform: scale(0.95);
}

.float-wish-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.float-wish-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 10, 20, 0.72);
  color: var(--text-main);
  font-size: 0.78rem;
  outline: none;
  user-select: text;
}

.float-wish-input:focus {
  border-color: var(--gold-soft);
}

.float-wish-send {
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 245, 220, 0.55);
  background: linear-gradient(180deg, #f5d89e 0%, #dda859 100%);
  color: #181106;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.16s ease;
}

.float-wish-send:hover {
  transform: translateY(-1px);
}

.float-wish-cancel {
  flex-shrink: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
}

.float-wish-cancel:hover {
  color: var(--champagne);
  border-color: var(--border-strong);
}

.float-my-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 118px;
  overflow-y: auto;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.float-my-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.float-my-item.is-editing {
  border-color: rgba(243, 212, 151, 0.5);
  background: rgba(243, 212, 151, 0.1);
}

.float-my-text {
  flex: 1;
  min-width: 0;
  font-size: 0.71rem;
  color: var(--champagne);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.float-my-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.float-my-btn {
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 11, 22, 0.55);
  color: var(--text-secondary);
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.float-my-btn:hover {
  color: var(--champagne);
  border-color: var(--gold-soft);
}

.float-my-btn.is-del:hover {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.12);
}

/* Persistent IG-Style Rotating Blessing Card at Bottom-Left Corner */
.floating-wishes-layer {
  position: fixed;
  left: calc(20px + var(--safe-left));
  bottom: calc(82px + var(--safe-bottom));
  max-width: min(320px, calc(100vw - 28px));
  z-index: 25;
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

body.zen-mode .floating-wishes-layer,
body.lobby-locked .floating-wishes-layer {
  opacity: 0;
  pointer-events: none;
}

.ig-note-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 7px 13px 7px 8px;
  border-radius: 999px;
  background: rgba(10, 18, 36, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(246, 239, 226, 0.2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}

.ig-note-card:hover {
  border-color: rgba(243, 212, 151, 0.5);
  transform: translateY(-1px);
}

.ig-note-card.is-peer {
  border-color: rgba(243, 212, 151, 0.46);
  background: linear-gradient(135deg, rgba(243, 212, 151, 0.16), rgba(10, 18, 36, 0.88));
}

.ig-note-card.is-pulse {
  animation: igCardPulse 0.65s var(--ease-out-expo);
}

.ig-live-avatar {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #181106;
  background: linear-gradient(145deg, #f8e2b2, #d49c4b);
  transition: transform 0.32s var(--ease-spring);
}

.ig-note-card.is-self .ig-live-avatar {
  background: linear-gradient(145deg, #e2e8f0, #94a3b8);
}

.ig-note-viewport {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.ig-note-slide {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
  animation: igSlideSwapIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ig-note-slide.is-leaving {
  animation: igSlideSwapOut 0.26s ease-in forwards;
}

.ig-live-author {
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--gold-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-note-card.is-self .ig-live-author {
  color: var(--text-secondary);
}

.ig-live-text {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--champagne);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-note-counter {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.64rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

@keyframes igSlideSwapIn {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes igSlideSwapOut {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-14px); }
}

@keyframes igCardPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(243, 212, 151, 0.55); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(243, 212, 151, 0); }
  100% { transform: scale(1); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); }
}

@media (max-width: 1120px) {
  .floating-wishes-layer {
    left: 14px;
    bottom: calc(134px + var(--safe-bottom));
    max-width: min(290px, calc(100vw - 28px));
  }
}

@media (max-width: 480px) {
  .float-wish-input {
    font-size: 16px;
  }

  .floating-wishes-layer {
    left: 12px;
    bottom: calc(138px + var(--safe-bottom));
    max-width: min(268px, calc(100vw - 24px));
  }
}

/* Synced 3-2-1 Celebration Countdown Overlay */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 64;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.countdown-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.countdown-num {
  font-size: clamp(3.4rem, 12vw, 6.2rem);
  font-weight: 600;
  line-height: 1;
  color: var(--champagne);
  text-shadow: 0 0 42px rgba(243, 212, 151, 0.72), 0 8px 28px rgba(0, 0, 0, 0.65);
  animation: countdownPop 0.85s var(--ease-out-expo) both;
}

.countdown-num.is-go {
  font-size: clamp(1.9rem, 7vw, 3.4rem);
  color: var(--gold-soft);
}

.countdown-sub {
  padding: 5px 16px;
  border-radius: var(--radius-pill);
  background: rgba(8, 15, 30, 0.76);
  border: 1px solid rgba(243, 212, 151, 0.32);
  color: var(--champagne);
  font-size: 0.84rem;
  font-weight: 400;
}

@keyframes countdownPop {
  0% { opacity: 0; transform: scale(0.55); }
  35% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
  .invite-qr-box {
    flex-direction: column;
    text-align: center;
  }

  .btn-qr-dl {
    align-self: center;
  }

  .quick-magic-dock {
    max-width: calc(100vw - 16px);
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .magic-pill {
    padding: 0 8px;
    font-size: 0.67rem;
  }

  .wish-reply-input {
    font-size: 16px;
  }
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-pill {
  position: fixed;
  bottom: calc(88px + var(--safe-bottom));
  left: 50%;
  transform: translate(-50%, 14px);
  z-index: 80;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: rgba(10, 18, 34, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(243, 212, 151, 0.36);
  color: var(--champagne);
  font-size: 0.82rem;
  font-weight: 400;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.52);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.26s var(--ease-out-expo), transform 0.26s var(--ease-out-expo), visibility 0.26s;
}

.toast-pill.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes enterFromTop {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes enterFromBottom {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheenSweep {
  0%, 45% { left: -130%; }
  100% { left: 160%; }
}

@keyframes naturalWaveBob {
  0%, 100% { transform: translateY(0px) rotate(-1.1deg); }
  50% { transform: translateY(-5.5px) rotate(1.3deg); }
}

@keyframes cinematicReleaseArc {
  0% {
    opacity: 0;
    transform: translateY(78px) scale(1.38) rotate(-3deg);
  }
  58% {
    opacity: 1;
    transform: translateY(6px) scale(1.03) rotate(1.2deg);
  }
  80% {
    transform: translateY(-3px) scale(0.99) rotate(-0.6deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0px) scale(1) rotate(0deg);
  }
}

@keyframes waterReflectionBreathe {
  from { opacity: 0.58; transform: translateX(-50%) scaleX(0.93); }
  to { opacity: 1; transform: translateX(-50%) scaleX(1.08); }
}

@keyframes ringExpandPulse {
  0%, 100% { transform: translateX(-50%) scale(0.96); opacity: 0.7; }
  50% { transform: translateX(-50%) scale(1.08); opacity: 1; }
}

@keyframes spotBreathe {
  0%, 100% { opacity: 0.55; transform: scale(0.97); }
  50% { opacity: 0.95; transform: scale(1.04); }
}

@keyframes ringRippleOut {
  0% { opacity: 0.65; transform: translate(-50%, -50%) scale(0.45); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.85); }
}

@keyframes flameDance {
  0% { transform: scale(1, 1) rotate(-2deg); opacity: 0.94; }
  50% { transform: scale(1.05, 1.12) rotate(2.2deg); opacity: 1; }
  100% { transform: scale(0.96, 1.04) rotate(-1.2deg); opacity: 0.92; }
}

@keyframes flameCore {
  0% { transform: scale(0.93, 0.95); }
  100% { transform: scale(1.07, 1.13); }
}

@keyframes haloBreathe {
  from { opacity: 0.45; transform: scale(0.92); }
  to { opacity: 0.84; transform: scale(1.1); }
}

@keyframes incenseDrift {
  0% { opacity: 0; transform: translateY(4px) translateX(0px); }
  30% { opacity: 0.44; }
  100% { opacity: 0; transform: translateY(-18px) translateX(5px); }
}

@keyframes emberFloat {
  0%, 100% { opacity: 0.22; transform: translateY(0px) scale(0.85); }
  50% { opacity: 0.92; transform: translateY(-10px) scale(1.18); }
}

@keyframes sparkRise {
  0% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -54px) scale(0.2); }
}

@keyframes bambooShake {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-11deg) translateY(-6px); }
  50% { transform: rotate(10deg) translateY(-2px); }
  75% { transform: rotate(-8deg) translateY(-5px); }
}

@keyframes slipUnfold {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Universal Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1280px) {
  .hud-pair.is-quad .pair-chip {
    max-width: 82px;
    padding: 4px 7px;
    font-size: 0.7rem;
  }

  .icon-btn {
    padding: 0 11px;
    font-size: 0.76rem;
  }
}

@media (max-width: 1120px) {
  .hud-pair {
    display: none;
  }

  .quick-magic-dock {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(84px + var(--safe-bottom));
  }
}

@media (max-width: 820px) {
  .hud-header {
    top: calc(10px + var(--safe-top));
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    gap: 8px;
  }

  .hud-brand {
    padding: 6px 12px 6px 7px;
    gap: 8px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-copy p,
  .icon-btn-label {
    display: none;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .guide-pill {
    top: calc(58px + var(--safe-top));
    padding: 4px 12px;
  }

  .quick-magic-dock {
    bottom: calc(78px + var(--safe-bottom));
    gap: 5px;
    max-width: calc(100% - 20px);
  }

  .magic-pill {
    height: 32px;
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .bottom-bar {
    bottom: calc(14px + var(--safe-bottom));
    width: calc(100% - 24px);
    max-width: 420px;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .btn-main-cta {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 16px;
    font-size: clamp(0.8rem, 3.6vw, 0.92rem);
    white-space: nowrap;
  }

  .btn-sub-cta {
    flex-shrink: 0;
    padding: 11px 14px;
    font-size: clamp(0.76rem, 3.2vw, 0.84rem);
    white-space: nowrap;
  }

  /* Bottom Sheet on Mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-sheet {
    width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    padding: 12px 16px calc(22px + var(--safe-bottom));
    transform: translateY(100%);
  }

  .modal-overlay.is-open .modal-sheet {
    transform: translateY(0);
  }

  .sheet-handle {
    display: block;
  }

  .studio-layout,
  .moment-studio-grid,
  .field-row-split,
  .moment-secondary-btns {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .studio-preview {
    min-height: 186px;
    padding: 14px 12px 10px;
  }

  .moment-preview-col {
    min-height: 250px;
    padding: 10px;
  }

  .moment-canvas-stage,
  #keepsakeCanvas {
    max-height: 260px;
  }

  .preview-krathong {
    width: 138px;
    height: 134px;
  }

  .copy-bar {
    flex-direction: column;
  }

  .btn-copy {
    width: 100%;
  }

  /* Prevent iOS Safari input auto-zoom */
  .field-input,
  .field-textarea,
  .paper-textarea {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .brand-copy {
    display: none;
  }

  .hud-brand {
    width: 32px;
    height: 32px;
    padding: 0;
    gap: 0;
    justify-content: center;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
  }

  .hud-controls {
    gap: 4px;
  }

  .icon-btn {
    width: 31px;
    height: 31px;
  }

  .icon-btn svg {
    width: 14px;
    height: 14px;
  }

  .quick-magic-dock {
    gap: 5px;
  }

  .magic-pill {
    height: 32px;
    padding: 0 9px;
    gap: 4px;
    font-size: 0.69rem;
  }

  .magic-pill svg {
    width: 12px;
    height: 12px;
  }

  .seg-tab {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 11px;
  }

  .seg-title {
    font-size: 0.78rem;
  }

  .seg-meta {
    font-size: 0.67rem;
  }

  .style-mini-card {
    font-size: 0.67rem;
    padding: 6px 4px;
  }

  .mixer-popover {
    right: -34px;
    width: min(244px, calc(100vw - 24px));
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .hud-header {
    top: calc(8px + var(--safe-top));
  }

  .brand-copy p,
  .guide-pill,
  .quick-magic-dock {
    display: none;
  }

  .bottom-bar {
    bottom: calc(10px + var(--safe-bottom));
  }

  .btn-main-cta,
  .btn-sub-cta {
    min-height: 40px;
    padding: 8px 18px;
    font-size: 0.84rem;
  }

  .modal-overlay {
    align-items: center;
    padding: 8px;
  }

  .modal-sheet {
    width: min(880px, 100%);
    max-height: 94dvh;
    border-radius: 20px;
    padding: 14px 18px;
  }

  .sheet-handle {
    display: none;
  }

  .studio-layout,
  .moment-studio-grid {
    grid-template-columns: 0.82fr 1.18fr;
    gap: 14px;
  }

  .studio-preview,
  .moment-preview-col {
    min-height: 190px;
  }

  .preview-krathong {
    width: 130px;
    height: 126px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }
}
