/* ===== โทน "ส้มตุ่น" + แอนิเมชันหน้ากำลังเล่น =====
   ไฟล์นี้โหลดหลังสุด — ถ้าอยากกลับไปโทนเขียวมะนาวเดิม แค่เอาบรรทัด ember.css ออกจาก index.html */

:root {
  --bg: #f5efe8;
  --text: #2a1f1a;
  --text-2: #5e4d44;
  --muted: #9a8a80;
  --line: #eee3da;

  /* ใช้ชื่อตัวแปรเดิม (--lime) เพื่อให้ทุกจุดในแอพเปลี่ยนสีตามทันที */
  --lime: #e6a27c;
  --lime-strong: #d4845a;
  --lime-soft: #f7e5d9;
  --lime-ink: #4a2414;

  --primary: #c06e43;
  --primary-dark: #9a5432;
  --primary-soft: #f6e7dd;

  --ember-glow: rgba(214, 128, 82, 0.35);
}

html,
body {
  background-color: #f5efe8;
}
body {
  background: #f5efe8;
}
@media (prefers-color-scheme: dark) {
  html,
  body {
    background-color: #f5efe8;
    color: #2a1f1a;
  }
}

/* แสงด้านหลังทั้งแอพ: ส้มดินเผา / ทราย / พีชตุ่น */
body::before {
  background:
    radial-gradient(50% 36% at 0% 0%, rgba(238, 190, 160, 0.62), transparent 72%),
    radial-gradient(44% 32% at 100% 6%, rgba(236, 214, 186, 0.6), transparent 72%),
    radial-gradient(48% 36% at 100% 100%, rgba(226, 172, 140, 0.45), transparent 72%),
    radial-gradient(44% 32% at 0% 88%, rgba(244, 218, 198, 0.55), transparent 72%);
}

.topbar {
  background: rgba(245, 239, 232, 0.86);
}

