/* ChipsVids. A dark marquee for Chip's daily videos: warm charcoal, his
   First Team orange for actions, the hook yellow kept for the posters.
   Every font stack ends in sans-serif. No serif, ever. */

:root {
  --bg: #16120F;
  --surface: #1F1A16;
  --raise: #2A231D;
  --line: #3B3129;
  --ink: #F5EFE6;
  --muted: #A99F92;
  --dim: #7D7368;
  --orange: #F58220;
  --orange-press: #D96D12;
  --marquee: #FFD21E;
  --gold: #DEBE6E;
  --green: #3FD27F;
  --red: #FF5D4F;
  --blue: #6FB7FF;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --sans: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow Condensed", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(84px + var(--safe-b));
}
body.bare { padding-bottom: 0; }
a { color: var(--orange); }
button, input, select, textarea { font-family: var(--sans); font-size: 17px; color: var(--ink); }
:focus-visible { outline: 3px solid var(--marquee); outline-offset: 2px; border-radius: 6px; }
img, video { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(22, 18, 15, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(59, 49, 41, .6);
}
.brand { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--orange); }
.balance { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: none; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.balance .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.balance.low { color: var(--ink); border-color: var(--red); }
.balance.low .dot { background: var(--red); }

.page { max-width: 760px; margin: 0 auto; padding: 16px; }

/* ---- bottom tabs ---- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 6px 4px calc(6px + var(--safe-b));
  background: rgba(22, 18, 15, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 52px;
  color: var(--dim); text-decoration: none; font-size: 12px; font-weight: 600; border-radius: 12px; }
.tabs a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--orange); }

/* ---- alerts: plain words, never buried ---- */
.alerts { display: grid; gap: 10px; margin-bottom: 16px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  background: #2B1B16; border: 1px solid #5A2B22; }
.alert.warn { background: #2A2213; border-color: #5B4818; }
.alert .mark { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--red); }
.alert.warn .mark { background: var(--marquee); }
.alert p { margin: 0; font-weight: 500; }
.alert a { font-weight: 700; }

/* ---- the card ---- */
.daylabel { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--muted); margin: 4px 2px 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.card + .card { margin-top: 18px; }

/* the poster: the hero of every card */
.poster { position: relative; aspect-ratio: 9 / 16; margin: 0 auto; width: min(100%, calc(68vh * 9 / 16));
  background: radial-gradient(120% 80% at 50% 20%, #3A2C20 0%, #17120E 70%); overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .hookart { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 7% 7% 6%; }
.poster .hookart b { font-family: var(--display); font-weight: 800; text-transform: uppercase; color: var(--marquee);
  font-size: clamp(34px, 11vw, 64px); line-height: .95; letter-spacing: .005em;
  -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 0 3px 0 rgba(0,0,0,.5); }
.poster .hookart small { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--gold); }
.poster .tag { position: absolute; left: 12px; bottom: 12px; font-size: 13px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 99px; }
@media (min-width: 700px) {
  .hero { display: grid; grid-template-columns: 300px 1fr; }
  .hero .poster { width: 100%; }
}
.cardhead { padding: 18px 18px 6px; }
.vno { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--orange); }
.title { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.02; margin: 2px 0 6px; }
.sub { color: var(--muted); font-size: 15px; margin: 0; }

/* the checklist */
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 18px 4px; margin: 0; list-style: none; }
.checks li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--raise); font-size: 15px; font-weight: 600; color: var(--muted); }
.checks li i { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.checks li.done { color: var(--ink); }
.checks li.done i { background: var(--green); border-color: var(--green); }
.checks li.done i::after { content: ""; width: 10px; height: 6px; border: solid #0B2414; border-width: 0 0 3px 3px; transform: translateY(-1px) rotate(-45deg); }

/* sections inside a card */
.sec { padding: 16px 18px; border-top: 1px solid var(--line); }
.sec:first-of-type { border-top: 0; }
.sec h3 { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec h3 .pill { font-family: var(--sans); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* drop zones */
.drops { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 118px; padding: 14px 10px; text-align: center; border-radius: var(--radius);
  border: 2px dashed var(--line); background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--orange); background: #22190F; }
.drop.has { border-style: solid; border-color: #2E5B3F; background: #142219; }
.drop b { font-family: var(--display); font-size: 22px; font-weight: 800; }
.drop span { font-size: 13px; color: var(--muted); word-break: break-word; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--orange); width: 0; transition: width .2s; }

/* pipeline status */
.status { display: flex; align-items: center; gap: 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--orange); animation: spin 0.9s linear infinite; flex: none; }
.status.idle .spinner { animation: none; border-top-color: var(--line); }
.status.ok .spinner { border-color: var(--green); animation: none; }
.status.bad .spinner { border-color: var(--red); animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.status strong { font-size: 18px; }
.progress { height: 8px; border-radius: 99px; background: var(--raise); overflow: hidden; margin-top: 12px; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--orange), var(--marquee)); width: 0; transition: width .4s; }
.log { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.log li { font-size: 14px; color: var(--muted); padding-left: 16px; position: relative; }
.log li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.log li.error { color: #FFB3AA; }
.log li.error::before { background: var(--red); }
.log li.good::before { background: var(--green); }

/* player */
.player { border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 9/16; width: min(100%, calc(72vh * 9 / 16)); margin: 0 auto; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 20px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--raise); color: var(--ink);
  font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #1A0E04; }
.btn.primary:hover { background: var(--orange-press); }
.btn.block { width: 100%; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }
.why { font-size: 14px; color: var(--marquee); margin: 8px 0 0; min-height: 1em; }

/* ship it: the one big button */
.ship { padding: 18px; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(245,130,32,.06), transparent); }
.shipbtn { width: 100%; min-height: 76px; border: 0; border-radius: 18px; cursor: pointer;
  font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .02em; text-transform: uppercase;
  color: #1A0E04; background: linear-gradient(180deg, #FF9A3D, var(--orange)); box-shadow: 0 8px 24px rgba(245,130,32,.28); }
.shipbtn[disabled] { background: var(--raise); color: var(--dim); box-shadow: none; cursor: not-allowed; }
.platforms { display: grid; gap: 6px; margin-top: 14px; }
.platforms div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--raise); border-radius: var(--radius-sm); font-size: 15px; }

/* pills */
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--raise); color: var(--muted); white-space: nowrap; }
.pill.ok { background: #173323; color: #9DF0BE; }
.pill.wait { background: #33290F; color: var(--marquee); }
.pill.bad { background: #3A1814; color: #FFB3AA; }
.pill.mud { background: #3A2511; color: #FFC18A; border: 1px solid #6B4219; letter-spacing: .06em; }

/* script */
.hookline { font-family: var(--display); font-weight: 800; text-transform: uppercase; color: var(--marquee); font-size: 28px; line-height: 1.05; margin: 0 0 12px; }
.script { white-space: pre-wrap; font-size: 18px; line-height: 1.6; }
.closebox { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--raise); }
.closebox b { display: block; font-size: 14px; color: var(--orange); margin-bottom: 4px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary h3::after { content: "Show"; font-family: var(--sans); font-size: 14px; font-weight: 700; color: var(--orange); }
details[open] > summary h3::after { content: "Hide"; }

/* thumbs and pictures */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 30%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.strip > * { scroll-snap-align: start; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 9/16; background: var(--raise); border: 2px solid transparent; cursor: pointer; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on { border-color: var(--marquee); }
.thumb .win { position: absolute; top: 6px; left: 6px; font-size: 12px; font-weight: 800; background: var(--marquee); color: #000; padding: 2px 8px; border-radius: 99px; }
.pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pics img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suggest { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.suggest li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; background: var(--raise); border-radius: var(--radius-sm); }

/* captions */
.copybox { position: relative; }
.copybox pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--sans); font-size: 15px; line-height: 1.55;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 56px; }
.copybox .btn { position: absolute; right: 10px; bottom: 10px; }
.trims { display: grid; gap: 10px; margin-top: 12px; }
.trims details { background: var(--raise); border-radius: var(--radius-sm); padding: 12px 14px; }
.trims summary { display: flex; justify-content: space-between; font-weight: 700; }
.trims pre { white-space: pre-wrap; font-family: var(--sans); font-size: 14px; margin: 10px 0 0; color: var(--ink); }

/* grids for other pages */
.pagehead { margin: 4px 2px 16px; }
.pagehead h1 { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; margin: 0 0 6px; }
.pagehead p { margin: 0; color: var(--muted); }
.avgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 620px) { .avgrid { grid-template-columns: repeat(3, 1fr); } }
.av { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.av.on { border-color: var(--orange); }
.av .ph { aspect-ratio: 3/4; background: var(--raise); }
.av .ph img { width: 100%; height: 100%; object-fit: cover; }
.av .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.av .meta b { font-size: 15px; line-height: 1.3; }
.av .meta .btn { margin-top: auto; }
.av .making { aspect-ratio: 3/4; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); }

.tracks { display: grid; gap: 8px; }
.track { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.track.on { border-color: var(--orange); background: #26190E; }
.play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--raise); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.play svg { width: 22px; height: 22px; fill: currentColor; }
.track.on .play { background: var(--orange); color: #1A0E04; }
.track .nm b { display: block; }
.track .nm span { font-size: 14px; color: var(--muted); }

.hist { display: grid; gap: 12px; }
.hrow { display: grid; grid-template-columns: 86px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.hrow .ph { aspect-ratio: 9/16; border-radius: 10px; overflow: hidden; background: var(--raise); }
.hrow .ph img { width: 100%; height: 100%; object-fit: cover; }
.hrow b { font-family: var(--display); font-size: 22px; line-height: 1.05; display: block; }
.hrow .links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 15px; color: var(--muted); }
.input, textarea.input { width: 100%; min-height: 54px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--orange); outline: none; }

/* sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin .box { width: 100%; max-width: 420px; }
.signin h1 { font-family: var(--display); font-weight: 800; font-size: 56px; margin: 0; line-height: 1; }
.signin h1 span { color: var(--orange); }
.signin .lede { color: var(--muted); margin: 6px 0 26px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 14px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err { color: #FFB3AA; font-weight: 600; margin: 10px 0 0; }
.okmsg { color: #9DF0BE; font-weight: 600; margin: 10px 0 0; }

/* end card editor */
.ecwrap { display: grid; gap: 16px; }
@media (min-width: 700px) { .ecwrap { grid-template-columns: 300px 1fr; align-items: start; } }
.ecprev { aspect-ratio: 9/16; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); position: relative; }
.ecprev canvas { width: 100%; height: 100%; display: block; }
.ecline { display: grid; grid-template-columns: 1fr 52px 70px; gap: 8px; align-items: center; margin-bottom: 8px; }
.ecline input[type=color] { width: 52px; height: 52px; padding: 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #111;
  padding: 12px 18px; border-radius: 99px; font-weight: 700; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.tomorrow { opacity: .92; }
.tomorrow .cardhead { padding-bottom: 16px; }
.mini { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; }
.mini .poster { width: 100%; border-radius: 12px; }
.mini .poster .hookart b { font-size: 16px; -webkit-text-stroke: 1px #000; }
.mini .poster .hookart small { font-size: 11px; }

/* create: one row per upcoming video, nothing else */
.create { display: grid; gap: 14px; }
.crow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.crow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.crow-title { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.05; margin: 2px 0 12px; }
.crow .drop { min-height: 96px; }
.crow-line { margin: 10px 2px 0; font-size: 15px; color: var(--muted); }
.crow-line.ok { color: #9DF0BE; }
.crow-line.wait { color: var(--marquee); }
.crow-line.bad { color: #FFB3AA; }
.crow-line a { font-weight: 700; margin-left: 4px; }
.tabs a span { white-space: nowrap; }
@media (max-width: 380px) { .tabs a { font-size: 11px; } }
.crow-look { display: block; margin: 8px 2px 0; font-size: 14px; color: var(--muted); text-decoration: none; }
.crow-look:hover { color: var(--ink); }
button.av { font: inherit; color: inherit; text-align: left; padding: 0; cursor: pointer; }
button.av:focus-visible { outline: 3px solid var(--marquee); }
.engines { display: grid; gap: 10px; }
.engine { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; padding: 14px 16px; border-radius: var(--radius);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.engine.on { border-color: var(--orange); background: #26190E; }
.engine[disabled] { opacity: .45; cursor: not-allowed; }
.eng-name { font-family: var(--display); font-weight: 800; font-size: 22px; }
.eng-cost { font-weight: 700; color: var(--marquee); align-self: center; white-space: nowrap; }
.eng-why { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }

