/* ═══ BENTO DASHBOARD — Purple theme ═══ */
.bento-screen {
  background: transparent;
  min-height: 100vh;
}

.bento-layout {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Side rail (desktop) ── */
.bento-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 72px;
  flex-shrink: 0;
  padding: 20px 10px;
  margin: 12px 0 12px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 28px;
  position: sticky;
  top: 12px;
  align-self: flex-start;
  height: calc(100vh - 24px);
  z-index: 20;
}

.bento-rail-spacer { flex: 1; min-height: 8px; }

.bento-rail-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  position: relative;
}

.bento-rail-btn:hover,
.bento-rail-btn.active {
  background: rgba(0, 123, 255, 0.18);
  color: var(--purple-bright);
}

.bento-rail-btn:active { transform: scale(0.94); }

.bento-rail-notif .notif-badge {
  top: 4px;
  right: 4px;
}

.bento-rail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-bright), var(--purple-deep));
  border: 2px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}

.bento-rail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.owner-only-btn.bento-rail-btn.visible { display: flex !important; }

/* ── Main area ── */
.bento-main {
  flex: 1;
  min-width: 0;
  padding: 12px 16px 100px;
}

.bento-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dash-user-menu-wrap {
  position: relative;
  flex: 1;
  min-width: 140px;
}

.bento-user-chip,
#dash-user-chip.dash-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px 6px 6px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

#dash-user-chip.dash-user-chip:hover,
#dash-user-chip.dash-user-chip[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.dash-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 120;
}

.dash-user-menu.hidden {
  display: none;
}

.dash-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.dash-user-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bento-user-chip { flex: 1; min-width: 0; }

.duc-chevron {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--muted);
  flex-shrink: 0;
  padding-right: 4px;
}

.bento-search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  max-width: 280px;
  flex: 1;
}

.bento-search-pill:hover {
  border-color: var(--purple-primary);
  background: rgba(0, 123, 255, 0.1);
  color: var(--text);
}

.bento-search-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-left: auto;
}

/* ── Bento grid ── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(72px, auto);
  gap: 14px;
}

.bento-cell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  overflow: hidden;
  position: relative;
}

/* Hero — mockup large green/purple block */
.bento-hero {
  grid-column: 1 / -1;
  grid-row: span 2;
  min-height: 200px;
  padding: 24px 20px 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 8px 12px;
  align-items: start;
}

.bento-hero-copy {
  grid-column: 1;
  grid-row: 1;
  z-index: 2;
}

.bento-hero-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}

.bento-hero-title {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 400;
  line-height: 0.95;
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bento-hero-title span {
  color: var(--accent);
  display: block;
}

.bento-hero-featured {
  grid-column: 1 / -1;
  grid-row: 2;
  z-index: 2;
  max-width: 100%;
}

.bento-hero-featured .live-match-card,
.bento-hero-featured .bento-hero-match {
  background: rgba(0, 0, 0, 0.22);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
  cursor: pointer;
}

.bento-hero-featured .live-match-card:hover,
.bento-hero-featured .bento-hero-match:hover {
  background: rgba(0, 0, 0, 0.32);
  transform: none;
}

.bento-hero-figure {
  position: absolute;
  right: -8px;
  bottom: -12px;
  width: min(42vw, 200px);
  height: auto;
  max-height: 88%;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.4));
}

/* Quick start card */
.bento-quick {
  grid-column: span 3;
  padding: 18px 16px;
  text-align: left;
  cursor: pointer;
  border: none;
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(160deg, var(--bg3), var(--bg2));
  transition: transform 0.15s, border-color 0.2s;
}

.bento-quick:hover {
  transform: translateY(-2px);
  border-color: var(--purple-primary);
}

.bento-quick-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple-bright);
}

.bento-quick-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.bento-quick-icon {
  font-size: 2rem;
  margin-top: auto;
  align-self: flex-end;
}

/* Stats */
.bento-stats {
  grid-column: span 9;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
  padding: 12px;
  background: transparent;
  border: none;
}

.bento-stats .dash-stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}

.bento-stats .dsc-val {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 800;
}

.bento-stats .dsc-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Action tiles */
.bento-actions {
  grid-column: span 4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  background: var(--bg2);
}

.bento-action-tile {
  border: none;
  background: var(--bg3);
  border-radius: 14px;
  padding: 12px 6px;
  cursor: pointer;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, transform 0.15s;
}

.bento-action-tile span { font-size: 1.35rem; }

