
:root{
 --ink:#0b111d;--surface:#131c2a;--surface2:#172232;--line:#3d4c63;
 --moon:#f0f3f7;--mist:#a6b2c2;--magic:#8fa2d0;--magic2:#b8a8d8;
 --success:#79c9a8;--warning:#d4b36e;--danger:#d98f9e;--red:#d95d68;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{margin:0;min-height:100%;background:var(--ink);color:var(--moon);
font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}
body{min-height:100vh;background:
radial-gradient(circle at 50% -10%,rgba(143,162,208,.12),transparent 36%),
linear-gradient(180deg,#0f1725 0%,#0b111d 70%,#080d16 100%)}
.stars{position:fixed;inset:0;pointer-events:none;opacity:.22;background-image:
radial-gradient(circle at 20% 15%,#fff 0 1px,transparent 1.3px),
radial-gradient(circle at 72% 11%,#fff 0 1px,transparent 1.3px),
radial-gradient(circle at 84% 42%,#fff 0 1px,transparent 1.3px),
radial-gradient(circle at 10% 58%,#fff 0 1px,transparent 1.3px);
background-size:260px 260px,340px 340px,390px 390px,310px 310px}
.app-shell{position:relative;width:min(92vw,820px);margin:auto;min-height:100vh;padding:clamp(24px,4vw,52px) clamp(14px,3vw,28px) 56px}
.screen{display:none;width:100%;animation:fade .22s ease}.screen.active{display:block}
@keyframes fade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.masthead{text-align:center;padding:6px 0 20px}.sigil,.secret-mark{text-align:center;color:var(--magic2);font-size:34px;margin-bottom:9px}
.overline,.day-eyebrow,.section-heading,.card-label{font-size:clamp(10px,1.6vw,12px);font-weight:750;letter-spacing:2px;color:var(--magic);text-align:center}
h1{font-family:Georgia,"Times New Roman",serif;font-size:clamp(34px,6vw,58px);font-weight:500;letter-spacing:.8px;margin:10px 0 8px}
h1 span{font-style:italic;color:#c9bce4}h2{font-family:Georgia,"Times New Roman",serif;text-align:center;font-size:clamp(27px,4.5vw,38px);font-weight:500;margin:12px 0 22px}
.tagline,.muted{color:var(--mist);text-align:center;line-height:1.55}.tagline{margin:0;font-family:Georgia,serif;font-style:italic;font-size:clamp(15px,2vw,17px)}
.welcome-card,.score-card,.puzzle-card{background:linear-gradient(180deg,rgba(23,34,50,.9),rgba(15,23,36,.94));border:1px solid var(--line);border-radius:18px;box-shadow:0 18px 55px rgba(0,0,0,.22)}
.welcome-card{padding:24px;text-align:center;margin:18px 0}.welcome-card p{color:#c4ccd8;line-height:1.65;margin:12px 0 0}
.score-card{padding:22px;margin:14px 0 28px}.score-title{text-align:center;font-size:13px;font-weight:800;letter-spacing:1.4px;color:#c6cfdd}.score-title span{font-family:Georgia,serif;font-style:italic;font-weight:400;color:var(--mist);letter-spacing:0}
.score-main{display:flex;justify-content:center;align-items:center;gap:clamp(12px,4vw,28px);margin:18px 0}.score-main>div:not(.score-divider){display:flex;flex-direction:column;align-items:center;min-width:80px}.score-main strong{font-family:Georgia,serif;font-size:clamp(38px,7vw,48px);font-weight:500}.score-main small{font-size:9px;letter-spacing:1.4px;color:var(--mist)}.score-divider{color:#52627d;font-size:28px}
.score-stats{border-top:1px solid rgba(255,255,255,.07);padding-top:14px;display:flex;flex-wrap:wrap;justify-content:center;gap:10px 18px;color:var(--mist);font-size:12px}.score-stats b{color:var(--moon)}
.section-heading{margin:10px 0 14px}.day-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.day-card{appearance:none;text-align:left;padding:17px;border-radius:15px;border:1px solid #2d394e;background:rgba(17,25,39,.9);color:var(--moon);cursor:pointer;min-height:108px;transition:transform .28s ease,border-color .2s ease,box-shadow .2s ease}
.day-card:hover{border-color:#4f6284}.day-card .dayline{display:flex;align-items:center;justify-content:space-between;gap:12px}.day-card .day{font-family:Georgia,serif;font-size:21px}.state-icon{width:22px;height:22px;display:block;flex:0 0 auto}.unsolved-icon{color:#e0606b}.solved-icon{color:#63c99b}.flag-icon{color:#f2f4f7}.day-card .date{font-size:11px;color:var(--mist);margin-top:5px}.day-card .state{font-size:12px;margin-top:12px;color:#aebbd0}.day-card .solved{color:var(--success)}.day-card .flag{color:var(--warning)}
.day-card .ready{color:#d9a0a7}.day-card .solved{color:var(--success);font-weight:700;letter-spacing:.25px}.day-card .flag{color:#d8c28e;font-weight:700;letter-spacing:.25px}
.day-card.entering{animation:cardIn .34s ease}@keyframes cardIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}
.empty-state{text-align:center;color:var(--mist);padding:28px 0}
.test-tools{text-align:center;color:#687990;font-size:10px;margin-top:20px;line-height:1.6}.test-tools code{color:#8295b3;background:#101827;padding:2px 4px;border-radius:4px}
.hidden{display:none!important}
.home-link{appearance:none;background:none;border:0;color:#8a98ad;font-size:11px;font-weight:750;letter-spacing:1.3px;padding:0;margin:0 0 28px;cursor:pointer}
.puzzle-card{padding:clamp(24px,4vw,34px);margin:18px auto;width:min(100%,720px)}.card-label{text-align:left;color:#7f90b3;margin-bottom:18px}
.question{font-family:Georgia,"Times New Roman",serif;font-size:clamp(19px,3vw,24px);line-height:1.65;color:#eef1f5;text-align:center;max-width:34em;margin:auto}
.question .line{display:block;text-wrap:balance}.question .gap{height:1em}
.scroll-cue{display:flex;flex-direction:column;align-items:center;gap:2px;margin:4px auto 12px;background:transparent;border:0;color:#8191ad;cursor:pointer;font-size:11px;letter-spacing:.5px}
.scroll-cue .chevron{font-size:28px;line-height:1;animation:bounce 1.7s ease-in-out infinite}
@keyframes bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(6px)}}
.answer-area{width:min(100%,620px);margin:0 auto}
input{width:100%;padding:16px 18px;margin:4px 0 10px;border-radius:13px;border:1px solid #3b4a63;background:#0d1420;color:var(--moon);font-size:17px;text-align:center;outline:none}
input:focus{border-color:var(--magic);box-shadow:0 0 0 3px rgba(143,162,208,.10)}
button.primary,button.secondary,button.giveup,.home-button{width:100%;padding:15px 18px;margin-top:10px;border-radius:13px;font-size:14px;font-weight:750;letter-spacing:.2px;cursor:pointer}
.primary{border:1px solid #7387b8;background:#536994;color:#fff}.secondary{border:1px solid #3a4a62;background:#141e2d;color:#c6cfdd}.giveup{border:1px solid #62414b;background:#261820;color:#e3b5bd}.home-button{border:1px solid #2d394e;background:transparent;color:#8795aa}
.status-panel{min-height:62px;text-align:center;padding:10px 4px 0}.feedback,.attempts{margin:3px 0;font-size:13px}.feedback.bad{color:#d1a5ad}.feedback.good{color:var(--success)}.attempts{color:#aeb8c8}
.compact{text-align:center}.answer-reveal{text-align:center;font-family:Georgia,serif;font-size:45px;color:#c8bce5;letter-spacing:3px;margin:18px 0}
.divider{display:flex;align-items:center;gap:12px;margin:25px 0 8px;color:#67758a}.divider span{height:1px;background:#2d394e;flex:1}.divider em{font-style:normal;font-size:10px;letter-spacing:1.5px}
.qr-wrap{width:min(280px,75vw);padding:15px;margin:18px auto;background:#fff;border-radius:14px}.qr-wrap img{display:block;width:100%;height:auto}.small{font-size:12px}

@media(max-width:620px){
 .app-shell{width:min(100%,520px);padding:24px 16px 42px}
 .day-grid{grid-template-columns:1fr}
 .welcome-card,.score-card,.puzzle-card{border-radius:16px}
 .score-stats{gap:8px 12px}
 .question{max-width:26em}
}
@media(min-width:621px) and (max-width:900px){
 .app-shell{width:min(94vw,760px)}
 .question{max-width:31em}
}
@media(min-width:901px){
 .app-shell{width:min(88vw,840px)}
 .question{max-width:34em}
}
@media(orientation:landscape) and (max-height:620px){
 .app-shell{padding-top:18px}
 .masthead{padding-top:0}
 .welcome-card{padding:18px}
}


/* v0.7 status icon + browser consistency fixes */
.day-card .state{font-size:11px;letter-spacing:.15px}
.day-card .state-icon{transition:none!important;animation:none!important}
.day-card .today-chip{
 display:inline-block;margin-left:7px;padding:2px 6px;border:1px solid #526887;border-radius:999px;
 color:#a9bce0;font-size:8px;font-weight:800;letter-spacing:1px;vertical-align:1px
}
.day-grid{grid-auto-flow:row!important}
.day-card{order:initial!important}


/* v1.1 dashboard freeze + scrolling cards */
.white-flag{color:#fff;font-weight:900}
.gift-mark{text-align:center;font-size:46px;line-height:1;margin:10px 0 14px}

/* Keep the scoreboard and "YOUR SECRETS" heading fixed while the card list scrolls. */
#home .score-card{
 position:sticky;
 top:10px;
 z-index:20;
 backdrop-filter:blur(10px);
 -webkit-backdrop-filter:blur(10px);
}
#home .section-heading{
 position:sticky;
 top:calc(var(--score-sticky-height, 238px));
 z-index:19;
 margin:0;
 padding:14px 0 10px;
 background:linear-gradient(180deg,rgba(11,17,29,.98),rgba(11,17,29,.94));
}
#home .day-grid{
 max-height:52vh;
 overflow-y:auto;
 overscroll-behavior:contain;
 padding-right:4px;
 scrollbar-width:thin;
}
#home .day-grid::-webkit-scrollbar{width:8px}
#home .day-grid::-webkit-scrollbar-thumb{background:#2c3a50;border-radius:999px}
#home .day-grid::-webkit-scrollbar-track{background:transparent}

/* On smaller screens, keep the sticky header compact enough to leave useful room for cards. */
@media(max-width:620px){
 #home .score-card{top:6px;padding:16px;margin-bottom:8px}
 #home .score-main{margin:10px 0}
 #home .score-main strong{font-size:36px}
 #home .score-stats{padding-top:10px;gap:6px 9px;font-size:10px}
 #home .section-heading{top:194px;padding-top:10px}
 #home .day-grid{max-height:48vh}
}
@media(min-width:621px){
 #home .section-heading{top:236px}
}

/* Fallback when backdrop-filter is unsupported */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
 #home .score-card{background:#131c2a}
}


/* v1.2 test controls */
.reset-test{
 margin-top:10px;
 padding:8px 12px;
 border:1px solid #6d4851;
 border-radius:10px;
 background:#21151b;
 color:#e8b5bd;
 font-size:10px;
 font-weight:800;
 letter-spacing:.8px;
 cursor:pointer;
}
.reset-test:hover{border-color:#9b626f}

/* Secret list can now hold all 41 date entries without expanding the page header. */
#home .day-grid{
 max-height:56vh;
 overflow-y:auto;
}


/* v1.4 EXIT 0 birthday finale */
.finale-screen{position:relative;overflow:hidden;min-height:calc(100vh - 80px)}
.finale-content{position:relative;z-index:2;width:min(100%,720px);margin:0 auto;text-align:center;padding-top:4px}
.finale-cake{font-size:58px;line-height:1;margin:6px 0 16px}
.birthday-title{font-size:clamp(34px,6vw,56px);margin:15px 0 10px}
.birthday-subtitle{font-family:Georgia,"Times New Roman",serif;font-size:clamp(21px,3vw,28px);margin:0 0 6px;color:#c9bce4}
.finale-gift{margin-top:26px}
.celebration-layer{position:fixed;inset:0;z-index:1;pointer-events:none;overflow:hidden}
.confetti-piece{position:absolute;top:-30px;opacity:0;animation:confettiFall 4s ease-in forwards;transform:translateX(0) rotate(0deg)}
@keyframes confettiFall{
  0%{transform:translateX(0) translateY(-20px) rotate(0deg);opacity:0}
  8%{opacity:1}
  100%{transform:translateX(var(--drift,0px)) translateY(105vh) rotate(720deg);opacity:.85}
}
.birthday-balloon{position:absolute;bottom:-100px;font-size:clamp(34px,6vw,56px);animation:balloonRise 6s ease-in forwards;opacity:.95}
@keyframes balloonRise{
  0%{transform:translateY(0) rotate(-4deg);opacity:0}
  8%{opacity:.95}
  50%{transform:translateY(-55vh) rotate(5deg)}
  100%{transform:translateY(-120vh) rotate(-3deg);opacity:.75}
}
@media(prefers-reduced-motion:reduce){
 .confetti-piece{animation-duration:6.5s!important;animation-timing-function:linear!important}
 .birthday-balloon{animation-duration:9s!important;animation-timing-function:linear!important}
}


/* v1.5 streamlined home masthead */
.journey-intro{
  max-width:900px;
  margin:10px auto 16px;
  text-align:center;
  color:#9fb2dc;
  font-size:clamp(10px,1.3vw,13px);
  font-weight:700;
  line-height:1.65;
  letter-spacing:.12em;
}
.masthead h1{
  margin-top:4px;
}
@media(max-width:700px){
  .journey-intro{
    padding:0 8px;
    font-size:10px;
    line-height:1.55;
    letter-spacing:.08em;
  }
}


/* v1.6 title refinement */
.masthead h1 .title-second-line{
  display:inline-block;
}
.masthead h1 .title-second-line em{
  color:#E8DFFF;
  font-style:italic;
}


/* v1.7 mobile-first frozen dashboard + reliable birthday celebration */

/*
   PHONE HOME SCREEN ARCHITECTURE
   - one fixed app viewport
   - page/body do not scroll
   - scoreboard + YOUR EXITS remain in place
   - only EXIT cards scroll
   - masthead gently collapses after the card pane starts moving
*/
@media(max-width:620px){
  html,
  body.home-active{
    height:100%;
    height:100dvh;
    overflow:hidden;
    overscroll-behavior:none;
  }

  body.home-active .app-shell{
    width:100%;
    max-width:520px;
    height:100vh;
    height:100dvh;
    min-height:0;
    padding:
      max(10px, env(safe-area-inset-top))
      12px
      max(8px, env(safe-area-inset-bottom));
    overflow:hidden;
    display:block;
  }

  body.home-active #home.active{
    height:100%;
    min-height:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }

  body.home-active #home .masthead{
    flex:0 0 auto;
    max-height:178px;
    overflow:hidden;
    padding:0 0 8px;
    opacity:1;
    transform:translateY(0);
    transition:
      max-height .28s ease,
      opacity .20s ease,
      transform .28s ease,
      padding .28s ease;
  }

  body.home-active #home .sigil{
    font-size:24px;
    margin:0 0 4px;
  }

  body.home-active #home .journey-intro{
    margin:2px auto 6px;
    padding:0 4px;
    font-size:8.8px;
    line-height:1.4;
    letter-spacing:.055em;
  }

  body.home-active #home .masthead h1{
    font-size:clamp(28px,8.4vw,38px);
    line-height:1.02;
    margin:3px 0 2px;
    letter-spacing:.35px;
  }

  /* Once Mika starts scrolling the exits, free the masthead space.
     The dashboard itself never jumps; the EXIT pane simply gains room. */
  body.home-active.home-grid-scrolled #home .masthead{
    max-height:0;
    opacity:0;
    transform:translateY(-12px);
    padding:0;
    pointer-events:none;
  }

  body.home-active #home .score-card{
    position:relative!important;
    top:auto!important;
    z-index:20;
    flex:0 0 auto;
    margin:4px 0 5px;
    padding:10px 12px 9px;
    border-radius:14px;
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
  }

  body.home-active #home .score-title{
    font-size:10.5px;
    letter-spacing:1.05px;
  }

  body.home-active #home .score-main{
    margin:5px 0 6px;
    gap:18px;
  }

  body.home-active #home .score-main>div:not(.score-divider){
    min-width:58px;
  }

  body.home-active #home .score-main strong{
    font-size:29px;
    line-height:1;
  }

  body.home-active #home .score-main small{
    font-size:7.5px;
  }

  body.home-active #home .score-divider{
    font-size:20px;
  }

  body.home-active #home .score-stats{
    padding-top:7px;
    gap:4px 9px;
    font-size:8.8px;
    line-height:1.25;
  }

  body.home-active #home .section-heading{
    position:relative!important;
    top:auto!important;
    z-index:19;
    flex:0 0 auto;
    margin:0;
    padding:6px 0 7px;
    background:linear-gradient(180deg,rgba(11,17,29,.99),rgba(11,17,29,.96));
  }

  body.home-active #home .day-grid{
    flex:1 1 auto;
    min-height:0;
    max-height:none!important;
    overflow-y:auto;
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
    touch-action:pan-y;
    padding:1px 2px max(14px, env(safe-area-inset-bottom)) 0;
    scrollbar-gutter:stable;
  }

  body.home-active #home .day-card{
    min-height:96px;
    padding:14px 15px;
  }

  body.home-active #home .day-card .day{
    font-size:20px;
  }

  body.home-active #home .test-tools{
    flex:0 0 auto;
    margin:4px 0 0;
    padding-top:2px;
    line-height:1.25;
    font-size:8px;
  }

  body.home-active #home .test-tools .test-hint{
    display:none;
  }

  body.home-active #home .reset-test{
    margin-top:4px;
    padding:5px 9px;
    font-size:8px;
  }
}

