/* Home: hub tile, tool tiles, run strip, player feel. */

.home { position: relative; padding-top: 36px; padding-bottom: var(--s4); }

/* --------------------------------------------------------- 100% HONEST burst
   Fixed (placed by home.js) so it can sit over the hazard tape. */
.home-burst {
  position: fixed; z-index: calc(var(--z-header) + 1);
  width: 76px; height: 76px;
  pointer-events: none;
  transform: rotate(10deg);
  --star: polygon(50% 1%, 61.5% 22.3%, 84.6% 15.4%, 77.7% 38.5%, 99% 50%, 77.7% 61.5%, 84.6% 84.6%, 61.5% 77.7%, 50% 99%, 38.5% 77.7%, 15.4% 84.6%, 22.3% 61.5%, 1% 50%, 22.3% 38.5%, 15.4% 15.4%, 38.5% 22.3%);
}
.home-burst::before { content: ''; position: absolute; inset: 0; background: var(--ink); clip-path: var(--star); }
.home-burst__fill {
  position: absolute; inset: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--amber); color: var(--ink);
  clip-path: var(--star);
}
.home-burst__fill b { font: 400 12px/1 var(--display-font); letter-spacing: 0; }
.home-burst.is-off { visibility: hidden; }

/* ------------------------------------------------------------ first run */
.home-first {
  position: relative;
  display: flex; flex-direction: column; gap: var(--s2);
  padding-top: calc(var(--s3) + 4px);
}
.home-first::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--amber); }
.home-first__top { display: flex; align-items: center; gap: var(--s3); }
.home-first__kicker { font: 600 var(--t-label)/1.15 var(--label-font); letter-spacing: .08em; color: var(--ink60); }
.home-first__title { font: 400 26px/1 var(--display-font); letter-spacing: .01em; }
.home-first__body { font: 400 var(--t-body)/1.4 var(--mono-font); }
.home-first__go { width: 100%; margin-top: var(--s1); }
.home-first__go .icon { width: 16px; height: 16px; }

/* ------------------------------------------------------------- hub tile */
.hero-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2);
  width: 100%; min-height: 150px;
  padding: 14px var(--s4);
  background: var(--ink); color: var(--paper);
  border: var(--border);
  box-shadow: var(--sh-hub);
  text-align: left;
}
.hero-tile:active { transform: translate(2px, 2px); box-shadow: 4px 4px 0 var(--red); }
.hero-tile__row { display: flex; align-items: center; gap: var(--s3); width: 100%; }
.hero-tile__icon { flex: none; width: 40px; height: 40px; }
.hero-tile__name { font: 400 var(--t-hub)/1 var(--display-font); letter-spacing: .02em; }
.hero-tile__go { margin-left: auto; display: inline-flex; color: var(--red); }
.hero-tile__go .icon { width: 30px; height: 30px; }
.hero-tile__what { font: 400 var(--t-body)/1.35 var(--mono-font); }
.hero-tile__last { max-width: 100%; height: 30px; gap: 0; border-color: var(--amber); }
.hero-tile__last > span { flex: none; }
.hero-tile__last > .hero-tile__rud { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ tool tiles */
.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.module-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-width: 0; min-height: 128px;
  padding: 10px 10px 10px 12px;
  background: var(--white); color: var(--ink);
  border: var(--border);
  box-shadow: var(--sh-card);
  text-align: left;
}
.module-tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.module-tile__name { display: flex; align-items: center; gap: 7px; font: 400 var(--t-tile-name)/1 var(--display-font); letter-spacing: .01em; }
.module-tile__name svg { flex: none; width: 24px; height: 24px; }
.module-tile__what { flex: 1 0 auto; font: 400 var(--t-body)/1.3 var(--mono-font); color: var(--ink60); }
.module-tile .chip { max-width: 100%; letter-spacing: .05em; }

/* -------------------------------------------------------------- run strip */
.home-stats .statbox b .unit { margin-left: 0; }
/* LAST SPREAD is the widest value ("±12.9 ms"): it steps down by its own
   length (statbox--long = 5+ characters) and by the tile width below */
.home-stats .statbox--long b { font-size: var(--t-stat-4); }

/* ----------------------------------------------------------- player feel */
.home-feel { display: flex; flex-direction: column; gap: var(--s2); }
.home-feel .sec-head__aside { margin-left: 0; text-align: left; }
/* four player cards in one row; NONE is a 44 px row across the bottom (the
   BPM sub-lines leave no room for a fifth column at 390 px) */
.home-feel__seg { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-feel__seg > button { gap: 4px; padding: 6px 2px; }
.home-feel__seg > .feel-none {
  grid-column: 1 / -1;
  flex-direction: row; gap: 10px;
  min-height: var(--hit);
  padding: 6px var(--s3);
  border-left: 0; border-top: var(--border);
}
.feel-name { font: 400 18px/1 var(--display-font); letter-spacing: .03em; }
/* "150–190 BPM" needs a hair of negative tracking to clear the dividers;
   below 360 px the cards drop the unit (home.js .feel-unit) and the aside
   names it once (.home-feel__unit) */
.feel-card .seg__sub { letter-spacing: -.03em; }
.home-feel__unit { display: none; }

/* ---------------------------------------------------------------- footer */
.home-foot { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.home-foot__bars {
  flex: 1; height: 22px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 7px, var(--ink) 7px 8px, transparent 8px 11px),
    repeating-linear-gradient(90deg, transparent 0 4px, var(--ink) 4px 5px, transparent 5px 13px);
}
.home-foot__text { flex: none; font: 600 var(--t-label)/1 var(--label-font); letter-spacing: .1em; white-space: nowrap; }

@media (max-width: 384px) {
  .home-stats .statbox--long b { font-size: 21px; }
}
@media (max-width: 374px) {
  .home-stats .statbox:last-child b { font-size: var(--t-stat-4); }
  .home-stats .statbox--long:last-child b { font-size: 20px; }
}
@media (max-width: 370px) {
  .home-feel__seg .seg__sub { font-size: var(--t-axis); }
}
@media (max-width: 359px) {
  .home-stats .statbox:last-child b { font-size: 20px; }
  .home-stats .statbox--long:last-child b { font-size: 16px; }
  /* tile names and chips stay inside their borders at 320 */
  .module-tile__name { font-size: 22px; }
  .module-tile__name svg { width: 20px; height: 20px; }
  .module-tile .chip { padding: 0 6px; letter-spacing: .02em; }
  .feel-card .feel-name { font-size: 16px; } /* JORDISON fills its card at 18 */
  .feel-card .seg__sub { letter-spacing: 0; }
  .feel-card .feel-unit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .home-feel__unit { display: inline; }
}
