/* homehub-layouts.css — Layout-specific styles for Classic / Bento / Desktop */

/* ─── Shared screen container ─────────────────────────────────────────── */
.hh-screen {
  position: relative;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse 100% 50% at 50% 0%, rgba(113,99,217,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 80% 40% at 100% 100%, rgba(147,197,253,0.04) 0%, transparent 70%),
    var(--bg-deep);
  overflow: hidden;
  font-family: var(--font-current);
  color: var(--text-primary);
}
.hh-screen-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  overflow-x: hidden;
}
.hh-screen-scroll::-webkit-scrollbar { width: 5px; }
.hh-screen-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* ─── Mobile Classic ──────────────────────────────────────────────────── */
.hh-classic-body {
  padding: 14px 14px 24px;
  display: flex; flex-direction: column;
  gap: 22px;
}
.hh-classic-section--first { margin-top: 2px; }

.hh-classic-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hh-classic-qa {
  display: flex; flex-direction: column;
  gap: 8px;
}

.hh-classic-dailies {
  display: flex; flex-direction: column; gap: 8px;
}

/* ─── Mobile Bento ────────────────────────────────────────────────────── */
.hh-screen-scroll--bento {
  /* Slightly different bg for bento */
  background:
    radial-gradient(ellipse 80% 50% at 50% 30%, rgba(113,99,217,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 40% at 20% 80%, rgba(252, 211, 77, 0.04) 0%, transparent 70%);
}
.hh-bento-body {
  padding: 14px 14px 24px;
}
.hh-bento-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 16px;
}
.hh-bento-strip-greet { min-width: 0; }
.hh-bento-strip-greet-line1 {
  font-size: 11px; color: var(--text-tertiary);
}
.hh-bento-strip-greet-line2 {
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display-current);
  margin-top: 2px;
}
.hh-bento-strip-meta { display: flex; gap: 6px; flex-shrink: 0; }

/* Bento grid — 6 columns */
.hh-bento-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.hh-bento-tile {
  min-width: 0;
  position: relative;
}

/* Tile spans — game-loop ordered.
   Row 2: Coin(3) + Submit(3) — equal halves, filling the full row like the
   bento tiles below them.
   Row 3: XP(4) + Rank(2) — XP wide for the progress bar, Rank narrow stat. */
.hh-bento-tile--hero            { grid-column: span 6; }
.hh-bento-tile--coin            { grid-column: span 3; }
.hh-bento-tile--submit          { grid-column: span 3; }
.hh-bento-tile--xp              { grid-column: span 4; }
.hh-bento-tile--rank            { grid-column: span 2; }
.hh-bento-tile--qa-predict      { grid-column: span 2; }
.hh-bento-tile--qa-pack         { grid-column: span 2; }
.hh-bento-tile--qa-invite       { grid-column: span 2; }
.hh-bento-tile--featured        { grid-column: span 6; }
.hh-bento-tile--mission         { grid-column: span 6; }
.hh-bento-tile--sponsor-mission { grid-column: span 6; }
.hh-bento-tile--daily           { grid-column: span 6; }
.hh-bento-tile--winrate         { grid-column: span 3; }
.hh-bento-tile--mycards         { grid-column: span 3; }
.hh-bento-tile--sponsor-mid     { grid-column: span 6; }
.hh-bento-tile--sponsor         { grid-column: span 6; }

/* Equal-height stat row — locks Coin, Submit, XP, Rank, Winrate, MyCards to
   the same baseline so the bento reads like an even tile grid even though
   each tile has different content. */
.hh-bento-tile--coin,
.hh-bento-tile--submit,
.hh-bento-tile--xp,
.hh-bento-tile--rank,
.hh-bento-tile--winrate,
.hh-bento-tile--mycards { min-height: 116px; }

/* Bento XP tile — compact stat */
.hh-bento-tile--xp {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(113, 99, 217, 0.25);
  background: linear-gradient(135deg, rgba(113, 99, 217, 0.16) 0%, rgba(113, 99, 217, 0.04) 100%);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
  gap: 6px;
}
.hh-bento-tile--xp::before {
  content: '';
  position: absolute;
  top: -40px; inset-inline-end: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0.16;
  filter: blur(30px);
}
.hh-bento-xp-head {
  display: inline-flex; align-items: center; gap: 5px;
  position: relative;
  color: var(--accent-primary);
  font-size: 11px; font-weight: 600;
}
.hh-bento-xp-icon {
  display: inline-flex; align-items: center; justify-content: center;
}
.hh-bento-xp-lvl-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.hh-bento-xp-lvl-num {
  font-size: 13px; font-weight: 700;
  color: var(--accent-primary);
}
.hh-bento-xp-value {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  display: inline-flex; align-items: baseline; gap: 4px;
  margin-top: 2px;
}
.hh-bento-xp-of { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.hh-bento-xp-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  margin-top: auto;
  overflow: hidden;
}
.hh-bento-xp-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-primary-2) 100%);
  border-radius: 999px;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Bento Rank tile — compact stat */
