:root {
  --bg1: #f1f2f4; --bg2: #d9dbe0; --ink: #15181d; --muted: #5d6470; --line: rgba(20, 24, 30, .12);
  --card: rgba(255, 255, 255, .78); --accent: #0e5f6e; --accent-ink: #fff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: radial-gradient(120% 90% at 50% 35%, var(--bg1) 0%, var(--bg2) 100%); color: var(--ink);
  font: 15px/1.45 "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

.brand { position: fixed; top: 18px; left: 22px; font-size: 13px; letter-spacing: .06em; color: var(--muted); display: flex; gap: 8px; align-items: center; pointer-events: none; }
.brand .logo { font-weight: 700; color: var(--ink); letter-spacing: .18em; }
.brand .sep { opacity: .5; }

.panel { position: fixed; top: 64px; left: 22px; width: 300px; padding: 18px 18px 14px; border-radius: 16px; background: var(--card);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(20, 24, 30, .08); }
.kicker { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 2px 0 6px; font-size: 30px; line-height: 1.05; letter-spacing: .02em; }
.blurb { margin: 0 0 12px; color: #343a44; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0 0 14px; }
.stats div { border-top: 1px solid var(--line); padding-top: 6px; }
.stats dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: rgba(20, 24, 30, .06); }
.modes button { appearance: none; border: 0; border-radius: 9px; padding: 8px 0; font: inherit; font-size: 14px; color: var(--ink); background: transparent; cursor: pointer; }
.modes button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.modes button:focus-visible, .strip button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slider { display: flex; align-items: center; gap: 12px; margin: 14px 2px 4px; font-size: 14px; }
.slider input { flex: 1; accent-color: var(--accent); }
.credit { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.featured { position: fixed; right: 22px; top: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  border: 2px solid transparent; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none;
  background: linear-gradient(var(--ink), var(--ink)) padding-box,
    conic-gradient(from var(--spin), #ff7a1a, #ffd166, #2ec4b6, #0e5f6e, #ff7a1a) border-box;
  box-shadow: 0 6px 18px rgba(20, 24, 30, .18), 0 0 18px rgba(255, 122, 26, .35);
  animation: spin 3s linear infinite; transition: transform .15s; }
.featured::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(255, 122, 26, .55); animation: pulse 2.2s ease-out infinite; }
.featured .arrow { display: inline-block; animation: nudge 2.2s ease-in-out infinite; }
.featured:hover { transform: translateY(-1px) scale(1.03); }
@keyframes spin { to { --spin: 360deg; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 122, 26, .55); } 70%, 100% { box-shadow: 0 0 0 12px rgba(255, 122, 26, 0); } }
@keyframes nudge { 0%, 60%, 100% { transform: translate(0, 0); } 75% { transform: translate(3px, -3px); } }
@media (prefers-reduced-motion: reduce) { .featured, .featured::after, .featured .arrow { animation: none; } }
.featured:focus-visible, .download:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.download { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 12px 0 0; padding: 9px 0; border-radius: 10px; border: 1px solid var(--accent);
  color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.download:hover { background: var(--accent); color: var(--accent-ink); }
.download span { font-weight: 400; font-size: 12px; opacity: .8; }
.hint { position: fixed; right: 22px; top: 62px; font-size: 12px; color: var(--muted); pointer-events: none; transition: opacity .6s; }
.loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.loading .bar { width: 200px; height: 3px; border-radius: 3px; background: rgba(20, 24, 30, .1); overflow: hidden; margin-bottom: 8px; }
.loading .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.strip { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; padding: 12px 22px calc(14px + env(safe-area-inset-bottom)); overflow-x: auto;
  justify-content: center; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: 0 0 auto; width: 128px; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); cursor: pointer;
  font: inherit; color: var(--ink); text-align: left; box-shadow: 0 4px 14px rgba(20, 24, 30, .06); transition: transform .15s, border-color .15s; }
.strip button:hover { transform: translateY(-2px); }
.strip button[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.strip img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #e4e5e8; }
.strip span { display: block; padding: 5px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 760px) {
  .brand { top: 12px; left: 16px; }
  .hint { display: none; }
  .featured { top: 8px; right: 10px; padding: 7px 12px; font-size: 12px; }
  .featured .long, .brand .sep, .brand .sub { display: none; }
  .download { margin-top: 8px; padding: 7px 0; font-size: 13px; }
  .panel { top: auto; bottom: 104px; left: 10px; right: 10px; width: auto; padding: 12px 14px 10px; }
  .panel .blurb, .panel .credit { display: none; }
  h1 { font-size: 22px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 4px 8px; margin-bottom: 10px; }
  .stats dd { font-size: 14px; }
  .stats dt { font-size: 9px; }
  .strip { justify-content: flex-start; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .strip button { width: 96px; }
}
