/* Skate Bud web demo: the home screens' styles (prefix hm-). The empty home, the working home, Your clips,
   the Run overnight nightstand and the Working sheet. Layout keys on .k-phone, .k-cover and .k-inner. */

/* ---------- the frame of a home ---------- */
.hm-root { height: 100%; min-height: 0; overflow: hidden; background: var(--sb-bg); color: var(--sb-text); }
.hm-col { display: flex; flex-direction: column; }
.hm-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(233px, 1fr); grid-template-rows: minmax(0, 1fr); }
.hm-side {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%;
  background: var(--sb-panel2); box-shadow: inset 1px 0 0 var(--sb-border);
}
.hm-keepwrap, .hm-barwrap { flex: none; }

/* ---------- the dark stage ---------- */
.hm-stage {
  flex: none; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 12px 20px; background: var(--sb-stage); color: #fff; text-align: center;
}
.k-inner .hm-stage { min-height: 0; height: 100%; padding: 16px 24px; }
.hm-stage-title { font-size: 20px; line-height: 25px; font-weight: 600; color: #fff; }
.hm-line { font-size: 16px; line-height: 21px; color: rgba(255, 255, 255, 0.72); max-width: 330px; }
.hm-plain { font-size: 16px; line-height: 21px; color: rgba(255, 255, 255, 0.72); max-width: 360px; font-variant-numeric: tabular-nums; }
.k-inner .hm-plain { max-width: 440px; }
.hm-fun { min-height: 36px; max-width: 330px; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 18px; color: rgba(255, 255, 255, 0.72); }
.hm-fun-in { display: inline-flex; align-items: center; gap: 8px; }
.hm-fun-in.is-wait { font-size: 16px; line-height: 21px; }
.hm-spin {
  display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: rgba(255, 255, 255, 0.85);
  animation: hmSpin 0.8s linear infinite;
}
@keyframes hmSpin { to { transform: rotate(360deg); } }

.hm-ring { width: 46px; height: 46px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.hm-ring > span { display: block; width: 46px; height: 46px; }
.hm-ring:active { opacity: 0.7; }

.hm-film { color: rgba(255, 255, 255, 0.55); }
.hm-film svg { stroke-width: 1.2; }
.hm-tick { width: 46px; height: 46px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.15); color: var(--sb-me); }
.hm-tick svg { stroke-width: 3; }

.hm-add {
  margin-top: 4px; min-height: 44px; padding: 0 26px; border-radius: 11px;
  background: var(--sb-blue); color: #fff; font-size: 17px; font-weight: 600; line-height: 22px;
}
.hm-add:active { opacity: 0.6; }

/* the keys on the stage (Duo closed and open) */
.hm-skeys { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.hm-skeys:empty { display: none; }
.hm-skey {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 22px;
  border-radius: 11px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 17px; font-weight: 600; line-height: 22px; white-space: nowrap;
}
.k-cover .hm-skey { padding: 0 16px; }
.hm-skey:active { opacity: 0.6; }

/* ---------- the filling bar ---------- */
.hm-fillwrap { display: flex; flex-direction: column; align-items: center; width: 240px; max-width: 100%; }
.hm-fill { width: 240px; max-width: 100%; padding: 4px 0; }
.hm-fill-track { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); }
.hm-fill.is-light .hm-fill-track { background: var(--sb-sel); }
.hm-fill-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; min-width: 8px; border-radius: inherit;
  background: linear-gradient(90deg, #6b9cff, #a6f2fc); transition: width 0.8s ease-out;
}
.hm-fill.is-light .hm-fill-bar { background: linear-gradient(90deg, #2563eb, #05b5d4); }
.hm-fill-bar.is-zero { display: none; }
.hm-fill-dot {
  position: absolute; z-index: 1; top: 50%; width: 3.6px; height: 3.6px; margin: -1.8px 0 0 -1.8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
.hm-fill.is-light .hm-fill-dot { background: var(--sb-border2); }
.hm-fill .hm-fill-dot.is-past { background: #fff; }
.hm-fill-ring {
  position: absolute; z-index: 2; top: 50%; left: 0; width: 19.2px; height: 19.2px; margin: -9.6px 0 0 -9.6px;
  border-radius: 50%; border: 2px solid #fff; opacity: 0; pointer-events: none;
}
.hm-fill.is-light .hm-fill-ring { border-color: var(--sb-accent); }
.hm-fill.is-pop .hm-fill-track { animation: hmSwell 0.6s ease-out; }
.hm-fill.is-pop .hm-fill-ring { animation: hmRingOut 0.7s ease-out; }
@keyframes hmSwell { 0% { transform: none; } 35% { transform: scaleY(1.5); } 100% { transform: none; } }
@keyframes hmRingOut { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
.hm-fill.is-night { width: 300px; }
.hm-fill.is-night .hm-fill-track { height: 10px; border-radius: 5px; }
.hm-fill.is-night .hm-fill-bar { min-width: 10px; }
.hm-clips {
  margin-top: 6px; min-height: 18px; display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px; line-height: 18px; font-weight: 600; color: rgba(255, 255, 255, 0.85); font-variant-numeric: tabular-nums;
}

/* ---------- the steps and the foot ---------- */
.hm-body { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; padding: 14px 16px 12px; }
.hm-steps { display: flex; flex-direction: column; gap: 12px; }
.hm-step { display: flex; align-items: flex-start; gap: 10px; }
.hm-mark {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1; background: var(--sb-sel); color: var(--sb-accent);
}
.hm-mark.is-now { background: var(--sb-accent); color: #fff; }
.hm-mark.is-done { background: rgba(31, 138, 76, 0.15); color: var(--sb-me); }
.hm-mark.is-done svg { stroke-width: 3; }
.hm-mark.is-stop { background: var(--sb-not); color: #fff; font-size: 12px; }
.hm-step-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.hm-step-title { font-size: 16px; line-height: 21px; color: var(--sb-text); }
.hm-step-line { font-size: 13px; line-height: 18px; color: var(--sb-muted); font-variant-numeric: tabular-nums; }
.hm-foot { padding-top: 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 18px; color: var(--sb-muted); }
.hm-foot.is-bottom { margin-top: auto; }

/* ---------- the empty home's top row (iPhone) and header line (Duo) ---------- */
.hm-toprow { flex: none; display: flex; align-items: center; gap: 10px; padding: 4px 10px; }
.hm-place {
  flex: 1 1 auto; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  border-radius: 12px; background: var(--sb-panel); box-shadow: inset 0 0 0 1px var(--sb-border2);
  font-size: 15px; line-height: 20px; color: var(--sb-text);
}
.hm-place > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-place svg { color: var(--sb-muted); }
.hm-pmark { flex: none; display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--sb-muted); white-space: nowrap; }
.hm-head { flex: none; height: 52px; padding: 8px 16px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; box-shadow: inset 0 -1px 0 var(--sb-border); }
.hm-games { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; color: var(--sb-accent); font-size: 17px; line-height: 22px; }
.hm-games:active, .hm-place:active { opacity: 0.6; }

/* ---------- Run overnight: the nightstand (a full-screen layer over the device) ---------- */
.hm-nightpage { background: #000; }
/* the whole screen goes dark with it, status bar, side strip and home indicator band included, before the black
   layer has faded in too: a real phone's overnight screen is black edge to edge */
.sb-screen:has(.hm-nightpage) { background: #000; }
.sb-screen:has(.hm-nightpage) .sb-status, .sb-screen:has(.hm-nightpage) .sb-homebar,
.sb-screen:has(.hm-nightpage) .sb-strip, .sb-screen:has(.hm-nightpage) .sb-island { visibility: hidden; }
.hm-night {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 0 24px; text-align: center; background: #000; color: rgba(255, 255, 255, 0.32); cursor: pointer;
  opacity: 0; transition: opacity 0.35s ease-out;
}
.sb-over.sb-shown > .hm-night { opacity: 1; }
.hm-night.is-awake { gap: 12px; color: #fff; }
.hm-night.is-done { color: rgba(255, 255, 255, 0.45); }
.hm-night .hm-moon svg { stroke-width: 1.4; }
.hm-n-title { font-size: 17px; line-height: 22px; font-weight: 600; }
.hm-n-line { font-size: 13px; line-height: 18px; max-width: 300px; }
.hm-n-big { font-size: 20px; line-height: 25px; font-weight: 600; color: #fff; }
.hm-n-plain { font-size: 16px; line-height: 21px; color: rgba(255, 255, 255, 0.72); max-width: 340px; font-variant-numeric: tabular-nums; }
.hm-n-pct { font-size: 28px; line-height: 34px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.hm-n-back { font-size: 13px; line-height: 18px; color: rgba(255, 255, 255, 0.5); }
.hm-n-tick { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); color: rgba(52, 199, 89, 0.8); }
.hm-n-tick svg { stroke-width: 3; }

/* ---------- the Working sheet ---------- */
.hm-wsheet { background: var(--sb-grouped); }
.hm-hair { height: 0; border-top: 0.5px solid var(--sb-border); }
.hm-wbody { padding: 14px 16px 16px; }
.hm-now { display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; box-shadow: inset 0 -0.5px 0 var(--sb-border2); }
.hm-now-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hm-now-title { font-size: 17px; line-height: 22px; color: var(--sb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-now-plain, .hm-now-fun { font-size: 13px; line-height: 18px; color: var(--sb-muted); font-variant-numeric: tabular-nums; }
.hm-now .hm-fill { width: 100%; padding: 4px 0 0; }
.hm-now-pct { flex: none; padding-top: 2px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--sb-accent); font-variant-numeric: tabular-nums; }
.sb-list-row.hm-arow { color: var(--sb-accent); }
.hm-wfoot { display: flex; flex-direction: column; gap: 6px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hm-fill-bar, .hm-night { transition: none; }
  .hm-fill.is-pop .hm-fill-track, .hm-fill.is-pop .hm-fill-ring { animation: none; }
  .hm-spin { animation-duration: 2.4s; }
}