.hh-bento-tile--rank {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.25);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.14) 0%, rgba(96, 165, 250, 0.02) 100%);
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
  position: relative;
}
.hh-bento-tile--rank::before {
  content: '';
  position: absolute;
  bottom: -30px; inset-inline-start: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--info);
  opacity: 0.16;
  filter: blur(28px);
}
.hh-bento-rank-head {
  font-size: 11px; font-weight: 600;
  color: var(--info);
  position: relative;
}
.hh-bento-rank-num {
  font-size: 22px; font-weight: 800;
  color: var(--info);
  font-family: var(--font-display-current);
  line-height: 1;
  position: relative;
  margin-top: 2px;
}
.hh-bento-rank-delta {
  font-size: 10px; font-weight: 600;
  margin-top: auto;
}
.hh-bento-rank-delta--up { color: var(--success); }
.hh-bento-rank-label {
  font-size: 10px; color: var(--text-tertiary);
  margin-top: 4px;
}

/* Bento Winrate tile */
.hh-bento-tile--winrate {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12) 0%, rgba(52, 211, 153, 0.02) 100%);
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden; position: relative;
}
.hh-bento-tile--winrate::before {
  content: '';
  position: absolute;
  top: -30px; inset-inline-end: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.14;
  filter: blur(28px);
}
.hh-bento-winrate-num {
  font-size: 28px; font-weight: 800;
  color: var(--success);
  font-family: var(--font-display-current);
  line-height: 1;
}
.hh-bento-winrate-label {
  font-size: 11px; color: var(--text-primary);
  margin-top: 6px;
}
.hh-bento-winrate-sub {
  font-size: 10px; color: var(--text-tertiary);
  margin-top: 3px;
}

/* The QuickActionCard inside hh-bento-tile--mycards needs to occupy the
   whole tile so it pairs with the winrate tile to its side. */
.hh-bento-tile--mycards .hh-qa-tile,
.hh-bento-tile--qa-predict .hh-qa-tile,
.hh-bento-tile--qa-pack .hh-qa-tile,
.hh-bento-tile--qa-invite .hh-qa-tile {
  height: 100%;
}
.hh-bento-tile--featured .hh-rail { margin-inline: -14px; }

/* ─── Desktop Bento ───────────────────────────────────────────────────── */
.hh-desk {
  position: relative;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(113,99,217,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 50% 30% at 20% 100%, rgba(147,197,253,0.04) 0%, transparent 70%),
    var(--bg-deep);
  overflow: hidden;
  font-family: var(--font-current);
  color: var(--text-primary);
  display: flex; flex-direction: column;
}
.hh-desk-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 28px 28px;
  scrollbar-width: thin;
}
.hh-desk-body::-webkit-scrollbar { width: 6px; }
.hh-desk-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.hh-desk-greet {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.hh-desk-greet-line1 {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display-current);
  letter-spacing: -0.01em;
}
.hh-desk-greet-line2 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.hh-desk-greet-meta {
  flex-shrink: 0;
}
.hh-desk-greet-meta .hh-btn--lg {
  /* Glass / translucent — matches the predict card CTA + Lineup Submit, so the
     hero family is visually consistent. */
  background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 100%);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-primary);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.20),
    0 8px 22px rgba(0,0,0,0.32);
}
.hh-desk-greet-meta .hh-btn--lg:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.08) 100%);
}
html[dir="rtl"] .hh-desk-greet-meta .hh-btn--lg svg { transform: scaleX(-1); }

/* Bento grid — 12 columns, slightly tighter on desktop */
.hh-desk-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.hh-desk-tile { min-width: 0; }

.hh-desk-tile--hero      { grid-column: span 8; }
.hh-desk-tile--side      { grid-column: span 4; }
.hh-desk-tile--stats     { grid-column: span 12; }
.hh-desk-tile--featured  { grid-column: span 12; }
.hh-desk-tile--mission   { grid-column: span 7; }
.hh-desk-tile--qa        { grid-column: span 5; }
.hh-desk-tile--dailies   { grid-column: span 7; }
.hh-desk-tile--pack      { grid-column: span 5; }
.hh-desk-tile--sponsor   { grid-column: span 12; }

.hh-desk-side-stack {
  display: flex; flex-direction: column;
  gap: 12px;
  height: 100%;
}
/* Side row holds Coin + Submit side-by-side at the top of the side column —
   compact enough to leave room for the sponsor grid below. */
.hh-desk-side-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
/* Tighten the two side tiles for the desktop side column. They're now half
   the column width each, so we dial padding + numeric scale down. */
.hh-desk-side-row .hh-coin-tile,
.hh-desk-side-row .hh-submit-tile {
  padding: 12px;
  gap: 8px;
  border-radius: 14px;
}
.hh-desk-side-row .hh-coin-tile-balance-num { font-size: 22px; }
.hh-desk-side-row .hh-coin-tile-balance-label { font-size: 10px; }
.hh-desk-side-row .hh-coin-tile-hint { font-size: 10px; }
.hh-desk-side-row .hh-submit-tile-status { font-size: 14px; }
.hh-desk-side-row .hh-submit-tile-foot { font-size: 10px; }
.hh-desk-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.hh-desk-stats .hh-stat { padding: 16px; }
.hh-desk-stats .hh-stat-value { font-size: 24px; }
.hh-desk-qa-stack { display: flex; flex-direction: column; gap: 10px; }
.hh-desk-dailies { display: flex; flex-direction: column; gap: 8px; }
.hh-desk-tile--featured .hh-rail { margin-inline: 0; }
.hh-desk-tile--featured .hh-rail-track { padding-inline: 0; }
