@font-face {
  font-family: 'Lora';
  src: url('fonts/Lora-400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('fonts/Lora-500.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('fonts/Lora-600.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('fonts/Lora-700.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('fonts/Raleway-300.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('fonts/Raleway-400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('fonts/Raleway-500.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('fonts/Raleway-600.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('fonts/Raleway-700.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif SC';
  src: url('fonts/NotoSerifSC-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif SC';
  src: url('fonts/NotoSerifSC-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif SC';
  src: url('fonts/NotoSerifSC-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('fonts/NotoSansSC-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('fonts/NotoSansSC-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('fonts/NotoSansSC-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('fonts/NotoSansSC-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0F172A;
  --bg-ink: #0B1120;
  --card: #192134;
  --white: #F8FAFC;
  --muted: #94A3B8;
  --indigo: #4338CA;
  --indigo-light: #6366F1;
  --violet: #7C3AED;
  --lavender: #A78BFA;
  --lavender-light: #C4B5FD;
  --glass: rgba(255, 255, 255, .08);
  --glass-line: rgba(255, 255, 255, .12);
  --serif: 'Lora', 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --sans: 'Raleway', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --tabbar-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  color-scheme: dark;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--white);
  font-family: var(--sans);
  background:
    radial-gradient(1200px 720px at 12% -14%, rgba(99, 102, 241, .16), transparent 64%),
    radial-gradient(980px 720px at 92% 0%, rgba(124, 58, 237, .13), transparent 64%),
    linear-gradient(180deg, #0B1120 0%, #0A1020 48%, #0B1224 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(196, 181, 253, .9);
  outline-offset: 3px;
}

input[type="range"] {
  touch-action: none;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.serif {
  font-family: var(--serif);
}

/* ——— App shell ——— */
.app-shell {
  min-height: 100dvh;
  padding: 26px 16px;
  display: grid;
  place-items: center;
}

.app {
  position: relative;
  width: 375px;
  height: 812px;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
  border-radius: 42px;
  box-shadow:
    0 42px 96px rgba(2, 6, 23, .62),
    0 10px 28px rgba(2, 6, 23, .38),
    0 0 0 1px rgba(255, 255, 255, .08),
    0 0 90px rgba(67, 56, 202, .16);
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 60;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .07),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  pointer-events: none;
}

/* ——— Status bar ——— */
.app-statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 35;
  height: calc(44px + var(--safe-top));
  padding: calc(9px + var(--safe-top)) 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  color: rgba(248, 250, 252, .94);
}

.status-time {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-icon {
  width: 16px;
  height: 11px;
  fill: currentColor;
  stroke: none;
  opacity: .92;
}

.status-icon.battery {
  width: 19px;
  height: 11px;
}

/* ——— Views ——— */
.view-stack {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity .34s ease,
    transform .34s cubic-bezier(.2, .7, .2, 1),
    visibility .34s;
}

.view.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.view-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  z-index: 0;
  filter: brightness(.9) saturate(1.1) contrast(1.01);
  transform: scale(1.035);
  pointer-events: none;
}

.player-bg {
  object-position: center 34%;
  filter: brightness(.78) saturate(1.16) contrast(1.02);
  animation: bg-drift 26s ease-in-out infinite alternate;
}

.scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.scrim-home {
  background:
    linear-gradient(180deg,
      rgba(15, 23, 42, .50) 0%,
      rgba(15, 23, 42, .14) 22%,
      rgba(15, 23, 42, .07) 42%,
      rgba(15, 23, 42, .48) 65%,
      rgba(15, 23, 42, .90) 84%,
      #0F172A 100%),
    radial-gradient(125% 60% at 50% 28%, transparent 42%, rgba(15, 23, 42, .26) 100%);
}

.scrim-player {
  background:
    radial-gradient(90% 58% at 50% 42%, rgba(15, 23, 42, .06) 0%, rgba(15, 23, 42, .30) 58%, rgba(15, 23, 42, .66) 100%),
    linear-gradient(180deg,
      rgba(15, 23, 42, .50) 0%,
      rgba(15, 23, 42, .20) 24%,
      rgba(15, 23, 42, .13) 47%,
      rgba(15, 23, 42, .60) 72%,
      rgba(15, 23, 42, .95) 90%,
      #0F172A 100%);
}

.view-scroll {
  position: relative;
  z-index: 3;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.view-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.glass {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
  backdrop-filter: blur(26px) saturate(145%);
  box-shadow:
    0 18px 44px rgba(2, 6, 23, .30),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}

.eyebrow {
  margin: 0;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .18em;
  color: rgba(226, 232, 240, .62);
  text-transform: uppercase;
}

/* ——— Home ——— */
.home-nav {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(52px + var(--safe-top)) 22px 0;
  height: auto;
  position: relative;
  z-index: 5;
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .28em;
  color: rgba(248, 250, 252, .84);
}

.mini-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #DDD6FE;
}

.mini-mark .icon {
  width: 15px;
  height: 15px;
}

.avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .38), transparent 36%),
    linear-gradient(145deg, #A78BFA 0%, #6366F1 52%, #4338CA 100%);
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: 0 5px 18px rgba(67, 56, 202, .32);
}

.avatar i {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #A78BFA;
  border: 2px solid #11192D;
  box-shadow: 0 0 8px rgba(167, 139, 250, .8);
}

.home-scroll {
  display: flex;
  flex-direction: column;
  padding: 22px 22px calc(104px + var(--safe-bottom));
}

.greeting h1 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.025em;
  color: #F8FAFC;
  text-shadow: 0 4px 30px rgba(15, 23, 42, .4);
}

.greeting h1 em {
  font-style: normal;
  color: var(--lavender-light);
}

.greeting-sub {
  margin: 8px 0 0;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .03em;
  color: rgba(203, 213, 225, .74);
}

.plan-card {
  position: relative;
  margin-top: 26px;
  padding: 15px 16px 13px;
  border-radius: 22px;
  overflow: hidden;
}

.plan-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -40px;
  width: 150px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, .18), transparent 68%);
  pointer-events: none;
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .06em;
  color: #E2E8F0;
}

.plan-kicker .icon {
  width: 13px;
  height: 13px;
  color: var(--lavender);
}

.plan-edit {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  margin: -4px -6px -4px 0;
  border-radius: 99px;
  font-size: 9.5px;
  color: rgba(148, 163, 184, .9);
  transition: color .2s ease, background .2s ease;
}

.plan-edit:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, .07);
}

.plan-edit .icon {
  width: 11px;
  height: 11px;
}

.plan-times {
  display: flex;
  align-items: center;
  margin-top: 12px;
}

.plan-time {
  min-width: 58px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plan-time > span {
  font-size: 9px;
  letter-spacing: .14em;
  color: rgba(148, 163, 184, .8);
}

.plan-time strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  color: #F8FAFC;
  font-variant-numeric: tabular-nums;
}

.plan-time.right {
  align-items: flex-end;
  text-align: right;
}

.plan-line {
  position: relative;
  flex: 1;
  height: 34px;
  margin: 0 8px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rail {
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(167, 139, 250, .16), rgba(167, 139, 250, .62), rgba(167, 139, 250, .16));
}

.rail::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 43%;
  height: 100%;
  background: linear-gradient(90deg, #6366F1, #A78BFA);
  box-shadow: 0 0 10px rgba(124, 58, 237, .7);
}

.node {
  position: relative;
  z-index: 1;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #DDD6FE;
  box-shadow: 0 0 8px rgba(167, 139, 250, .9);
}

.plan-duration {
  position: absolute;
  left: 50%;
  top: -4px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(15, 23, 42, .68);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .05em;
  color: #DDD6FE;
  white-space: nowrap;
}

.plan-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  font-size: 9px;
  color: rgba(148, 163, 184, .78);
}

.plan-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #C7D2FE;
}

.plan-status i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lavender);
  box-shadow: 0 0 8px var(--lavender);
  animation: dot-pulse 2.4s ease-in-out infinite;
}