/* Normal scrolling resumes on puzzle / gift / finale screens. */
@media(max-width:620px){
  body:not(.home-active){
    min-height:100%;
    overflow-y:auto;
    overscroll-behavior-y:auto;
  }
}

/*
   Birthday celebration:
   keep animation viewport-wide and above the background on mobile.
   Content stays above the effects so buttons remain readable/tappable.
*/
.celebration-layer{
  position:fixed!important;
  inset:0!important;
  width:100vw;
  width:100dvw;
  height:100vh;
  height:100dvh;
  z-index:90!important;
  pointer-events:none!important;
  overflow:hidden!important;
  contain:layout paint;
}

.finale-content{
  position:relative;
  z-index:100!important;
}

.confetti-piece{
  will-change:transform,opacity;
  text-shadow:0 0 8px rgba(255,255,255,.22);
}

.birthday-balloon{
  will-change:transform,opacity;
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.28));
}

@media(max-width:620px){
  .finale-screen{
    overflow:visible;
    min-height:calc(100dvh - 30px);
  }
  .finale-content{
    padding-bottom:max(20px,env(safe-area-inset-bottom));
  }
  .finale-cake{
    font-size:48px;
    margin:3px 0 11px;
  }
  .birthday-title{
    font-size:clamp(30px,9vw,42px);
    line-height:1.08;
  }
  .finale-gift{
    margin-top:18px;
  }
}


