/* Layout: the page frame, the header (with the player HUD from game.css), the footer and the phone tab bar. */

.wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

.main { flex: 1; padding-top: 24px; padding-bottom: 40px; }
.main:focus { outline: none; }

.skip-link {
    position: absolute;
    inset-inline-start: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Header: a dark "console" bar in both themes ---------- */
.site-header {
    position: relative;
    z-index: 40;
    background: var(--console);
    color: var(--on-console);
    border-bottom: 2px solid rgba(32, 184, 166, .35);
    box-shadow: 0 8px 24px -16px rgba(0, 0, 0, .6);
}
.header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 44px;
    min-height: 44px;
    color: var(--on-console);
    text-decoration: none;
}
.brand-mark { transition: transform .25s var(--ease-spring); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.brand-name { font-family: var(--font-title); font-size: 1.4rem; line-height: 1; }

.top-nav { display: none; align-items: center; gap: 4px; }
.top-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    color: var(--on-console-muted);
    font-family: var(--font-title);
    font-size: 1.05rem;
    text-decoration: none;
}
.top-nav a:hover { color: var(--on-console); background: rgba(255, 255, 255, .08); }
.top-nav a.active { color: var(--navy); background: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.header-actions .btn { min-height: 44px; padding: 6px 16px; font-size: 1rem; border-radius: 14px; }
.header-actions .btn-icon { padding-inline: 10px; }
.header-action-label { display: none; }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: auto;
    padding: 24px 0 calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom));
    border-top: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: var(--fs-sm);
}
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-brand { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.footer-name { font-family: var(--font-title); font-size: 1.15rem; color: var(--text); }
.footer-tagline { color: var(--text-muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--text-muted); }
.footer-links a:hover { color: var(--link); }

/* Channel links (SocialLinks.razor): round 44 px buttons. */
.social { --social-cut: var(--surface); display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.social a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-muted);
    transition: transform .15s var(--ease-spring);
}
.social a:hover { transform: translateY(-2px) rotate(-6deg); border-color: var(--primary); color: var(--link); }
.social a:active { transform: scale(.92); }

/* ---------- Tab bar: phones only ---------- */
.tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    gap: 4px;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    background: var(--console);
    border-top: 2px solid rgba(32, 184, 166, .35);
    box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .7);
}
.tab {
    position: relative;
    flex: 1;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    border-radius: 14px;
    color: var(--on-console-muted);
    font-family: var(--font-title);
    font-size: .85rem;
    line-height: 1.1;
    text-decoration: none;
    transition: transform .15s var(--ease-out);
}
.tab:active { transform: scale(.92); }
.tab.active { color: var(--amber); }
.tab.active::before {
    content: "";
    position: absolute;
    top: -8px;
    width: 32px;
    height: 4px;
    border-radius: 0 0 4px 4px;
    background: var(--amber);
    box-shadow: 0 0 12px var(--amber);
}
.tab.active .icon { transform: translateY(-1px) scale(1.1); }

/* ---------- Wider screens: nav in the header, no tab bar ---------- */
@media (min-width: 900px) {
    .top-nav { display: flex; }
    .tabbar { display: none; }
    .site-footer { padding-bottom: 24px; }
    .header-action-label { display: inline; }
    .toast-stack { bottom: 24px; }
    .main { padding-top: 32px; padding-bottom: 56px; }
}

/* Phones with the player HUD: one header row, the logo without the name. */
@media (max-width: 559px) {
    .site-header:has(.hud) .brand-name { display: none; }
    .site-header:has(.hud) .header-row { flex-wrap: nowrap; gap: 8px; }
}

/* Very small phones: keep the brand short. */
@media (max-width: 380px) {
    .brand-name { font-size: 1.2rem; }
    .header-actions .btn { padding-inline: 12px; }
}