.plan-start {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 500;
  color: #F8FAFC;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  transition: background .2s ease, transform .2s ease;
}

.plan-start:hover {
  background: rgba(255, 255, 255, .16);
  transform: translateY(-1px);
}

.plan-start .icon {
  width: 9px;
  height: 9px;
}

.rec-section {
  margin-top: auto;
  padding-top: 26px;
}

.rec-head {
  margin-bottom: 12px;
  padding: 0 2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.rec-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: #F1F5F9;
}

.rec-count {
  font-size: 9.5px;
  letter-spacing: .04em;
  color: rgba(148, 163, 184, .8);
}

.rec-row {
  display: flex;
  gap: 9px;
}

.rec-card {
  flex: 1;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 17px;
  text-align: left;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 12px 28px rgba(2, 6, 23, .25);
  transition: transform .25s ease, border-color .25s ease;
}

.rec-card:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, .38);
}

.rec-card:active {
  transform: scale(.975);
}

.rec-art {
  position: relative;
  display: block;
  height: 112px;
  overflow: hidden;
}

.rec-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, .02) 25%, rgba(15, 23, 42, .72) 100%);
}

.rec-icon {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 3;
  width: 28px;
  height: 28px;
  padding: 7px;
  border-radius: 9px;
  background: rgba(15, 23, 42, .32);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .32));
}

