/* ============================================================
   Home page
   ============================================================ */

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #111;
}

.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    padding: 2rem;
    max-width: 1100px;
    width: 100%;
}

/* --- Title -------------------------------------------------- */

.home-title {
    text-align: center;
}

.home-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.home-title h1 {
    font-size: 1.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: normal;
    margin-bottom: 0.4rem;
}

.home-location {
    font-size: 0.85rem;
    color: #666;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Nav buttons ------------------------------------------- */

.home-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

/* Full-width rainbow separator between public and admin cards.
   Uses the active theme's rainbow when present, falls back to the hub palette. */
.home-divider {
    flex: 0 0 100%;
    height: 3px;
    border: 0;
    margin: 0.3rem 0;
    border-radius: 2px;
    background: var(--bm-rainbow, linear-gradient(
        100deg,
        #cc2288 0%,
        #e06000 25%,
        #d4b800 45%,
        #22aa44 65%,
        #00b4cc 82%,
        #2255cc 100%));
}

@media (max-width: 700px) {
    .nav-btn {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

.nav-btn {
    flex: 0 0 calc(25% - 0.75rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1.4rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    background: #1a1a1a;
    cursor: pointer;
    font-family: inherit;
}

/* Let impersonation forms act as transparent flex wrappers around their button */
.home-nav form { display: contents; }

.nav-btn:hover {
    transform: translateY(-2px);
}

.nav-btn__icon {
    font-size: 1.6rem;
    line-height: 1;
}

.nav-btn__label {
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-btn__desc {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    opacity: 0.6;
    text-align: center;
}

/* Per-button color themes */

.nav-btn--athlete {
    border-color: #2255cc;
    color: #7aaaff;
}
.nav-btn--athlete:hover { background: #080f2e; }

.nav-btn--admin {
    border-color: #e06000;
    color: #ff9940;
}
.nav-btn--admin:hover { background: #2e1500; }

.nav-btn--leaderboard {
    border-color: #c8960c;
    color: #ffd060;
}
.nav-btn--leaderboard:hover { background: #2a1e00; }

.nav-btn--live {
    border-color: #1f9fb8;
    color: #5fd6ec;
}
.nav-btn--live:hover { background: #07232a; }

.nav-btn--pictures {
    border-color: #996699;
    color: #ddaadd;
}
.nav-btn--pictures:hover { background: #1e0e1e; }

.nav-btn--settings {
    border-color: #557799;
    color: #88bbdd;
}
.nav-btn--settings:hover { background: #0a1a28; }

/* --- Help: floating chat-style widget (bottom right) --------- */

.help-fab {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 100;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid #444;
    background: #1a1a1a;
    color: #999;
    font-family: inherit;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.help-fab:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.help-popup {
    position: fixed;
    right: 1.2rem;
    bottom: 4.8rem;
    z-index: 100;
    width: min(360px, calc(100vw - 2.4rem));
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    animation: help-popup-in 0.15s ease-out;
}
.help-popup[hidden] { display: none; }
@keyframes help-popup-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.help-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #2a2a2a;
}
.help-popup__title {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: normal;
}
.help-popup__close {
    border: none;
    background: transparent;
    color: #666;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.2rem;
    cursor: pointer;
}
.help-popup__close:hover { color: #eee; }
.help-popup__body {
    padding: 1rem 1.1rem;
    overflow-y: auto;
}

.help-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.help-item {
    display: flex;
    gap: 0.8rem;
    align-items: baseline;
}
.help-item__icon {
    flex: 0 0 1.6rem;
    text-align: center;
    font-size: 1rem;
    background: transparent;
    border: none;
}
.help-item__name {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
    border: none;
}
.help-item__desc {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #999;
    line-height: 1.5;
}
.help-list .home-divider { margin: 0; }
