:root {
  --bg: #030406;
  --bg-2: #07090d;
  --panel: #0a0d13;
  --panel-2: #0f131b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e8edf2;
  --muted: #8b95a4;
  --accent: #33ccff;
  --accent-2: #ff3df2;
  --pro: #ffcf5c;
  --radius: 16px;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --bar-h: 60px;
  --tabs-h: 44px;
  --nav-h: calc(var(--bar-h) + var(--tabs-h) + 2px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); }

body {
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0) 0 0 / 28px 28px,
    var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.05; }
canvas { display: block; }
.mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, 0.03); color: var(--text);
  font: 500 15px var(--font); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn:hover { border-color: var(--accent); background: rgba(51, 204, 255, 0.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #001018;
  box-shadow: 0 0 0 0 rgba(51, 204, 255, 0.5), 0 8px 30px -8px rgba(51, 204, 255, 0.6);
}
.btn.primary:hover { background: #66dcff; box-shadow: 0 0 0 4px rgba(51, 204, 255, 0.18), 0 8px 30px -8px rgba(51, 204, 255, 0.8); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn[hidden] { display: none; }
.icon-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.tag-pro {
  display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px;
  background: rgba(255, 207, 92, 0.14); color: var(--pro);
  font: 600 9px/1.4 var(--mono); letter-spacing: 0.06em; vertical-align: middle;
}
body.is-pro .tag-pro { display: none; }

.eyebrow {
  margin: 0 0 14px; color: var(--accent);
  font: 500 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
}

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(3, 4, 6, 0.96);
  border-bottom: 1px solid var(--line);
}
.nav-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  height: var(--bar-h); padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
}
.nav-menu {
  justify-self: start; display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer;
  font: 600 12px var(--font); letter-spacing: 0.14em; text-transform: uppercase;
}
.nav-menu svg { width: 20px; height: 20px; }
.nav-menu:hover { color: var(--accent); }
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 14px; border: 2px solid var(--accent);
  font: 700 16px var(--font); letter-spacing: 0.16em; text-transform: uppercase;
  box-shadow: 0 0 14px -4px rgba(51, 204, 255, 0.6), inset 0 0 14px -6px rgba(51, 204, 255, 0.5);
}
.brand svg { width: 22px; height: 22px; color: var(--accent); filter: drop-shadow(0 0 6px rgba(51, 204, 255, 0.6)); }
.brand b, .brand-sm b { color: var(--accent); }
.nav-end { justify-self: end; display: flex; align-items: center; gap: 16px; }
.nav-search { display: grid; place-items: center; width: 36px; height: 36px; color: var(--text); }
.nav-search:hover { color: var(--accent); }
.nav-search svg { width: 20px; height: 20px; }
.tabs {
  display: flex; justify-content: center; gap: clamp(20px, 3.4vw, 44px);
  height: var(--tabs-h); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none;
  font: 600 12px var(--font); letter-spacing: 0.14em; text-transform: uppercase;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; flex: none; color: var(--muted); border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }

.drawer {
  position: fixed; inset: 0 auto 0 0; margin: 0;
  width: min(360px, 88vw); height: 100dvh; max-height: none; padding: 0;
  border: 0; border-right: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  overflow-y: auto;
}
.drawer::backdrop { background: rgba(0, 0, 0, 0.6); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--bar-h); padding: 0 24px; border-bottom: 1px solid var(--line);
}
.brand-sm { font: 700 14px var(--font); letter-spacing: 0.16em; text-transform: uppercase; }
.drawer-close { width: 36px; height: 36px; border: 0; background: none; color: var(--text); font-size: 28px; line-height: 1; cursor: pointer; }
.drawer-close:hover { color: var(--accent); }
.drawer nav { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 24px 32px; }
.drawer nav > a[aria-current] { color: var(--accent); }
.drawer nav > a { padding: 10px 0; font-size: 22px; font-weight: 600; }
.drawer nav > a:hover { color: var(--accent); }
.drawer .pro-btn { margin-top: 10px; }
.pro-btn { height: 36px; padding: 0 16px; font-size: 14px; border-color: rgba(255, 207, 92, 0.4); color: var(--pro); }
.pro-btn:hover { border-color: var(--pro); background: rgba(255, 207, 92, 0.08); }
.pro-btn.active { background: rgba(255, 207, 92, 0.12); }
.signin-btn { height: 36px; padding: 0 16px; font-size: 14px; margin-left: -12px; }
.user-slot { display: flex; align-items: center; min-width: 32px; height: 36px; margin-left: -8px; }
.user-slot[hidden], .signin-btn[hidden] { display: none; }
/* Download controls stay hidden unless the signed-in account may download (owner or Pro). */
body:not(.can-download) .dl-only { display: none !important; }
.plans { margin-top: 32px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); scroll-margin-top: calc(var(--nav-h) + 24px); }
.plans[hidden] { display: none; }
.plans h3 { margin: 0 0 20px; }