/* =========================================================
   v1.8 — responsive home + mobile reward usability
   ========================================================= */

/* HOME: page is the scroller on every device. The journey intro/title
   scrolls away naturally; only the scoreboard remains sticky. */
#home .day-grid{
  max-height:none!important;
  overflow:visible!important;
  overscroll-behavior:auto!important;
  scrollbar-gutter:auto!important;
  padding-right:0!important;
}
#home .section-heading{
  position:relative!important;
  top:auto!important;
  z-index:auto!important;
  margin:10px 0 14px!important;
  padding:0!important;
  background:none!important;
}
#home .score-card{
  position:sticky!important;
  top:10px;
  z-index:30;
}

/* Laptop/desktop sticky scoreboard: approximately 90% of prior footprint. */
@media(min-width:621px){
  #home .score-card{padding:18px 20px;margin:12px 0 18px}
  #home .score-main{margin:14px 0}
  #home .score-main strong{font-size:clamp(36px,6.2vw,43px)}
  #home .score-stats{padding-top:11px;gap:8px 16px;font-size:11px}
}

/* MOBILE PORTRAIT + LANDSCAPE */
@media(max-width:620px){
  html{
    height:auto!important;
    min-height:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
  }
  body,
  body.home-active,
  body:not(.home-active){
    height:auto!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
  }
  body.home-active .app-shell,
  body:not(.home-active) .app-shell{
    width:100%!important;
    max-width:520px;
    height:auto!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    overflow:visible!important;
    display:block!important;
    padding:max(10px,env(safe-area-inset-top)) 10px max(34px,env(safe-area-inset-bottom))!important;
  }
  body.home-active #home.active{
    height:auto!important;
    min-height:0!important;
    display:block!important;
    overflow:visible!important;
  }
  body.home-active #home .masthead,
  body.home-active.home-grid-scrolled #home .masthead{
    max-height:none!important;
    overflow:visible!important;
    opacity:1!important;
    transform:none!important;
    padding:0 0 8px!important;
    pointer-events:auto!important;
  }

  /* Portrait scoreboard ≈75–80% of previous mobile footprint. */
  body.home-active #home .score-card{
    position:sticky!important;
    top:max(4px,env(safe-area-inset-top))!important;
    margin:4px 0 7px!important;
    padding:8px 10px 7px!important;
    border-radius:13px;
  }
  body.home-active #home .score-title{font-size:9.6px;letter-spacing:.95px}
  body.home-active #home .score-main{margin:4px 0 5px;gap:14px}
  body.home-active #home .score-main>div:not(.score-divider){min-width:52px}
  body.home-active #home .score-main strong{font-size:26px;line-height:1}
  body.home-active #home .score-main small{font-size:6.8px;letter-spacing:1px}
  body.home-active #home .score-divider{font-size:17px}
  body.home-active #home .score-stats{padding-top:6px;gap:3px 7px;font-size:8px;line-height:1.18}
  body.home-active #home .section-heading{margin:7px 0 8px!important}

  /* Two columns on phone. Existing newest-first ordering is intentionally
     preserved, which keeps EXIT 40 at the bottom of the full journey. */
  body.home-active #home .day-grid,
  #home .day-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    overflow:visible!important;
    max-height:none!important;
    padding:0 1px 6px!important;
  }
  body.home-active #home .day-card{
    min-width:0;
    min-height:88px;
    padding:11px 10px;
    border-radius:13px;
  }
  body.home-active #home .day-card .dayline{justify-content:flex-start;gap:6px}
  body.home-active #home .day-card .day{font-size:18px;line-height:1.05;white-space:nowrap}
  body.home-active #home .day-card .state-icon{width:19px;height:19px}
  body.home-active #home .day-card .date{font-size:9.5px;line-height:1.25;margin-top:6px}
  body.home-active #home .day-card .state{font-size:9.6px;line-height:1.2;margin-top:9px;overflow-wrap:anywhere}
  body.home-active #home .day-card .today-chip{margin-left:3px;padding:1px 4px;font-size:6.5px}
  body.home-active #home .test-tools{margin-top:12px}

  /* QR is not useful on the same phone. Direct surprise/video button stays primary. */
  #video .divider,
  #video .qr-wrap,
  #video .qr-wrap + .muted.small,
  #finale .divider,
  #finale .qr-wrap,
  #finale .qr-wrap + .muted.small{display:none!important}
  #video.active,
  #finale.active{overflow:visible!important;min-height:auto!important}
  #video .home-button,
  #finale .home-button{margin-top:18px}
  .finale-screen{overflow:visible!important;min-height:auto!important}
  .finale-content{padding-bottom:max(44px,env(safe-area-inset-bottom))!important}
}

/* Short landscape phones: tighter ≈60% scoreboard footprint. */
@media(max-width:920px) and (orientation:landscape) and (max-height:620px){
  .app-shell{
    width:min(100%,920px)!important;
    max-width:none!important;
    padding:max(6px,env(safe-area-inset-top)) 10px max(22px,env(safe-area-inset-bottom))!important;
  }
  body.home-active #home .masthead{padding-bottom:4px!important}
  body.home-active #home .sigil{font-size:18px;margin-bottom:1px}
  body.home-active #home .journey-intro{margin:1px auto 3px;font-size:7.3px;line-height:1.25}
  body.home-active #home .masthead h1{font-size:23px;line-height:1;margin:2px 0 1px}
  body.home-active #home .score-card{
    top:max(3px,env(safe-area-inset-top))!important;
    padding:5px 8px!important;
    margin:2px 0 4px!important;
    border-radius:11px;
  }
  body.home-active #home .score-title{font-size:8px;letter-spacing:.75px}
  body.home-active #home .score-main{margin:2px 0 3px;gap:10px}
  body.home-active #home .score-main>div:not(.score-divider){min-width:42px}
  body.home-active #home .score-main strong{font-size:21px}
  body.home-active #home .score-main small{font-size:5.8px}
  body.home-active #home .score-divider{font-size:14px}
  body.home-active #home .score-stats{padding-top:4px;gap:2px 6px;font-size:7.2px;line-height:1.1}
  body.home-active #home .section-heading{margin:4px 0 5px!important;font-size:9px}
  body.home-active #home .day-grid,
  #home .day-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  body.home-active #home .day-card{min-height:72px;padding:8px 10px}
  body.home-active #home .day-card .day{font-size:16px}
  body.home-active #home .day-card .state-icon{width:17px;height:17px}
  body.home-active #home .day-card .date{font-size:8.5px;margin-top:4px}
  body.home-active #home .day-card .state{font-size:8.5px;margin-top:6px}
}

/* Birthday effects */
.confetti-piece{
  color:var(--confetti-color,#f3c5d2);
  text-shadow:0 0 8px rgba(255,255,255,.18);
}
.birthday-balloon{
  top:var(--balloon-origin-y,calc(100vh - 90px))!important;
  bottom:auto!important;
}
@keyframes balloonRise{
  0%{transform:translateY(20px) rotate(-4deg);opacity:0}
  5%{opacity:.95}
  50%{transform:translateY(-58vh) rotate(5deg)}
  100%{transform:translateY(-118vh) rotate(-3deg);opacity:.72}
}


/* =========================================================
   PROJECT 40 v2.0 — approved UX pass
   ========================================================= */
.project40-header{text-align:center;padding:2px 0 14px}
.project40-brand{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:min(92vw,430px);padding:0 42px}
.project40-handwritten{
 margin:0!important;font-family:"Segoe Print","Bradley Hand","Segoe Script","Brush Script MT",cursive!important;
 font-size:clamp(42px,6.2vw,62px)!important;font-weight:500!important;line-height:1!important;letter-spacing:-2px!important;
 background:linear-gradient(105deg,#eab8d1 4%,#e6c4dc 42%,#e9cf9b 77%,#f0dba9 100%);
 -webkit-background-clip:text;background-clip:text;color:transparent!important;-webkit-text-fill-color:transparent;
 filter:drop-shadow(0 2px 12px rgba(225,181,208,.13))
}
.project40-handwritten span{color:inherit!important;font-style:normal!important;-webkit-text-fill-color:transparent}
.brand-sparkle{position:absolute;color:#efd7a3;text-shadow:0 0 10px rgba(239,215,163,.48);pointer-events:none}
.sparkle-left{left:23px;top:15px;font-size:15px}.sparkle-right{right:19px;top:3px;font-size:19px}.sparkle-mini{right:39px;bottom:3px;font-size:8px;color:#e8bfd3}
.journey-lockup{margin-top:17px}
.project40-subtitle{color:#d3dbed;font-size:11px;font-weight:750;line-height:1.1;letter-spacing:.32em;text-indent:.32em}
.project40-subline{margin-top:4px;color:#77609f;font-family:Georgia,"Times New Roman",serif;font-size:15px;line-height:1.1;font-style:italic;font-weight:600}
.project40-header .journey-intro{margin:14px auto 0;max-width:760px;padding:0 8px;color:#a9b9d6;font-size:12px;font-weight:650;line-height:1.55;letter-spacing:.06em}

/* Opaque frozen frame on desktop: EXIT cards cannot be seen through it */
#home .score-card{background:#131c2a!important;z-index:50!important;box-shadow:0 12px 20px rgba(5,9,17,.72)}
#home .section-heading{background:#0b111d!important;z-index:49}
@media(min-width:621px){
 #home .score-card{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
 #home .section-heading{position:sticky!important;top:var(--score-frame-bottom,180px)!important;padding:9px 0!important;margin:0!important;box-shadow:0 8px 12px rgba(5,9,17,.65)}
}

/* Long revealed answers never overflow */
#answerReveal{display:block;width:100%;max-width:100%;box-sizing:border-box;padding-inline:12px;white-space:normal!important;overflow-wrap:anywhere;word-break:normal;line-height:1.04}

/* Laptop QR is intentionally secondary */
@media(min-width:921px){
 .qr-wrap{width:132px!important;padding:8px!important;margin:12px auto!important;border-radius:10px!important}
 .qr-wrap img{width:100%!important;height:auto!important}
}

/* Wrong-answer phone popup, anchored above the keyboard */
.wrong-answer-popover{
 position:fixed;left:50%;bottom:calc(var(--keyboard-offset,0px) + 16px);transform:translateX(-50%);
 width:min(90vw,390px);z-index:10000;display:none;box-sizing:border-box;padding:16px 16px 13px;
 border:1px solid rgba(181,197,230,.28);border-radius:16px;background:rgba(17,27,45,.99);
 box-shadow:0 12px 38px rgba(0,0,0,.55);text-align:center;color:#eef2fb
}
.wrong-answer-popover.show{display:block}
.wap-message{font-family:Georgia,"Times New Roman",serif;font-size:18px;line-height:1.32}
.wap-remaining{margin-top:7px;color:#b8c5e2;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.wap-ok{width:100%;margin-top:12px;padding:11px 16px;border:1px solid rgba(190,205,236,.3);border-radius:12px;background:#5d78a7;color:#fff;font:700 14px/1 system-ui,sans-serif;letter-spacing:.08em}

/* Mobile = fixed app frame; ONLY EXIT cards scroll */
@media(max-width:620px){
 html,body.home-active{height:100%!important;height:100dvh!important;overflow:hidden!important;overscroll-behavior:none!important}
 body.home-active .app-shell{width:100%!important;max-width:520px;height:100vh!important;height:100dvh!important;min-height:0!important;overflow:hidden!important;display:block!important;padding:max(8px,env(safe-area-inset-top)) 10px max(7px,env(safe-area-inset-bottom))!important}
 body.home-active #home.active{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
 body.home-active #home .project40-header,body.home-active.home-grid-scrolled #home .project40-header{flex:0 0 auto;max-height:none!important;overflow:visible!important;opacity:1!important;transform:none!important;padding:0 0 7px!important}
 body.home-active #home .project40-brand{min-width:min(94vw,360px);padding:0 34px}
 body.home-active #home .project40-handwritten{font-size:clamp(36px,11vw,46px)!important;line-height:.98!important}
 body.home-active #home .journey-lockup{margin-top:14px}
 body.home-active #home .project40-subtitle{font-size:8.8px;letter-spacing:.30em;text-indent:.30em}
 body.home-active #home .project40-subline{font-size:13px;margin-top:3px}
 body.home-active #home .project40-header .journey-intro{margin:10px auto 0;font-size:10px;line-height:1.42;letter-spacing:.04em}
 body.home-active #home .score-card{position:relative!important;top:auto!important;flex:0 0 auto!important;margin:3px 0 4px!important;padding:8px 10px 7px!important;background:#131c2a!important}
 body.home-active #home .section-heading{position:relative!important;top:auto!important;flex:0 0 auto!important;margin:0!important;padding:6px 0 7px!important;background:#0b111d!important}
 body.home-active #home .day-grid,#home .day-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain!important;touch-action:pan-y;padding:1px 1px max(14px,env(safe-area-inset-bottom))!important}
 body.home-active #home .test-tools{flex:0 0 auto;margin:3px 0 0!important;font-size:8px}
 #video .divider,#video .qr-wrap,#video .qr-wrap + .muted.small,#finale .divider,#finale .qr-wrap,#finale .qr-wrap + .muted.small{display:none!important}
}

/* Phone landscape is still phone: no QR */
@media(max-width:920px) and (orientation:landscape) and (max-height:620px){
 #video .divider,#video .qr-wrap,#video .qr-wrap + .muted.small,#finale .divider,#finale .qr-wrap,#finale .qr-wrap + .muted.small{display:none!important}
 body.home-active #home .project40-handwritten{font-size:30px!important}
 body.home-active #home .journey-lockup{margin-top:5px}
 body.home-active #home .project40-header .journey-intro{font-size:7.5px;line-height:1.22;margin-top:4px}
}
@media(min-width:921px){.wrong-answer-popover{display:none!important}}


/* =========================================================
   PROJECT 40 v2.1
   - selected subtitle Option 5
   - mobile single-scroll sticky scoreboard
   - intentional mobile intro wrapping
   - compact desktop gift CTA
   ========================================================= */

/* Option 5: cinematic subtitle */
.option5-lockup .project40-subtitle{
  color:#f0e5cf!important;
  font-family:Georgia,"Times New Roman",serif!important;
  font-size:12px!important;
  font-weight:600!important;
  letter-spacing:.34em!important;
  text-indent:.34em!important;
}
.option5-lockup .project40-subline{
  margin-top:5px!important;
  line-height:1.05!important;
}
.option5-lockup .subline-with{
  color:#b78ad6;
  font-family:"Segoe Script","Snell Roundhand","Brush Script MT",cursive;
  font-style:italic;
  font-weight:500;
  font-size:17px;
}
.option5-lockup .subline-exits{
  color:#e6c56d;
  font-family:Georgia,"Times New Roman",serif;
  font-style:normal;
  font-weight:700;
  font-size:16px;
  letter-spacing:.08em;
}

.intro-mobile{display:none}

/* Laptop/desktop: primary gift button fits its wording instead of spanning the page */
@media(min-width:621px){
  #video .primary,
  #finale .primary{
    width:auto!important;
    max-width:none!important;
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    padding-left:30px!important;
    padding-right:30px!important;
    min-width:0!important;
  }
  #video .actions,
  #finale .actions{
    text-align:center;
  }
}

/* PHONE: one natural page scrollbar.
   Branding/intro scroll away; scoreboard + YOUR EXITS become sticky only after reaching top. */
@media(max-width:620px){
  html,
  body,
  body.home-active{
    height:auto!important;
    min-height:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
  }

  body.home-active .app-shell{
    height:auto!important;
    min-height:100dvh!important;
    overflow:visible!important;
    display:block!important;
    padding:
      max(8px,env(safe-area-inset-top))
      10px
      max(12px,env(safe-area-inset-bottom))!important;
  }

  body.home-active #home.active{
    height:auto!important;
    min-height:100dvh!important;
    display:block!important;
    overflow:visible!important;
  }

  /* Branding and intro are normal content: they scroll away. */
  body.home-active #home .project40-header,
  body.home-active.home-grid-scrolled #home .project40-header{
    position:relative!important;
    top:auto!important;
    max-height:none!important;
    overflow:visible!important;
    opacity:1!important;
    transform:none!important;
    pointer-events:auto!important;
  }

  body.home-active #home .option5-lockup .project40-subtitle{
    font-size:9.2px!important;
    letter-spacing:.30em!important;
    text-indent:.30em!important;
  }
  body.home-active #home .option5-lockup .subline-with{
    font-size:14px!important;
  }
  body.home-active #home .option5-lockup .subline-exits{
    font-size:13px!important;
  }

  /* Intentional mobile line breaks for intro copy. */
  .intro-desktop{display:none!important}
  .intro-mobile{
    display:block!important;
  }
  .intro-mobile > span{
    display:block;
    white-space:nowrap;
  }
  body.home-active #home .project40-header .journey-intro{
    font-size:9.5px!important;
    line-height:1.42!important;
    letter-spacing:.025em!important;
    padding:0 2px!important;
  }

  /* Single-scroll sticky frame: scoreboard sticks once it reaches top. */
  body.home-active #home .score-card{
    position:sticky!important;
    top:max(8px,env(safe-area-inset-top))!important;
    z-index:60!important;
    margin:3px 0 0!important;
    background:#131c2a!important;
  }

  /* YOUR EXITS sits directly under the sticky scoreboard. */
  body.home-active #home .section-heading{
    position:sticky!important;
    top:var(--mobile-score-bottom, 150px)!important;
    z-index:59!important;
    margin:0!important;
    padding:7px 0 8px!important;
    background:#0b111d!important;
  }

  /* IMPORTANT: no nested scrolling / second scrollbar. */
  body.home-active #home .day-grid,
  #home .day-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    overflow:visible!important;
    padding:1px 1px max(16px,env(safe-area-inset-bottom))!important;
  }

  body.home-active #home .test-tools{
    position:relative!important;
    bottom:auto!important;
  }
}

