/* Spirit-Led Gratitude app
   Two looks on purpose: the story (start, video, lesson, end) is dark, gold and bone like Rick's lyric videos;
   the menu and Dwell are warm cream and gold like his existing song player. */
:root {
  --ink: #0c0b09;          /* story black */
  --panel: #16140f;
  --bone: #eee7d8;         /* reading text on dark */
  --soft: #d9cfb9;         /* inner thoughts on dark */
  --mute: #a59c88;
  --gold: #c9a24a;         /* brand gold */
  --gold-hi: #e6c97f;      /* gold on dark */
  --gold-deep: #9a7524;    /* gold on cream */
  --cream: #f5efe3;        /* menu and Dwell paper */
  --card: #fbf8f1;
  --brown: #2a2418;        /* text on cream */
  --brown-soft: #6f6450;
  --line-dark: rgba(238, 231, 216, .14);
  --line-light: rgba(42, 36, 24, .12);
  --display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --body: "EB Garamond", Garamond, "Times New Roman", serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ink); color: var(--bone); font-family: var(--body); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { position: fixed; inset: 0; overflow: hidden; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar used on dark screens ---------- */
.bar { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + var(--safe-t)) max(14px, var(--safe-r)) 8px max(14px, var(--safe-l)); }
.bar .pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px;
  background: rgba(12, 11, 9, .45); border: 1px solid rgba(230, 201, 127, .35); font-family: var(--ui); font-size: 13px; color: var(--bone);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bar .pill .icon { width: 17px; height: 17px; }

/* ---------- start and end screens ---------- */
.cover-view { background: #000; }
.cover-view .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-view .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,.05) 35%, rgba(0,0,0,.05) 60%, rgba(0,0,0,.6) 100%); }
.cover { position: relative; z-index: 2; flex: 1; display: grid; grid-template-rows: auto 1fr auto; text-align: center;
  padding: 6px max(24px, var(--safe-r)) calc(36px + var(--safe-b)) max(24px, var(--safe-l)); }
.series { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .32em; color: var(--gold-hi); text-shadow: 0 1px 12px rgba(0,0,0,.7); padding-left: .32em; }
.dayno { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 11vw, 52px); letter-spacing: .06em; margin-top: 8px; line-height: 1; text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.daytitle { font-style: italic; font-size: clamp(21px, 6vw, 26px); margin-top: 8px; text-wrap: balance; text-shadow: 0 1px 14px rgba(0,0,0,.8); }
.playwrap { align-self: center; justify-self: center; display: grid; justify-items: center; gap: 12px; }
.play { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: rgba(12,11,9,.42);
  border: 1.5px solid var(--gold-hi); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 0 10px rgba(230,201,127,.12); transition: transform .2s ease, box-shadow .2s ease; }
.play:hover, .play:active { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(230,201,127,.18); }
.play svg { width: 32px; height: 32px; margin-left: 5px; fill: var(--gold-hi); }
.playlabel { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .3em; padding-left: .3em; text-shadow: 0 1px 10px rgba(0,0,0,.8); }
.coverfoot { display: grid; gap: 10px; justify-items: center; }
.coverfoot .songname { font-size: 18px; font-style: italic; text-shadow: 0 1px 10px rgba(0,0,0,.9); }
.coverfoot small { display: block; font-family: var(--display); font-style: normal; font-size: 10px; letter-spacing: .28em; color: var(--gold-hi); margin-bottom: 4px; }
.textlink { font-family: var(--ui); font-size: 13px; color: var(--bone); opacity: .85; text-decoration: underline; text-underline-offset: 3px; text-shadow: 0 1px 8px rgba(0,0,0,.9); padding: 8px; }