/* ---------- hero ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 72px);
  min-height: min(calc(100vh - var(--nav-h)), 940px); padding: 48px var(--gutter);
  max-width: 1360px; margin: 0 auto;
}
.hero h1 { font-size: clamp(44px, 6.4vw, 92px); font-weight: 700; letter-spacing: -0.04em; line-height: 0.98; }
.grad {
  background: linear-gradient(100deg, var(--accent) 10%, #a78bfa 55%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { max-width: 520px; margin: 28px 0 32px; color: var(--muted); font-size: 18px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-frame {
  position: relative; width: min(100%, 620px); aspect-ratio: 1;
  border-radius: 28px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 40px 120px -40px rgba(51, 204, 255, 0.35);
}
.hero-frame canvas { width: 100%; height: 100%; }
.hero-try { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.hero-say { min-height: 3em; margin: 0; max-width: 440px; color: var(--muted); font-size: 15px; }
.hero-say b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-try .btn { min-width: 220px; touch-action: manipulation; }
.hero-more { color: var(--accent); font-size: 14px; }
.hero-more:hover { text-decoration: underline; }
.hero-more[hidden] { display: none; }
.hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.hint em { color: var(--text); font-style: normal; }

/* The home page's hero is today's Daily (js/home.js): its art links to the challenge. */
.today h1 { font-size: clamp(40px, 5.2vw, 76px); margin-bottom: 26px; }
.today .hero-frame { display: block; position: relative; }
.hero-badge { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; pointer-events: none; }
.hero-badge[hidden] { display: none; }
.streak { margin: 0 0 22px; color: var(--text); font-weight: 500; }
.streak::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); vertical-align: 1px; }
.streak[hidden] { display: none; }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, 0.02); }
.seg button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font: 500 13px var(--font); cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--text); color: #05070a; }

/* ---------- principles ---------- */

.principles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.principles > div { padding: 36px 32px 40px 0; }
.principles > div + div { padding-left: 32px; border-left: 1px solid var(--line); }
.principles .num { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.principles h3 { margin: 14px 0 8px; font-size: 22px; }
.principles p { margin: 0; color: var(--muted); font-size: 15px; }
.principles p a { color: var(--accent); white-space: nowrap; }

/* ---------- sections ---------- */

.section { max-width: 1360px; margin: 0 auto; padding: 112px var(--gutter) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 36px; }
.gallery-segs { display: flex; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 600; }
.sub { margin: 14px 0 0; color: var(--muted); }

/* ---------- gallery ---------- */

.gallery-bar {
  position: sticky; top: var(--nav-h); z-index: 10;
  display: flex; flex-direction: column; gap: 12px;
  margin: 0 calc(-1 * var(--gutter)) 28px; padding: 14px var(--gutter);
  background: rgba(3, 4, 6, 0.94); border-bottom: 1px solid var(--line);
}
.gallery-bar input {
  width: min(100%, 520px); height: 42px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, 0.03);
  color: var(--text); font: inherit; font-size: 15px;
}
.gallery-bar input:focus { outline: none; border-color: var(--accent); }
.themes { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.themes::-webkit-scrollbar { display: none; }
.themes button, .set-tabs button {
  display: inline-flex; align-items: center; gap: 8px; flex: none; height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--muted);
  font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.themes button:hover, .set-tabs button:hover { color: var(--text); border-color: var(--accent); }
.themes button[aria-pressed="true"], .set-tabs button[aria-selected="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.themes button:focus-visible, .set-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.theme-group { margin-bottom: 44px; }
.theme-group[hidden], .tile[hidden], .card[hidden] { display: none; }
.group-name { margin: 0 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 0 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.tile:hover, .tile:focus-visible { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 24px 60px -30px rgba(51, 204, 255, 0.4); outline: none; }
.tile-art { display: block; aspect-ratio: 1; margin-bottom: 8px; background: #000; border-bottom: 1px solid var(--line); }
.tile-art canvas { display: block; width: 100%; height: 100%; }
.tile-name { padding: 0 14px; font-size: 16px; font-weight: 600; line-height: 1.2; }
.tile:hover .tile-name { color: var(--accent); }
.tile-meta { padding: 0 14px; font: 11px var(--mono); color: var(--muted); }
.tile-meta span { white-space: nowrap; }
.gallery-empty { color: var(--muted); }

.collection-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.collection-step { display: flex; gap: 6px; }
.collection-step .icon-btn { font-size: 20px; line-height: 1; }
.collection-head { margin-bottom: 20px; }
.collection-head h3 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; letter-spacing: -0.02em; }
.collection-head p { max-width: 720px; margin: 10px 0 0; color: var(--muted); }
#collection-body .grid { padding: 4px 0 32px; }
/* While searching, the matches run together in one grid, without their themes' headings. */
#gallery-groups.flat { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-bottom: 44px; }
#gallery-groups.flat .theme-group, #gallery-groups.flat .tiles { display: contents; }
#gallery-groups.flat .group-name { display: none; }
.row-about { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 14px; }
.row-about:hover { text-decoration: underline; }
.gallery-more { margin: 24px 0 0; color: var(--muted); font-size: 14px; }
.gallery-more a { color: var(--accent); }
.set-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 18px; }
.set-tabs[hidden], .set-tabs button[hidden], .collection .grid[hidden] { display: none; }
.set-count { font: 11px var(--mono); opacity: 0.7; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 24px 60px -30px rgba(51, 204, 255, 0.4); }
.card-art { position: relative; aspect-ratio: 1; cursor: pointer; }
.card-art canvas { width: 100%; height: 100%; }
.badge {
  position: absolute; top: 12px; left: 12px; padding: 3px 8px; border-radius: 6px;
  font: 600 10px/1.4 var(--mono); letter-spacing: 0.1em;
}
.badge.free { background: rgba(20, 24, 32, 0.85); color: var(--text); }
.badge.pro { background: rgba(40, 32, 10, 0.85); color: var(--pro); border: 1px solid rgba(255, 207, 92, 0.3); }
.card-body { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; flex: 1; padding: 16px 18px 18px; border-top: 1px solid var(--line); }
.card-body h3 { font-size: 18px; font-weight: 600; }
.card-body p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-icons { display: flex; gap: 6px; }

/* Learn article cards (home page strip and the Learn index): a live preview, then the article. */
.learn-card { color: inherit; text-decoration: none; }
.learn-card .card-art { display: block; aspect-ratio: 16 / 10; }
.learn-card:hover { border-color: var(--accent); }
.learn-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lc-group { display: block; margin-bottom: 8px; color: var(--muted); font: 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.lc-more { color: var(--accent); font-size: 14px; font-weight: 600; }
.learn-grid.featured { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.learn-grid.featured .card-art { aspect-ratio: 4 / 3; }
.learn-grid.featured h3 { font-size: 21px; }

/* ---------- studio ---------- */

.studio { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.stage-col { position: sticky; top: calc(var(--nav-h) + 20px); display: flex; flex-direction: column; gap: 12px; }
.stage {
  --arw: 9; --arh: 16;
  width: min(100%, calc(72vh * var(--arw) / var(--arh)));
  aspect-ratio: var(--arw) / var(--arh);
  margin: 0 auto; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #000;
}
.stage canvas { width: 100%; height: 100%; }
.playbar { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.playbar input { flex: 1; }
.playbar .mono { width: 34px; text-align: right; }
.pro-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(255, 207, 92, 0.07); border: 1px solid rgba(255, 207, 92, 0.2); color: #f3dfa8; font-size: 14px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.group { border-bottom: 1px solid var(--line); }
.group summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; cursor: pointer; list-style: none;
  font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: '+'; font-size: 14px; }
.group[open] summary::after { content: '−'; }
.group-body { display: flex; flex-direction: column; gap: 16px; padding: 0 18px 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field[hidden] { display: none; }
.label { display: flex; align-items: center; font-size: 13px; color: var(--text); }
.label output { margin-left: auto; font: 12px var(--mono); color: var(--muted); }

.music-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.music-row .select { flex: 1; width: auto; min-width: 0; }
.music-row label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.music-row input[type='number'] { width: 56px; height: 28px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 12px var(--mono); }
.music-row input[type='range'] { width: 90px; }
#song-tune[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font: 500 13px var(--font); cursor: pointer;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.chip[aria-pressed='true'] { color: #001018; background: var(--accent); border-color: var(--accent); }
.chip[aria-pressed='true'] .tag-pro { background: rgba(0, 0, 0, 0.18); color: #001018; }

.select {
  width: 100%; height: 34px; padding: 0 32px 0 11px; border-radius: 8px;
  border: 1px solid var(--line-2); color: var(--text); font: 500 13px var(--font); cursor: pointer;
  -webkit-appearance: none; appearance: none; color-scheme: dark;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b95a4' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.select:hover { border-color: rgba(255, 255, 255, 0.3); }
.select.words-input { height: auto; padding: 8px 11px; background-image: none; cursor: text; resize: vertical; line-height: 1.4; font-size: 15px; }
.select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch {
  position: relative; aspect-ratio: 1; border-radius: 50%; cursor: pointer;
  border: 3px solid var(--sw-bg); background: var(--sw);
  box-shadow: 0 0 0 1px var(--line-2);
}
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--text); }
.swatch.is-pro::after {
  content: ''; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--pro); box-shadow: 0 0 0 2px var(--panel);
}
body.is-pro .swatch.is-pro::after { display: none; }

.stripes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stripes input[type='color'] {
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%;
  background: none; cursor: pointer; overflow: hidden;
}
.stripes input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
.stripes input[type='color']::-webkit-color-swatch { border: none; border-radius: 50%; }
.stripes input[type='color']::-moz-color-swatch { border: none; border-radius: 50%; }

input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--line-2); }
input[type='range']::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line-2); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(51, 204, 255, 0.7); }
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(51, 204, 255, 0.7); }

.toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.toggle input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background 0.2s; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform 0.2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(14px); background: #001018; }

.export { display: flex; flex-direction: column; gap: 16px; padding: 18px; background: var(--panel-2); }
.export h3 { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.export-btns { display: grid; gap: 8px; }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress[hidden] { display: none; }
.save-video[hidden] { display: none; }
.progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bar { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.15s; }
.fine { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- gifts and the daily puzzle (home page) ---------- */

.gift-band { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 72px); }
.gift-band-stage {
  justify-self: center; width: min(100%, 440px); aspect-ratio: 4 / 5; overflow: hidden;
  border: 1px solid var(--line); border-radius: 28px; background: #000;
  box-shadow: 0 40px 120px -40px rgba(255, 90, 200, 0.3);
}
.gift-band-stage canvas { display: block; width: 100%; height: 100%; }
.gift-band-copy h2 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 600; }
/* The home page opens on Gifts (the hero); today's Daily follows it. */
.gift-hero { max-width: 1360px; margin: 0 auto; padding: 40px var(--gutter) 0; }
.gift-hero .gift-band { min-height: min(calc(100vh - var(--nav-h) - 40px), 880px); }
.gift-hero h1 { font-size: clamp(40px, 5.2vw, 76px); font-weight: 700; letter-spacing: -0.04em; line-height: 0.98; }
.gift-hero .gift-band-stage { width: min(100%, 520px); }
.today h2 { font-size: clamp(36px, 4.6vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: 0.98; margin-bottom: 26px; }
.hero.today { min-height: 0; padding-top: 112px; }
.gift-band-copy .chips { margin: 24px 0 20px; }
.gift-points { margin: 0 0 26px; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--muted); font-size: 15px; }
.gift-points li { display: flex; gap: 10px; }
.gift-points li::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: 7px; border: 1.5px solid var(--accent); transform: rotate(45deg) scale(0.8); }

.daily-band { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.daily-band > div { max-width: 640px; }
.daily-band h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; }

/* ---------- pricing ---------- */