.tabs button.active {
  background: linear-gradient(135deg, #f3cfb8, #e6a27c);
}
@media (max-width: 720px) {
  .topbar {
    background: rgba(245, 239, 232, 0.92);
  }
  .tabs button.active {
    background-color: rgba(230, 162, 124, 0.95);
    background-image: linear-gradient(135deg, rgba(247, 218, 199, 0.9), rgba(230, 162, 124, 0.2));
    box-shadow: 0 12px 28px rgba(190, 110, 62, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
  .tabs button.active .tab-ico {
    box-shadow: 0 2px 8px rgba(150, 80, 40, 0.18);
  }
}

.ctl.on {
  box-shadow: 0 4px 12px rgba(200, 120, 70, 0.3);
}
.ctl.big {
  box-shadow: 0 8px 22px rgba(200, 120, 70, 0.4);
}
.now-stats {
  color: #7a3a1c;
}
.stage {
  background: radial-gradient(circle at 50% 45%, #fffaf6, #f2e6dc);
}

/* ---------- หน้ากำลังเล่น ---------- */
.player-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* แสงออโรร่าไหลช้าๆ ด้านหลังการ์ด — เล่นเพลงแล้วสว่างและไหลเร็วขึ้น */
.aurora {
  position: absolute;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  filter: blur(38px);
  opacity: 0.55;
  transition: opacity 0.8s;
}
.aurora i {
  position: absolute;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: aurora-drift 18s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.aurora i:nth-child(1) {
  left: 5%;
  top: 8%;
  background: #f0a982;
}
.aurora i:nth-child(2) {
  right: 0;
  top: 30%;
  background: #e8c39a;
  animation-duration: 22s;
  animation-delay: -6s;
}
.aurora i:nth-child(3) {
  left: 25%;
  bottom: 0;
  background: #dd8f73;
  animation-duration: 26s;
  animation-delay: -12s;
}
.is-playing .aurora {
  opacity: 0.85;
}
.is-playing .aurora i {
  animation-play-state: running;
}
@keyframes aurora-drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(18%, -12%) scale(1.18);
  }
  100% {
    transform: translate(-14%, 14%) scale(0.92);
  }
}

/* วงแหวนแสงหมุนรอบจอเพลง/วิดีโอ */
.stage-ring {
  position: relative;
  padding: 3px;
  border-radius: 25px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
}
.stage-ring::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: conic-gradient(from 0deg, transparent 0 55%, #f6c8a8 68%, #d4845a 80%, #fff1e6 86%, transparent 92%);
  opacity: 0;
  transition: opacity 0.6s;
  animation: ring-spin 4.5s linear infinite;
  animation-play-state: paused;
}
.is-playing .stage-ring::before {
  opacity: 1;
  animation-play-state: running;
}
.stage-ring .stage {
  position: relative;
  border-radius: 22px;
}
@keyframes ring-spin {
  to {
    rotate: 360deg;
  }
}

/* แท่งอีควอไลเซอร์เล็กๆ ข้างป้ายแหล่งเพลง */
.pill-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 16px;
}
.eq i {
  width: 3px;
  height: 30%;
  border-radius: 2px;
  background: var(--lime-strong);
  transform-origin: bottom;
  animation: eq-bounce 0.9s ease-in-out infinite;
  animation-play-state: paused;
}
.eq i:nth-child(2) {
  animation-duration: 0.7s;
  animation-delay: -0.3s;
}
.eq i:nth-child(3) {
  animation-duration: 1.1s;
  animation-delay: -0.5s;
}
.eq i:nth-child(4) {
  animation-duration: 0.8s;
  animation-delay: -0.2s;
}
.eq i:nth-child(5) {
  animation-duration: 1s;
  animation-delay: -0.7s;
}
.is-playing .eq i {
  animation-play-state: running;
}
@keyframes eq-bounce {
  0%,
  100% {
    height: 25%;
  }
  50% {
    height: 100%;
  }
}

/* ชื่อเพลงเลื่อนขึ้นมาตอนเปลี่ยนเพลง */
.now-meta.enter > * {
  animation: meta-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.now-meta.enter > :nth-child(2) {
  animation-delay: 0.07s;
}
.now-meta.enter > :nth-child(3) {
  animation-delay: 0.14s;
}
.now-meta.enter > :nth-child(4) {
  animation-delay: 0.21s;
}
@keyframes meta-in {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
}

/* ปุ่มเล่น: คลื่นวงแหวนกระจายออกตอนกำลังเล่น */
.controls .ctl.big {
  position: relative;
}
.controls .ctl.big::before,
.controls .ctl.big::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--lime-strong);
  opacity: 0;
  pointer-events: none;
}
.is-playing .controls .ctl.big::before,
.is-playing .controls .ctl.big::after {
  animation: ripple 2.4s ease-out infinite;
}
.is-playing .controls .ctl.big::after {
  animation-delay: 1.2s;
}
@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

/* แถบเวลาเพลง: เส้นไล่สีส้ม + หัวจับมีแสง */
#seek {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f3c3a2, var(--lime-strong)) 0 0 / var(--p, 0%) 100% no-repeat, rgba(120, 80, 50, 0.13);
  outline: none;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--lime-strong);
  box-shadow: 0 0 0 5px var(--ember-glow);
  cursor: pointer;
}
#seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--lime-strong);
  box-shadow: 0 0 0 5px var(--ember-glow);
}

/* คนที่ตั้งเครื่องให้ลดการเคลื่อนไหว: ปิดแอนิเมชันตกแต่ง */
@media (prefers-reduced-motion: reduce) {
  .aurora i,
  .stage-ring::before,
  .eq i,
  .now-meta.enter > *,
  .controls .ctl.big::before,
  .controls .ctl.big::after {
    animation: none !important;
  }
}

/* ---------- คลื่นพิกเซล ---------- */
.pixwave {
  display: block;
  width: 100%;
  height: 52px;
  margin: -2px 0 -4px;
  image-rendering: pixelated;
}
.pixwave.big {
  height: 78px;
  margin: 0;
}

/* หัวแอพ: ซ่อนวันที่และชื่อแอพ เหลือแค่ปุ่มเมนู */
.topbar .greet[hidden] + .tabs + .menu-wrap,
.topbar .menu-wrap {
  margin-left: auto;
}

