/* Home motion v1. Scoped to the launcher and its title screen; matches are unchanged. */
@font-face {
  font-family: "KK Comic";
  src: url("fonts/luckiest-guy-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "KK Head";
  src: url("fonts/bangers-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

#start, #splash {
  --paper: #f3ecd4;
  --ink: #0a0a0a;
  --yellow: #ffd833;
  --red: #d7191c;
  --surface: #fff8e0;
  --separator: rgba(10, 10, 10, .18);
}
html:has(#start.is-active), body:has(#start.is-active) { background: #f3ecd4 !important; }
body:has(#start.is-active)::before { display: none !important; }
#start.view.is-active { padding: 0 !important; background: var(--paper) !important; }
#start [hidden], #splash[hidden] { display: none !important; }
#start .cx-content {
  --home-safe-top: env(safe-area-inset-top, 0px);
  --home-safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-boom: "KK Comic", "Luckiest Guy", Impact, sans-serif;
  --font-head: "KK Head", Bangers, Impact, sans-serif;
  max-width: 640px;
  margin-inline: auto;
  padding: calc(var(--home-safe-top) + 16px) 16px calc(var(--home-safe-bottom) + 16px);
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  touch-action: pan-y;
}
#start .cx-content::-webkit-scrollbar { display: none; }
#start .cx-ambient { display: none; }
#start .cx-content .cx-sound,
#start .cx-content .cx-issue {
  top: calc(var(--home-safe-top) + 12px);
  min-height: 44px;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
  transform: none;
  animation: none !important;
  letter-spacing: .04em;
}
#start .cx-content .cx-sound { left: 16px; font-size: 14px; }
#start .cx-content .cx-sound.is-on { background: var(--ink); color: var(--paper); }
#start .cx-sound .home-sound-icon { width: 20px; height: 20px; flex: none; }
#start .cx-sound:not(.is-on) .sound-waves, #start .cx-sound.is-on .sound-off { display: none; }
#start .cx-content .cx-issue {
  right: 16px;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 18px;
}
#start .cx-content .cx-issue .lbl { font-size: 13px; }
#start .cx-content .cx-mast { margin: 63px 0 3px !important; flex: none; }
#start .cx-content .cx-mast h1 {
  max-width: 100%;
  gap: 3px !important;
  letter-spacing: .005em !important;
  line-height: 1 !important;
}
#start .cx-content .cx-mast h1 > span { animation: none !important; transform: none; paint-order: stroke fill; }
#start .cx-content .cx-mast .top,
#start .cx-content .cx-mast .bot {
  font-size: clamp(30px, 10.2vw, 62px) !important;
  -webkit-text-stroke: 3.5px var(--ink) !important;
  text-shadow: 4px 5px 0 var(--ink) !important;
}
#start .cx-content .cx-mast .amp {
  font-size: clamp(20px, 5.6vw, 34px) !important;
  margin-inline: 1px !important;
  -webkit-text-stroke: 1.5px var(--ink) !important;
  text-shadow: 2px 2px 0 var(--ink) !important;
}
#start .cx-content .cx-sect {
  flex: none;
  min-height: 24px;
  margin: 0 !important;
  padding: 0 !important;
  gap: 10px;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: .025em;
}
#start .cx-content .cx-sect .ball { display: none !important; }
#start .cx-content .cx-sect::after { height: 2px; }
#start .cx-content .cx-doors { gap: 12px !important; min-height: 528px !important; }
#start .cx-door {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-rows: auto 1fr auto auto;
  gap: 6px 10px;
  min-height: 156px;
  flex: 1 0 auto;
  box-sizing: border-box;
  padding: 14px 15px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 3px 0 rgba(10, 10, 10, .17);
  transform: none;
  animation: none !important;
  will-change: auto;
  transition: transform 100ms ease-out, box-shadow 100ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