/* ---------- video overlay ---------- */
.video-view { background: #000; }
.video-stage { flex: 1; display: grid; place-items: center; padding: 16px max(16px, var(--safe-r)) calc(24px + var(--safe-b)) max(16px, var(--safe-l)); }
.frame { width: 100%; max-width: 960px; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; }
.frame.tall { aspect-ratio: 9 / 16; width: auto; height: min(100%, calc(100svh - 120px)); max-width: 100%; }
.frame iframe, .frame > div { width: 100%; height: 100%; border: 0; display: block; }
.vfallback { width: 100%; max-width: 520px; text-align: center; display: grid; gap: 16px; justify-items: center; }
.vfallback h2 { font-family: var(--display); font-size: 15px; letter-spacing: .2em; color: var(--gold-hi); margin: 0; font-weight: 600; }
.vfallback p { margin: 0; font-size: 18px; line-height: 1.5; color: var(--soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 24px;
  font-family: var(--ui); font-size: 15px; font-weight: 600; text-decoration: none; }
.btn-gold { background: var(--gold); color: #1b1407; }
.btn-ghost { border: 1px solid rgba(230,201,127,.55); color: var(--bone); }

/* ---------- lesson reader ---------- */
.lesson-view { background: var(--ink); }
.lesson-view .bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(18px) brightness(.36) saturate(.85); }
.lesson-view .over { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .6s ease; }
.lesson-view .over::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,11,9,.82) 0%, rgba(12,11,9,.7) 45%, rgba(12,11,9,.55) 100%); }
.lesson-view .over.on { opacity: 1; }
.lesson-view .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,11,9,.45), rgba(12,11,9,.15) 40%, rgba(12,11,9,.65)); }
.prog { position: relative; z-index: 5; height: 2px; margin: 0 max(16px, var(--safe-r)) 0 max(16px, var(--safe-l)); background: var(--line-dark); border-radius: 2px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .35s ease; }
.lmeta { position: relative; z-index: 5; display: flex; justify-content: space-between; gap: 12px; padding: 8px max(18px, var(--safe-r)) 0 max(18px, var(--safe-l));
  font-family: var(--display); font-size: 10px; letter-spacing: .22em; color: var(--mute); }