.bento-action-tile small {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.bento-action-tile:hover {
  background: rgba(124, 58, 237, 0.3);
  transform: translateY(-2px);
}

/* Horizontal scroll matches */
.bento-scroll-wrap {
  grid-column: 1 / -1;
  padding: 16px;
  background: var(--bg2);
}

.bento-scroll-wrap .dash-scroll-title {
  margin-bottom: 12px;
}

.bento-scroll-wrap .dash-scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.bento-scroll-wrap .mini-match-card {
  flex: 0 0 150px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.bento-scroll-wrap .mini-match-card:hover {
  border-color: var(--purple-bright);
}

/* League CTA card */
.bento-league-card {
  grid-column: span 8;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  text-align: left;
  cursor: pointer;
  border: none;
  color: #fff;
  font: inherit;
  background: linear-gradient(120deg, #1a1028 0%, #2d1b4e 50%, #1a1028 100%);
  transition: transform 0.15s;
}

.bento-league-card:hover { transform: translateY(-2px); }

.bento-league-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bento-league-text strong {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bento-league-text span {
  font-size: 0.8rem;
  color: var(--muted);
}

.bento-league-cta {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--purple-primary);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.bento-league-art {
  font-size: 2.5rem;
  opacity: 0.9;
}

/* Friends & recent panels */
.bento-panel {
  grid-column: 1 / -1;
  padding: 18px 16px 20px;
  background: var(--bg2);
}

.bento-panel .dash-section-title {
  color: var(--purple-bright);
  margin-bottom: 14px;
}

.bento-friends-panel .friends-list-view,
.bento-friends-panel .friends-row {
  margin-top: 0;
}

/* Wide CTA */
.bento-cta-wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border: none;
  cursor: pointer;
  font: inherit;
  background: linear-gradient(90deg, var(--accent), var(--purple-primary));
  color: #0f0618;
  font-weight: 800;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 10px 32px rgba(232, 121, 249, 0.35);
}

.bento-cta-wide:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(232, 121, 249, 0.5);
}

.bento-cta-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 6, 24, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Hide legacy dashboard chrome inside bento */
.bento-screen .dash-header,
.bento-screen .dash-container,
.bento-screen .dash-cta-bar { display: none !important; }

#screen-dashboard.bento-screen { padding-bottom: 88px; }

.dash-panel-collapsed {
  display: none !important;
}

/* ── Tablet ── */
@media (max-width: 900px) {
  .bento-hero-figure {
    width: 160px;
    opacity: 0.85;
  }

  .bento-stats { grid-column: 1 / -1; }
  .bento-quick { grid-column: span 6; }
  .bento-actions { grid-column: span 6; }
  .bento-league-card { grid-column: 1 / -1; }
}

/* ── Mobile: bottom nav rail ── */
@media (max-width: 720px) {
  .bento-layout {
    flex-direction: column;
    padding-bottom: 76px;
  }

  .bento-rail {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100vw;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-evenly;
    align-items: center;
    margin: 0;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    z-index: 100;
    gap: 2px;
    overflow: hidden;
    box-sizing: border-box;
  }

  .bento-rail-spacer { display: none; }

  .bento-rail-btn {
    flex: 1 1 0;
    min-width: 0;
    max-width: 48px;
    width: auto;
    height: 44px;
    border-radius: 12px;
    font-size: 1.05rem;
    flex-shrink: 1;
  }

  .bento-rail-secondary { display: none; }

  .bento-rail-avatar {
    display: flex !important;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
  }

  .bento-main { padding: 8px 12px 16px; }

  .bento-topbar { margin-bottom: 12px; }

  .bento-search-pill {
    max-width: none;
    width: 100%;
    order: 3;
    flex-basis: 100%;
  }

  .bento-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .bento-hero {
    grid-column: 1 / -1;
    min-height: 180px;
    padding: 18px 16px;
  }

  .bento-hero-figure {
    width: 120px;
    right: -20px;
    bottom: -20px;
    opacity: 0.7;
  }

  .bento-quick {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .bento-quick-icon {
    margin-top: 0;
    font-size: 1.75rem;
  }

  .bento-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 1fr);
  }

  .bento-league-card {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    padding: 16px;
  }

  .bento-league-cta { width: 100%; text-align: center; margin-top: 8px; }

  .bento-panel { grid-column: 1 / -1; }

  .bento-cta-wide { grid-column: 1 / -1; }

  #screen-dashboard.bento-screen { padding-bottom: 88px; }
}

@media (max-width: 380px) {
  .bento-hero-title { font-size: 2rem; }
  .bento-actions { grid-template-columns: repeat(2, 1fr); }
}