.rec-play {
  position: absolute;
  right: 9px;
  bottom: 9px;
  z-index: 3;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .20);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
}

.rec-play .icon {
  width: 8px;
  height: 8px;
  margin-left: 1px;
}

.art-rain {
  background:
    radial-gradient(90px 80px at 78% 18%, rgba(96, 165, 250, .62), transparent 65%),
    radial-gradient(80px 90px at 20% 82%, rgba(67, 56, 202, .52), transparent 70%),
    repeating-linear-gradient(112deg, transparent 0 8px, rgba(191, 219, 254, .10) 8px 9px),
    linear-gradient(155deg, #16255A 0%, #0F1B3D 48%, #10182E 100%);
}

.art-aurora {
  background-image:
    linear-gradient(180deg, rgba(67, 56, 202, .08), rgba(15, 23, 42, .18)),
    url('images/aurora-night.jpg');
  background-size: cover, 168%;
  background-position: center, 58% 58%;
}

.art-forest {
  background:
    radial-gradient(90px 90px at 25% 20%, rgba(52, 211, 153, .54), transparent 68%),
    radial-gradient(100px 90px at 82% 82%, rgba(5, 150, 105, .46), transparent 70%),
    repeating-linear-gradient(76deg, transparent 0 11px, rgba(209, 250, 229, .07) 11px 12px),
    linear-gradient(155deg, #123E35 0%, #0C2A2A 52%, #10182E 100%);
}

.rec-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 10px 11px;
  background: rgba(25, 33, 52, .97);
}

.rec-title {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: #F1F5F9;
}

.rec-meta {
  font-size: 9.5px;
  color: rgba(148, 163, 184, .82);
}

/* ——— Mix lab ——— */
.mix-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(440px 380px at 108% -4%, rgba(124, 58, 237, .25), transparent 64%),
    radial-gradient(520px 360px at -12% 34%, rgba(67, 56, 202, .20), transparent 70%),
    radial-gradient(420px 400px at 50% 112%, rgba(99, 102, 241, .10), transparent 72%),
    linear-gradient(180deg, #0F172A 0%, #0C1324 55%, #0F172A 100%);
}

.mix-bg::before,
.report-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: radial-gradient(rgba(255, 255, 255, .36) .7px, transparent .8px);
  background-size: 58px 58px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
}

.page-head {
  position: relative;
  z-index: 5;
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: calc(58px + var(--safe-top)) 22px 0;
}

.head-copy h1 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: #F8FAFC;
}

.reset-btn {
  height: 28px;
  padding: 0 13px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  font-size: 9.5px;
  color: rgba(203, 213, 225, .86);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  transition: background .2s ease, color .2s ease;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, .11);
  color: #F8FAFC;
}

.mix-scroll {
  padding: 14px 20px calc(104px + var(--safe-bottom));
}

.mix-lead {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: .02em;
  color: rgba(148, 163, 184, .82);
}

.now-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  color: rgba(148, 163, 184, .82);
}

.now-left {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #C7D2FE;
  letter-spacing: .03em;
}

.now-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.eq {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 11px;
}

.eq i {
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: var(--lavender);
  box-shadow: 0 0 6px rgba(167, 139, 250, .6);
  animation: eq 1.1s ease-in-out infinite;
}

.eq i:nth-child(2) { animation-delay: -.35s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
.eq i:nth-child(4) { animation-delay: -.15s; }

.tracks {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.track-card {
  height: 96px;
  flex: none;
  padding: 12px 14px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 18px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
  cursor: pointer;
}

.track-card:hover {
  background: rgba(255, 255, 255, .10);
}

.track-card.active {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(167, 139, 250, .74);
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, .18),
    0 12px 34px rgba(67, 56, 202, .22),
    inset 0 1px 0 rgba(255, 255, 255, .15);
}

.track-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.track-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}

.track-icon .icon {
  width: 19px;
  height: 19px;
}

