/* X Minus One — simple dark program-guide look.
   Three colors: near-black, warm cream text, and yellow (yellow = Play and "selected", nothing else).
   Two faces: Anton for titles and the wordmark, Barlow for everything else. */
:root{
  color-scheme:dark;
  --bg:#15110e; --surface:#211b17; --surface-2:#2b241f; --line:#3d342d; --edge:#6e6258;
  --text:#f3ead8; --muted:#b9ad9b; --yellow:#f5c542; --on-yellow:#15110e; --green:#7fcf9a; --danger:#ff9b85;
  --display:Anton,Impact,"Arial Narrow",sans-serif;
  --body:Barlow,system-ui,-apple-system,"Segoe UI",sans-serif;
  --r:12px; --player-h:0px;
}
*{box-sizing:border-box}
html{font-size:20px;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--body);line-height:1.45;padding-bottom:calc(var(--player-h) + 24px)}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
:focus-visible{outline:3px solid var(--yellow);outline-offset:3px}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:-999px;top:0;background:var(--yellow);padding:8px 12px;z-index:100}
.skip:focus{left:8px}

/* icons */
.i{width:1.2em;height:1.2em;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
.i-star{color:var(--yellow)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:56px;padding:0 20px;border-radius:var(--r);border:2px solid var(--edge);background:var(--surface);color:var(--text);font-weight:600;font-size:1rem;text-align:center;line-height:1.15}
.btn:active{transform:translateY(1px)}
.btn-play{background:var(--yellow);border-color:var(--yellow);color:var(--on-yellow)}
.btn-big{min-height:64px;font-size:1.1rem;font-weight:700}
.btn-block{width:100%}
.btn[aria-pressed="true"]{background:var(--yellow);border-color:var(--yellow);color:var(--on-yellow)}
.btn-text{background:none;border:none;padding:10px 6px;min-height:48px;color:var(--text);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.btn-text.danger{color:var(--danger)}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border:none;background:none;border-radius:50%;color:var(--text);padding:0}
.circle{display:inline-flex;align-items:center;justify-content:center;width:60px;height:60px;border-radius:50%;border:2px solid var(--yellow);background:var(--yellow);color:var(--on-yellow);padding:0;flex:0 0 auto}
.circle .i{width:28px;height:28px}
.lnk{background:none;border:none;padding:0;color:inherit;font:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer}

/* layout */
.shell{max-width:720px;margin:0 auto;padding:0 16px}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 0 12px}
.brand{display:flex;align-items:center;gap:12px}
.wordmark{font-family:var(--display);font-size:1.8rem;line-height:1;letter-spacing:.01em}
.tagline{font-size:.8rem;color:var(--muted);margin-top:4px}
.user-btn{display:flex;flex-direction:column;align-items:flex-end;background:none;border:none;padding:6px 0 6px 8px;min-height:48px;color:var(--text)}
.user-btn #userInitials{font-weight:700;font-size:1.1rem;letter-spacing:.06em}
.user-change{font-size:.8rem;color:var(--muted);text-decoration:underline;text-underline-offset:2px}
.meta{color:var(--muted);font-size:.85rem}
.sec-head{font-size:.9rem;font-weight:700;color:var(--muted);margin:16px 0 8px}