/* On very narrow phones, allow only the third intro line to wrap gracefully if absolutely necessary. */
@media(max-width:365px){
  .intro-mobile > span{white-space:normal}
}

/* Keep mobile CTA touch-friendly; override desktop content-width behavior. */
@media(max-width:620px){
  #video .primary,
  #finale .primary{
    width:100%!important;
    display:flex!important;
  }
}

/* =========================================================
   PROJECT 40 v2.2
   Testing fixes from canonical MAIN CHAT
   ========================================================= */

/* Scoreboard: labels belong directly above their score; VS aligns with dash. */
.score-main{
  align-items:flex-start!important;
}
.score-main .score-player,
.score-main .score-divider{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
}
.score-main .score-player small,
.score-main .score-divider small{
  display:block;
  min-height:14px;
  margin:0 0 5px;
  color:#c6cfdd;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  font-size:9px;
  font-style:normal;
  font-weight:800;
  letter-spacing:1.2px;
  line-height:1;
  white-space:nowrap;
}
.score-main .score-divider{
  min-width:42px;
  color:#52627d;
}
.score-main .score-divider span{
  display:block;
  font-size:28px;
  line-height:1;
}

/* EXIT cards: highway-sign treatment with Option 7's warm serif EXIT label
   and a clearly boxed route/exit number so EXIT 0 can never read as EXIT O. */