.tile-rain {
  background: linear-gradient(145deg, #60A5FA 0%, #4338CA 100%);
  box-shadow: 0 8px 20px rgba(96, 165, 250, .22), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.tile-ocean {
  background: linear-gradient(145deg, #22D3EE 0%, #0E7490 55%, #4338CA 100%);
  box-shadow: 0 8px 20px rgba(34, 211, 238, .18), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.tile-forest {
  background: linear-gradient(145deg, #6EE7B7 0%, #10B981 52%, #047857 100%);
  box-shadow: 0 8px 20px rgba(52, 211, 153, .18), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.tile-fire {
  background: linear-gradient(145deg, #FDE68A 0%, #F59E0B 48%, #EA580C 100%);
  box-shadow: 0 8px 20px rgba(245, 158, 11, .18), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.track-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.track-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  color: #F1F5F9;
}

.track-sub {
  font-size: 9.5px;
  line-height: 1.35;
  color: rgba(148, 163, 184, .82);
}

.track-value {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-size: 12.5px;
  font-weight: 600;
  color: #E2E8F0;
  font-variant-numeric: tabular-nums;
}

.track-value small {
  font-size: 8.5px;
  font-weight: 500;
  color: rgba(148, 163, 184, .82);
}

.track-slider {
  display: flex;
  align-items: center;
  gap: 9px;
}

.color-block {
  width: 5px;
  height: 14px;
  flex: none;
  border-radius: 3px;
  background: var(--track);
  box-shadow: 0 0 9px var(--track);
}

.track-range {
  width: 100%;
  height: 20px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.track-range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    var(--track) 0%,
    var(--track) var(--p),
    rgba(255, 255, 255, .11) var(--p),
    rgba(255, 255, 255, .11) 100%);
}

.track-range::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  background: #F8FAFC;
  border: 3px solid var(--track);
  box-shadow:
    0 0 0 3px rgba(15, 23, 42, .22),
    0 0 12px rgba(167, 139, 250, .34);
}

.track-range::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
}

.track-range::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--track);
}

.track-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #F8FAFC;
  border: 3px solid var(--track);
  box-shadow: 0 0 10px rgba(167, 139, 250, .34);
}

.save-btn {
  position: relative;
  width: 100%;
  height: 54px;
  flex: none;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #fff;
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 255, 255, .18), transparent 34%),
    linear-gradient(135deg, #4338CA 0%, #7C3AED 56%, #8B5CF6 100%);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow:
    0 14px 34px rgba(124, 58, 237, .32),
    0 2px 10px rgba(30, 27, 75, .28),
    inset 0 1px 0 rgba(255, 255, 255, .26);
  transition: transform .2s ease, box-shadow .2s ease;
}

.save-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 40px rgba(124, 58, 237, .42),
    0 2px 10px rgba(30, 27, 75, .28),
    inset 0 1px 0 rgba(255, 255, 255, .30);
}

.save-btn:active {
  transform: scale(.985);
}

.save-btn .icon {
  width: 15px;
  height: 15px;
}

.save-btn .i-check {
  display: none;
}

.save-btn.saved .i-plus {
  display: none;
}

.save-btn.saved .i-check {
  display: block;
}

.save-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: .03em;
  color: rgba(148, 163, 184, .72);
}

/* ——— Sleep report ——— */
.report-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(460px 380px at 104% -6%, rgba(124, 58, 237, .22), transparent 66%),
    radial-gradient(520px 380px at -8% 26%, rgba(67, 56, 202, .16), transparent 68%),
    radial-gradient(440px 360px at 48% 108%, rgba(99, 102, 241, .10), transparent 72%),
    linear-gradient(180deg, #10192F 0%, #0D1526 56%, #0F172A 100%);
}

.report-bg::before {
  opacity: .12;
  background-size: 64px 64px;
}

.report-head {
  align-items: flex-end;
}

.icon-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #E2E8F0;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: background .2s ease, transform .2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .13);
  transform: translateY(-1px);
}

.icon-btn.on {
  color: #F5D0FE;
  background: rgba(124, 58, 237, .26);
  border-color: rgba(167, 139, 250, .55);
  box-shadow: 0 0 18px rgba(124, 58, 237, .38), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.icon-btn.on .icon {
  fill: currentColor;
}

.icon-btn:active {
  transform: scale(.94);
}

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

.report-scroll {
  padding: 14px 20px calc(104px + var(--safe-bottom));
}

.date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  letter-spacing: .03em;
  color: rgba(148, 163, 184, .82);
}

.trend {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #C4B5FD;
}

.trend .icon {
  width: 9px;
  height: 9px;
}

.score-card {
  margin-top: 10px;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  gap: 17px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.score-card::after {
  content: "";
  position: absolute;
  top: -64px;
  right: -50px;
  width: 160px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, .18), transparent 68%);
  pointer-events: none;
}

.score-ring {
  position: relative;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-track,
.score-progress {
  fill: none;
  stroke-width: 7;
}

.score-track {
  stroke: rgba(255, 255, 255, .09);
}

.score-progress {
  stroke: url(#scoreGrad);
  stroke-linecap: round;
  stroke-dasharray: 301.6;
  stroke-dashoffset: 48.3;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, .58));
}