.lmeta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reader { position: relative; z-index: 2; flex: 1; overflow: hidden; touch-action: pan-y; }
.screen { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; opacity: 0; transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease; pointer-events: none; visibility: hidden; }
.screen.on { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.screen .inner { min-height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: 8vh max(26px, var(--safe-r)) 110px max(26px, var(--safe-l)); }
.screen .inner { text-shadow: 0 1px 14px rgba(0,0,0,.55); }
.screen.center .inner { justify-content: center; padding-bottom: 140px; }
.screen.photo { overflow: hidden; }
.screen.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,11,9,.35), transparent 22%, transparent 70%, rgba(12,11,9,.7)); pointer-events: none; }
.lfoot { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 max(18px, var(--safe-r)) calc(18px + var(--safe-b)) max(18px, var(--safe-l)); pointer-events: none; }
.lfoot .hint { font-family: var(--ui); font-size: 12px; color: var(--mute); text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.lfoot button { pointer-events: auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(230,201,127,.55); background: rgba(12,11,9,.5); color: var(--gold-hi); }
.lfoot .back { border-color: var(--line-dark); color: var(--mute); }
.lfoot .back[disabled] { opacity: 0; }

/* lesson text */
.b-title .ey { font-family: var(--display); font-size: 12px; letter-spacing: .3em; color: var(--gold-hi); }
.b-title h1 { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 9vw, 44px); line-height: 1.08; margin: 10px 0 0; text-wrap: balance; }
.b-title .hk { margin: 18px 0 0; font-size: 22px; font-style: italic; line-height: 1.4; color: var(--soft); text-wrap: balance; }
.b-p { font-size: 19.5px; line-height: 1.5; margin: 0; }
.b-thought { font-size: 19.5px; line-height: 1.5; font-style: italic; color: var(--soft); margin: 0; }
.b-payoff { font-size: 23px; line-height: 1.35; font-weight: 600; margin: 8px 0 0; text-wrap: balance; }
.b-note { font-family: var(--ui); font-size: 12.5px; line-height: 1.5; color: var(--mute); margin: 0; }
.b-scene { font-family: var(--display); font-weight: 600; font-size: 24px; color: var(--gold-hi); margin: 0; line-height: 1.2; text-wrap: balance; }
.b-scene::after { content: ""; display: block; width: 34px; height: 1px; background: var(--gold); margin-top: 12px; }
.b-section { font-family: var(--display); font-size: 14px; letter-spacing: .24em; color: var(--gold-hi); margin: 0; text-transform: uppercase; }
.b-deeper { margin: 0; }
.b-deeper .ey { display: block; font-family: var(--display); font-size: 11px; letter-spacing: .28em; color: var(--gold); }
.b-deeper .tt { display: block; font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1.2; margin-top: 8px; color: var(--gold-hi); text-wrap: balance; }
.b-verse { margin: 2px 0; padding-left: 16px; border-left: 2px solid var(--gold); }
.b-verse p { margin: 0; font-size: 21px; line-height: 1.45; }
.b-verse cite { display: block; margin-top: 10px; font-style: normal; font-family: var(--display); font-size: 11px; letter-spacing: .18em; color: var(--gold-hi); text-transform: uppercase; }
.b-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.b-list li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 18.5px; line-height: 1.45; }
.b-list li::before { content: "✓"; color: var(--gold); font-family: var(--ui); font-size: 14px; padding-top: 4px; }
.b-list strong { color: var(--gold-hi); font-weight: 600; }
.b-main { border: 1px solid rgba(230,201,127,.6); border-radius: 12px; padding: 20px 20px 22px; background: rgba(12,11,9,.45); display: grid; gap: 12px; }
.b-main .ey { font-family: var(--display); font-size: 11px; letter-spacing: .26em; color: var(--gold-hi); text-transform: uppercase; }
.b-main .mt { font-size: 23px; line-height: 1.35; font-weight: 600; margin: 0; }
.b-main .mp { font-size: 19px; font-style: italic; color: var(--soft); margin: 0; }
.b-main .mr { font-family: var(--display); font-size: 11px; letter-spacing: .18em; color: var(--gold-hi); }
.b-try { border: 1px dashed rgba(230,201,127,.65); border-radius: 12px; padding: 18px 20px; font-size: 19.5px; line-height: 1.5; }
.b-try .ey { display: block; font-family: var(--display); font-size: 11px; letter-spacing: .28em; color: var(--gold-hi); margin-bottom: 8px; }
.b-question { font-size: 21px; font-weight: 600; line-height: 1.35; margin: 0; color: var(--gold-hi); }