.day-card{
  border:1px solid rgba(235,239,224,.74)!important;
  background:linear-gradient(180deg,#07523f 0%,#063f33 100%)!important;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,.08),
    inset 0 0 0 5px rgba(236,240,225,.12),
    0 10px 24px rgba(0,0,0,.18)!important;
}
.day-card:hover{
  border-color:#f2e9c5!important;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,.10),
    inset 0 0 0 5px rgba(236,240,225,.15),
    0 12px 28px rgba(0,0,0,.24)!important;
}
.day-card .dayline{align-items:center!important}
.day-card .day{
  display:flex;
  align-items:center;
  gap:9px;
  font-family:Georgia,"Times New Roman",serif!important;
  line-height:1;
}
.day-card .exit-word{
  color:#e6c56d;
  font-family:Georgia,"Times New Roman",serif;
  font-size:22px;
  font-weight:700;
  letter-spacing:.02em;
}
.day-card .exit-number{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:38px;
  height:34px;
  padding:0 8px;
  border:2px solid #f2efe5;
  border-radius:7px;
  color:#fffdf4;
  font-family:Georgia,"Times New Roman",serif;
  font-size:23px;
  font-weight:700;
  line-height:1;
  text-shadow:0 1px 1px rgba(0,0,0,.35);
}
.day-card .date{color:#d8e3dc!important}
.day-card .state{color:#e6ece8!important}
.day-card .ready{color:#ffd0d5!important}
.day-card .solved{color:#a9f0cf!important}
.day-card .flag{color:#f0dca7!important}
.day-card .today-chip{border-color:#9bb9d8!important;color:#cfe1ff!important;background:rgba(11,17,29,.24)}

/* Desktop/laptop primary surprise CTA: true horizontal centering. */
@media(min-width:621px){
  #video #watchBtn,
  #finale #birthdaySurpriseBtn{
    margin:10px auto 0!important;
  }
}

/* PHONE PORTRAIT: freeze the complete Project 40 header + scoreboard + YOUR EXITS.
   The EXIT list is the only scrolling region. This intentionally does NOT touch
   the already-approved mobile landscape home behavior. */
@media(max-width:620px) and (orientation:portrait){
  html,
  body.home-active{
    height:100%!important;
    height:100dvh!important;
    overflow:hidden!important;
    overscroll-behavior:none!important;
  }
  body.home-active .app-shell{
    width:100%!important;
    max-width:520px!important;
    height:100vh!important;
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
    display:block!important;
    padding:max(8px,env(safe-area-inset-top)) 10px max(7px,env(safe-area-inset-bottom))!important;
  }
  body.home-active #home.active{
    height:100%!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  body.home-active #home .project40-header,
  body.home-active.home-grid-scrolled #home .project40-header{
    position:relative!important;
    top:auto!important;
    flex:0 0 auto!important;
    max-height:none!important;
    overflow:visible!important;
    opacity:1!important;
    transform:none!important;
    pointer-events:auto!important;
    padding:0 0 7px!important;
  }
  body.home-active #home .score-card{
    position:relative!important;
    top:auto!important;
    flex:0 0 auto!important;
    margin:3px 0 4px!important;
    padding:8px 10px 7px!important;
    background:#131c2a!important;
  }
  body.home-active #home .section-heading{
    position:relative!important;
    top:auto!important;
    flex:0 0 auto!important;
    margin:0!important;
    padding:6px 0 7px!important;
    background:#0b111d!important;
  }
  body.home-active #home .day-grid,
  #home .day-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y;
    padding:1px 1px max(14px,env(safe-area-inset-bottom))!important;
  }
  body.home-active #home .test-tools{
    flex:0 0 auto;
    margin:3px 0 0!important;
    font-size:8px;
  }

  /* Mobile finale CTA alignment: independent of text length / device width. */
  #finale #birthdaySurpriseBtn,
  #video #watchBtn{
    width:calc(100% - 12px)!important;
    max-width:480px!important;
    margin:10px auto 0!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }
}

/* Wrong-answer/surrender popups stay above the soft keyboard. */
.wrong-answer-popover[data-mode="surrender"]{
  border-color:rgba(217,143,158,.42);
}
.wrong-answer-popover[data-mode="surrender"] .wap-ok{
  background:#6d4851;
  border-color:#93606d;
}

/* Mobile landscape puzzle entry: when the keyboard is open, temporarily collapse
   nonessential puzzle chrome so the textbox and UNLOCK button remain usable.
   Home/scoreboard landscape layout is untouched. */
@media(max-width:920px) and (orientation:landscape) and (max-height:620px){
  body.answer-entry-active .app-shell{
    padding:4px 12px!important;
  }
  body.answer-entry-active #puzzle .home-link,
  body.answer-entry-active #puzzle .day-eyebrow,
  body.answer-entry-active #puzzle .secret-mark,
  body.answer-entry-active #puzzle .puzzle-card,
  body.answer-entry-active #puzzle .scroll-cue,
  body.answer-entry-active #puzzle #hintBtn,
  body.answer-entry-active #puzzle .status-panel,
  body.answer-entry-active #puzzle .home-button,
  body.answer-entry-active #puzzle #giveUpBtn{
    display:none!important;
  }
  body.answer-entry-active #puzzle.active{
    display:block!important;
    min-height:var(--visual-height,100dvh)!important;
  }
  body.answer-entry-active #answerArea{
    position:fixed!important;
    z-index:9000!important;
    left:50%!important;
    top:calc(var(--visual-top, 0px) + 4px)!important;
    transform:translateX(-50%)!important;
    width:min(94vw,680px)!important;
    margin:0!important;
    padding:0!important;
  }
  body.answer-entry-active #answerInput{
    margin:0 0 4px!important;
    padding:8px 12px!important;
    min-height:36px!important;
    font-size:16px!important;
  }
  body.answer-entry-active #submitBtn{
    margin:0!important;
    padding:8px 12px!important;
    min-height:34px!important;
    font-size:12px!important;
  }
}

/* =========================================================
   PROJECT 40 v2.3 — MAIN CHAT QA fixes
   ========================================================= */