.view-report.active .score-progress {
  animation: score-draw 1.3s cubic-bezier(.25, .8, .3, 1) both;
}

.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
  color: #F8FAFC;
}

.score-cap {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .12em;
  color: rgba(148, 163, 184, .8);
}

.score-copy {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 7px;
  padding: 3px 7px;
  border-radius: 99px;
  background: rgba(124, 58, 237, .18);
  border: 1px solid rgba(167, 139, 250, .26);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: #DDD6FE;
}

.score-badge i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lavender);
  box-shadow: 0 0 7px var(--lavender);
}

.score-copy h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: #F1F5F9;
}

.score-copy p {
  margin: 0;
  font-size: 10px;
  line-height: 1.65;
  color: rgba(148, 163, 184, .82);
}

.score-copy strong {
  font-weight: 600;
  color: #C7D2FE;
}

.stage-card {
  margin-top: 12px;
  padding: 14px 15px 12px;
  border-radius: 22px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  color: #F1F5F9;
}

.card-head p {
  margin: 3px 0 0;
  font-size: 9px;
  letter-spacing: .04em;
  color: rgba(148, 163, 184, .74);
}

.stage-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.stage-total strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  color: #E2E8F0;
}

.stage-total span {
  font-size: 8px;
  letter-spacing: .06em;
  color: rgba(148, 163, 184, .74);
}

.stage-chart {
  position: relative;
  height: 148px;
  margin-top: 4px;
  padding: 0 2px 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
}

.stage-chart::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 22px;
  height: 1px;
  background: rgba(255, 255, 255, .09);
}

.grid-line {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1px;
  background: rgba(255, 255, 255, .045);
  z-index: 0;
}

.line-a { bottom: 64px; }
.line-b { bottom: 106px; }

.stage-col {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.stage-val {
  margin-bottom: 5px;
  font-size: 9px;
  color: rgba(148, 163, 184, .8);
  font-variant-numeric: tabular-nums;
}

.stage-bar {
  display: block;
  width: 36px;
  border-radius: 6px 6px 2px 2px;
  transform-origin: bottom center;
  transform: scaleY(0);
}

.view-report.active .stage-bar {
  animation: bar-rise .85s cubic-bezier(.22, .8, .26, 1) forwards;
}

.view-report.active .stage-col:nth-child(3) .stage-bar { animation-delay: .05s; }
.view-report.active .stage-col:nth-child(4) .stage-bar { animation-delay: .1s; }
.view-report.active .stage-col:nth-child(5) .stage-bar { animation-delay: .15s; }
.view-report.active .stage-col:nth-child(6) .stage-bar { animation-delay: .2s; }

.stage-bar.deep {
  background: #4338CA;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 6px 18px rgba(67, 56, 202, .30);
}

.stage-bar.light {
  background: #6366F1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 18px rgba(99, 102, 241, .28);
}

.stage-bar.rem {
  background: #A78BFA;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 6px 18px rgba(167, 139, 250, .26);
}

.stage-bar.awake {
  background: #64748B;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20);
}

.stage-name {
  position: absolute;
  bottom: -19px;
  font-size: 9px;
  letter-spacing: .02em;
  color: rgba(203, 213, 225, .82);
  white-space: nowrap;
}

.metric-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.metric-card {
  flex: 1;
  min-width: 0;
  padding: 11px 10px 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08);
  position: relative;
  overflow: hidden;
}

.metric-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 7px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(99, 102, 241, .16);
  color: #A5B4FC;
}

.metric-icon .icon {
  width: 12px;
  height: 12px;
}

.metric-label {
  display: block;
  font-size: 8.5px;
  letter-spacing: .03em;
  color: rgba(148, 163, 184, .82);
}

.metric-value {
  display: block;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
  white-space: nowrap;
  color: #F8FAFC;
}

.metric-sub {
  display: block;
  margin-top: 3px;
  font-size: 8.5px;
  color: rgba(148, 163, 184, .68);
}

.insight-card {
  margin-top: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.insight-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(124, 58, 237, .38), rgba(67, 56, 202, .24));
  border: 1px solid rgba(167, 139, 250, .20);
  color: #DDD6FE;
}

.insight-icon .icon {
  width: 14px;
  height: 14px;
}

.insight-card p {
  flex: 1;
  margin: 0;
  font-size: 9.5px;
  line-height: 1.5;
  color: rgba(148, 163, 184, .82);
}

.insight-card strong {
  font-weight: 600;
  color: #E2E8F0;
}

