/* Battle Barge — Home screen styles
   ================================================================
   _home_impl.js renders these classes (carried over from the legacy
   per-universe home modules). The shared shell never had a home
   stylesheet, so cards rendered as plain text. This file fills that
   gap with universe-token-aware styling.
   ================================================================ */

.home-screen {
    padding: var(--bb-space-6) var(--bb-space-4);
    max-width: 920px;
    margin: 0 auto;
}

.home-section {
    margin-bottom: var(--bb-space-8);
}

.home-section-title {
    font-family: var(--bb-font-display);
    font-size: var(--bb-text-xl);
    color: var(--bb-text-primary);
    margin: 0 0 var(--bb-space-3);
    letter-spacing: 0.02em;
}

/* ----- Card primitives ----- */

.card {
    background: var(--bb-bg-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-md);
    padding: var(--bb-space-4);
    color: var(--bb-text-primary);
}

.card-clickable {
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: border-color var(--bb-transition-fast),
                transform var(--bb-transition-fast),
                box-shadow var(--bb-transition-fast);
}

.card-clickable:hover {
    border-color: var(--bb-accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--bb-shadow-md);
}

.card-clickable:focus-visible {
    outline: 2px solid var(--bb-accent-primary);
    outline-offset: 2px;
}

/* ----- Recent battles ----- */

#recent-battles-summary {
    display: flex;
    flex-direction: column;
    gap: var(--bb-space-3);
}

.recent-battle-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title chip"
        "meta  chip";
    gap: var(--bb-space-1) var(--bb-space-3);
    align-items: center;
    background: var(--bb-bg-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-md);
    padding: var(--bb-space-3) var(--bb-space-4);
}

.recent-battle-title {
    grid-area: title;
    font-weight: 600;
    color: var(--bb-text-primary);
}

.recent-battle-meta {
    grid-area: meta;
    font-size: var(--bb-text-sm);
    color: var(--bb-text-secondary);
}

.recent-battle-result {
    grid-area: chip;
    font-family: var(--bb-font-display);
    font-size: var(--bb-text-sm);
    font-weight: 700;
    padding: var(--bb-space-1) var(--bb-space-3);
    border-radius: var(--bb-radius-full);
    border: 1px solid var(--bb-border);
    color: var(--bb-text-primary);
}

.recent-battle-result.result-win,
.recent-battle-row .stats-result-win {
    color: var(--bb-accent-success);
    border-color: var(--bb-accent-success);
}

.recent-battle-result.result-loss,
.recent-battle-row .stats-result-loss {
    color: var(--bb-accent-danger);
    border-color: var(--bb-accent-danger);
}

.recent-battle-result.result-draw,
.recent-battle-row .stats-result-draw {
    color: var(--bb-text-secondary);
}

/* ----- Action buttons row ----- */

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bb-space-3);
    margin-bottom: var(--bb-space-6);
}

.home-actions .btn {
    flex: 1 1 200px;
}

/* ----- Friends summary -----
   _home_impl.js builds #friends-home-list with .friend-home-card children
   each containing a .friend-avatar circle. Selectors here match those
   exactly — earlier drafts targeted #friends-summary-list / .friend-home-avatar
   which never existed in the DOM. */

#friends-home-list,
.friends-home-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--bb-space-3);
}

.friend-home-card {
    display: flex;
    align-items: center;
    gap: var(--bb-space-3);
    padding: var(--bb-space-3);
    background: var(--bb-bg-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-md);
}

.friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--bb-radius-full);
    background: var(--bb-bg-elevated);
    border: 1px solid var(--bb-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--bb-font-display);
    color: var(--bb-text-secondary);
    object-fit: cover;
    flex-shrink: 0;
}

.friend-avatar-placeholder {
    font-weight: 600;
    text-transform: uppercase;
}

.friend-home-name {
    color: var(--bb-text-primary);
    font-weight: 600;
}

/* ----- Announcements -----
   _home_impl.js fills #home-announcements (not #announcements-list). */

#home-announcements,
.home-announcements {
    display: flex;
    flex-direction: column;
    gap: var(--bb-space-3);
}

.announcement-card {
    background: var(--bb-bg-surface);
    border: 1px solid var(--bb-border);
    border-left: 3px solid var(--bb-accent-primary);
    padding: var(--bb-space-3) var(--bb-space-4);
    border-radius: 0 var(--bb-radius-md) var(--bb-radius-md) 0;
}

/* Welcome band — hero header with a soft underline so the rest of the
   home screen visibly starts below it instead of running directly into
   the first card. */
.home-welcome {
    margin-bottom: var(--bb-space-6);
    padding-bottom: var(--bb-space-4);
    border-bottom: 1px solid var(--bb-border);
}
.home-welcome-title {
    margin: 0 0 var(--bb-space-1);
    font-family: var(--bb-font-display);
    font-size: var(--bb-text-2xl, 1.5rem);
    color: var(--bb-text-primary);
    letter-spacing: 0.02em;
}
.home-system-blurb,
.home-welcome-title-tagline {
    margin: 0;
    color: var(--bb-text-secondary);
}

/* The bug-report CTA at the bottom of the home screen is just one
   button — opt it out of the generic .section card so we don't put
   a backdrop behind a single CTA. */
.home-feedback-section {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    text-align: center;
}

.announcement-card-title {
    margin: 0 0 var(--bb-space-1);
    font-family: var(--bb-font-display);
    font-size: var(--bb-text-base);
    font-weight: 700;
    color: var(--bb-text-primary);
    letter-spacing: 0.04em;
}

.announcement-card-body {
    margin: 0;
    color: var(--bb-text-secondary);
    line-height: 1.45;
}

/* ----- Quick links -----
   _home_impl.js emits .quick-link-btn buttons (plain <button>); style as
   tappable cards. Keep .quick-link-card as a fallback for any caller that
   still uses the legacy class. */

#home-quick-links,
.home-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--bb-space-3);
}

.quick-link-btn,
.quick-link-card {
    background: var(--bb-bg-elevated);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-md);
    padding: var(--bb-space-4);
    color: var(--bb-text-primary);
    text-align: left;
    font-family: var(--bb-font-display);
    font-size: var(--bb-text-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    min-height: var(--bb-touch-min);
    transition: border-color var(--bb-transition-fast),
                transform var(--bb-transition-fast),
                background var(--bb-transition-fast);
}

.quick-link-btn:hover,
.quick-link-btn:focus-visible,
.quick-link-card:hover,
.quick-link-card:focus-visible {
    border-color: var(--bb-accent-primary);
    transform: translateY(-1px);
    outline: none;
}

.home-welcome-title-rank {
    color: var(--bb-accent-primary);
    font-family: var(--bb-font-display);
    letter-spacing: 0.04em;
    margin-right: 0.25em;
}

/* ----- Misc text utilities ----- */

.text-muted { color: var(--bb-text-muted); }
.text-secondary { color: var(--bb-text-secondary); }