#start .cx-door.d1 { min-height: 192px; flex-basis: auto; }
#start .cx-door.d1 {
  background-color: var(--comic-red);
  background-image: radial-gradient(rgba(75, 0, 0, .19) .8px, transparent 1.2px);
  background-size: 6px 6px;
}
#start .cx-door.d2 {
  background-color: var(--comic-blue);
  background-image: radial-gradient(rgba(0, 28, 75, .18) .8px, transparent 1.2px);
  background-size: 6px 6px;
}
#start .cx-door.d3 {
  background-color: #087b38;
  background-image: radial-gradient(rgba(0, 35, 10, .18) .8px, transparent 1.2px);
  background-size: 6px 6px;
}
#start .cx-door > .kicker {
  /* Legacy .kicker adds 24px + 12px of margin and clips the last grid row on iOS. */
  margin: 0;
  max-width: calc(100% - 10px);
  padding: 4px 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.1;
  letter-spacing: .05em;
  transform: rotate(-1deg);
}
#start .cx-door > .label {
  position: relative;
  isolation: isolate;
  grid-row: 2;
  align-self: center;
  justify-self: start;
  max-width: 100%;
  font-size: clamp(38px, 12vw, 54px);
  font-style: italic;
  line-height: 1;
  paint-order: stroke fill;
  -webkit-text-stroke: 4px var(--ink);
  text-shadow: none;
  animation: none !important;
}
#start .cx-title-face { display: block; color: var(--paper); -webkit-text-fill-color: var(--paper); }
/* A separate solid ink impression stays visible independently of text-shadow painting. */
#start .cx-title-ink {
  position: absolute;
  left: 5px;
  top: 6px;
  z-index: -1;
  display: block;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  -webkit-text-stroke: 4px var(--ink);
  pointer-events: none;
  white-space: nowrap;
}
#start .cx-door.d1 > .label { font-size: clamp(42px, 13.3vw, 58px); }
#start .cx-door.d3 > .label { font-size: clamp(25px, 7.9vw, 38px); align-self: end; }
#start .cx-door > .arrow {
  grid-row: 1 / -1;
  width: 44px;
  height: 44px;
  animation: none !important;
}
#start .cx-door > .scene svg { opacity: 1; }
#start .cx-door > .scene { opacity: 1; }
#start .cx-door > .scene svg.cx-illustration {
  position: absolute;
  top: 12px;
  right: 68px;
  width: clamp(86px, 28vw, 132px);
  height: calc(100% - 24px);
  overflow: visible;
  filter: drop-shadow(1px 2px 0 rgba(10, 10, 10, .23));
}
#start .cx-door.d1 > .scene svg.cx-illustration { right: 65px; width: clamp(116px, 36vw, 164px); }
#start .home-calendar-day { fill: #0a0a0a; text-anchor: middle; font: 400 65px "KK Head",Bangers,Impact,sans-serif; }
#start .home-calendar-month { fill: #0a0a0a; text-anchor: middle; text-transform: uppercase; font: 400 18px "KK Head",Bangers,Impact,sans-serif; }
#start .cx-door > .scene .cx-pitch { width: 100%; height: 100%; }
#start .cx-description {
  grid-column: 1;
  grid-row: 3;
  z-index: 3;
  margin: 0;
  color: #fff8e0;
  font: 600 14px/1.25 var(--font-text);
}
#start .cx-door > .meta {
  grid-row: 4;
  margin: 0;
  gap: 7px;
  align-items: center;
  font: 500 12px/1.3 var(--font-text);
  text-transform: none;
  letter-spacing: 0;
  color: #fff8e0;
}
#start .cx-door > .meta .chip {
  padding: 5px 8px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink) !important;
  font: 600 12px/1.2 var(--font-text);
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
  animation: none !important;
}
#start .cx-door > .meta .chip.live::before { display: none; }
#start .cx-door > .meta .chip.live { padding-left: 8px; }
#start #home-daily-cta { background: var(--yellow); }
#start #home-daily-score { background: var(--paper); }
#start .cx-door.d1 > .meta .chip:not(#home-daily-next) { padding: 7px 10px; font-size: 14px; }
#start .cx-door > .meta.cx-mode-list { font-weight: 600; }
#start #home-daily-next {
  flex-basis: 100%;
  width: max-content;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff8e0 !important;
  font: 500 12px/1.3 var(--font-text);
}
#start .cx-daily-status {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  z-index: 3;
  color: var(--paper);
  font: 400 16px/1 var(--font-head);
  letter-spacing: .025em;
}
#start [data-state="done"] .cx-daily-status {
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--yellow);
  color: var(--ink);
}
#start .cx-door.is-pressed,
#start .cx-door:active { transform: scale(.985); box-shadow: 0 1px 0 rgba(10, 10, 10, .2); filter: none; }
#start .cx-content .cx-ticker {
  margin: 0 !important;
  padding: 10px !important;
  min-height: 36px !important;
  border: 1px solid var(--separator) !important;
  border-radius: 10px;
  box-shadow: none !important;
  transform: none;
  cursor: default !important;
  font: 500 12px/1.2 var(--font-text) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
#start .cx-content .cx-ticker .n { animation: none !important; font: 700 18px/1 var(--font-text) !important; }
#start .cx-stats-empty {
  flex: none;
  margin: 0;
  padding: 5px 0;
  text-align: center;
  color: #454238;
  font: 500 12px/1.4 var(--font-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 28px;
}
#start .cx-stats-empty svg { width: 26px; height: 26px; flex: none; color: var(--ink); }
#start #home-streak { flex: none; margin: 0; font: 500 12px/1.2 var(--font-text); animation: none; }
#start #rejoin:not([hidden]) {
  flex: none;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
#start :is(a, button):focus-visible { outline: 3px solid var(--ink) !important; outline-offset: 3px !important; }
#start .cx-mast h1:focus { outline: none !important; box-shadow: none !important; }