/* ---------- cream pages: menu and Dwell ---------- */
.paper { background: var(--cream); color: var(--brown); color-scheme: light; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.paper .wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: calc(18px + var(--safe-t)) max(16px, var(--safe-r)) calc(40px + var(--safe-b)) max(16px, var(--safe-l)); }
.brand { text-align: center; padding: 18px 0 8px; }
.brand .s { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .42em; padding-left: .42em; color: var(--gold-deep); }
.brand .g { font-family: var(--body); font-style: italic; font-size: 54px; line-height: 1; margin-top: 4px; }
.brand p { margin: 10px 0 0; color: var(--brown-soft); font-size: 17px; font-style: italic; }
.menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 8px; }
.mbtn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 14px; font-family: var(--ui); font-weight: 600; font-size: 15px; }
.mbtn.gold { background: var(--gold); color: #1b1407; }
.mbtn.line { border: 1px solid rgba(154,117,36,.45); color: var(--brown); background: var(--card); }
.mbtn .icon { width: 19px; height: 19px; }
.sect { font-family: var(--display); font-size: 12px; letter-spacing: .26em; color: var(--gold-deep); margin: 26px 2px 10px; }
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dcard { width: 100%; display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; text-align: left; padding: 10px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line-light); }
.dcard img, .dcard .ph { width: 76px; height: 96px; border-radius: 10px; object-fit: cover; background: #ddd2bd; }
.dcard .t { min-width: 0; }
.dcard .n { font-family: var(--display); font-size: 11px; letter-spacing: .24em; color: var(--gold-deep); }
.dcard .h { font-size: 21px; font-weight: 600; line-height: 1.15; margin-top: 3px; }
.dcard .k { font-size: 15px; font-style: italic; color: var(--brown-soft); margin-top: 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard .st { font-family: var(--ui); font-size: 11px; font-weight: 600; color: var(--gold-deep); white-space: nowrap; }
.dcard .done { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1b1407; display: grid; place-items: center; }
.dcard .done .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.dcard[disabled] { opacity: .55; cursor: default; }
.menu-foot { text-align: center; font-size: 14px; color: var(--brown-soft); margin-top: 28px; font-style: italic; }

/* Dwell */
.dtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dtop .back { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px 0 8px; border-radius: 18px; border: 1px solid var(--line-light); background: var(--card); font-family: var(--ui); font-size: 13px; }
.dtop .back .icon { width: 18px; height: 18px; }
.dtop h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .14em; }
.dtop .spacer { width: 80px; }
.daytabs { display: flex; gap: 6px; overflow-x: auto; padding: 14px 2px 4px; scrollbar-width: none; }
.daytabs::-webkit-scrollbar { display: none; }
.daytabs button { flex: 0 0 auto; min-width: 44px; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line-light); background: var(--card); font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--brown-soft); }
.daytabs button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1b1407; }
.daytabs button[disabled] { opacity: .45; }
.hero { position: relative; margin-top: 12px; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 5; max-height: 52vh; width: 100%; background: #222; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.72)); }
.hero .ov { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 16px; display: grid; gap: 10px; justify-items: center; text-align: center; color: #fff; }
.hero .ov h2 { margin: 0; font-family: var(--body); font-weight: 600; font-size: clamp(26px, 8vw, 34px); line-height: 1.1; text-shadow: 0 2px 14px rgba(0,0,0,.6); }
.hero .ov .ref { font-family: var(--display); font-size: 11px; letter-spacing: .2em; color: var(--gold-hi); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chips button { height: 32px; padding: 0 14px; border-radius: 16px; font-family: var(--ui); font-size: 12.5px; font-weight: 600; border: 1px solid rgba(255,255,255,.5); color: #fff; background: rgba(0,0,0,.25); }
.chips button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1b1407; }
.chips.light button { border-color: rgba(154,117,36,.4); color: var(--brown); background: var(--card); height: 30px; }
.chips.light button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1b1407; }
.player { padding: 14px 4px 4px; }
.np { font-size: 15px; color: var(--brown-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np b { color: var(--brown); font-weight: 600; }
.seek { display: grid; grid-template-columns: 40px 1fr 40px; gap: 8px; align-items: center; margin-top: 8px; font-family: var(--ui); font-size: 11.5px; color: var(--brown-soft); font-variant-numeric: tabular-nums; }
.seek span:last-child { text-align: right; }
.seek input { width: 100%; accent-color: var(--gold); }
.controls { display: flex; align-items: center; justify-content: space-between; max-width: 300px; margin: 8px auto 0; }
.controls button { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--brown); }
.controls button[aria-pressed="true"] { color: var(--gold-deep); background: rgba(201,162,74,.16); }
.controls .big { width: 64px; height: 64px; background: var(--gold); color: #1b1407; box-shadow: 0 6px 18px rgba(154,117,36,.35); }
.controls .big .icon { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.plist { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line-light); }
.plist li { border-bottom: 1px solid var(--line-light); }
.prow { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px 2px; text-align: left; }
.prow .th { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #e8dfcc; display: grid; place-items: center; color: var(--gold-deep); }
.prow .th .icon { width: 22px; height: 22px; }
.prow .tx { min-width: 0; }
.prow .tt { font-size: 18px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .ss { font-family: var(--ui); font-size: 11.5px; color: var(--gold-deep); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pb { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #ece3d1; color: var(--brown); }
.prow .pb .icon { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.plist li.cur .pb { background: var(--gold); color: #1b1407; }
.plist li.cur .tt { color: var(--gold-deep); }
.plist li.off .prow { opacity: .45; cursor: default; }
.pmore { padding: 0 2px 14px 60px; display: grid; gap: 10px; }
.pmore .vt { font-style: italic; font-size: 16px; line-height: 1.45; color: var(--brown-soft); margin: 0; }
.prayer { font-style: italic; font-size: 18px; line-height: 1.55; margin: 0; white-space: pre-line; }
.dnote { margin-top: 22px; text-align: center; font-size: 14px; font-style: italic; color: var(--brown-soft); }

/* ---------- small mini player on the menu ---------- */
.mini { position: sticky; bottom: calc(10px + var(--safe-b)); margin-top: 20px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  padding: 8px 8px 8px 16px; border-radius: 16px; background: var(--brown); color: var(--cream); box-shadow: 0 10px 24px rgba(42,36,24,.25); }
.mini .mt { min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.mini .pp { background: var(--gold); color: #1b1407; }
.mini .pp .icon { fill: currentColor; stroke: none; width: 18px; height: 18px; }

@media (min-width: 700px) {
  .screen .inner { padding-top: 12vh; }
  .b-p, .b-thought { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .prog i, .play { transition: none; }
}

/* pictures that fail to load fall back to a warm gradient instead of a broken icon */
img.failed { visibility: hidden; }
.imgfb { background: linear-gradient(180deg, #2a2418, #0c0b09); }
.dcard .prog2 { display: block; height: 3px; margin-top: 8px; border-radius: 2px; background: #e8dfcc; overflow: hidden; }
.dcard .prog2 i { display: block; height: 100%; background: var(--gold); }
.more-hint { position: absolute; z-index: 6; left: 50%; bottom: calc(76px + var(--safe-b)); transform: translateX(-50%); font-family: var(--ui); font-size: 12px;
  color: var(--gold-hi); background: rgba(12,11,9,.7); border: 1px solid rgba(230,201,127,.35); padding: 6px 12px; border-radius: 14px; pointer-events: none; }
.install { margin-top: 12px; width: 100%; }

/* full-screen video layer: one tap on play opens it, it closes by itself when the video ends */
.vlayer { position: fixed; inset: 0; z-index: 50; background: #000; display: none; align-items: center; justify-content: center; }
.vlayer.on { display: flex; }
.vbox { width: 100%; aspect-ratio: 16 / 9; max-height: 100%; }
.vlayer.tall .vbox { aspect-ratio: 9 / 16; height: 100%; width: auto; max-width: 100%; }
.vbox iframe, .vbox > div { width: 100%; height: 100%; border: 0; display: block; }
.vskip { position: absolute; top: calc(12px + var(--safe-t)); right: max(12px, var(--safe-r)); z-index: 2; height: 34px; padding: 0 14px; border-radius: 17px;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.3); color: #fff; font-family: var(--ui); font-size: 13px; }
a.play { text-decoration: none; color: inherit; }

/* Wide videos on an upright phone: turn the player sideways so it fills the whole screen.
   When the phone is turned (or the screen locks to landscape) this no longer applies and it plays normally. */
@media (orientation: portrait) {
  .vlayer.on:not(.tall) .vbox { width: 100vh; width: 100dvh; height: 100vw; max-height: none; aspect-ratio: auto; flex: none; transform: rotate(90deg); }
  .vlayer.on:not(.tall) .vskip { top: auto; bottom: calc(16px + var(--safe-b, 0px)); right: 12px; transform: rotate(90deg); transform-origin: center; }
}

.vnote { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; padding: 24px; }
.vnote.on { display: flex; }
.vnote-box { max-width: 320px; text-align: center; color: #eee7d8; font-family: var(--body, serif); font-size: 19px; line-height: 1.45; }
.vnote-go { margin-top: 18px; padding: 12px 28px; border-radius: 26px; border: 1px solid #e6c97f; background: none; color: #e6c97f; font-family: var(--display, serif); letter-spacing: .2em; font-size: 12px; }
