/* Little Tiger: game night. Gemini's stadium at dusk is the header, with felt pieces out on its field, its chenille
   varsity patch the title, and the page is a close-up of the night grass with a band of field paint (field.jpg): it
   rides up with the header, then stays still once the header is gone while the sections scroll over it. Every section (the invitation and the footer too) sits on Gemini's cream felt panel with its
   stitched border: purple, and gold on every other section. A border-image keeps the panel's mitered corners as
   sewn, stretches its top and bottom edges a little and repeats its sides (round) as a section grows, so the
   stitches never stretch; the cream middle is the panel's own felt (paper.jpg), tiled at its size. Colors and
   fonts come from vars.css. */

html{background:var(--ink-deep)}
body{background:transparent}
body::before{content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:var(--ink-deep) url(../art/field.jpg) center / cover no-repeat}

/* no pennant strip at the top and bottom: the stadium and the field are the frame now */
.stripes{display:none}

/* ---------- the grass: one screen of it, starting at the foot of the header (fading in over the header's last 14%)
   and scrolling up with it; it stops (sticky) the moment the header has gone off the top, so the header never slides
   over still grass. Its negative margins take it out of the flow and let it stay put to the end of the page.
   body::before above is the same grass, fixed, for pages without the painted header. main is its own block
   formatting context so the grass's negative top margin doesn't pull main itself up. The header's height follows
   its photo: about the wide photo's shape, or on a tall screen (a phone) the usual share of it. ---------- */
:root{--hero-h:clamp(460px, 50vw, 86svh); --fade:calc(var(--hero-h) * .14)}
@media (max-aspect-ratio:18/25){:root{--hero-h:clamp(460px, 72svh, 700px)}}
.hero.painted ~ main:not(.own){display:flow-root}
.hero.painted ~ main:not(.own)::before{content:""; display:block; position:sticky; top:calc(-1 * var(--fade)); z-index:-1;
  height:calc(100vh + var(--fade)); margin:calc(-1 * var(--fade)) calc(-1 * max(12px, env(safe-area-inset-right,0px) + 8px))
  calc(-100vh) calc(-1 * max(12px, env(safe-area-inset-left,0px) + 8px));
  background:var(--ink-deep) url(../art/field.jpg) center / cover no-repeat; pointer-events:none;
  -webkit-mask-image:linear-gradient(transparent, #000 var(--fade)); mask-image:linear-gradient(transparent, #000 var(--fade))}
/* a shadow over the grass where it meets the header, so the bright blades there don't pull the eye; it scrolls away
   with the header */
.hero.painted ~ main:not(.own)::after{content:""; position:absolute; z-index:-1; left:0; right:0; top:calc(-1 * var(--fade));
  height:calc(var(--fade) + 46vh); pointer-events:none;
  background:linear-gradient(rgba(6,12,4,0), rgba(6,12,4,.62) var(--fade), rgba(6,12,4,.38) calc(var(--fade) + 18vh), rgba(6,12,4,0))}

/* ---------- the header: the stadium, the felt pieces on its field, and the title big and low over the stands, just
   above the pieces. Gemini made it twice, each with its own light towers: the wide photo (laptops, tablets, phones on
   their side), shown from its middle, and the tall photo for tall screens (a phone held upright), shown from its foot.
   The pick goes by the screen's shape, not its width, so a squarish screen never gets the tall one cropped to its
   field. The layers start at the header's top (the shared header starts them higher, for room to drift; this one
   never shows that gap, since the back drifts down slower than the header scrolls up). ---------- */
.hero.painted{height:var(--hero-h); background:transparent; margin-top:0}
.hero.painted::after{display:none}
.hero.painted .layer{top:0; background-position:center 50%}
.hero-title{top:auto; bottom:35%; width:clamp(300px, 40vw, 680px); filter:drop-shadow(0 6px 12px rgba(var(--shadow-rgb),.5))}
@media (max-aspect-ratio:18/25){
  .hero.painted .layer{background-position:center bottom}
  .hero.painted .back{background-image:url(../art/hero-back-phone.webp)}
  .hero.painted .front{background-image:url(../art/hero-front-phone.webp)}
  .hero-title{bottom:38%; width:min(92vw, 420px)}
}

/* ---------- every section on a felt panel ---------- */
main{padding-left:max(12px, env(safe-area-inset-left,0px) + 8px); padding-right:max(12px, env(safe-area-inset-right,0px) + 8px)}
.card, .invite, footer{--panel:url(../art/panel.webp); --slice:72 67 69 62; border-style:solid; border-width:26px 24px;
  border-image:var(--panel) var(--slice) / 26px 24px stretch round;
  background:var(--card) url(../art/paper.jpg) repeat; background-size:280px; background-clip:padding-box;
  filter:drop-shadow(0 2px 2px rgba(var(--shadow-rgb),.35)) drop-shadow(0 12px 16px rgba(var(--shadow-rgb),.4))}
.col > section:nth-of-type(2n) > .card{--panel:url(../art/panel-gold.webp); --slice:73 71 119 78}
/* a page of its own's header (the board) on the purple panel too, so its words never sit on the grass */
.page-head{border-style:solid; border-width:26px 24px; border-image:url(../art/panel.webp) 72 67 69 62 / 26px 24px stretch round;
  background:var(--card) url(../art/paper.jpg) repeat; background-size:280px; background-clip:padding-box; max-width:min(92vw, 560px); margin:18px auto 0;
  padding:4px 12px 10px; filter:drop-shadow(0 2px 2px rgba(var(--shadow-rgb),.35)) drop-shadow(0 12px 16px rgba(var(--shadow-rgb),.4))}
.page-head .page-party{margin-top:10px}
.card{padding:4px max(6px, 2vw) 8px; border-radius:0}
.card::before{display:none}
.invite{padding:8px max(6px, 2vw) 12px; margin-top:-28px; position:relative; z-index:2}
section{padding-block:24px 4px}
/* the countdown's small words stay on one line inside the felt border */
.count span{letter-spacing:.06em}

/* the footer: one more panel, out on the field */
footer{max-width:560px; margin:30px auto 24px; padding:10px 16px 12px; width:calc(100% - 24px); box-sizing:border-box}
.foot-line{color:var(--ink-deep)}
/* the big screen: each heading on a felt panel, so it reads over the grass from across the room */
#tv .tv-head .sec-title{display:inline-block; max-width:100%; box-sizing:border-box; padding:0 .35em .08em; text-shadow:none;
  border-style:solid; border-width:26px 24px; border-image:url(../art/panel.webp) 72 67 69 62 / 26px 24px stretch round;
  background:var(--card) url(../art/paper.jpg) repeat padding-box; background-size:280px;
  filter:drop-shadow(0 2px 2px rgba(var(--shadow-rgb),.35)) drop-shadow(0 12px 16px rgba(var(--shadow-rgb),.4))}