/* continue */
.continue{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.cont{display:flex;align-items:center;gap:10px;background:var(--surface);border:2px solid var(--line);border-radius:var(--r);padding:8px 6px 8px 14px}
.cont-main{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;background:none;border:none;padding:4px 0;text-align:left;color:var(--text)}
.cont-title{font-weight:700;font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.cont .circle{width:52px;height:52px}
.cont .circle .i{width:24px;height:24px}

/* tonight's pick */
.pick{background:var(--surface);border:2px solid var(--edge);border-radius:16px;padding:18px 18px 8px;margin-top:12px}
.pick-label{font-size:.85rem;font-weight:700;color:var(--yellow)}
.pick-title{display:block;font-family:var(--display);font-size:1.9rem;line-height:1.05;margin:6px 0 4px;background:none;border:none;padding:0;text-align:left;color:var(--text)}
.pick-hook{font-size:1rem;margin:10px 0 16px}
.pick-actions{display:flex;justify-content:space-between;gap:8px;margin-top:4px}

.quick{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0 24px}
.quick .btn{padding:0 10px;gap:8px;font-size:.9rem;white-space:nowrap}

/* search + filter */
.search-row{display:flex;gap:10px;align-items:stretch}
.search-wrap{position:relative;flex:1;min-width:0}
.search-icon{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
#search{width:100%;min-height:56px;padding:0 14px 0 46px;border:2px solid var(--edge);border-radius:var(--r);background:var(--surface);color:var(--text);font-size:1rem;-webkit-appearance:none;appearance:none}
#search::placeholder{color:var(--muted)}
.search-clear{position:absolute;right:4px;top:50%;transform:translateY(-50%)}
.search-wrap.has-text #search{padding-right:52px}
.filter-btn{padding:0 16px}
.filter-count{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;border-radius:13px;background:var(--yellow);color:var(--on-yellow);border:none;font-size:.75rem;font-weight:700;padding:0 6px}
.active-filters{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;padding:4px 4px 4px 14px;background:var(--surface);border:2px solid var(--line);border-radius:var(--r);font-size:.9rem}

/* list */
.count{font-size:.9rem;font-weight:700;color:var(--muted);margin:20px 0 10px}
.cards{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-items:center;background:var(--surface);border:2px solid var(--line);border-radius:var(--r);padding:12px 12px 12px 16px}
.card.is-playing{border-color:var(--yellow)}
.card-main{display:flex;flex-direction:column;gap:3px;min-width:0;background:none;border:none;padding:2px 0;text-align:left;color:var(--text)}
.card-title{font-family:var(--display);font-size:1.3rem;line-height:1.1;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.card-title .i{width:18px;height:18px}
.mark-heard{color:var(--green)}
.mark-heard .i{stroke-width:3}
.card-hook{font-size:.95rem;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card.is-heard .card-hook{color:var(--muted)}
.card.is-heard .circle{background:transparent;color:var(--yellow)}
.bar{grid-column:1/-1;height:6px;background:var(--line);border-radius:3px;overflow:hidden}
.bar i{display:block;height:100%;background:var(--yellow)}
.empty{padding:28px 8px;text-align:center;color:var(--muted)}

/* episode page */
.detail{background:var(--bg)}
.back-btn{min-height:52px;padding:0 16px 0 10px;margin:16px 0 8px}
.d-title{font-family:var(--display);font-weight:400;font-size:2.2rem;line-height:1;margin:6px 0 10px}
.credits{font-size:.95rem;margin:0 0 16px;line-height:1.55}
.d-sub{display:flex;justify-content:center;margin:4px 0 8px}
.d-summary{font-size:1rem;line-height:1.55;margin:12px 0 16px}
.rating{margin:4px 0 16px}
.rating-label{font-size:.85rem;font-weight:700;color:var(--muted);margin-bottom:6px}
.rating .grid3{gap:8px}
.rating .btn{min-height:52px;padding:0 4px;font-size:.85rem;white-space:nowrap}
.fold{border-top:2px solid var(--line);padding:4px 0}
.fold:last-of-type{border-bottom:2px solid var(--line)}
.fold>summary{list-style:none;cursor:pointer;min-height:56px;display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:1rem}
.fold>summary::-webkit-details-marker{display:none}
.fold>summary::after{content:"+";font-size:1.4rem;font-weight:400;width:28px;text-align:center}
.fold[open]>summary::after{content:"–"}
.fold p{margin:0 0 12px}
.fold dl{margin:0 0 12px;display:grid;gap:10px}
.fold dt{font-size:.8rem;font-weight:700;color:var(--muted)}
.fold dd{margin:0}

/* player */
.player{position:fixed;left:0;right:0;bottom:0;background:#0c0a08;border-top:2px solid var(--line);color:var(--text);z-index:40;padding-bottom:env(safe-area-inset-bottom)}
.player-inner{max-width:720px;margin:0 auto;padding:10px 16px 12px}
.player-top{display:flex;align-items:center;gap:10px}
.player-title{flex:1;min-width:0;background:none;border:none;padding:6px 0;color:var(--text);font-family:var(--display);font-size:1.15rem;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:44px}
.player-time{font-size:.8rem;font-variant-numeric:tabular-nums;opacity:.85;white-space:nowrap}
.sleep-badge{display:inline-flex;align-items:center;gap:4px;font-size:.75rem;font-weight:700;border:1.5px solid var(--text);border-radius:999px;padding:2px 8px;white-space:nowrap}
.seek{position:relative;padding:12px 0;cursor:pointer;touch-action:none}
.seek-track{height:8px;background:var(--line);border-radius:4px}
.seek-fill{position:relative;height:100%;width:0;background:var(--yellow);border-radius:4px}
.seek-fill::after{content:"";position:absolute;right:-11px;top:50%;width:22px;height:22px;margin-top:-11px;border-radius:50%;background:var(--yellow)}
.controls{display:flex;justify-content:space-between;align-items:center;max-width:380px;margin:2px auto 0}
.ctl{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;border:none;background:none;color:var(--text);padding:0}
.ctl .i{width:32px;height:32px}
.ctl-play{width:72px;height:72px;background:var(--yellow);color:var(--on-yellow)}
.ctl-play .i{width:34px;height:34px}

/* rate prompt */
.rate{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--player-h) + 12px);width:min(688px,calc(100% - 32px));background:var(--surface-2);border:2px solid var(--edge);border-radius:16px;padding:10px 12px 12px 16px;z-index:45}
.rate-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.rate-q{margin:0;font-size:1rem}
.rate-btns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:6px}
.rate-btns .btn{min-height:52px;padding:0 4px;font-size:.85rem;white-space:nowrap}

/* sheets */
.sheet{position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheet-card{background:var(--surface);border:2px solid var(--line);border-bottom:none;width:100%;max-width:560px;max-height:88vh;overflow:auto;border-radius:18px 18px 0 0;padding:8px 20px calc(20px + env(safe-area-inset-bottom))}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0 4px}
.sheet-head h2{font-family:var(--display);font-weight:400;font-size:1.6rem;margin:0}
.sheet-sub{font-size:.9rem;font-weight:700;color:var(--muted);margin:18px 0 8px}
.sheet-p{margin:4px 0 14px}
.hint{font-size:.85rem;color:var(--muted);margin:-4px 0 10px}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.grid2 .btn,.grid3 .btn{padding:0 10px;min-height:56px}
.grid3 .wide{grid-column:span 2}
.field{display:flex;flex-direction:column;gap:6px;font-size:.9rem;font-weight:700;color:var(--muted);margin-top:16px}
.field select{min-height:56px;padding:0 14px;border:2px solid var(--edge);border-radius:var(--r);background:var(--surface-2);color:var(--text);font-size:1rem;font-weight:600}
.sheet-actions{display:grid;grid-template-columns:1fr 1.4fr;gap:10px;margin-top:24px}
.sheet-actions .btn-block{grid-column:1/-1}
.user-form{display:grid;gap:12px}
#initialsInput{min-height:76px;width:100%;text-align:center;font-family:var(--display);font-size:2.4rem;letter-spacing:.3em;text-transform:uppercase;border:2px solid var(--edge);border-radius:var(--r);background:var(--bg);color:var(--text)}
#initialsInput::placeholder{color:var(--line)}
.recent{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px;align-items:center}
.recent .btn{flex:1 1 80px;font-family:var(--display);font-weight:400;font-size:1.3rem;letter-spacing:.1em}
.recent-label{width:100%;font-size:.85rem;font-weight:700;color:var(--muted)}
.user-extra{margin-top:16px;text-align:center}
.stats{font-weight:600}

/* toast */
.toast{position:fixed;left:50%;top:14px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);background:var(--text);color:var(--bg);border-radius:14px;padding:10px 10px 10px 16px;z-index:60;display:flex;align-items:center;gap:10px;font-size:.95rem;font-weight:600}
.toast .btn-text{color:var(--bg);min-height:40px;padding:6px}

/* phone: episode page covers the list */
@media (max-width:1099px){
  .detail{position:fixed;inset:0;z-index:30;overflow:auto;padding:0 16px calc(var(--player-h) + 32px)}
  .detail>*{max-width:720px;margin-left:auto;margin-right:auto}
  .detail .back-btn{margin-left:0}
  body.detail-open{overflow:hidden}
}
/* wide screens: episode page as a side panel */
@media (min-width:1100px){
  html{font-size:18px}
  .shell.with-detail{max-width:1240px;display:grid;grid-template-columns:minmax(0,720px) 440px;gap:40px;justify-content:center}
  .detail{position:sticky;top:0;max-height:calc(100vh - var(--player-h));overflow:auto;padding:0 4px 24px}
  .back-btn{display:none}
  .d-title{font-size:2.1rem;margin-top:24px}
  .sheet{align-items:center}
  .sheet-card{border-radius:18px;border-bottom:2px solid var(--line)}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
