/* BigPool UI refresh — home. Uses the shared design language from app.css (Oct 2026). */

/* Everything here is scoped to the lobby (`.home-page`, set in homePage()).
   The hero (`.lobby-hero-v4`) is styled in app.css and deliberately untouched. */

/* ---------- Rhythm ---------- */
.home-page > .section { margin-top: 36px; }
.home-page > .guest-claim-panel { margin: 22px 0 0; }

/* ---------- Section header: kicker, title, "View all" ---------- */
.home-page .home-head { min-height: 0; align-items: flex-end; margin-bottom: 14px; }
.home-head > div:first-child { min-width: 0; display: grid; gap: 5px; }
.home-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font: 800 10.5px var(--font-heading); letter-spacing: 1.6px; text-transform: uppercase; }
.home-kicker:has(.home-pip) { color: var(--green-bright); }
.home-page .home-head h2 { margin: 0; color: var(--text); font: 800 20px/1.15 var(--font-heading); letter-spacing: -0.01em; }
.home-head-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.home-more { display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 8px 0 12px; border: 1px solid rgba(255,255,255,0.08); border-radius: 999px; background: rgba(255,255,255,0.025); color: var(--green-bright); font: 800 12px var(--font-heading); text-decoration: none; white-space: nowrap; transition: border-color .18s, background .18s; }
.home-more svg { width: 14px; height: 14px; transition: transform .18s; }
.home-more:hover { border-color: rgba(104,211,145,0.4); background: rgba(104,211,145,0.08); }
.home-more:hover svg { transform: translateX(2px); }
.home-count { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border: 1px solid rgba(255,255,255,0.08); border-radius: 999px; background: rgba(255,255,255,0.04); color: var(--text-soft); font: 800 11px var(--font-heading); font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-count.is-live { border-color: rgba(104,211,145,0.28); background: rgba(104,211,145,0.12); color: var(--green-bright); }
.home-pip { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(104,211,145,0.16), 0 0 10px rgba(104,211,145,0.8); animation: homePip 1.6s ease-in-out infinite; }
@keyframes homePip { 50% { opacity: .45; transform: scale(.8); } }

/* ---------- Rails: a grid on desktop, a swipeable row on a phone ---------- */
.home-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

/* ---------- Shared card surface ---------- */
.home-page .player-stats,
.home-page .home-leaderboard .list,
.home-page .clubhouse-chat .chat-panel {
  border: 1px solid rgba(255,255,255,0.07); border-radius: 18px;
  background: linear-gradient(180deg, #111712, #0b0f0c);
  box-shadow: 0 24px 50px -36px rgba(0,0,0,0.9);
}

/* ---------- Challenge cards on the lobby (container-level only) ---------- */
@media (min-width: 721px) {
  .home-page .challenge-card { border-color: rgba(255,255,255,0.07); border-radius: 16px; background: linear-gradient(180deg, #111712, #0b0f0c); box-shadow: 0 20px 44px -34px rgba(0,0,0,0.9); }
  .home-page .challenge-card:hover { border-color: rgba(104,211,145,0.32); background: linear-gradient(180deg, #131a14, #0c110d); transform: translateY(-2px); }
  .home-page .challenge-card .btn { border-radius: 12px; }
}
/* A challenge naming you is the one thing on the page waiting on you. */
.home-page .challenges-for-you .challenge-card { border-color: rgba(104,211,145,0.3); background: radial-gradient(120% 90% at 100% 0%, rgba(104,211,145,0.12), transparent 60%), linear-gradient(180deg, #111712, #0b0f0c); }

/* ---------- Live matches ---------- */
.home-live-card { position: relative; overflow: hidden; display: grid; gap: 16px; padding: 16px 18px; border: 1px solid rgba(104,211,145,0.22); border-radius: 18px; background: radial-gradient(120% 90% at 50% 0%, rgba(104,211,145,0.12), transparent 60%), linear-gradient(180deg, #111712, #0b0f0c); box-shadow: 0 24px 50px -34px rgba(0,0,0,0.9); transition: transform .18s, border-color .18s; }
.home-live-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(104,211,145,0.7) 35%, rgba(104,211,145,0.7) 65%, transparent); }
.home-live-card:hover { transform: translateY(-2px); border-color: rgba(104,211,145,0.42); }
.home-live-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-live-state { display: inline-flex; align-items: center; gap: 7px; color: var(--green-bright); font: 800 11px var(--font-heading); letter-spacing: 1.3px; text-transform: uppercase; }
.home-live-card:not(.is-live) .home-live-state { color: var(--text-soft); }
.home-live-card:not(.is-live) .home-pip { animation: none; }
.home-live-format { overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.home-live-versus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.home-live-player { min-width: 0; display: grid; justify-items: center; gap: 6px; }
.home-live-player .avatar { width: 46px; height: 46px; font-size: 15px; }
.home-live-player.is-you .avatar { box-shadow: 0 0 0 2px rgba(104,211,145,0.55); }
.home-live-player span { max-width: 100%; overflow: hidden; color: var(--text-soft); font: 800 13px var(--font-heading); text-overflow: ellipsis; white-space: nowrap; }
.home-live-score { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.home-live-score b { color: var(--text); font: 900 38px/1 BigPoolDisplay, var(--font-heading); }
.home-live-score i { color: var(--muted); font-size: 20px; font-style: normal; }
.home-live-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.home-live-stake { min-width: 0; display: inline-flex; align-items: center; gap: 7px; color: var(--gold); font: 800 13px var(--font-heading); font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-live-stake.is-free { color: var(--muted); font-weight: 700; }
.home-live-stake .coin { width: 20px; height: 20px; font-size: 10px; }
.home-live-actions { display: flex; align-items: center; gap: 4px; }
.home-live-enter { min-height: 40px; padding: 0 16px; border-radius: 12px; background: linear-gradient(180deg, #86e6a9, var(--green)); box-shadow: 0 10px 24px -12px rgba(104,211,145,0.8), inset 0 1px 0 rgba(255,255,255,0.35); }
.home-live-report { padding: 6px; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.home-live-report:hover { color: var(--text-soft); }

/* ---------- Open challenges ---------- */
.home-challenges .grid-3 > .empty { grid-column: 1 / -1; }

/* ---------- Empty states: one message, one action ---------- */
.home-page .home-empty,
.home-page .home-challenges .empty { min-height: 0; padding: 32px 20px; border: 1px dashed rgba(255,255,255,0.12); border-radius: 18px; background: radial-gradient(80% 100% at 50% 0%, rgba(104,211,145,0.07), transparent 70%), linear-gradient(180deg, #101511, #0b0f0c); }
.home-page .home-empty strong { margin-bottom: 6px; font: 800 16px var(--font-heading); }
.home-page .home-empty span:not(.home-empty-ball) { display: block; max-width: 38ch; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.5; }
.home-empty-ball { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #f5f5f2 0 33%, transparent 35%), radial-gradient(circle at 35% 30%, #4a504c, #0a0c0b 70%); color: #0a0c0b; font: 900 13px var(--font-heading); box-shadow: 0 12px 24px -8px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.08); }
.home-empty-action { margin-top: 16px; }
.home-empty-action .btn { border-radius: 12px; }
.home-leaderboard .list:has(> .home-empty) { border: 0; background: none; box-shadow: none; }

/* ---------- Your form ---------- */
.home-page .player-stats-head { padding: 14px 18px; border-bottom-color: rgba(255,255,255,0.06); }
.home-page .player-stats-head .eyebrow { color: var(--muted); letter-spacing: 1.6px; }
.home-page .player-stats-head .rank-chip { height: 24px; font-size: 10.5px; }
.home-page .player-stats-strip > div + div::before { background: rgba(255,255,255,0.06); }
.home-page .player-stats-strip strong { color: var(--text); font: 900 30px/1 BigPoolDisplay, var(--font-heading); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.home-page .player-stats-strip .is-primary strong { color: var(--gold); text-shadow: 0 0 24px rgba(217,180,93,0.3); }
.home-page .player-stats-strip .is-hot strong { color: var(--green-bright); }
.home-form-recent { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.015); }
.home-form-label { color: var(--muted); font: 800 10.5px var(--font-heading); letter-spacing: 1.4px; text-transform: uppercase; white-space: nowrap; }
.home-form-pips { display: flex; flex: 1; gap: 6px; }
.home-form-pip { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; font: 900 12px var(--font-heading); text-decoration: none; transition: transform .18s; }
.home-form-pip.is-win { color: #2b1d04; background: linear-gradient(180deg, #ffe39a, #d9b45d); box-shadow: 0 6px 14px -6px rgba(217,180,93,0.7); }
.home-form-pip.is-loss { border: 1px solid rgba(240,125,115,0.3); background: rgba(240,125,115,0.1); color: var(--red); }
.home-form-pip:hover { transform: translateY(-2px); }
.home-form-recent .home-more { margin-left: auto; }
.home-form-none { color: var(--muted); font-size: 13px; }

/* ---------- Rooms and tournaments ---------- */
.home-page .home-tournament-feature,
.home-page .home-room-feature { border-color: rgba(255,255,255,0.08); border-radius: 18px; transition: transform .2s, border-color .2s; }
.home-page .home-tournament-feature { border-radius: 22px; }
.home-page .home-tournament-feature > img,
.home-page .home-room-feature > img { transition: transform .5s; }
.home-page .home-tournament-feature:hover,
.home-page .home-room-feature:hover { transform: translateY(-2px); border-color: rgba(104,211,145,0.35); }
.home-page .home-tournament-feature:hover > img,
.home-page .home-room-feature:hover > img { transform: scale(1.03); }
.home-page .home-feature-badges > span:last-child { border-color: rgba(217,180,93,0.4); border-radius: 999px; color: var(--gold); }
.home-page .home-feature-badges .status { border-radius: 999px; }
.home-page .home-feature-empty { background: radial-gradient(100% 120% at 100% 0%, rgba(217,180,93,0.1), transparent 55%), linear-gradient(160deg, #121813, #0b0f0c); }
.home-page .home-feature-footer .btn,
.home-page .home-feature-empty .btn,
.home-page .home-room-copy .btn,
.home-page .home-room-column-heading .btn { border-radius: 12px; }
.home-page .home-room-state { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; }
.home-page .home-room-state.is-live { border-color: rgba(104,211,145,0.5); background: rgba(8,24,14,0.88); color: var(--green-bright); }
.home-page .home-room-state.is-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(104,211,145,0.9); animation: homePip 1.6s ease-in-out infinite; }

/* ---------- Faucets ---------- */
.home-page .home-faucet-band { padding: 20px 22px; border: 1px solid rgba(217,180,93,0.25); border-radius: 18px; background: radial-gradient(100% 140% at 100% 0%, rgba(217,180,93,0.12), transparent 55%), linear-gradient(160deg, #121813, #0b0f0c); transition: border-color .18s, transform .18s; }
.home-page .home-faucet-band:hover { border-color: rgba(217,180,93,0.45); transform: translateY(-1px); }
.home-faucet-prize { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px solid rgba(217,180,93,0.35); border-radius: 999px; background: rgba(217,180,93,0.1); color: var(--gold); font: 800 11px var(--font-heading); letter-spacing: .4px; }
.home-page .home-faucet-band h3 { margin: 10px 0 6px; font-size: 19px; }
.home-page .home-faucet-band p { font-size: 13px; }
.home-faucet-meter { max-width: 320px; height: 4px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,0.07); }
.home-faucet-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--gold)); }
.home-page .home-faucet-band .btn { border-radius: 12px; }

/* ---------- The Vault ---------- */
.home-page .home-vault-feature { border-color: rgba(217,180,93,0.22); border-radius: 22px; box-shadow: inset 0 0 70px rgba(0,0,0,0.42), 0 30px 70px -40px rgba(0,0,0,0.9); }
.home-page .home-vault-actions .btn { border-radius: 12px; }
.home-page .home-vault-facts div:nth-child(2) strong { color: var(--gold); }

/* ---------- Chat and leaderboard ---------- */
.home-page .home-social-grid { gap: 24px; }
.home-page .clubhouse-chat .chat-panel { overflow: hidden; }
.home-page .clubhouse-chat .chat-composer { background: rgba(0,0,0,0.25); border-top-color: rgba(255,255,255,0.06); }
.home-page .clubhouse-chat .chat-composer .btn { border-radius: 12px; }
.home-page .home-leaderboard .list { overflow: hidden; }
.home-page .home-leaderboard .leaderboard-row { border-bottom-color: rgba(255,255,255,0.06); }
.home-page .home-leaderboard .leaderboard-row:hover { background: rgba(104,211,145,0.04); }
.home-page .home-leaderboard .leaderboard-row > strong { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .home-page > .section { margin-top: 28px; }
  .home-page .home-head { margin-bottom: 12px; }
  .home-page .home-head h2 { font-size: 18px; }
  .home-kicker { font-size: 10px; letter-spacing: 1.4px; }
  .home-head-links .home-count { display: none; }
  /* Two links don't fit beside a title on a phone: they drop under it as chips. */
  .home-page .home-head:has(.home-more + .home-more) { flex-wrap: wrap; align-items: flex-start; row-gap: 10px; }
  .home-head:has(.home-more + .home-more) .home-head-links { width: 100%; justify-content: flex-start; }

  /* Swipeable rail that bleeds to the screen edge. */
  .home-rail { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(86%, 330px); gap: 10px; margin: 0 -15px; padding: 2px 15px 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 15px; scrollbar-width: none; }
  .home-rail::-webkit-scrollbar { display: none; }
  .home-rail > * { scroll-snap-align: start; }
  .home-rail:has(> :only-child) { grid-auto-columns: 100%; }

  /* The slim challenge bars (app.css) get the lobby's surface and radius. */
  .home-page .home-challenges .challenge-card { border-color: rgba(255,255,255,0.07); border-radius: 14px; background: linear-gradient(100deg, #141b16 0%, #0d120e 70%); }
  .home-page .home-challenges .challenge-card > .btn { border-radius: 10px; }
  .home-page .home-challenges-more { min-height: 44px; border-radius: 12px; }

  .home-live-card { padding: 14px 15px; }
  .home-live-score b { font-size: 32px; }
  .home-live-player .avatar { width: 42px; height: 42px; }

  .home-page .player-stats-strip strong { font-size: 23px; }
  .home-form-recent { gap: 10px; padding: 11px 14px; }
  .home-form-pips { gap: 5px; }
  .home-form-pip { width: 26px; height: 26px; border-radius: 8px; }
  .home-form-recent .home-more { padding: 0 6px 0 10px; }

  .home-page .home-tournament-feature { border-radius: 18px; }
  .home-page .home-room-strip { padding-bottom: 6px; scrollbar-width: none; }
  .home-page .home-room-strip::-webkit-scrollbar { display: none; }
  .home-page .home-faucet-band { padding: 18px 16px; }
  .home-page .home-vault-feature { border-radius: 18px; }
}
@media (max-width: 380px) {
  .home-form-recent .home-more { display: none; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .home-pip, .home-page .home-room-state.is-live::before { animation: none; }
  .home-page .challenge-card:hover,
  .home-live-card:hover,
  .home-form-pip:hover,
  .home-page .home-tournament-feature:hover,
  .home-page .home-room-feature:hover,
  .home-page .home-faucet-band:hover,
  .home-page .home-tournament-feature:hover > img,
  .home-page .home-room-feature:hover > img { transform: none; }
  .home-rail { scroll-behavior: auto; }
}