.insight-arrow {
  width: 11px;
  height: 11px;
  flex: none;
  color: rgba(148, 163, 184, .62);
}

/* ——— Player ——— */
.view-player {
  z-index: 20;
  transform: translateY(100%);
  transition:
    transform .46s cubic-bezier(.32, .72, 0, 1),
    opacity .3s ease,
    visibility .46s;
}

.view-player.active {
  transform: translateY(0);
}

.player-head {
  position: relative;
  z-index: 5;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(54px + var(--safe-top)) 20px 0;
}

.player-head-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 1px;
}

.player-head-copy span {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .2em;
  color: rgba(148, 163, 184, .75);
  text-transform: uppercase;
}

.player-head-copy strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .05em;
  color: #F8FAFC;
}

.player-body {
  position: relative;
  z-index: 3;
  flex: 1;
  min-height: 0;
  padding: 0 22px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.player-title {
  text-align: center;
  flex: none;
}

.player-title h1 {
  margin: 6px 0 5px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: #F8FAFC;
  text-shadow: 0 4px 28px rgba(15, 23, 42, .40);
}

.player-title > p:last-child {
  margin: 0;
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(203, 213, 225, .64);
}

.orb-stage {
  position: relative;
  flex: none;
  width: 300px;
  height: 300px;
  margin: 8px 0 2px;
  display: grid;
  place-items: center;
}

.orb-halo {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(124, 58, 237, .42) 0%,
    rgba(99, 102, 241, .17) 34%,
    rgba(99, 102, 241, .04) 58%,
    transparent 70%);
  filter: blur(9px);
  animation: halo-478 19s cubic-bezier(.4, 0, .5, 1) infinite;
  animation-delay: var(--breath-delay, 0s);
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(196, 181, 253, .16);
}

.ring-a {
  width: 196px;
  height: 196px;
  border-top-color: rgba(196, 181, 253, .30);
  box-shadow: inset 0 0 26px rgba(167, 139, 250, .08);
  animation: ring-a-478 19s cubic-bezier(.4, 0, .5, 1) infinite;
  animation-delay: var(--breath-delay, 0s);
}

.ring-b {
  width: 242px;
  height: 242px;
  border-color: rgba(255, 255, 255, .08);
  border-bottom-color: rgba(196, 181, 253, .22);
  animation: ring-b-478 19s cubic-bezier(.4, 0, .5, 1) infinite;
  animation-delay: var(--breath-delay, 0s);
}

.orb {
  position: relative;
  z-index: 2;
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 31% 24%,
    #C4B5FD 0%,
    #A78BFA 18%,
    #7C3AED 48%,
    #4338CA 76%,
    #312E81 100%);
  box-shadow:
    0 0 48px rgba(124, 58, 237, .78),
    0 0 104px rgba(99, 102, 241, .42),
    inset -10px -14px 30px rgba(15, 23, 42, .44),
    inset 9px 10px 26px rgba(255, 255, 255, .30);
  animation: orb-478 19s infinite;
  animation-delay: var(--breath-delay, 0s);
}

.orb::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(196, 181, 253, .12);
  pointer-events: none;
}

.orb-highlight {
  position: absolute;
  top: 17px;
  left: 23px;
  width: 42px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .46);
  filter: blur(8px);
  transform: rotate(-30deg);
}

.orb-rim {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 -12px 24px rgba(30, 27, 75, .24);
}

.orb-text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-shadow: 0 2px 20px rgba(30, 27, 75, .65);
}

.orb-word {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: .06em;
  color: #F8FAFC;
}

.orb-sec {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .70);
  font-variant-numeric: tabular-nums;
}

.orb-spark {
  position: absolute;
  z-index: 3;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #DDD6FE;
  box-shadow: 0 0 12px #A78BFA;
  animation: twinkle 4s ease-in-out infinite;
}

.spark-a { top: 55px; left: 43px; }
.spark-b { top: 82px; right: 35px; width: 2px; height: 2px; animation-delay: -1.3s; }
.spark-c { bottom: 48px; left: 68px; width: 2px; height: 2px; animation-delay: -2.5s; }

.orb-stage.is-paused .orb,
.orb-stage.is-paused .orb-ring,
.orb-stage.is-paused .orb-halo,
.orb-stage.is-paused .orb-spark {
  animation-play-state: paused;
}

.guide {
  margin-top: 8px;
  text-align: center;
  flex: none;
}

.guide-main {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .01em;
  color: #F1F5F9;
}

.guide-sub {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .03em;
  color: rgba(148, 163, 184, .82);
}

.player-bottom {
  position: relative;
  z-index: 5;
  flex: none;
  padding: 0 24px calc(40px + var(--safe-bottom));
}