/* ---------- ปุ่มลูกเล่น (เต็มจอ / บรรยากาศ) ---------- */
.fx-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.fx-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.85), rgba(255, 244, 236, 0.6));
  box-shadow: 0 4px 14px rgba(150, 90, 50, 0.08);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  min-width: 0;
  transition: transform 0.15s, box-shadow 0.25s, background 0.25s;
}
.fx-btn:active {
  transform: scale(0.97);
}
.fx-btn > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fx-btn b {
  font-size: 0.9rem;
}
.fx-btn small {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fx-ico {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--lime-soft);
  color: var(--primary-dark);
}
.fx-ico svg,
.fs-round svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fx-btn.on {
  background: linear-gradient(150deg, #f7dcc9, #eeb48f);
  box-shadow: 0 6px 18px rgba(200, 120, 70, 0.28);
}
.fx-btn.on .fx-ico {
  background: #fff;
  animation: fx-breathe 2.4s ease-in-out infinite;
}
.fx-btn.on small {
  color: #7a3a1c;
}
@keyframes fx-breathe {
  50% {
    transform: scale(1.08);
  }
}

/* ---------- โหมดเต็มจอ ---------- */
html.fs-lock,
html.fs-lock body {
  overflow: hidden;
}
.fs {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(18px + env(safe-area-inset-bottom));
  background: #f5ebe2;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  touch-action: pan-x;
}
.fs.show {
  opacity: 1;
  transform: none;
}
.fs > * {
  width: 100%;
  max-width: 520px;
}
.yt-box.in-fs {
  z-index: 46;
  border-radius: 0;
}
.vol {
  z-index: 50;
}

/* พื้นหลัง: ปกเพลงเบลอฟุ้ง + แสงส้มลอยช้าๆ */
.fs-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  max-width: none;
  pointer-events: none;
}
.fs-bg img {
  position: absolute;
  inset: -15%;
  width: 130%;
  height: 130%;
  object-fit: cover;
  filter: blur(46px) saturate(1.2);
  opacity: 0.55;
}
.fs-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(245, 235, 226, 0.35), rgba(245, 235, 226, 0.75) 60%, rgba(245, 235, 226, 0.92));
}
.fs-bg i {
  position: absolute;
  width: 70vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: aurora-drift 20s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.fs-bg i:nth-of-type(1) {
  left: -30%;
  top: -20%;
  background: #f1a57e;
}
.fs-bg i:nth-of-type(2) {
  right: -35%;
  bottom: -10%;
  background: #e9c29a;
  animation-duration: 26s;
}
.is-playing .fs-bg i {
  animation-play-state: running;
}

.fs-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fs-round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(120, 70, 40, 0.1);
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
}
.fs-round.on {
  background: var(--lime);
  color: var(--lime-ink);
}
.fs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.fs-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}
.fs.yt .fs-stage {
  max-width: none;
  width: 100vw;
}
.fs-video {
  width: 100%;
  position: relative;
}
.fs-video::before {
  /* แสงฟุ้งรอบวิดีโอ */
  content: "";
  position: absolute;
  inset: -18px 6%;
  border-radius: 30px;
  background: radial-gradient(closest-side, rgba(214, 128, 82, 0.55), transparent);
  filter: blur(22px);
  animation: glow-pulse 3.2s ease-in-out infinite;
  animation-play-state: paused;
}
.is-playing .fs-video::before {
  animation-play-state: running;
}
@keyframes glow-pulse {
  50% {
    opacity: 0.55;
    transform: scale(1.04);
  }
}
.fs-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  max-height: 60vh;
  background: #111;
}