.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tier { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tier h3 { font-size: 20px; font-weight: 600; }
.price { margin: 0; font-size: 48px; font-weight: 700; letter-spacing: -0.03em; }
.price small { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.tier ul { flex: 1; margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; align-content: start; color: var(--muted); font-size: 15px; }
.tier li { display: flex; gap: 10px; }
.tier li::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: 7px; border: 1.5px solid var(--accent); transform: rotate(45deg) scale(0.8); }
.tier.featured { border-color: rgba(51, 204, 255, 0.5); background: linear-gradient(180deg, rgba(51, 204, 255, 0.08), var(--panel) 60%); box-shadow: 0 30px 80px -40px rgba(51, 204, 255, 0.5); }
.tier-gift { margin: 22px 0 0; color: var(--muted); font-size: 15px; text-align: center; }
.tier-gift a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.ribbon { position: absolute; top: -11px; right: 24px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #001018; font: 600 11px var(--mono); }

/* ---------- footer ---------- */

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; max-width: 1360px; margin: 120px auto 0; padding: 28px var(--gutter) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; width: 100%; padding-bottom: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-switch { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.footer-switch:hover { color: var(--text); }
/* The switch's confirm (js/motion.js): the site's modal, without the Pro gold. */
.motion-dialog .modal { border-color: var(--line-2); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8); }
.motion-dialog h2 { padding-right: 28px; }
.motion-dialog p { margin: 16px 0 0; color: var(--text); font-size: 15px; }
.motion-dialog p.muted { color: var(--muted); font-size: 14px; }
.motion-dialog .modal-actions { margin: 24px 0 0; }
.motion-dialog .modal-actions .primary { background: var(--accent); border-color: var(--accent); color: #001018; }

/* ---------- modal & toast ---------- */

dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.78); }
.modal { position: relative; width: 460px; max-width: 100%; padding: 32px; border: 1px solid rgba(255, 207, 92, 0.3); border-radius: 22px; background: var(--panel); box-shadow: 0 40px 120px -30px rgba(255, 207, 92, 0.25); }
.modal h2 { font-size: 30px; }
.modal .eyebrow { color: var(--pro); }
.close { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.needs { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 207, 92, 0.08); color: #f3dfa8; font-size: 14px; }
.needs b { color: var(--pro); font-weight: 600; }
.modal-list { margin: 18px 0 24px; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
#save-meta { margin: 8px 0 22px; font-size: 14px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.modal-actions .primary { background: var(--pro); border-color: var(--pro); color: #1a1200; box-shadow: none; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(15, 19, 27, 0.95); font-size: 14px;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: 0.25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.show:has(button:not([hidden])) { pointer-events: auto; }
.toast button { margin-left: 14px; }

/* ---------- home: Keep watching, one big card that opens the player (js/home.js) ---------- */

.watch-screen {
  position: relative; display: block; width: 100%; height: min(78vh, 760px); padding: 0; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: #000; color: #fff; font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.watch-screen:hover, .watch-screen:focus-visible { border-color: var(--accent); box-shadow: 0 30px 80px -40px rgba(51, 204, 255, 0.55); outline: none; }
.watch-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.watch-screen-info {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 80px 200px 22px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); pointer-events: none;
}
.watch-screen-name { font-size: clamp(24px, 3vw, 34px); font-weight: 600; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.watch-screen-info .slide-row { margin: 0; }
.watch-screen-go { position: absolute; right: 20px; bottom: 22px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.watch-screen-go svg { width: 16px; height: 16px; }

.principles.how { margin-top: 112px; }
.principles.how h3 { font-size: 19px; }

/* ---------- home gallery: the Watch card, shelves and results (js/home.js) ---------- */

.watch-start {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); width: 100%; margin: 0 0 28px; padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.watch-start:hover, .watch-start:focus-visible { border-color: var(--accent); box-shadow: 0 30px 80px -40px rgba(51, 204, 255, 0.55); outline: none; }
.watch-art { display: block; aspect-ratio: 16 / 10; background: #000; }
.watch-art canvas { width: 100%; height: 100%; }
.watch-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: clamp(22px, 3vw, 44px); }
.watch-copy .eyebrow { margin: 0; }
.watch-title { font-size: clamp(30px, 3.6vw, 48px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.watch-sub { margin-bottom: 14px; color: var(--muted); }
.watch-copy .btn svg { width: 16px; height: 16px; }

.shelf { margin-bottom: 36px; }
.shelf[hidden], #shelves[hidden], #results[hidden] { display: none; }
.shelf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.shelf-head .group-name { flex: 1; margin: 0; }
.shelf-head .group-name span { margin-left: 6px; color: var(--muted); font: 12px var(--mono); }
.shelf-step { display: flex; gap: 6px; }
.shelf-step .icon-btn { font-size: 20px; line-height: 1; }
.shelf-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px;
}
.shelf-strip::-webkit-scrollbar { display: none; }
.shelf-strip .pick { scroll-snap-align: start; }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--muted); }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-bottom: 36px; }

.pick {
  display: grid; align-content: start; gap: 2px; padding: 0 0 12px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.pick:hover, .pick:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.pick-art { display: block; aspect-ratio: 4 / 5; margin-bottom: 8px; background: #000; }
.pick-art canvas { width: 100%; height: 100%; }
.pick-name { padding: 0 12px; font-weight: 600; line-height: 1.2; }
.pick:hover .pick-name { color: var(--accent); }
.pick-row { padding: 0 12px; color: var(--muted); font-size: 13px; }

/* ---------- the player (js/player.js): one illusion per screen, swiped through ---------- */

html.watching, html.watching body { overflow: hidden; }
.player { position: fixed; inset: 0; z-index: 40; background: #000; color: #fff; }
.player[hidden] { display: none; }
/* Opened from the page, it slides up over it (player.js play()). */
.player.opening { animation: player-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes player-in { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .player.opening { animation-duration: 1ms; } }
.feed {
  height: 100%; overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; outline: none;
}
.feed::-webkit-scrollbar { display: none; }
.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; background: #000; overflow: hidden; }
.slide canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The ring an illusion shows while it builds (player.js wait()), in its own first color. */
.slide-wait {
  position: absolute; left: 50%; top: 42%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  border: 2px solid var(--ink, #fff); opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.slide.waiting .slide-wait { animation: slide-wait 1.4s ease-in-out infinite; }
/* Animations switched off (motion.js): the ring holds still, faint. */
.slide.waiting.still .slide-wait { animation: none; opacity: 0.4; }
@keyframes slide-wait {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  50% { opacity: 0.7; transform: scale(1); }
}
.slide-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 80px max(16px, var(--gutter)) calc(84px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); pointer-events: none;
}
.slide-info h2 { max-width: 720px; font-size: clamp(26px, 3.4vw, 40px); font-weight: 600; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.slide-row { margin: 6px 0 0; color: rgba(255, 255, 255, 0.75); font-size: 14px; }
.slide-row a { color: #fff; text-decoration: underline; text-underline-offset: 3px; pointer-events: auto; }
/* The feed's Daily says so above its name, and has its challenge under it (js/player.js). */
.slide-eyebrow { margin: 0 0 6px; color: var(--accent); font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.slide-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.slide-acts .btn { pointer-events: auto; }
.slide-acts .btn:not(.primary) { background: rgba(0, 0, 0, 0.65); border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.slide-acts [hidden] { display: none; }
/* Its challenge, played on the slide: the prompt where the status line was, the tap button under it. While a round
   runs the strip can't scroll and the bar and hints step aside (js/player.js). */
.slide-say { display: grid; gap: 2px; margin: 8px 0 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.slide-say[hidden] { display: none; }
.slide-say b { font-size: clamp(28px, 4vw, 44px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.slide-say span { color: rgba(255, 255, 255, 0.85); font-size: 15px; }
.slide.live .slide-blurb, .slide.live .slide-row { display: none; }
.slide.live [data-challenge] { min-width: 180px; min-height: 52px; font-size: 17px; }
.player.challenging .feed { overflow: hidden; }
.player.challenging .slide-info { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
/* The arrows stay: with the strip held still they're the plain way on, and pressing one ends the round. */
.player.player.challenging :is(.p-bar, .p-hint, .p-cues, .p-shares, .p-like) { display: none; }
.slide-blurb { max-width: 560px; margin: 6px 0 0; color: rgba(255, 255, 255, 0.82); font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.p-btn {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer;
}
.p-btn:hover { border-color: var(--accent); }
.p-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-btn svg { width: 20px; height: 20px; }
.p-btn[hidden] { display: none; }
.p-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, var(--gutter)) 24px;
  background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); pointer-events: none;
}
.p-top > * { pointer-events: auto; }
/* The lists side by side (js/player.js): the one playing white, the rest grey; the small line (1 / 12, Today) under
   the white one. A search's word, in front while its hits play, takes Liked's place, as all three don't fit a phone,
   and can run long, so it gives way first. */
.p-where { display: flex; align-items: flex-start; gap: 14px; flex: 1; min-width: 0; margin: 0; }
#p-query:not([hidden]) ~ [data-list='liked'] { display: none; }
.p-tab {
  display: flex; flex-direction: column; flex: none; min-width: 0; max-width: 100%; padding: 4px 0; border: 0; background: none;
  color: rgba(255, 255, 255, 0.5); font: inherit; font-weight: 600; line-height: 1.25; text-align: left; cursor: pointer;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.p-tab[hidden] { display: none; }
.p-tab:hover { color: rgba(255, 255, 255, 0.8); }
.p-tab[aria-current] { color: #fff; cursor: default; }
.p-tab[data-list='q'] { flex: 0 1 auto; cursor: pointer; }
.p-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.p-tab small { color: rgba(255, 255, 255, 0.7); font-size: 12px; font-weight: 400; }
.p-tab small:empty { display: none; }
/* One row, always: .slide-info leaves room for one above the blurb, so a second would cover it. A screen too narrow
   for the row scrolls it sideways. */
.p-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 0 max(16px, var(--gutter)) calc(20px + env(safe-area-inset-bottom));
}
.p-bar::-webkit-scrollbar { display: none; }
.p-bar .btn { flex: none; }
.p-bar .btn { background: rgba(0, 0, 0, 0.65); border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.p-bar .btn:hover { border-color: var(--accent); }
.p-bar .btn[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }
.player.at-ad :is(.p-bar, .p-hint, .p-cues, .p-shares, .p-like) { display: none; }
.p-bar .btn[aria-expanded='true'] { border-color: var(--accent); color: var(--accent); }
.p-bar .btn[hidden] { display: none; }
/* Share's three ways (js/player.js), stacked just over the bar from its left end, under Share; the link first and
   biggest, as most shares are. */
.p-shares {
  position: absolute; left: max(16px, var(--gutter)); bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 2;
  display: flex; flex-direction: column; gap: 2px; min-width: 220px; padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 16px; background: #0a0b0d; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.p-shares[hidden] { display: none; }
.p-shares :is(button, a) {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px;
  background: none; color: #fff; font: inherit; font-size: 15px; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.p-shares :is(button, a):hover { border-color: rgba(255, 255, 255, 0.3); }
.p-shares :is(button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-shares .p-share-link { min-height: 50px; background: var(--accent); color: #001018; font-weight: 600; }
.p-shares .p-share-link:hover { background: #66dcff; border-color: transparent; }
.p-shares a::after { content: '›'; margin-left: auto; padding-left: 12px; opacity: 0.7; }
/* The heart, on the right just over the bar; .slide-info keeps its words clear of it. Red and filled when liked. */
.p-like { position: absolute; right: max(16px, var(--gutter)); bottom: calc(76px + env(safe-area-inset-bottom)); width: 48px; height: 48px; }
.p-like svg { width: 24px; height: 24px; }
.p-like[aria-pressed='true'] { color: #ff4d6d; }
.p-like[aria-pressed='true'] svg { fill: currentColor; }
.p-like.pop svg { animation: like-pop 0.35s ease-out; }
@keyframes like-pop { 40% { transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .p-like.pop svg { animation: none; } }
.slide-info { padding-right: calc(max(16px, var(--gutter)) + 60px); }
/* Hint's two readings, just under the top bar. */
.p-cues {
  position: absolute; left: 50%; top: calc(76px + env(safe-area-inset-top)); display: flex; gap: 4px; padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 999px; background: rgba(0, 0, 0, 0.72); transform: translateX(-50%);
}
.p-cues[hidden] { display: none; }
.p-cues button {
  min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; background: none;
  color: #fff; font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.p-cues button:hover { border-color: rgba(255, 255, 255, 0.3); }
.p-cues button[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }
.p-cues button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slide-level { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px; font: 11px var(--mono); vertical-align: 1px; }
/* AdSense sets height: auto !important on an ad's parents, which shrank the slide to the ad and put every slide
   after it off the player's one-screen-a-slide reckoning; min and max height outrank height, so it stays a screen. */
.slide-ad { min-height: 100%; max-height: 100%; display: grid; place-items: center; padding: 88px 16px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); }
.ad-card { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100%, 480px); }
.ad-label { margin: 0; color: var(--muted); font: 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.ad-box { width: 100%; min-height: 280px; }
.ad-next { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.ad-next b { color: var(--text); }
.p-step { position: absolute; right: max(16px, var(--gutter)); top: 50%; display: flex; flex-direction: column; gap: 10px; transform: translateY(-50%); }
.p-hint {
  position: absolute; left: 50%; top: 58%; display: none; align-items: center; gap: 8px; margin: 0;
  padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); font-size: 14px; white-space: nowrap;
  transform: translateX(-50%); pointer-events: none; animation: hint-bob 1.6s ease-in-out infinite;
}
.player.hinting .p-hint { display: flex; }
.p-hint svg { width: 18px; height: 18px; }
.p-hint-mouse { display: none; }
@media (pointer: fine) { .p-hint-touch { display: none; } .p-hint-mouse { display: inline; } }
/* On a phone a swipe does it, so the arrows are a quieter pair: bare chevrons in a slim translucent pill, a
   touch-sized target each, and a little further from the edge than a thumb resting on the bezel. */
@media (pointer: coarse) {
  .p-step { right: 10px; gap: 0; padding: 2px; border-radius: 999px; background: rgba(0, 0, 0, 0.28); }
  .p-step .p-btn { width: 40px; height: 44px; border: 0; background: none; color: rgba(255, 255, 255, 0.75); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.8)); }
  .p-step .p-btn svg { width: 22px; height: 22px; }
  .p-step .p-btn:active { color: var(--accent); }
}
@keyframes hint-bob { 50% { transform: translate(-50%, -8px); } }

.p-search {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, var(--gutter)) 16px; background: rgba(3, 4, 6, 0.96);
}
.p-search[hidden] { display: none; }
.p-search-bar { display: flex; gap: 10px; width: min(100%, 720px); margin: 0 auto 14px; }
.p-search-bar input {
  flex: 1; min-width: 0; height: 44px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); color: var(--text); font: inherit; font-size: 16px;
}
.p-search-bar input:focus { outline: none; border-color: var(--accent); }
.p-results { width: min(100%, 720px); margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; }
.p-results button:not(.chip) {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 6px;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.p-results button:not(.chip):hover, .p-results button:not(.chip):focus-visible { color: var(--accent); outline: none; }
.p-results button:not(.chip) span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.p-results .p-results-all { justify-content: center; color: var(--accent); }
.p-results-note { color: var(--muted); }
.p-results-head { margin: 20px 0 8px; font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.p-chips .chip { padding: 8px 14px; font-size: 14px; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 40px; }
  /* On a phone or a tablet, today's illusion comes first: the art sells it before any words do. */
  .today { padding-top: 16px; gap: 20px; }
  .today .hero-stage { order: -1; gap: 10px; }
  .today .hero-frame { width: min(100%, 62vh); }
  /* Today's challenge on the first screen: its button comes straight after the headline, the streak after it. */
  .today h1 { margin-bottom: 0; }
  .today .hero-copy { display: flex; flex-direction: column; }
  .today .hero-copy .cta { order: 1; margin-top: 18px; }
  .today .hero-copy .streak { order: 2; }
  .today .hero-frame { width: min(100%, 42vh); }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .stage-col { position: static; }
  .stage { width: min(100%, calc(60vh * var(--arw) / var(--arh))); }
  .tiers { grid-template-columns: minmax(0, 1fr); }
  .gift-band { grid-template-columns: minmax(0, 1fr); }
  /* On a phone the gift plays first, small enough that the headline and its button share the first screen. */
  .gift-hero { padding-top: 16px; }
  .gift-hero .gift-band { min-height: 0; gap: 20px; }
  .gift-hero .gift-band-stage { width: min(100%, 36vh); }
  .gift-hero .gift-band-copy { display: flex; flex-direction: column; }
  .gift-hero .gift-band-copy > .btn { order: -1; align-self: flex-start; margin-top: 18px; }
  .gift-hero .gift-band-copy h1 { order: -2; }
  .gift-hero .gift-band-copy .eyebrow { order: -3; }
  .hero.today { padding-top: 80px; }
  .today h2 { margin-bottom: 0; }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .principles > div, .principles > div + div { padding: 28px 0; border-left: 0; }
  .principles > div + div { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  :root { --bar-h: 52px; --tabs-h: 40px; }
  .nav-menu span { display: none; }
  .brand { gap: 8px; padding: 4px 10px; font-size: 13px; letter-spacing: 0.12em; }
  .brand svg { width: 18px; height: 18px; }
  .nav-end { gap: 6px; }
  .tabs { justify-content: flex-start; }
  .tiles, #gallery-groups.flat { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-name { font-size: 15px; }
  .watch-start { grid-template-columns: minmax(0, 1fr); }
  .watch-art { aspect-ratio: 4 / 3; }
  .today h1, .today h2, .gift-hero h1 { font-size: 34px; }
  .today .hero-say { min-height: 0; font-size: 13px; }
  .watch-screen { height: 72vh; }
  .principles.how { margin-top: 80px; }
  .shelf-strip { grid-auto-columns: 42vw; gap: 10px; }
  .shelf-step { display: none; }
  .picks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .playbar { flex-wrap: wrap; border-radius: 16px; }
  .playbar input { flex-basis: 100%; order: -1; }
  .section { padding-top: 80px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 12px; }
  .card-body p { display: none; }
  .seg button { padding: 0 10px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card-body p { display: block; }
}

/* ad units (js/ads.js), hidden until AdSense has a slot for them. The box holds a responsive ad's usual height before
   it fills, so nothing below jumps, and folds away when AdSense has no ad to show. */
.ad-slot { margin: 32px 0; min-height: 280px; }
.ad-slot[hidden], .ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
/* The banner under the header (ads.js): a fixed size, so it can't grow into a tall box above the hero. */
.ad-top { margin: 0; min-height: 0; padding: 8px var(--gutter); }
.ad-top ins { width: min(100%, 320px); height: 100px; margin: 0 auto; }
@media (min-width: 768px) { .ad-top ins { width: 728px; height: 90px; } }
/* The home page's big banners (under the gift band, above Learn): a 336x280 box on a phone, a 728x90 leaderboard
   on a tablet, a 970x250 billboard on a desktop. Fixed sizes, so a responsive unit can't pick a tall one. */
.ad-banner { min-height: 0; padding: 0 var(--gutter); }
.ad-banner ins { width: min(100%, 336px); height: 280px; margin: 0 auto; }
@media (min-width: 768px) { .ad-banner ins { width: 728px; height: 90px; } }
@media (min-width: 1040px) { .ad-banner ins { width: 970px; height: 250px; } }
#gifts .ad-banner { margin: 40px 0 0; padding: 0; }
/* Between the Learn strip's cards: an ad in a card-sized cell of the grid. */
.ad-cell { margin: 0; min-height: 250px; display: flex; align-items: center; justify-content: center; }
.ad-cell ins { width: 100%; }
.ad-box:has(ins[data-ad-status="unfilled"]) { min-height: 0; }

/* /muse: the studio alone, shown only once the studio password is in */
body.muse :is(.hero, .principles, #gallery, #gifts, #daily, #learn, #pricing, .footer, .nav .tabs, .nav-search, #nav-signin, #nav-user, #nav-pro) { display: none; }
.muse-pw {
  width: 100%; height: 44px; margin: 18px 0 10px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255, 255, 255, 0.03);
  color: var(--text); font: inherit; font-size: 16px;
}
.muse-pw:focus { outline: none; border-color: var(--pro); }
.muse-wrong { color: var(--pro); }
body.muse:not(.owner) main { visibility: hidden; }
/* /austinkranc: the gallery and the studio, shown only once the owner is signed in */
body.austinkranc :is(.hero, .principles, #gifts, #daily, #learn, #pricing, .footer, .nav .tabs, #nav-pro) { display: none; }
body.austinkranc:not(.owner) main { visibility: hidden; }

/* The player's gifts slide (js/player.js): the next holiday's gift spinning behind, and the way to make one. */
.slide-gift .gift-slide-info {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: start; gap: 10px;
  padding: 120px max(16px, var(--gutter)) calc(32px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8) 45%);
}
.slide-gift .eyebrow { margin: 0; }
.slide-gift h2 { max-width: 640px; font-size: clamp(26px, 3.4vw, 40px); font-weight: 600; }
.slide-gift .slide-blurb { margin: 0; }
.slide-gift .ad-next { text-align: left; }
.slide-gift canvas { height: 70%; }