.progress-labels {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 500;
  color: rgba(148, 163, 184, .82);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  cursor: pointer;
}

.progress-track::before {
  content: "";
  position: absolute;
  inset: -10px 0;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366F1 0%, #A78BFA 100%);
  box-shadow: 0 0 12px rgba(124, 58, 237, .42);
}

.progress-fill::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E9D5FF;
  box-shadow: 0 0 10px #A78BFA;
  transform: translateY(-50%);
}

.controls {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ctrl {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #CBD5E1;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.ctrl:hover {
  background: rgba(255, 255, 255, .11);
  color: #F8FAFC;
}

.ctrl:active {
  transform: scale(.9);
}

.ctrl .icon {
  width: 15px;
  height: 15px;
}

.ctrl.on {
  color: #E9D5FF;
  background: rgba(124, 58, 237, .26);
  border-color: rgba(167, 139, 250, .5);
  box-shadow: 0 0 16px rgba(124, 58, 237, .34);
}

.play-btn {
  width: 64px;
  height: 64px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .32), transparent 30%),
    linear-gradient(145deg, #A78BFA 0%, #7C3AED 48%, #4338CA 100%);
  box-shadow:
    0 0 36px rgba(124, 58, 237, .62),
    0 12px 30px rgba(30, 27, 75, .45),
    inset 0 1px 0 rgba(255, 255, 255, .34);
}

.play-btn:hover {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .38), transparent 30%),
    linear-gradient(145deg, #B4A0FC 0%, #7C3AED 48%, #4F46E5 100%);
}

.play-btn .icon {
  width: 21px;
  height: 21px;
}

.play-btn .i-play {
  display: none;
  margin-left: 2px;
}

.play-btn.paused .i-pause {
  display: none;
}

.play-btn.paused .i-play {
  display: block;
}

.session-note {
  margin: 15px 0 0;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: .03em;
  color: rgba(148, 163, 184, .74);
}

/* ——— Tab bar ——— */
.tabbar {
  position: absolute;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  z-index: 25;
  transform: translateX(-50%);
  width: calc(100% - 44px);
  max-width: 331px;
  height: var(--tabbar-h);
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-radius: 30px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  box-shadow:
    0 18px 40px rgba(2, 6, 23, .48),
    inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: opacity .28s ease, transform .34s cubic-bezier(.3, .7, .2, 1);
}

.app[data-view="player"] .tabbar {
  opacity: 0;
  transform: translateX(-50%) translateY(130px);
  pointer-events: none;
}

.tab {
  flex: 1;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .05em;
  color: rgba(148, 163, 184, .9);
  transition: color .2s ease;
}

.tab-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  transition: background .25s ease, box-shadow .25s ease;
}

.tab-icon .icon {
  width: 16px;
  height: 16px;
}

.tab.active {
  color: #F8FAFC;
}

.tab.active .tab-icon {
  background: linear-gradient(135deg, #6366F1 0%, #7C3AED 100%);
  box-shadow:
    0 0 20px rgba(124, 58, 237, .55),
    inset 0 1px 0 rgba(255, 255, 255, .26);
}

.home-indicator {
  position: absolute;
  left: 50%;
  bottom: calc(7px + var(--safe-bottom));
  z-index: 34;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 10px rgba(255, 255, 255, .12);
  pointer-events: none;
}

.app[data-view="player"] .home-indicator {
  background: rgba(255, 255, 255, .35);
}

/* ——— Toast ——— */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(102px + var(--safe-bottom));
  z-index: 80;
  max-width: calc(100% - 64px);
  padding: 10px 16px;
  border-radius: 99px;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .02em;
  text-align: center;
  color: #F1F5F9;
  background: rgba(23, 31, 50, .86);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 14px 34px rgba(2, 6, 23, .5);
  opacity: 0;
  transform: translate(-50%, 14px) scale(.96);
  pointer-events: none;
  transition: opacity .26s ease, transform .3s cubic-bezier(.2, .7, .2, 1);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ——— Plan sheet ——— */
.sheet-layer {
  position: absolute;
  inset: 0;
  z-index: 70;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s;
}

.sheet-layer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 20px calc(24px + var(--safe-bottom));
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #1B2439 0%, #141C2E 100%);
  border-top: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 -20px 60px rgba(2, 6, 23, .6);
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.32, .72, 0, 1);
}

.sheet-layer.open .sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 9px auto 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, .22);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: #F8FAFC;
}

.sheet-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(203, 213, 225, .8);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
}

.sheet-close .icon {
  width: 13px;
  height: 13px;
}