/* Pending elements retain their layout so the shared wordmark has a real target. */
#start.home-pending :is(.cx-sound, .cx-issue, .cx-sect, .cx-door, .cx-ticker, .cx-stats-empty, #home-streak, #rejoin, .st-tabbar) { opacity: 0; }
#start.home-pending .cx-mast { visibility: hidden; }
.home-word-flight {
  position: fixed;
  z-index: 510;
  pointer-events: none;
  white-space: nowrap;
  transform-origin: 0 0;
  paint-order: stroke fill;
  will-change: transform;
}

#splash {
  --font-boom: "KK Comic", "Luckiest Guy", Impact, sans-serif;
  --font-head: "KK Head", Bangers, Impact, sans-serif;
  overflow: hidden;
  background: var(--paper);
  touch-action: manipulation;
  cursor: default;
  isolation: isolate;
  outline: none;
}
#splash::before {
  content: "";
  position: absolute;
  top: 48%;
  left: 50%;
  width: min(90vw, 460px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(rgba(232, 180, 30, .2) 1.25px, transparent 1.6px) 0 0 / 8px 8px;
  -webkit-mask-image: radial-gradient(ellipse, black 12%, transparent 70%);
  mask-image: radial-gradient(ellipse, black 12%, transparent 70%);
  pointer-events: none;
}
#splash .sp-inner {
  position: absolute;
  top: 48%;
  left: 50%;
  width: min(82%, 410px);
  transform: translate(-50%, -50%);
  gap: 18px;
}
#splash:not(.sp-ready) .sp-inner { opacity: 0; }
#splash .sp-logo { position: relative; display: grid; justify-items: center; gap: 2px; width: 100%; animation: none; line-height: 1; }
#splash .sp-logo > span { display: block; width: max-content; paint-order: stroke fill; letter-spacing: .005em; }
#splash .sp-top,
#splash .sp-bot { font-size: clamp(38px, 14.2vw, 70px); line-height: 1.04; }
#splash .sp-top { justify-self: start; margin-left: 9%; }
#splash .sp-bot { grid-row: 2; }
#splash .sp-amp { position: absolute; left: 46%; top: 38%; z-index: 2; font-size: clamp(25px, 8vw, 40px); line-height: 1; }
#splash .sp-sub { margin: 0; font: 750 clamp(12px, 3.3vw, 16px)/1.2 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--ink); opacity: 1; letter-spacing: .12em; }
#splash .sp-ball { position: absolute; top: -18%; right: 0; width: 25%; aspect-ratio: 1; pointer-events: none; }
#splash .sp-ball img { display: block; width: 100%; height: 100%; transform: rotate(10deg); }
#splash .sp-speed { position: absolute; width: 90%; height: auto; left: 7%; top: -35%; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
#splash .sp-accent { position: absolute; left: 0; top: -24%; width: 10%; height: auto; fill: var(--yellow); stroke: var(--ink); stroke-width: 1.6; }
#page-veil { transition-duration: 160ms; }

@media (min-width: 700px) {
  #start .cx-content { max-width: 1000px; }
  #start .cx-content .cx-doors { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 320px !important; height: min(54vh, 420px); flex: 0 0 auto !important; margin-block: auto; }
  #start .cx-door { min-height: 320px; }
  #start .cx-door.d1 { min-height: 320px; }
  #start .cx-door > .scene svg { object-fit: cover; }
  #start .cx-door > .label { font-size: 34px; }
  #start .cx-door.d3 > .label { font-size: 25px; }
  #start .cx-door > .scene svg.cx-illustration { top: 40px; right: 68px; width: 106px; height: 160px; }
  #start .cx-door.d1 > .scene svg.cx-illustration { top: 24px; right: 68px; width: 112px; height: 190px; }
  #start .cx-door > .arrow { width: 38px; height: 38px; }
  #start .cx-content .cx-mast { margin-top: 68px !important; }
}
@media (max-width: 359px) {
  #start .cx-content { padding-inline: 12px; gap: 10px; }
  #start .cx-content .cx-sound { left: 12px; }
  #start .cx-content .cx-issue { right: 12px; }
  #start .cx-door { padding: 12px; column-gap: 5px; }
  #start .cx-description { font-size: 13px; }
  #start .cx-door > .meta { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #splash *, #start .cx-content *, #page-veil { animation: none !important; transition: none !important; }
}

/* Keep unreleased entry points visible without offering navigation. */
#start .cx-door[aria-disabled="true"] {
  cursor: default;
  filter: grayscale(1) !important;
  background: #e7e1cf !important;
  transform: none !important;
}
#start .cx-door[aria-disabled="true"] > .scene { opacity: .45; }
#start .cx-door[aria-disabled="true"] > .meta { display: none !important; }
#start .cx-door[aria-disabled="true"] .kicker { color: #605c50; }
#start .cx-door[aria-disabled="true"] :is(.cx-description, .cx-daily-status) { color: #605c50 !important; opacity: 1 !important; }


