/* ============================================================
   Spinward — Home screen  ·  "Attract Mode"
   Drop-in replacement for css/home.css
   Reuses all existing IDs / classes / data-i18n — no JS changes.
   Live preview is driven by js/home-attract.js; the nebula + stars
   come from the <canvas> (background.js), so this stays mostly clear.
   ============================================================ */

.screen--home {
  /* magenta / cyan duotone = the actual rotate-control colors */
  --duo-a: 255,61,166;
  --duo-b: 58,209,255;

  justify-content: flex-start;
  gap: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* extra breathing room under the status bar */
  padding-top: calc(env(safe-area-inset-top, 20px) + 16px);
  background:
    linear-gradient(180deg, rgba(var(--screen-bg),0.78) 0%, rgba(var(--screen-bg),0) 24%),
    linear-gradient(0deg,   rgba(var(--screen-bg),0.88) 0%, rgba(var(--screen-bg),0) 30%);
  animation: homeFadeIn 0.5s ease-out;
}

@keyframes homeFadeIn { from { opacity: 0 } to { opacity: 1 } }

/* ---------- top bar : identity (left) + currency/settings (right) ---------- */
.home__top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 0;
  flex-shrink: 0;
}

.home__id { display: flex; align-items: center; gap: 11px; min-width: 0; }

.home__id-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.home__badges { display: flex; align-items: center; gap: 8px; }
.home__level-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px;
  background: rgba(var(--accent-dim),0.22);
  border: 1px solid rgba(var(--accent),0.3);
  color: rgba(var(--text-primary),0.9);
}
.home__streak-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 3px;
  color: rgba(255,190,90,0.95);
}
.home__streak-badge svg { width: 12px; height: 12px; flex-shrink: 0; }

.home__top-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.home__currency {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.3px;
  color: rgba(255,205,90,0.95);
  background: rgba(255,200,60,0.08);
  border: 1px solid rgba(255,200,60,0.2);
  padding: 6px 11px; border-radius: 999px;
}
.home__icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(var(--text-secondary),0.6);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.home__icon-btn:active { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.22); }
.home__icon-btn svg { display: block; width: 17px; height: 17px; }

/* ---------- slim xp line under the top bar ---------- */
.home__xp-line { width: 100%; display: flex; align-items: center; gap: 9px; margin-top: 12px; flex-shrink: 0; }
.home__xp-track {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.07); overflow: hidden;
}
.home__xp-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, rgb(var(--duo-a)), rgb(var(--duo-b)));
  transition: width 0.5s ease-out;
}
.home__xp-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
  color: rgba(var(--text-muted),0.55); white-space: nowrap;
}

/* ---------- LIVE HERO : the smaller spinning-shield preview ---------- */
.home__hero {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  margin: 6px 0 8px;
}
.home__hero svg { width: 58%; max-width: 205px; overflow: visible; }

.home__core { transform-origin: 150px 150px; animation: hCorePulse 2.6s ease-in-out infinite; }
@keyframes hCorePulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.1) } }
.home__ring-track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 2; }
.home__shield {
  fill: none; stroke: url(#homeDuo); stroke-width: 11; stroke-linecap: round;
  filter: drop-shadow(0 0 9px rgba(var(--duo-a),0.55));
}
.ha-ball  { fill: #fff; filter: drop-shadow(0 0 5px rgba(var(--duo-b),0.85)); }
.ha-spark { fill: none; stroke: rgb(var(--duo-a)); stroke-width: 2;
            filter: drop-shadow(0 0 6px rgba(var(--duo-a),0.8)); }

/* ---------- dock : stats + modes + play (roomier) ---------- */
.home__dock { width: 100%; flex-shrink: 0; padding-top: 6px; }

.home__stats {
  display: flex; width: 100%; max-width: 320px; margin: 0 auto 18px;
}
.home__stat { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; padding: 3px 4px; }
.home__stat + .home__stat::before {
  content: ''; position: absolute; left: 0; top: 16%; height: 68%; width: 1px;
  background: rgba(255,255,255,0.09);
}
.home__stat-value {
  font-size: 22px; font-weight: 800; line-height: 1;
  color: rgba(var(--text-primary),0.94);
}
.home__stat-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(var(--text-muted),0.55); margin-top: 6px;
}

.home__mode-tabs {
  display: flex; gap: 6px; width: 236px; margin: 0 auto 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 5px;
}
.home__mode-tab {
  flex: 1; border: 0; background: transparent;
  font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 10px 0; border-radius: 10px;
  color: rgba(var(--text-secondary),0.5); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.home__mode-tab--active {
  background: linear-gradient(120deg, rgba(var(--duo-a),0.9), rgba(var(--duo-b),0.75));
  color: #fff;
  box-shadow: 0 4px 16px rgba(var(--duo-a),0.35);
}

.home__play-btn {
  width: 100%; height: 70px; border: 0; border-radius: 20px; cursor: pointer;
  position: relative; overflow: hidden;
  background: linear-gradient(110deg, rgb(var(--duo-a)), rgb(var(--duo-b)));
  display: flex; align-items: center; justify-content: center; gap: 13px;
  box-shadow: 0 12px 36px rgba(var(--duo-a),0.42), inset 0 1px 0 rgba(255,255,255,0.4);
  animation: hBreathe 3s ease-in-out infinite;
}
@keyframes hBreathe {
  0%,100% { box-shadow: 0 12px 36px rgba(var(--duo-a),0.38), inset 0 1px 0 rgba(255,255,255,0.35) }
  50%     { box-shadow: 0 14px 50px rgba(var(--duo-b),0.52), inset 0 1px 0 rgba(255,255,255,0.5) }
}
.home__play-btn::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: hSheen 3.4s ease-in-out infinite;
}
@keyframes hSheen { 0% { left: -60% } 55%,100% { left: 130% } }
.home__play-btn:active { transform: scale(0.97); }
.home__play-icon { line-height: 0; }
.home__play-icon svg { display: block; width: 22px; height: 22px; fill: #fff; }
.home__play-text { font-size: 28px; font-weight: 800; letter-spacing: 5px; color: #fff; }

/* ---------- bottom nav : ALWAYS labelled ---------- */
.home__nav {
  display: flex; width: 100%; margin-top: auto;
  padding: 10px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.home__nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: rgba(var(--text-secondary),0.5); transition: color 0.15s;
}
.home__nav-btn:active { color: rgba(var(--text-primary),0.95); }
.home__nav-icon { position: relative; display: flex; align-items: center; justify-content: center; }
.home__nav-icon svg { display: block; width: 21px; height: 21px; }
.home__nav-label {
  display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
}
.home__nav-icon--badge::after {
  content: ''; position: absolute; top: -2px; right: -7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: rgb(var(--duo-a)); box-shadow: 0 0 7px rgb(var(--duo-a));
}
