/* Mission Christmas, Northern Ireland. One sheet for the page, the widget and the 1920x1080 screen.
   Kept to what old TV browsers draw (Chrome 79): no flex gap, no aspect-ratio, no inset. */
@font-face { font-family: "Barlow Condensed"; src: url("/assets/fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/assets/fonts/barlow-condensed-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --red: #b8232a;
  --red-deep: #8f161c;
  --card: #ffffff;
  --ink: #141414;
  --muted: #5b5f66;
  --green: #2d7d3e;       /* helped: 5.2:1 on white */
  --waiting: #b8232a;     /* still waiting: 6.1:1 on white */
  --track: #eceae6;
  --gold: #f2b632;
  --font: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-weight: 600; color: var(--ink); background: var(--red); -webkit-font-smoothing: antialiased; }
html.bg-clear body { background: transparent; }

/* pieces shared by every view */
.num { font-weight: 800; line-height: 0.95; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num.helped { color: var(--green); }
.num.waiting { color: var(--waiting); }
.label { font-weight: 800; text-transform: none; }
.sub { color: var(--muted); }
.sub b { font-weight: 800; padding: 0.05em 0.35em; border-radius: 0.3em; }
.sub b.up { background: #e3f1e6; color: var(--green); }
.sub b.down { background: #f9e1e2; color: var(--waiting); }
.bar { position: relative; height: 0.7em; border-radius: 1em; background: var(--track); overflow: hidden; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 1em; transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
  background: repeating-linear-gradient(-45deg, #3e9a51 0, #3e9a51 0.5em, #2d7d3e 0.5em, #2d7d3e 1em); }
.days { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; background: var(--red-deep); border: 0.12em solid rgba(255,255,255,.35); border-radius: 0.5em; line-height: 1; }
.days .star { width: 1.3em; height: 1.3em; margin: -0.75em 0 0.15em; filter: drop-shadow(0 0 0.4em rgba(224,187,67,.7)); }
.days .n { font-weight: 800; }
.days .l { font-weight: 800; line-height: 1.05; }
.brand { display: flex; align-items: center; }
.ico { display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em; border-radius: 0.35em; margin-right: 0.45em; vertical-align: -0.35em; background: var(--ink); }
.ico img { width: 62%; height: 62%; filter: brightness(0) invert(1); }
.ico-helped { background: var(--green); }
.ico-waiting { background: var(--waiting); }
body.tree { background: var(--red) url("/assets/img/mission-hands-tree.svg") no-repeat right -60px top 10px; background-size: auto 820px; }
.live { display: inline-flex; align-items: center; color: #fff; font-weight: 600; }
.live::before { content: ""; width: 0.6em; height: 0.6em; margin-right: 0.45em; border-radius: 50%; background: #4cd964; box-shadow: 0 0 0 0.18em rgba(76,217,100,.3); }
html.is-stale .live::before, html.is-offline .live::before { background: var(--gold); box-shadow: 0 0 0 0.18em rgba(242,182,50,.3); }
.source { color: rgba(255,255,255,.85); }
@media (prefers-reduced-motion: reduce) { .bar-fill { transition: none; } }

/* ---------- the page (/) ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 40px; font-size: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; color: #fff; margin-bottom: 22px; }
.mc-logo { width: 150px; height: auto; margin-right: 22px; padding-right: 22px; border-right: 2px solid rgba(255,255,255,.4); }
.page-head h1 { margin: 0 24px 6px 0; font-weight: 800; font-size: 54px; line-height: 1; }
.page-head h1 span { display: block; font-size: 26px; font-weight: 600; opacity: .9; margin-top: 6px; }
.page-head .days { width: 104px; height: 104px; font-size: 16px; }
.page-head .days .n { font-size: 46px; }
.page-head .days .star { font-size: 18px; }
.page-head .days .l { font-size: 15px; }
.page-head .live { font-size: 18px; margin-top: 10px; }
.cards { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.card { background: var(--card); border-radius: 18px; padding: 20px 24px 22px; margin: 0 8px 16px; flex: 1 1 280px; }
.card .label { font-size: 22px; display: block; }
.card .num { font-size: 72px; margin: 8px 0 6px; display: block; }
.card .sub { font-size: 17px; }
.progress { width: calc(100% - 16px); flex-basis: auto; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.progress-top .num { display: inline; font-size: 40px; margin: 0 8px 0 0; color: var(--green); }
.progress .bar { font-size: 22px; }
.ticks { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-top: 6px; }
.page-foot { display: flex; align-items: center; color: rgba(255,255,255,.9); font-size: 16px; margin-top: 8px; }
.page-foot p { margin: 0; }
.rlsl { width: 150px; height: auto; margin-right: 20px; flex: none; }
.page-foot a { color: #fff; }
@media (max-width: 600px) {
  .page { padding: 20px 14px 32px; }
  .mc-logo { width: 96px; margin-right: 14px; padding-right: 14px; }
  .page-head h1 { font-size: 34px; }
  .page-head { align-items: flex-start; }
  .page-foot { flex-direction: column; align-items: flex-start; }
  .rlsl { margin: 0 0 12px; }
  body.tree { background-size: auto 520px; }
  .page-head h1 span { font-size: 20px; }
  .page-head .days { width: 84px; height: 84px; }
  .page-head .days .n { font-size: 36px; }
  .card .num { font-size: 58px; }
}

/* ---------- the widget (/widget) ---------- */
/* Everything is in em: the script sets the root size from the slot, so one layout fits any edge. */
html[data-fit="widget"], html[data-fit="widget"] body { height: 100%; overflow: hidden; }
.widget { height: 100%; display: flex; padding: 0.5em; }
.w-head { display: flex; align-items: center; color: #fff; }
.w-logo { width: 4.4em; height: auto; flex: none; }
.w-place { font-weight: 800; font-size: 1.15em; line-height: 1; margin: 0 0.7em 0 0.6em; padding-left: 0.6em; border-left: 0.08em solid rgba(255,255,255,.45); }
.w-stat .label .ico { width: 1.4em; height: 1.4em; margin-right: 0.35em; }
.w-stat { background: var(--card); border-radius: 0.45em; padding: 0.45em 0.6em 0.5em; display: flex; flex-direction: column; justify-content: center; }
.w-stat .label { font-size: 0.8em; line-height: 1.1; }
.w-stat .num { font-size: 2.3em; }
.w-prog .top { display: flex; justify-content: space-between; align-items: baseline; }
.w-prog .top .num { font-size: 1.6em; color: var(--green); }
.w-prog .bar { font-size: 1em; margin-top: 0.3em; }
.w-foot { color: rgba(255,255,255,.9); font-size: 0.65em; }
.w-foot .live { font-size: 1em; }
.w-days { width: 4.6em; height: 4.4em; font-size: 0.75em; flex: 0 0 auto; }
.w-days .n { font-size: 2.1em; }
.w-days .l { font-size: 0.72em; }


/* band: one row along the top or bottom of the screen */
html[data-layout="band"] .widget { flex-direction: row; align-items: stretch; }
html[data-layout="band"] .w-head { flex: 0 0 auto; padding-right: 0.7em; }
html[data-layout="band"] .w-head { flex-wrap: wrap; width: 9.6em; align-content: center; }
html[data-layout="band"] .w-logo { width: 4.6em; }
html[data-layout="band"] .w-place { order: 3; width: 100%; border: 0; padding: 0; margin: 0.3em 0 0; font-size: 0.95em; }
html[data-layout="band"] .w-days { margin: 0 0 0 auto; }
html[data-layout="band"] .w-stat { flex: 1 1 0; margin-left: 0.45em; min-width: 0; }
html[data-layout="band"] .w-prog { flex: 1.5 1 0; }
html[data-layout="band"] .w-foot { display: none; }

/* column: stacked down the side of the screen */
html[data-layout="column"] .widget { flex-direction: column; }
html[data-layout="column"] .w-head { flex-wrap: wrap; margin-bottom: 0.5em; }
html[data-layout="column"] .w-logo { width: 6.4em; }
html[data-layout="column"] .w-days { margin: 0 0 0 auto; }
html[data-layout="column"] .w-place { order: 3; width: 100%; border: 0; padding: 0; margin: 0.35em 0 0; font-size: 1.3em; }
html[data-layout="column"] .w-stat { flex: 1 1 0; margin-bottom: 0.45em; }
html[data-layout="column"] .w-stat .num { font-size: 2.6em; }
html[data-layout="column"] .w-foot { text-align: center; }

/* box: a corner tile, two by two */
html[data-layout="box"] .widget { flex-wrap: wrap; align-content: stretch; }
html[data-layout="box"] .w-head { width: 100%; margin-bottom: 0.45em; }
html[data-layout="box"] .w-logo { width: 5.2em; }
html[data-layout="box"] .w-place { font-size: 1.45em; }
html[data-layout="box"] .w-days { margin-left: auto; margin-right: 0; }
html[data-layout="box"] .w-stat { width: calc(50% - 0.225em); height: calc((100% - 6.8em) / 2); margin-bottom: 0.45em; }
html[data-layout="box"] .w-stat:nth-of-type(odd) { margin-right: 0.45em; }
html[data-layout="box"] .w-foot { width: 100%; text-align: center; }

/* ---------- the screen (/screen): a fixed 1920x1080 canvas, scaled to fit ---------- */
html[data-fit="canvas"], html[data-fit="canvas"] body { height: 100%; overflow: hidden; background: var(--red-deep); }
.canvas { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; background: var(--red) url("/assets/img/mission-hands-tree.svg") no-repeat 1500px 20px; background-size: auto 1040px; padding: 64px 88px 64px; overflow: hidden;
  background-image: url("/assets/img/mission-hands-tree.svg"), radial-gradient(circle at 78% 18%, rgba(255,255,255,.08) 0, rgba(255,255,255,0) 42%), radial-gradient(circle at 10% 95%, rgba(0,0,0,.14) 0, rgba(0,0,0,0) 45%);
  background-position: 1380px 30px, 0 0, 0 0; background-size: auto 1040px, auto, auto; }
.canvas .snow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.s-head { position: relative; display: flex; align-items: center; justify-content: space-between; color: #fff; height: 170px; }
.s-logo { width: 300px; height: auto; margin-right: 44px; padding-right: 44px; border-right: 3px solid rgba(255,255,255,.4); filter: drop-shadow(0 6px 14px rgba(60,0,4,.3)); }
.s-rlsl { width: 250px; height: auto; margin-right: 40px; }
.s-title { font-weight: 800; font-size: 104px; line-height: 0.95; }
.s-title small { display: block; font-size: 46px; font-weight: 600; margin-top: 10px; opacity: .92; }
.s-days { width: 200px; height: 200px; font-size: 24px; }

.s-days .n { font-size: 96px; }
.s-days .l { font-size: 27px; }
.s-stats { position: relative; display: flex; margin: 56px -14px 0; }
.s-stat { flex: 1 1 0; background: var(--card); border-radius: 30px; margin: 0 14px; padding: 36px 44px 38px; }
.s-stat .label { font-size: 44px; display: block; }
.s-stat .num { font-size: 164px; display: block; margin: 14px 0 12px; }
.s-stat .sub { font-size: 32px; }
.s-prog { position: relative; background: var(--card); border-radius: 30px; margin-top: 28px; padding: 32px 44px 36px; }
.s-prog .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.s-prog .label { font-size: 44px; }
.s-prog .top .num { font-size: 88px; color: var(--green); }
.s-prog .top .sub { font-size: 32px; margin-left: 14px; }
.s-prog .bar { font-size: 52px; }
.robin { position: absolute; left: 835px; bottom: -6px; width: 250px; height: auto; pointer-events: none; transform-origin: 50% 100%; filter: drop-shadow(0 -4px 14px rgba(60,0,4,.35)); animation: peek 7s ease-in-out infinite; }
@keyframes peek { 0%, 100% { transform: translateY(18px); } 45%, 70% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .robin { animation: none; } }
.s-foot { position: absolute; left: 88px; right: 88px; bottom: 30px; display: flex; justify-content: space-between; font-size: 28px; }
.s-foot .live { font-size: 28px; }
