.blossom-layer {
  position: fixed;
  z-index: 9990;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.blossom-layer[data-effect="off"] {
  display: none !important;
}

.petal {
  position: absolute;
  top: -32px;
  width: 10px;
  height: 13px;
  opacity: 0;
  will-change: transform, opacity;
  animation: petal-fall var(--fall-duration, 20s) linear var(--fall-delay, 0s) infinite;
}

.petal i {
  position: absolute;
  inset: 2px 4px 4px 3px;
  display: block;
  border-radius: 70% 15% 70% 20%;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.7), transparent 40%),
    linear-gradient(135deg, var(--petal-color, #6e6e6e), var(--petal-color-2, #2f2f2f));
  box-shadow: 0 0 8px var(--petal-glow, rgba(110,110,110,0.45));
  transform: scale(var(--petal-scale, 1)) rotate(28deg);
  animation: petal-sway var(--sway-duration, 4s) ease-in-out infinite alternate;
}

/* Rain effect */
.blossom-layer[data-effect="rain"] .petal {
  width: 2px;
  height: 28px;
  animation: rain-fall var(--fall-duration, 1.2s) linear var(--fall-delay, 0s) infinite;
}

.blossom-layer[data-effect="rain"] .petal i {
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(125,211,252,0.85));
  box-shadow: 0 0 6px rgba(56,189,248,0.5);
  transform: rotate(12deg);
  animation: none;
}

/* Snow effect */
.blossom-layer[data-effect="snow"] .petal {
  width: 10px;
  height: 10px;
}

.blossom-layer[data-effect="snow"] .petal i {
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 30%, rgba(220,220,220,0.8) 80%, transparent 100%);
  box-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* Stars / Fireflies effect */
.blossom-layer[data-effect="stars"] .petal {
  width: 9px;
  height: 9px;
}

.blossom-layer[data-effect="stars"] .petal i {
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fafafa 20%, #bcbcbc 65%, transparent 100%);
  box-shadow: 0 0 12px #a0a0a0, 0 0 22px rgba(188,188,188,0.7);
}

.petal-small {
  width: 12px;
  height: 15px;
}

@keyframes petal-fall {
  0% { opacity: 0; transform: translate3d(0, -4vh, 0) rotate(0deg); }
  10% { opacity: 0.76; }
  85% { opacity: 0.62; }
  100% { opacity: 0; transform: translate3d(20px, 106vh, 0) rotate(360deg); }
}

@keyframes rain-fall {
  0% { opacity: 0; transform: translate3d(0, -6vh, 0); }
  15% { opacity: 0.75; }
  90% { opacity: 0.65; }
  100% { opacity: 0; transform: translate3d(-14vh, 106vh, 0); }
}

@keyframes petal-sway {
  from { translate: -14px 0; rotate: -24deg; }
  to { translate: 16px 0; rotate: 32deg; }
}

/* Floating Music + Falling Effects Widget (Top-Right — Không che Avatar & Tên ở góc trái dưới) */
.ltn-atmosphere-dock {
  position: fixed;
  bottom: 22px;
  right: 22px;
  top: auto;
  left: auto;
  z-index: 9995;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

.ltn-atmo-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(185,185,185,0.48);
  background: linear-gradient(135deg, rgba(18,18,18,0.96), rgba(27,27,27,0.96));
  color: #ebebeb;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.55), 0 0 18px rgba(160,160,160,0.22);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.ltn-atmo-trigger:hover {
  transform: translateY(-2px);
  border-color: rgba(199,199,199,0.9);
}

.ltn-atmo-trigger.is-playing .ltn-atmo-eq {
  display: inline-flex;
}

.ltn-atmo-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.ltn-atmo-eq span {
  width: 2.5px;
  background: #4ade80;
  border-radius: 2px;
  animation: ltn-eq-bounce 0.7s ease-in-out infinite alternate;
}

.ltn-atmo-eq span:nth-child(2) { animation-delay: 0.2s; }
.ltn-atmo-eq span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ltn-eq-bounce {
  from { height: 3px; }
  to { height: 12px; }
}

.ltn-atmo-panel {
  position: absolute;
  bottom: calc(100% + 14px) !important;
  top: auto !important;
  right: 0 !important;
  left: auto !important;
  right: 0;
  left: auto;
  bottom: auto;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: linear-gradient(165deg, #111111 0%, #0a0a0a 100%);
  border: 1.5px solid rgba(185,185,185,0.42);
  border-radius: 22px;
  padding: 16px;
  color: #ededed;
  box-shadow: 0 24px 64px rgba(0,0,0,0.82);
}

.ltn-volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(185,185,185,0.25);
  background: rgba(0,0,0,0.35);
}

.ltn-vol-btn {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(185,185,185,0.35);
  background: rgba(185,185,185,0.14);
  color: #e2e2e2;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.ltn-vol-btn:hover {
  background: rgba(185,185,185,0.28);
}

.ltn-volume-slider {
  flex: 1;
  accent-color: #a4a4a4;
  cursor: pointer;
}

.ltn-volume-value {
  min-width: 38px;
  text-align: right;
  font-size: 12px;
  font-weight: 850;
  color: #d2d2d2;
}

.ltn-atmo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ltn-atmo-head strong {
  font-size: 14.5px;
  color: #d5d5d5;
}

.ltn-atmo-close {
  background: rgba(255,255,255,0.07);
  border: 0;
  color: #d2d2d2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 800;
}

.ltn-atmo-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaaaaa;
  margin: 10px 0 7px;
}

.ltn-effect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ltn-effect-btn {
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #e4e4e4;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.ltn-effect-btn:hover {
  border-color: rgba(185,185,185,0.45);
  background: rgba(185,185,185,0.1);
}

.ltn-effect-btn.is-active {
  background: linear-gradient(120deg, #a4a4a4, #868686);
  color: #0e0e0e;
  border-color: transparent;
  font-weight: 800;
}

.ltn-music-input-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.ltn-music-input-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid rgba(185,185,185,0.28);
  background: rgba(0,0,0,0.35);
  color: #f4f4f4;
  font-size: 12.5px;
}

.ltn-music-input-row button {
  padding: 8px 13px;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(120deg, #a4a4a4, #868686);
  color: #0f0f0f;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}

.ltn-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ltn-preset-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(185,185,185,0.24);
  background: rgba(185,185,185,0.08);
  color: #dadada;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.ltn-preset-chip:hover,
.ltn-preset-chip.is-active {
  background: rgba(185,185,185,0.25);
  border-color: rgba(185,185,185,0.65);
  color: #ffffff;
}

.ltn-music-embed-box {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ltn-music-embed-box iframe {
  width: 100%;
  border: 0;
  display: block;
}

.ltn-music-empty {
  padding: 14px;
  font-size: 12px;
  color: #8f8f8f;
  text-align: center;
}

@media (max-width: 720px) {
  .blossom-layer { opacity: 0.65; }
  .ltn-atmosphere-dock { left: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .blossom-layer { display: none; }
}