.sheet-sub {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(148, 163, 184, .82);
}

.plan-options {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.plan-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 44px 12px 14px;
  border-radius: 16px;
  text-align: left;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  transition: border-color .22s ease, background .22s ease;
}

.plan-option.selected {
  background: rgba(124, 58, 237, .16);
  border-color: rgba(167, 139, 250, .66);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, .14), 0 10px 26px rgba(67, 56, 202, .2);
}

.option-main {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: #F1F5F9;
  font-variant-numeric: tabular-nums;
}

.option-main i {
  font-style: normal;
  font-size: 11px;
  color: rgba(148, 163, 184, .7);
}

.option-sub {
  font-size: 9.5px;
  letter-spacing: .02em;
  color: rgba(148, 163, 184, .8);
}

.option-check {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  color: transparent;
  transition: all .22s ease;
}

.option-check .icon {
  width: 11px;
  height: 11px;
}

.plan-option.selected .option-check {
  color: #fff;
  background: linear-gradient(135deg, #6366F1, #7C3AED);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(124, 58, 237, .6);
}

.sheet-confirm {
  width: 100%;
  height: 50px;
  margin-top: 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #fff;
  background: linear-gradient(135deg, #4338CA 0%, #7C3AED 60%, #8B5CF6 100%);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow:
    0 14px 32px rgba(124, 58, 237, .3),
    inset 0 1px 0 rgba(255, 255, 255, .24);
}

.sheet-confirm:active {
  transform: scale(.985);
}

/* ——— Motion ——— */
@keyframes bg-drift {
  from { transform: scale(1.045) translate3d(0, 0, 0); }
  to { transform: scale(1.10) translate3d(0, -9px, 0); }
}

@keyframes orb-478 {
  0% {
    transform: scale(.84);
    animation-timing-function: cubic-bezier(.4, 0, .5, 1);
  }
  21.05% {
    transform: scale(1.15);
    animation-timing-function: linear;
  }
  57.89% {
    transform: scale(1.15);
    animation-timing-function: cubic-bezier(.45, 0, .55, 1);
  }
  100% {
    transform: scale(.84);
  }
}

@keyframes halo-478 {
  0% {
    transform: scale(.94);
    opacity: .72;
    animation-timing-function: cubic-bezier(.4, 0, .5, 1);
  }
  21.05% {
    transform: scale(1.08);
    opacity: 1;
    animation-timing-function: linear;
  }
  57.89% {
    transform: scale(1.08);
    opacity: 1;
    animation-timing-function: cubic-bezier(.45, 0, .55, 1);
  }
  100% {
    transform: scale(.94);
    opacity: .72;
  }
}

@keyframes ring-a-478 {
  0% {
    transform: scale(.96);
    opacity: .55;
    animation-timing-function: cubic-bezier(.4, 0, .5, 1);
  }
  21.05% {
    transform: scale(1.07);
    opacity: .95;
    animation-timing-function: linear;
  }
  57.89% {
    transform: scale(1.07);
    opacity: .95;
    animation-timing-function: cubic-bezier(.45, 0, .55, 1);
  }
  100% {
    transform: scale(.96);
    opacity: .55;
  }
}

@keyframes ring-b-478 {
  0% {
    transform: scale(.98);
    opacity: .5;
    animation-timing-function: cubic-bezier(.4, 0, .5, 1);
  }
  21.05% {
    transform: scale(1.05);
    opacity: .85;
    animation-timing-function: linear;
  }
  57.89% {
    transform: scale(1.05);
    opacity: .85;
    animation-timing-function: cubic-bezier(.45, 0, .55, 1);
  }
  100% {
    transform: scale(.98);
    opacity: .5;
  }
}

@keyframes twinkle {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes dot-pulse {
  0%, 100% { opacity: .55; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes eq {
  0%, 100% { height: 4px; opacity: .62; }
  50% { height: 11px; opacity: 1; }
}

@keyframes score-draw {
  from { stroke-dashoffset: 301.6; }
  to { stroke-dashoffset: 48.3; }
}

@keyframes bar-rise {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* ——— Mobile full screen ——— */
@media (max-width: 640px) {
  .app-shell {
    display: block;
    padding: 0;
    min-height: 100dvh;
  }

  .app {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .app::after {
    border-radius: 0;
  }
}

@media (max-height: 780px) and (max-width: 640px) {
  .orb-stage {
    width: 260px;
    height: 260px;
  }

  .orb-halo {
    width: 260px;
    height: 260px;
  }

  .ring-a { width: 172px; height: 172px; }
  .ring-b { width: 212px; height: 212px; }

  .orb {
    width: 112px;
    height: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