/* แผ่นเสียง */
.vinyl-wrap {
  position: relative;
  width: min(78vw, 42vh, 380px);
  aspect-ratio: 1;
}
.vinyl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 31%, rgba(255, 255, 255, 0.06) 31.5% 32%, transparent 32.5%),
    repeating-radial-gradient(circle, #2b201c 0 1.6px, #3a2b25 2.2px 3.2px),
    #2b201c;
  box-shadow: 0 24px 50px rgba(90, 45, 20, 0.35), inset 0 0 0 6px #241a16;
  animation: spin 3.2s linear infinite;
  animation-play-state: paused;
}
.vinyl::after {
  /* แสงสะท้อนบนแผ่น (ไม่หมุนตาม ใช้ conic) */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 8%, rgba(255, 255, 255, 0.16) 12%, transparent 18% 50%, rgba(255, 255, 255, 0.12) 62%, transparent 68%);
}
.is-playing .vinyl {
  animation-play-state: running;
}
@keyframes spin {
  to {
    rotate: 360deg;
  }
}
.vinyl-label {
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #f6c9a8, #d4845a);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.15);
}
.vinyl-label.radio {
  background: radial-gradient(circle at 35% 30%, #f3dcc0, #c08a62);
}
.vinyl-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vinyl-note {
  font-size: 2.2rem;
  color: #fff;
}
.vinyl-hole {
  position: absolute;
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f5ebe2;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.tonearm {
  position: absolute;
  right: -9%;
  top: -6%;
  width: 22%;
  height: 72%;
  transform-origin: 50% 11%;
  rotate: -28deg;
  transition: rotate 0.9s cubic-bezier(0.3, 1.2, 0.4, 1);
  filter: drop-shadow(0 6px 8px rgba(60, 30, 10, 0.3));
}
.is-playing .tonearm {
  rotate: 6deg;
}
.arm-base {
  fill: #fff;
  stroke: #e3d3c6;
  stroke-width: 2;
}
.arm-pin {
  fill: var(--lime-strong);
}
.arm-rod {
  fill: none;
  stroke: #efe4da;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arm-head {
  fill: var(--lime-strong);
}

.fs-meta {
  text-align: center;
}
.fs-meta h2 {
  margin: 0 0 2px;
  font-size: 1.45rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fs-meta p {
  margin: 0;
  color: var(--text-2);
}
.fs-meta.enter > * {
  animation: meta-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.fs-meta.enter > :nth-child(2) {
  animation-delay: 0.08s;
}
.fs-progress #fs-seek {
  width: 100%;
}
#fs-seek {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f3c3a2, var(--lime-strong)) 0 0 / var(--p, 0%) 100% no-repeat, rgba(120, 80, 50, 0.15);
  outline: none;
}
#fs-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--lime-strong);
  box-shadow: 0 0 0 5px var(--ember-glow);
}
.fs-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.fs-controls {
  justify-content: space-between;
}
.fs-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fs-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- เสียงบรรยากาศ ---------- */
.amb-sheet {
  max-width: 460px;
}
.amb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 6px;
}
.amb-tile {
  border-radius: 22px;
  padding: 10px 10px 12px;
  background: #faf5f0;
  border: 1px solid #f0e4da;
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}
.amb-tile.on {
  background: linear-gradient(160deg, #fbe3d3, #f1bf9e);
  border-color: #f3cdb3;
  box-shadow: 0 10px 24px rgba(200, 120, 70, 0.25);
}
.amb-toggle {
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.amb-toggle:active {
  transform: scale(0.97);
}
.amb-toggle b {
  font-size: 0.95rem;
  margin-top: 6px;
}
.amb-toggle small {
  font-size: 0.72rem;
  color: var(--muted);
}
.amb-tile.on .amb-toggle small {
  color: #7a3a1c;
}
.amb-lv {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--lime-strong);
}
.art {
  position: relative;
  width: 100%;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}
.art i,
.art path {
  animation-play-state: paused !important;
}
.amb-tile.on .art i,
.amb-tile.on .art path {
  animation-play-state: running !important;
}
/* ฝน */
.art.rain i {
  position: absolute;
  top: -14px;
  width: 2px;
  height: 12px;
  border-radius: 2px;
  background: #b98a6c;
  animation: rain-fall 0.9s linear infinite;
}
.art.rain i:nth-child(1) { left: 12%; animation-delay: -0.1s; }
.art.rain i:nth-child(2) { left: 25%; animation-delay: -0.5s; }
.art.rain i:nth-child(3) { left: 38%; animation-delay: -0.3s; }
.art.rain i:nth-child(4) { left: 52%; animation-delay: -0.7s; }
.art.rain i:nth-child(5) { left: 65%; animation-delay: -0.2s; }
.art.rain i:nth-child(6) { left: 78%; animation-delay: -0.6s; }
.art.rain i:nth-child(7) { left: 90%; animation-delay: -0.4s; }
@keyframes rain-fall {
  to {
    transform: translate(-6px, 92px);
  }
}
/* คลื่น */
.art.waves svg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200%;
  height: 100%;
}
.art.waves path {
  fill: rgba(212, 132, 90, 0.35);
  animation: wave-move 4s linear infinite;
}
.art.waves path + path {
  fill: rgba(212, 132, 90, 0.6);
  animation-duration: 2.6s;
  animation-direction: reverse;
}
@keyframes wave-move {
  to {
    transform: translateX(-50%);
  }
}
/* กองไฟ */
.art.fire i {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 26px;
  height: 36px;
  margin-left: -13px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 75%, #ffe2b8, #f08a4b 55%, #d4573a);
  transform-origin: 50% 100%;
  animation: flicker 0.7s ease-in-out infinite alternate;
}
.art.fire i:nth-child(2) {
  margin-left: -26px;
  width: 18px;
  height: 26px;
  animation-duration: 0.55s;
  opacity: 0.85;
}
.art.fire i:nth-child(3) {
  margin-left: 6px;
  width: 18px;
  height: 28px;
  animation-duration: 0.8s;
  opacity: 0.85;
}
@keyframes flicker {
  to {
    transform: scale(0.88, 1.12) skewX(4deg);
  }
}
/* ลม */
.art.wind i {
  position: absolute;
  left: -40%;
  height: 3px;
  width: 45%;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #c99a7c, transparent);
  animation: gust 2.2s ease-in-out infinite;
}
.art.wind i:nth-child(1) { top: 22%; }
.art.wind i:nth-child(2) { top: 48%; animation-delay: -0.8s; width: 60%; }
.art.wind i:nth-child(3) { top: 72%; animation-delay: -1.5s; }
@keyframes gust {
  to {
    transform: translateX(330%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vinyl,
  .fs-bg i,
  .fs-video::before,
  .art i,
  .art path,
  .fx-btn.on .fx-ico {
    animation: none !important;
  }
}

/* ไอคอนสถิติ: แท่งกราฟ 3 แท่งโตขึ้น + เส้นแนวโน้ม */
.st-ico {
  background: linear-gradient(150deg, #fbe5d6, #f3c6a7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 4px 10px rgba(200, 120, 70, 0.18);
}
.st-ico svg {
  width: 26px;
  height: 26px;
  overflow: visible;
}
.st-ico rect {
  fill: #d4845a;
  transform-box: fill-box;
  transform-origin: bottom;
  animation: st-grow 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.st-ico .b1 {
  fill: #eeb08c;
}
.st-ico .b2 {
  fill: #e0946a;
  animation-delay: 0.08s;
}
.st-ico .b3 {
  fill: #c8704a;
  animation-delay: 0.16s;
}
.st-ico .trend {
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: st-draw 0.6s 0.35s ease-out forwards;
  filter: drop-shadow(0 1px 1px rgba(120, 60, 30, 0.35));
}
@keyframes st-grow {
  from {
    transform: scaleY(0.15);
  }
}
@keyframes st-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* จอ YouTube ต้องสูงอย่างน้อย 200px (เงื่อนไข YouTube) — จอมือถือแคบ 16:9 ไม่ถึง จึงยืดความสูงให้ */
.stage.yt {
  min-height: 200px;
}
.fx-btn {
  padding: 10px;
  gap: 8px;
}
.fx-ico {
  width: 34px;
  height: 34px;
}
.fx-btn b {
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* แผงเสียงบรรยากาศ: เว้นขอบเหมือนหน้าต่างอื่น */
.sheet.amb-sheet {
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}
.amb-sheet .sheet-head h2 {
  margin: 0;
}

/* จอ YouTube ในหน้ากำลังเล่น: เลื่อนไปพร้อมหน้า และอยู่ใต้แถบด้านบน/เมนูล่าง */
.yt-box.anchored {
  position: absolute;
  z-index: 15;
}

/* คลื่นพิกเซลสูงขึ้น ให้เห็นแท่งขึ้นลงจากเส้นกลางชัดๆ */
.pixwave {
  height: 78px;
  margin: 0;
}
.pixwave.big {
  height: 110px;
}

/* ปุ่มหมุนปรับเสียงขนาดใหญ่ขึ้น */
.vol {
  width: 250px;
  height: 450px;
}
.vol-dial {
  width: 200px;
  height: 400px;
  border-radius: 200px 0 0 200px;
}
.vol-handle {
  width: 38px;
  height: 96px;
  border-radius: 22px 0 0 22px;
}
.vol-handle svg {
  width: 22px;
  height: 22px;
}
.vol-read {
  right: 18px;
  width: 84px;
}
.vol-read svg {
  width: 24px;
  height: 24px;
}
.vol-read b {
  font-size: 2.6rem;
}
.vol-read small {
  font-size: 0.85rem;
}
.vinyl-wrap {
  width: min(78vw, 38vh, 380px);
}

/* ตัดขอบแบบเลื่อนไม่ได้ (clip) — แบบ hidden ยังถูกเบราว์เซอร์เลื่อนเนื้อหาข้างในได้ ทำให้จอ YouTube ไม่ตรงช่อง */
.player-card,
.stage-ring,
.fs {
  overflow: hidden;
  overflow: clip;
}

/* ---------- ตัวเลือกรูปแบบคลื่น (พิกเซล / คลื่นนุ่ม) ---------- */
.wave-wrap {
  position: relative;
}
.pixwave {
  cursor: pointer;
}
.wave-switch {
  position: absolute;
  right: 0;
  top: -6px;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(120, 70, 40, 0.1);
}
.wave-switch button {
  width: 28px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: none;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.wave-switch button.on {
  background: var(--lime);
  color: var(--lime-ink);
}
.wave-switch svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.wave-switch {
  right: auto;
  left: 0;
}

/* แถบบน: ทึบ + ไล่จางด้านล่าง — เลื่อนหน้าแล้ววิดีโอค่อยๆ จางหายใต้แถบ ไม่โผล่ทะลุ */
.topbar,
.topbar.scrolled {
  background: #f5efe8 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 34px;
  background: linear-gradient(#f5efe8, rgba(245, 239, 232, 0.85) 35%, rgba(245, 239, 232, 0));
  pointer-events: none;
}

/* เฟดใต้แถบบนแบบเนียน: ยาวขึ้น + ไล่ความทึบแบบโค้ง (ease-out) ไม่เห็นขอบ */
.topbar::after {
  height: 72px;
  background: linear-gradient(
    to bottom,
    rgba(245, 239, 232, 1) 0%,
    rgba(245, 239, 232, 0.94) 10%,
    rgba(245, 239, 232, 0.82) 22%,
    rgba(245, 239, 232, 0.66) 34%,
    rgba(245, 239, 232, 0.48) 47%,
    rgba(245, 239, 232, 0.31) 60%,
    rgba(245, 239, 232, 0.17) 73%,
    rgba(245, 239, 232, 0.07) 86%,
    rgba(245, 239, 232, 0) 100%
  );
}

/* ===== แสงรอบๆ ตามปกเพลง (โทนสว่าง): ปกเพลงเบลอจางๆ ด้านบนของแอพ ===== */
:root {
  --amb: 214, 128, 82;
  --amb2: 160, 90, 60;
  --amb3: 240, 190, 150;
}
#ambient {
  position: fixed;
  inset: -10% -10% auto;
  height: 80vh;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 20%, transparent 92%);
  mask-image: linear-gradient(#000 20%, transparent 92%);
}
#ambient img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(70px) saturate(1.5);
  opacity: 0;
  transform: scale(1.15);
  transition: opacity 1.6s ease;
}
#ambient img.show {
  opacity: 0.32;
}
.is-playing #ambient img.show {
  animation: amb-breathe-light 7s ease-in-out infinite;
}
@keyframes amb-breathe-light {
  50% {
    opacity: 0.45;
    transform: scale(1.22);
  }
}
/* วงแหวนรอบจอเพลง เรืองแสงเป็นสีจากปก */
.stage-ring {
  box-shadow: 0 0 40px rgba(var(--amb), 0.35);
  transition: box-shadow 1.2s;
}

:root { --wave: 206, 122, 84; }
