:root {
  --lavender: #E2D6FF;
  --deep-purple: #2A1B6F;
  --pale: #F7F4FF;
  --ink: #323232;
  --line: rgba(42, 27, 111, 0.12);
  --card: #ffffff;
  --bg: #F7F4FF;
  --accent: #b39ce0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: 'Quicksand', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }

/* gentle ambient gradient on picker bg */
#picker { padding: 48px 56px 64px; background: radial-gradient(ellipse 80% 60% at 20% 0%, var(--lavender) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 100% 100%, #f0e6ff 0%, transparent 60%), var(--bg); min-height: 100%; }

.view { position: fixed; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; overflow: auto; }
.view.active { opacity: 1; pointer-events: auto; }

.header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; gap: 32px; flex-wrap: wrap; }
.header .brand-logo { height: 64px; width: auto; }
.header-text { flex: 1; min-width: 280px; }
.eyebrow { font-family: 'Quicksand', sans-serif; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--deep-purple); font-weight: 600; margin-bottom: 12px; opacity: 0.7; }
.h1 { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500; font-size: clamp(36px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.01em; margin: 0; color: var(--deep-purple); }
.h1-sub { font-size: 16px; color: var(--ink); margin: 14px 0 0; max-width: 580px; line-height: 1.55; opacity: 0.75; }

.seasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; max-width: 1600px; }
.season { position: relative; aspect-ratio: 4/5; border-radius: 22px; overflow: hidden; cursor: pointer; border: 1px solid var(--line); background: var(--deep-purple); transition: transform 0.3s ease, box-shadow 0.3s ease; isolation: isolate; }
.season:hover { transform: translateY(-4px) rotate(-0.3deg); box-shadow: 0 24px 50px -20px rgba(42, 27, 111, 0.3); }
.season-bg { position: absolute; inset: 0; z-index: 0; transition: transform 0.8s ease; background-size: cover; background-position: center; }
.season:hover .season-bg { transform: scale(1.06); }
.season-grad { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 40%, rgba(42, 27, 111, 0.75) 100%); }
.season-content { position: absolute; left: 22px; right: 22px; bottom: 22px; z-index: 2; color: #fff; }
.season-name { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500; font-size: 28px; letter-spacing: -0.005em; margin: 0; }
.season-sub { font-family: 'Quicksand', sans-serif; font-size: 11px; opacity: 0.85; margin: 4px 0 0; letter-spacing: 0.14em; text-transform: uppercase; }
.season-count { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(255,255,255,0.25); backdrop-filter: blur(8px); color: #fff; font-family: 'Quicksand', sans-serif; font-size: 10px; padding: 5px 10px; border-radius: 999px; letter-spacing: 0.1em; font-weight: 500; }
.season-empty .season-bg { background-image: linear-gradient(135deg, transparent 49%, rgba(255,255,255,0.10) 49%, rgba(255,255,255,0.10) 51%, transparent 51%), linear-gradient(135deg, transparent 49%, rgba(255,255,255,0.10) 49%, rgba(255,255,255,0.10) 51%, transparent 51%); background-size: 24px 24px; background-position: 0 0, 12px 12px; }

.picker-foot { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; gap: 24px; flex-wrap: wrap; align-items: center; justify-content: space-between; color: var(--ink); font-size: 13px; opacity: 0.75; }
.picker-foot a { color: var(--deep-purple); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 500; }

/* SETUP */
#setup { background: var(--bg); padding: 40px 48px 80px; }
.setup-wrap { max-width: 820px; margin: 0 auto; }
.setup-back { background: none; border: none; cursor: pointer; padding: 6px 0; font: inherit; color: var(--deep-purple); font-size: 13px; margin-bottom: 16px; opacity: 0.75; }
.setup-back:hover { opacity: 1; }
.setup-title { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500; font-size: 40px; letter-spacing: -0.01em; margin: 0 0 6px; display: flex; align-items: center; gap: 14px; color: var(--deep-purple); }
.setup-title .accent { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.setup-sub { color: var(--ink); margin: 0 0 32px; font-size: 15px; opacity: 0.7; }

.row { margin-bottom: 28px; }
.row-label-line { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.row-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--deep-purple); font-weight: 600; }
.row-hint { font-size: 12px; color: var(--ink); flex: 1; opacity: 0.7; }
.add-btn { background: var(--deep-purple); color: #fff; border: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 11px; letter-spacing: 0.06em; font-weight: 500; }
.add-btn:hover { background: #1a0f55; }

.pillgroup { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px; transition: all 0.15s ease; }
.pill:hover { border-color: var(--deep-purple); }
.pill.active { background: var(--deep-purple); color: #fff; border-color: var(--deep-purple); }

.seg { display: inline-flex; padding: 3px; background: var(--lavender); border-radius: 999px; }
.seg-btn { background: none; border: none; cursor: pointer; padding: 6px 14px; font: inherit; font-size: 13px; border-radius: 999px; color: var(--deep-purple); opacity: 0.7; }
.seg-btn.active { background: var(--card); color: var(--deep-purple); box-shadow: 0 1px 4px rgba(42,27,111,0.12); opacity: 1; font-weight: 500; }

.num-input { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 4px 6px; }
.num-input button { background: none; border: none; cursor: pointer; padding: 6px 12px; font: inherit; font-size: 16px; color: var(--deep-purple); border-radius: 6px; }
.num-input button:hover { background: var(--lavender); }
.num-input input { width: 60px; text-align: center; border: none; background: none; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 22px; font-weight: 500; padding: 6px 0; color: var(--deep-purple); }
.num-input input:focus { outline: none; }
.num-input span { color: var(--ink); margin-right: 8px; font-size: 14px; opacity: 0.7; }

.duration-block { display: flex; flex-direction: column; gap: 12px; }
.pomo-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--lavender); border: 1px solid var(--line); border-radius: 10px; }
.pomo-chip { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500; font-size: 18px; color: var(--deep-purple); background: #fff; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); }
.pomo-chip.pomo-break { color: #8a5a2b; }
.pomo-arrow { color: var(--deep-purple); opacity: 0.6; font-size: 14px; }
.pomo-note { font-size: 12px; color: var(--ink); opacity: 0.7; margin-left: auto; font-family: 'Quicksand', sans-serif; }
.hidden { display: none !important; }

.pomo-cycle { font-family: 'Quicksand', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: rgba(255,255,255,0.7); text-shadow: 0 2px 6px rgba(0,0,0,0.55); margin-top: 4px; }
.timer-wrap.break-phase .timer-label { color: #ffd7a8; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gtile { position: relative; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--deep-purple) center/cover no-repeat; cursor: pointer; transition: all 0.2s ease; }
.gtile:hover { transform: translateY(-2px); }
.gtile.selected { border-color: var(--deep-purple); box-shadow: 0 8px 20px -8px rgba(42,27,111,0.4); }
.gtile.selected::after { content: '✓'; position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; background: var(--deep-purple); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.gtile-remove { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; background: rgba(42,27,111,0.7); color: #fff; border: none; border-radius: 50%; cursor: pointer; font-size: 12px; opacity: 0; transition: opacity 0.15s; line-height: 1; padding: 0; }
.gtile:hover .gtile-remove { opacity: 1; }
.gtile-empty { background: var(--card); border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--deep-purple); font-size: 11px; text-align: center; padding: 8px; opacity: 0.7; }
.gtile-empty:hover { border-color: var(--deep-purple); border-style: solid; opacity: 1; }

.audio-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.atile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 2px solid transparent; border-radius: 12px; cursor: pointer; transition: all 0.15s; }
.atile:hover { background: var(--pale); }
.atile.selected { border-color: var(--deep-purple); }
.atile-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--lavender); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--deep-purple); }
.atile-icon svg { width: 14px; height: 14px; }
.atile.selected .atile-icon { background: var(--deep-purple); color: #fff; }
.atile-name { flex: 1; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atile-meta { font-size: 11px; color: var(--ink); opacity: 0.6; font-family: 'Quicksand', sans-serif; letter-spacing: 0.04em; }
.atile-remove { background: none; border: none; cursor: pointer; color: var(--ink); opacity: 0.5; font-size: 16px; padding: 4px 8px; line-height: 1; }
.atile-remove:hover { opacity: 1; }
.atile-empty { padding: 24px 12px; text-align: center; color: var(--ink); font-size: 13px; background: rgba(42,27,111,0.04); border-radius: 12px; opacity: 0.7; }

.music-pane { padding-top: 4px; }
.text-input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: inherit; font-size: 14px; color: var(--ink); margin-top: 8px; }
.text-input:focus { outline: none; border-color: var(--deep-purple); }
.spotify-preview { margin-top: 10px; border-radius: 12px; overflow: hidden; background: var(--deep-purple); }
.spotify-preview iframe { display: block; border: 0; width: 100%; height: 152px; }

.start-btn { margin-top: 14px; padding: 18px 36px; font: inherit; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 20px; font-weight: 500; background: var(--deep-purple); color: #fff; border: none; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 12px; transition: all 0.25s; letter-spacing: 0.02em; }
.start-btn:hover { background: #1a0f55; transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(42,27,111,0.5); }
.start-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.start-btn .arrow { transition: transform 0.25s; }
.start-btn:hover:not(:disabled) .arrow { transform: translateX(4px); }

/* RUNNING */
#running { background: var(--deep-purple); overflow: hidden; }
.stage { position: absolute; inset: 0; background-size: cover; background-position: center; background-color: var(--deep-purple); }
.stage.empty { background-image: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%, rgba(255,255,255,0.04) 100%), repeating-linear-gradient(45deg, transparent 0 12px, rgba(255,255,255,0.03) 12px 13px); }
.stage.empty::after { content: 'SCENE — set an image in setup'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,0.45); font-family: 'Quicksand', sans-serif; font-size: 13px; letter-spacing: 0.1em; }
.stage.panning { animation: panKenBurns 90s ease-in-out infinite alternate; }
@keyframes panKenBurns { 0% { transform: scale(1.00) translate(0,0); } 100% { transform: scale(1.06) translate(-1.2%, -0.8%); } }

.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 50%, rgba(42,27,111,0.35) 100%); }

.motion-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mote { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: rgba(226, 214, 255, 0.85); box-shadow: 0 0 8px rgba(226, 214, 255, 0.6); filter: blur(0.5px); animation: drift linear infinite; }
@keyframes drift { from { transform: translate3d(0, 110vh, 0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { transform: translate3d(20vw, -20vh, 0); opacity: 0; } }
.snow { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.85); filter: blur(0.5px); animation: snowfall linear infinite; }
@keyframes snowfall { from { transform: translate3d(0,-10vh,0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate3d(8vw, 110vh, 0); opacity: 1; } }
.steam { position: absolute; bottom: 18%; width: 80px; height: 120px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(255,255,255,0.18), transparent 70%); filter: blur(8px); animation: rise linear infinite; }
@keyframes rise { from { transform: translate3d(0,0,0) scale(0.6); opacity: 0; } 20% { opacity: 0.7; } 100% { transform: translate3d(-30px,-40vh,0) scale(1.6); opacity: 0; } }

/* Timer styles */
.timer-wrap { position: absolute; top: 40px; right: 44px; z-index: 10; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.timer-label { font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: rgba(255,255,255,0.9); text-shadow: 0 2px 6px rgba(0,0,0,0.5); padding-right: 4px; }
.timer-digits { font-variant-numeric: tabular-nums; line-height: 1; color: #fff; text-shadow: 0 4px 18px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.4); }
[data-style="italic"] .timer-digits { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500; font-size: clamp(56px, 7.5vw, 104px); letter-spacing: 0.01em; }
[data-style="card"] .timer-digits { font-family: 'Courier New', ui-monospace, monospace; font-weight: 500; font-size: clamp(42px, 5.5vw, 72px); letter-spacing: 0.02em; background: rgba(255,255,255,0.92); color: var(--deep-purple); padding: 14px 26px; border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); text-shadow: none; }
[data-style="ring"] { align-items: center; }
[data-style="ring"] .timer-digits { font-family: 'Quicksand', sans-serif; font-weight: 500; font-size: clamp(34px, 4.2vw, 54px); letter-spacing: 0.04em; width: clamp(140px, 16vw, 200px); height: clamp(140px, 16vw, 200px); border: 2px solid rgba(255,255,255,0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); background: rgba(255,255,255,0.05); }
[data-style="thin"] .timer-digits { font-family: 'Helvetica Neue', 'Helvetica', sans-serif; font-weight: 200; font-size: clamp(64px, 8.5vw, 120px); letter-spacing: 0.08em; }
[data-style="pill"] .timer-digits { font-family: 'Courier New', ui-monospace, monospace; font-weight: 500; font-size: clamp(36px, 4.8vw, 64px); letter-spacing: 0.06em; background: rgba(20,15,55,0.78); color: #fff; padding: 16px 38px; border-radius: 999px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.18); text-shadow: none; }

.logo-wrap { position: absolute; left: 40px; bottom: 36px; z-index: 10; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.logo-tagline { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: clamp(13px, 1.3vw, 17px); color: #fff; letter-spacing: 0.04em; padding-left: 4px; text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.logo-plate { background: rgba(247, 244, 255, 0.85); backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%); padding: 14px 22px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.5); }
.logo-plate img { height: clamp(48px, 7vh, 76px); width: auto; display: block; }

.spotify-embed { position: absolute; bottom: 36px; right: 44px; z-index: 9; width: 320px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.spotify-embed iframe { display: block; border: 0; width: 100%; height: 152px; }
.spotify-embed.hidden { display: none; }

.controls { position: absolute; left: 50%; top: 36px; transform: translateX(-50%); z-index: 11; display: flex; gap: 10px; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
body.show-controls .controls { opacity: 1; pointer-events: auto; }
.ctrl { background: rgba(42,27,111,0.55); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid rgba(255,255,255,0.15); color: #fff; border-radius: 999px; padding: 10px 18px; cursor: pointer; font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.ctrl:hover { background: rgba(60,40,140,0.7); }
.ctrl svg { width: 16px; height: 16px; }

.hidden { display: none !important; }

/* Timer style picker */
.timer-styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tstyle { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 18px 12px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: all 0.15s ease; font: inherit; }
.tstyle:hover { border-color: var(--deep-purple); transform: translateY(-2px); }
.tstyle.active { border-color: var(--deep-purple); background: var(--pale); box-shadow: 0 8px 20px -8px rgba(42,27,111,0.3); }
.tprev { color: var(--deep-purple); display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-variant-numeric: tabular-nums; }
.tprev-italic { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500; font-size: 28px; }
.tprev-card { font-family: 'Courier New', monospace; font-size: 15px; background: var(--deep-purple); color: #fff; padding: 6px 12px; border-radius: 3px; }
.tprev-ring { position: relative; width: 60px; height: 60px; font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 500; }
.tprev-ring-circle { position: absolute; inset: 0; border: 2px solid var(--deep-purple); border-radius: 50%; }
.tprev-thin { font-family: 'Helvetica Neue', sans-serif; font-weight: 200; font-size: 30px; letter-spacing: 0.06em; }
.tprev-pill { font-family: 'Courier New', monospace; font-size: 14px; background: var(--deep-purple); color: #fff; padding: 8px 18px; border-radius: 999px; }
.tname { font-size: 11px; color: var(--ink); opacity: 0.7; letter-spacing: 0.05em; }
.tstyle.active .tname { opacity: 1; color: var(--deep-purple); font-weight: 600; }

@media (max-width: 720px) {
  #picker, #setup { padding: 28px 20px 60px; }
  .timer-wrap { top: 22px; right: 24px; }
  .logo-wrap { left: 22px; bottom: 22px; }
  .controls { top: 22px; }
  .spotify-embed { right: 22px; bottom: 22px; width: 240px; }
}