/* Locked EXIT design: Option A black/neon card + A3 modern digits. */
.day-card{
  border:1px solid #20d98b!important;
  background:linear-gradient(180deg,#101720 0%,#090e15 100%)!important;
  box-shadow:inset 0 0 0 1px rgba(32,217,139,.12),0 9px 22px rgba(0,0,0,.22)!important;
}
.day-card:hover{border-color:#35efa0!important;box-shadow:inset 0 0 0 1px rgba(53,239,160,.16),0 11px 25px rgba(0,0,0,.27)!important}
.day-card .exit-word{color:#e7c75f!important;font-family:Georgia,"Times New Roman",serif!important;font-weight:700!important}
.day-card .exit-number{
  min-width:38px!important;height:36px!important;padding:0 7px!important;
  border:2px solid #20d98b!important;border-radius:5px!important;color:#f5f7f8!important;
  font-family:Arial,"Helvetica Neue",sans-serif!important;font-size:23px!important;font-weight:800!important;
  line-height:36px!important;text-align:center!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  font-variant-numeric:tabular-nums lining-nums!important;text-shadow:none!important;
}
.day-card .date{color:#f0f2f3!important}.day-card .state{color:#dfe7e3!important}
.day-card .ready{color:#20d98b!important}.day-card .solved{color:#20d98b!important}.day-card .flag{color:#e7c75f!important}
.day-card .today-chip{border-color:#20d98b!important;color:#e7c75f!important;background:#111820!important}

/* Locked scoreboard treatment: airport split-flap style ONLY on the large score digits. */
.score-main .score-player strong{
  position:relative;display:inline-flex!important;align-items:center;justify-content:center;
  min-width:54px;height:58px;padding:0 8px;border:1px solid #394453;border-radius:5px;
  background:linear-gradient(to bottom,#111820 0%,#111820 49%,#070b10 50%,#0d131b 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 5px 12px rgba(0,0,0,.28);
  color:#f3f0e7!important;font-family:"Arial Narrow",Arial,"Helvetica Neue",sans-serif!important;
  font-size:42px!important;font-weight:800!important;line-height:1!important;font-variant-numeric:tabular-nums lining-nums;
  text-shadow:0 1px 0 #000;
}
.score-main .score-player strong::after{content:"";position:absolute;left:3px;right:3px;top:50%;height:1px;background:rgba(0,0,0,.9);box-shadow:0 1px 0 rgba(255,255,255,.055);pointer-events:none}

/* CTA alignment: deterministic centering on laptop and phone. */
#video .actions,#finale .actions{display:flex!important;flex-direction:column!important;align-items:center!important}
#video #watchBtn,#finale #birthdaySurpriseBtn{display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;margin:10px auto 0!important;box-sizing:border-box!important}
@media(min-width:621px){#video #watchBtn,#finale #birthdaySurpriseBtn{width:max-content!important;max-width:100%!important;min-width:260px!important}}
@media(max-width:620px){#video #watchBtn,#finale #birthdaySurpriseBtn{width:calc(100% - 24px)!important;max-width:440px!important}}

/* PORTRAIT HOME: natural single page scroll. Branding scrolls away; scoreboard alone sticks.
   This overrides v2.2's accidental whole-screen frozen frame. */
@media(max-width:620px) and (orientation:portrait){
  html,body,body.home-active{height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:auto!important}
  body.home-active .app-shell{height:auto!important;min-height:100dvh!important;overflow:visible!important;display:block!important;padding:max(8px,env(safe-area-inset-top)) 10px max(12px,env(safe-area-inset-bottom))!important}
  body.home-active #home.active{height:auto!important;min-height:100dvh!important;display:block!important;overflow:visible!important}
  body.home-active #home .project40-header,body.home-active.home-grid-scrolled #home .project40-header{position:relative!important;top:auto!important;max-height:none!important;overflow:visible!important;opacity:1!important;transform:none!important;pointer-events:auto!important}
  body.home-active #home .score-card{position:sticky!important;top:max(8px,env(safe-area-inset-top))!important;z-index:60!important;margin:3px 0 0!important;background:#131c2a!important}
  body.home-active #home .section-heading{position:sticky!important;top:var(--mobile-score-bottom,150px)!important;z-index:59!important;margin:0!important;padding:7px 0 8px!important;background:#0b111d!important}
  body.home-active #home .day-grid,#home .day-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;height:auto!important;max-height:none!important;min-height:0!important;overflow:visible!important;padding:1px 1px max(16px,env(safe-area-inset-bottom))!important}
}

/* Compact modal so message + OK always fit inside the visible keyboard-adjusted viewport. */
@media(max-width:920px){
 .wrong-answer-popover{bottom:auto!important;max-height:calc(var(--visual-height,100dvh) - 16px);overflow:auto;padding:12px 14px 10px!important}
 .wap-message{font-size:16px!important;line-height:1.22!important}.wap-remaining{margin-top:5px!important;font-size:10px!important}.wap-ok{margin-top:8px!important;padding:10px 14px!important}
}

/* =========================================================
   PROJECT 40 v2.4 — MAIN CHAT QA hardening
   ========================================================= */

/* Header descender safety: keep the "j" in Project fully clear of MIKA'S JOURNEY. */
.project40-brand{padding-bottom:9px!important}
.project40-handwritten{line-height:1.08!important}
.journey-lockup{margin-top:13px!important}

/* Laptop scoreboard labels: larger and easier to read, same three-column alignment. */
@media(min-width:621px){
  .score-main .score-player small,
  .score-main .score-divider small{
    font-size:12px!important;
    line-height:1.05!important;
    letter-spacing:1.35px!important;
    min-height:16px!important;
    margin-bottom:6px!important;
  }
}

/* Locked EXIT card design: ONLY change the EXIT word from gold/yellow to white. */
.day-card .exit-word{color:#f5f7f8!important}

/* Wrong-answer popup: distinct lavender family, separate from answer blue and SAVE ME. */
.wrong-answer-popover[data-mode="wrong"]{
  background:#403653!important;
  border-color:#cdb9e8!important;
  box-shadow:0 12px 38px rgba(0,0,0,.55),0 0 0 1px rgba(205,185,232,.08) inset!important;
}
.wrong-answer-popover[data-mode="wrong"] .wap-message{color:#fffafc!important}
.wrong-answer-popover[data-mode="wrong"] .wap-remaining{color:#eadff6!important}
.wrong-answer-popover[data-mode="wrong"] .wap-ok{
  background:#b79ad8!important;
  border-color:#d9c7ed!important;
  color:#1b1422!important;
}

/* CTA centering hardening across laptop + phone. */
#video #watchBtn,#finale #birthdaySurpriseBtn{
  margin-left:auto!important;margin-right:auto!important;
  align-self:center!important;left:auto!important;right:auto!important;transform:none!important;
}

/* Portrait-only deterministic score freeze. JS adds this class exactly when the
   scoreboard reaches the top. Landscape is intentionally untouched. */
@media(max-width:620px) and (orientation:portrait){
  body.home-active.portrait-score-fixed #home .score-card{
    position:fixed!important;
    top:max(8px,env(safe-area-inset-top))!important;
    left:var(--portrait-score-left,10px)!important;
    width:var(--portrait-score-width,calc(100vw - 20px))!important;
    margin:0!important;
    z-index:80!important;
    background:#131c2a!important;
  }
  body.home-active.portrait-score-fixed #home .section-heading{
    margin-top:var(--portrait-score-space,0px)!important;
  }
  /* Do not stack YOUR EXITS as a second sticky layer in portrait. */
  body.home-active #home .section-heading{
    position:relative!important;
    top:auto!important;
    z-index:1!important;
  }
}

/* =========================================================
   ROUTE 4T v2.5 — approved MAIN CHAT visual + QA pass
   ========================================================= */
/* Scenic header from approved Route 4T visual target. */
.project40-header{
  position:relative; isolation:isolate; overflow:hidden;
  padding:18px 12px 16px!important; border-radius:0 0 18px 18px;
  background:
    linear-gradient(180deg,rgba(4,12,27,.10),rgba(5,13,28,.34) 56%,rgba(8,17,31,.92)),
    url('route4t-header.png') center 16%/cover no-repeat!important;
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.06);
}
.project40-header::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgba(5,13,27,.16),transparent 28%,transparent 72%,rgba(5,13,27,.14));pointer-events:none}
.project40-brand{padding:0 42px 18px!important;overflow:visible!important}
.project40-handwritten{line-height:1.22!important;padding:0 0 .16em!important;overflow:visible!important}
.journey-lockup{margin-top:4px!important;position:relative;z-index:2}
.project40-subtitle{text-shadow:0 2px 8px #06101f}
.project40-subline .subline-with{color:#f0cf61!important}.project40-subline .subline-exits{color:#ffd85b!important}
.project40-header .journey-intro{color:#e4ebf6!important;text-shadow:0 2px 8px #06101f;background:rgba(5,13,27,.36);border-radius:10px;padding:5px 10px!important;width:max-content;max-width:96%}

/* Mobile scoreboard labels: intentionally readable, not micro type. */
@media(max-width:620px){
  body.home-active #home .score-main .score-player small,
  body.home-active #home .score-main .score-divider small{
    font-size:10.5px!important;line-height:1.08!important;letter-spacing:1.05px!important;
    min-height:13px!important;margin-bottom:5px!important;font-weight:800!important;
  }
}

/* Wrong answer attempt palette: 1 yellow, 2 lavender, 3 green. */
/* v2.23: one common popup engine; deterministic Green → Purple → Red themes. */
.wrong-answer-popover[data-attempt="1"]{background:#294b3d!important;border-color:#9ed7b9!important}
.wrong-answer-popover[data-attempt="1"] .wap-message{color:#f1fff7!important}.wrong-answer-popover[data-attempt="1"] .wap-remaining{color:#ccebd9!important}.wrong-answer-popover[data-attempt="1"] .wap-ok{background:#91cfad!important;border-color:#b8e4cb!important;color:#10261a!important}
.wrong-answer-popover[data-attempt="2"]{background:#403653!important;border-color:#cdb9e8!important}.wrong-answer-popover[data-attempt="2"] .wap-message{color:#fffafc!important}.wrong-answer-popover[data-attempt="2"] .wap-remaining{color:#eadff6!important}.wrong-answer-popover[data-attempt="2"] .wap-ok{background:#b79ad8!important;border-color:#d9c7ed!important;color:#1b1422!important}
.wrong-answer-popover[data-attempt="3"]{background:#562e36!important;border-color:#e49aa5!important}
.wrong-answer-popover[data-attempt="3"] .wap-message{color:#fff4f5!important}.wrong-answer-popover[data-attempt="3"] .wap-remaining{color:#f4c9cf!important}.wrong-answer-popover[data-attempt="3"] .wap-ok{background:#d97984!important;border-color:#efaab2!important;color:#2b1015!important}

/* Ensure modal remains compact above phone keyboard. */
@media(max-width:620px){
 .wrong-answer-popover{width:min(92vw,390px)!important;padding:10px 13px 9px!important}
 .wap-message{font-size:15px!important;line-height:1.18!important}.wap-remaining{margin-top:4px!important;font-size:9.5px!important}.wap-ok{margin-top:7px!important;padding:9px 12px!important}
}


/* =========================================================
   ROUTE 4T v2.6 — banner + popup reliability QA
   ========================================================= */
/* The approved artwork already contains Route 4T, MIKA'S JOURNEY,
   with 40 EXITS and the intro copy. Hide the HTML copies so the
   banner can never double-render those words. */
.project40-header .project40-brand,
.project40-header .journey-lockup,
.project40-header .journey-intro{display:none!important}

/* Show the complete approved scenic composition on every viewport.
   `contain` is deliberate: it preserves BOTH the moon and the 40 road sign
   instead of cropping either edge on portrait phones. */
.project40-header{
  min-height:0!important;
  aspect-ratio:940/350!important;
  padding:0!important;
  border-radius:0 0 18px 18px!important;
  background-color:#071326!important;
  background-image:url('route4t-header.png')!important;
  background-repeat:no-repeat!important;
  background-position:center center!important;
  background-size:100% 100%!important;
}
.project40-header::after{
  /* Mask ONLY the embedded “Small Puzzles Brighter Days” lettering.
     Keep the moon, road, sign and the rest of the approved scene visible. */
  content:""!important;display:block!important;position:absolute!important;
  left:0!important;bottom:0!important;width:20.5%!important;height:39%!important;
  z-index:3!important;pointer-events:none!important;
  background:linear-gradient(145deg,rgba(4,15,31,.96),rgba(5,19,37,.92) 54%,rgba(7,24,43,.72) 100%)!important;
  border-radius:0 0 0 18px!important;
}
@media(max-width:620px) and (orientation:portrait){
  .project40-header{aspect-ratio:940/350!important;background-size:100% 100%!important;background-position:center!important}
}

/* Preserve the already-approved mobile scoreboard label size. */
@media(max-width:620px){
  body.home-active #home .score-main .score-player small,
  body.home-active #home .score-main .score-divider small{
    font-size:10.5px!important;line-height:1.08!important;letter-spacing:1.05px!important;
    min-height:13px!important;margin-bottom:5px!important;font-weight:800!important;
  }
}

/* v2.6 popup instance is freshly created for every failed attempt. */
.wrong-answer-popover{z-index:10000!important}


/* =========================================================
   ROUTE 4T v2.7 — FINAL QA hardening
   ========================================================= */

/* The banner asset itself is now clean (moon restored; four-word phrase removed).
   Remove the v2.6 masking overlay entirely so it cannot cover the moon. */
.project40-header::after{display:none!important}

/* Modal shield blocks ghost taps from reaching HOME / puzzle controls while
   the soft keyboard changes the visual viewport. */
.wrong-answer-backdrop{
  position:fixed!important;
  inset:0!important;
  z-index:9999!important;
  display:none;
  background:transparent!important;
  pointer-events:auto!important;
  touch-action:none!important;
}
.wrong-answer-backdrop.show{display:block!important}
.wrong-answer-backdrop .wrong-answer-popover{z-index:10000!important}

/* Message content may compress/scroll, but OK stays inside the visible viewport. */
@media(max-width:920px){
  .wrong-answer-popover{
    display:none;
    flex-direction:column!important;
    overflow:hidden!important;
    width:min(92vw,390px)!important;
  }
  .wrong-answer-popover.show{display:flex!important}
  .wap-message{
    flex:0 1 auto!important;
    overflow:auto!important;
    max-height:3.1em!important;
  }
  .wap-remaining{flex:0 0 auto!important}
  .wap-ok{
    flex:0 0 auto!important;
    position:relative!important;
    bottom:auto!important;
  }
}

/* =========================================================
   ROUTE 4T v2.14 — v2.7 stable-baseline anti-flicker patch
   =========================================================
   IMPORTANT: Popup positioning remains the v2.7 implementation.
   Only visual transitions are disabled; JS reveals the modal after
   the original v2.7 placement sequence settles. */
@media(max-width:920px){
  .wrong-answer-popover,
  .wrong-answer-popover.show{
    animation:none!important;
    transition:none!important;
  }
}


/* =========================================================
   ROUTE 4T v2.18 — video attribution + birthday celebration QA
   Stable v2.16 puzzle/popup/keyboard rules above are intentionally untouched.
   ========================================================= */
.gift-from{
  margin:4px auto 10px;
  max-width:620px;
  color:#e9d9f4;
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(16px,2.4vw,20px);
  line-height:1.35;
  text-align:center;
}
button.primary:disabled{
  cursor:not-allowed!important;
  opacity:.58!important;
  filter:saturate(.65)!important;
}

/* Use dedicated keyframe names so older birthday CSS cannot override this pass. */
.celebration-layer{
  position:fixed!important;
  top:0!important;
  left:0!important;
  right:auto!important;
  bottom:auto!important;
  z-index:90!important;
  pointer-events:none!important;
  overflow:hidden!important;
  contain:layout paint style!important;
  transform:translateZ(0);
}
.confetti-piece{
  position:absolute!important;
  top:-36px!important;
  opacity:0;
  animation-name:route4tConfettiFall!important;
  animation-timing-function:cubic-bezier(.18,.72,.35,1)!important;
  animation-fill-mode:both!important;
  color:var(--confetti-color,#f3c5d2)!important;
  will-change:transform,opacity;
  backface-visibility:hidden;
}
.birthday-balloon{
  position:absolute!important;
  top:var(--balloon-origin-y,calc(100dvh + 8px))!important;
  bottom:auto!important;
  opacity:0;
  animation-name:route4tBalloonRise!important;
  animation-timing-function:cubic-bezier(.22,.61,.36,1)!important;
  animation-fill-mode:both!important;
  will-change:transform,opacity;
  backface-visibility:hidden;
}
@keyframes route4tConfettiFall{
  0%{transform:translate3d(0,-24px,0) rotate(0deg);opacity:0}
  7%{opacity:1}
  82%{opacity:.96}
  100%{transform:translate3d(var(--drift,0px),var(--celebration-fall,110vh),0) rotate(760deg);opacity:.25}
}
@keyframes route4tBalloonRise{
  0%{transform:translate3d(0,0,0) rotate(-4deg) scale(.94);opacity:0}
  6%{opacity:.98}
  50%{transform:translate3d(10px,var(--celebration-rise-mid,-58vh),0) rotate(5deg) scale(1)}
  100%{transform:translate3d(-8px,var(--celebration-rise-end,-118vh),0) rotate(-3deg) scale(1.03);opacity:.68}
}
@media(prefers-reduced-motion:reduce){
  .confetti-piece{animation-timing-function:linear!important}
  .birthday-balloon{animation-timing-function:linear!important}
}
@media(max-width:620px){
  .gift-from{font-size:16px;margin:3px 12px 9px}
}


/* v2.19 photo puzzle support */
.question-media{display:flex;justify-content:center;align-items:center;margin:0 auto 22px;max-width:min(100%,520px)}
.puzzle-photo{display:block;width:min(100%,520px);max-height:min(52vh,420px);object-fit:contain;border-radius:16px;border:1px solid rgba(255,255,255,.14);box-shadow:0 14px 32px rgba(0,0,0,.28);background:rgba(6,10,18,.55)}
@media(max-width:620px){
 .question-media{margin-bottom:18px;max-width:100%}
 .puzzle-photo{width:100%;max-height:min(42vh,320px);border-radius:14px}
}


/* =========================================================
   ROUTE 4T v2.21 — solved/gift typography refinement only
   ========================================================= */
#video #giftHeading{
  font-size:clamp(25px,3.6vw,32px);
  margin-bottom:10px;
}
#video .gift-from{
  color:#f0cf91;
  font-size:clamp(19px,2.8vw,23px);
  line-height:1.35;
  margin:5px auto 13px;
}
#video .gift-from-name{
  color:#ffd76a;
  font-weight:700;
  font-size:1.13em;
}
@media(max-width:620px){
  #video #giftHeading{font-size:clamp(23px,7.2vw,29px);}
  #video .gift-from{font-size:18px;margin:4px 12px 11px;}
  #video .gift-from-name{font-size:1.1em;}
}


/* =========================================================
   ROUTE 4T v2.22 — mobile regression hardening
   ========================================================= */
#hintBtn{display:none!important}


/* =========================================================
   ROUTE 4T v2.24 — focused mobile QA (EXIT 0–3)
   Standardize photo-puzzle geometry without cropping originals.
   ========================================================= */
.question-media{
  width:min(100%,520px)!important;
  max-width:520px!important;
  aspect-ratio:4/3!important;
  height:auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  margin:0 auto 22px!important;
  border-radius:16px!important;
  border:1px solid rgba(255,255,255,.14)!important;
  background:rgba(6,10,18,.72)!important;
  box-shadow:0 14px 32px rgba(0,0,0,.28)!important;
}
.question-media .puzzle-photo{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:contain!important;
  object-position:center center!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:transparent!important;
}
@media(max-width:620px){
  .question-media{width:100%!important;aspect-ratio:4/3!important;margin-bottom:18px!important;border-radius:14px!important}
}
