﻿.home-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 18px 112px;
    background: var(--sc-page-bg);
    overflow-x: hidden;
    transition: none;
}

.home-page:has(.home-record-search.has-results) {
    justify-content: flex-start;
    padding: 18px 18px 112px;
}

.home-footer {
    position: absolute;
    right: 18px;
    bottom: 24px;
    left: 18px;
    color: rgba(51, 65, 85, .72);
    font-size: 12px;
    text-align: center;
}

.home-footer p { margin: 0 0 7px; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.home-footer nav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.home-footer nav span { color: rgba(100, 116, 139, .35); }
.home-footer button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 2px 0; transition: color .18s ease; }
.home-footer button:hover, .home-footer button:focus-visible { color: var(--sc-accent); outline: none; }

.home-footer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(7px);
    animation: footer-backdrop-in .18s ease both;
}

.home-footer-dialog {
    position: relative;
    width: min(100%, 440px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .94);
    border-radius: 22px;
    background: rgba(248, 250, 252, .97);
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
    padding: 30px 28px 26px;
    text-align: center;
    animation: footer-dialog-in .22s cubic-bezier(.22, 1, .36, 1) both;
}

.home-footer-dialog-mark { width: 38px; height: 38px; display: inline-grid; place-items: center; margin-bottom: 13px; border-radius: 12px; background: linear-gradient(135deg, #2563eb, #8b5cf6); color: white; font-size: 18px; font-weight: 950; font-style: italic; box-shadow: 0 9px 24px rgba(79, 70, 229, .22); }
.home-footer-dialog h2 { margin: 0 0 12px; color: var(--sc-text); font-size: 22px; font-weight: var(--sc-font-black); }
.home-footer-dialog > p, .home-footer-dialog-copy p { margin: 0; color: var(--sc-muted); font-size: 14px; font-weight: 650; line-height: 1.75; }
.home-footer-dialog-copy { display: grid; gap: 7px; text-align: left; }
.home-footer-dialog-copy h3 { margin: 8px 0 0; color: #334155; font-size: 14px; font-weight: var(--sc-font-black); }
.home-footer-dialog-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(226, 232, 240, .72); color: #64748b; font-size: 22px; line-height: 1; cursor: pointer; }
.home-footer-dialog-close:hover { background: #e2e8f0; color: #0f172a; }
.home-footer-dialog-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 20px; border-radius: 12px; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff !important; font-size: 14px; font-weight: var(--sc-font-heavy); padding: 0 20px; text-decoration: none !important; box-shadow: 0 10px 24px rgba(79, 70, 229, .2); }

@keyframes footer-backdrop-in { from { opacity: 0; } }
@keyframes footer-dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.home-page:has(.home-record-search.has-results) .home-menu {
    width: 100%;
    padding-bottom: 58px;
    animation: none;
}

.home-page:has(.home-record-search.has-results) .home-nav {
    position: absolute;
    right: 0;
    bottom: 0;
    width: auto;
    justify-content: flex-end;
}

@keyframes home-controls-rise {
    from {
        transform: translateY(18vh);
        opacity: .72;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 1200px) {
    .home-page:has(.home-record-search.has-results) .home-menu {
        width: min(100%, 760px);
        padding-bottom: 0;
    }

    .home-page:has(.home-record-search.has-results) .home-nav {
        position: static;
        width: 100%;
        justify-content: center;
    }
}

.home-menu {
    position: relative;
    width: min(100%, 920px);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    gap: 10px;
    transform: none;
    transition: none;
}

.home-page > .home-record-search {
    width: 100%;
}

.home-brand {
    position: relative;
    order: 1;
    width: 100%;
    min-height: 71px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-brand-action {
    position: absolute;
    top: 50%;
    left: calc(50% + 120px);
    transform: translateY(-50%);
    width: 104px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.admin-hash {
    order: 2;
    position: static;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #334155;
    font-size: 14px;
    font-weight: var(--sc-font-black);
    box-shadow: none;
    text-decoration: none !important;
    cursor: pointer;
}

.admin-hash:hover {
    color: var(--sc-accent);
    border-color: var(--sc-border);
    background: rgba(255, 255, 255, .28);
}

.home-broadcast-link {
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 38px;
    gap: 6px;
    border: 1px solid rgba(147, 197, 253, .82);
    border-radius: 999px;
    padding: 0 13px 0 9px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(224, 242, 254, .88));
    color: #31558a;
    font-size: 13px;
    font-weight: var(--sc-font-heavy);
    line-height: 1;
    white-space: nowrap;
    box-shadow:
        0 8px 20px rgba(59, 130, 246, .14),
        inset 0 1px 0 #fff;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-broadcast-link svg {
    width: 25px;
    height: 25px;
    overflow: visible;
    fill: #dbeafe;
    stroke: #4f7fd1;
    stroke-width: 1.45;
    stroke-linejoin: round;
}

.home-broadcast-link .broadcast-play {
    fill: #6366f1;
    stroke: none;
}

.home-broadcast-link:hover {
    border-color: #93c5fd;
    background: linear-gradient(145deg, #fff, #e0f2fe);
    color: #2563eb;
    box-shadow: 0 11px 25px rgba(59, 130, 246, .22), inset 0 1px 0 #fff;
    transform: translateY(-2px);
}

.home-logo {
    display: block;
    width: 220px;
    height: 71px;
    min-width: 220px;
    flex: 0 0 220px;
    aspect-ratio: 1254 / 406;
    object-fit: contain;
    order: 1;
    transform: none;
    transition: none;
}

.home-page .home-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    order: 3;
    width: 100%;
    padding: 3px 0 4px;
    text-align: center;
    overflow: visible;
}

.home-menu + .home-record-search.before-search {
    padding-top: 6px;
}

.home-user-area {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    justify-content: center;
    min-width: 118px;
    gap: 8px;
    border-radius: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, .74);
    color: #334155;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.home-user-area strong,
.home-user-area a {
    display: inline-block;
    white-space: nowrap;
    word-break: keep-all;
}

.home-user-area strong {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-user-area a {
    color: #6d28d9 !important;
    font-weight: var(--sc-font-heavy);
}

.notification-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 12px 28px rgba(37,99,235,.1);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: var(--sc-font-black);
    padding: 0 5px;
}

.notification-toggle:hover,
.notification-toggle[aria-expanded="true"] {
    background: var(--sc-card-bg-strong);
}

.home-menu a,
.home-menu a:link,
.home-menu a:visited,
.home-menu a:hover,
.home-menu a:active,
.home-menu a:focus {
    text-decoration: none !important;
}

.home-page .home-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    height: 48px;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-sm);
    background: var(--sc-card-bg);
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    padding: 0 16px;
    box-shadow: 0 10px 24px rgba(37,99,235,.08);
    transition: .2s;
    white-space: nowrap;
}

.home-page .home-nav-link:hover {
    background: var(--sc-card-bg-strong);
    color: var(--sc-accent);
}

.menu-user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 260px;
    min-height: 48px;
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(232,241,255,.76));
    box-shadow: 0 12px 28px rgba(37,99,235,.1);
    overflow: hidden;
    color: var(--sc-accent-strong);
    font-size: 17px;
    font-weight: var(--sc-font-black);
    line-height: 1;
    padding: 0 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-right a,
.tier-apply-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 999px;
    background: var(--sc-purple);
    color: white;
    font-weight: var(--sc-font-heavy);
    padding: 0 24px;
}

.tier-apply-button {
    border: 0;
    cursor: pointer;
}

.tier-registration-backdrop {
    z-index: 1100;
    padding: 20px;
}

.tier-registration-modal {
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .94);
    border-radius: 18px;
    padding: 24px;
    background: #f8fafc;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.tier-registration-modal h2 {
    margin: 0 0 6px;
    color: #172033;
    font-weight: var(--sc-font-black);
}

.tier-registration-modal > p {
    margin: 0 0 16px;
    color: #64748b;
}

.tier-registration-form {
    display: grid;
    gap: 9px;
}

.tier-registration-form label {
    color: #334155;
    font-size: 14px;
    font-weight: var(--sc-font-heavy);
}

.tier-registration-form input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 10px;
    padding: 13px 14px;
    background: #fff;
    color: #172033;
    font-size: 16px;
    outline: none;
}

.tier-registration-form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.tier-registration-error {
    margin-bottom: 12px;
    border-radius: 10px;
    padding: 11px 13px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}

.tier-registration-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.tier-registration-actions button {
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    font-weight: var(--sc-font-heavy);
    cursor: pointer;
}

.tier-registration-close {
    background: #e2e8f0;
    color: #334155;
}

.tier-registration-submit {
    background: #2563eb;
    color: #fff;
}

.notification-panel {
    position: fixed;
    top: 94px;
    right: 18px;
    z-index: 900;
    width: 0;
    max-width: calc(100vw - 36px);
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--sc-radius);
    background: rgba(255,255,255,.88);
    box-shadow: none;
    opacity: 0;
    transition: width .22s ease, opacity .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.notification-panel.open {
    width: 360px;
    border-color: rgba(255,255,255,.9);
    box-shadow: var(--sc-shadow);
    opacity: 1;
}

.notification-inner {
    width: 360px;
    padding: 16px 18px 18px;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--sc-line);
}

.notification-header strong {
    color: var(--sc-accent-strong);
    font-size: 15px;
    font-weight: var(--sc-font-black);
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-header button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: var(--sc-accent-strong);
    color: white;
    font-size: 12px;
    font-weight: var(--sc-font-heavy);
    padding: 0 12px;
    white-space: nowrap;
    cursor: pointer;
}

.notification-header .push-enable-button {
    background: var(--sc-purple);
}

.notification-header .notification-close-button {
    width: 30px;
    padding: 0;
    background: transparent;
    color: var(--sc-accent-strong);
    font-size: 22px;
    line-height: 1;
}

.notification-header .notification-close-button:hover {
    background: rgba(15, 23, 42, .08);
}

.notification-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.push-prompt-backdrop {
    z-index: 1100;
    padding: 20px;
    background: rgba(15, 23, 42, .52);
}

.push-prompt {
    width: min(100%, 420px);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 24px;
    background: white;
    box-shadow: 0 24px 70px rgba(15,23,42,.24);
    padding: 30px 26px 24px;
    text-align: center;
}

.push-prompt-icon {
    display: block;
    margin-bottom: 12px;
    font-size: 38px;
}

.push-prompt h2 {
    margin: 0;
    color: var(--sc-accent-strong);
    font-size: 22px;
    font-weight: var(--sc-font-black);
}

.push-prompt p {
    margin: 12px 0 22px;
    color: var(--sc-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
}

.push-prompt-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.push-prompt-actions button {
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    font-weight: var(--sc-font-heavy);
    cursor: pointer;
}

.push-prompt-enable {
    background: var(--sc-purple);
    color: white;
}

.push-prompt-later {
    background: #e2e8f0;
    color: #475569;
    padding: 0 18px;
}

.notification-list li {
    color: var(--sc-text);
    font-size: 14px;
    font-weight: var(--sc-font-heavy);
    line-height: 1.7;
}

.notification-list li + li {
    border-top: 1px solid var(--sc-line);
}

.notification-list li button {
    width: 100%;
    display: grid;
    gap: 3px;
    border: 0;
    background: transparent;
    padding: 10px 4px;
    text-align: left;
    cursor: pointer;
}

.notification-list li.unread button {
    background: rgba(37,99,235,.07);
}

.notification-list li.read {
    opacity: .68;
}

.notification-list span {
    color: var(--sc-accent);
    white-space: normal;
}

.notification-list time {
    color: var(--sc-muted);
    font-size: 11px;
}

.notification-list .notification-empty {
    color: var(--sc-muted);
    padding: 18px 4px;
    text-align: center;
}

@media (max-width: 820px) {
    .home-page {
        min-height: 100svh;
        padding:
            max(18px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            max(102px, calc(84px + env(safe-area-inset-bottom)))
            max(12px, env(safe-area-inset-left));
        align-items: center;
        overflow-x: clip;
    }

    .home-footer { right: 12px; bottom: 18px; left: 12px; }
    .home-footer nav { gap: 6px; font-size: 11px; }
    .home-footer-dialog { border-radius: 18px; padding: 27px 22px 23px; }

    .home-menu {
        align-items: center;
        gap: 9px;
    }

    .home-brand {
        min-height: 55px;
    }

    .home-logo {
        width: 170px;
        height: 55px;
        min-width: 170px;
        flex-basis: 170px;
    }

    .home-broadcast-link {
        min-height: 30px;
        gap: 3px;
        padding: 0 7px 0 5px;
        font-size: 10px;
    }

    .home-broadcast-link svg {
        width: 20px;
        height: 20px;
    }

    .home-brand-action {
        left: calc(50% + 94px);
        width: 76px;
        height: 28px;
    }

    .home-page .home-nav {
        display: flex;
        justify-content: center;
        flex-wrap: nowrap;
        gap: clamp(2px, .8vw, 4px);
        padding-right: 0;
        padding-left: 0;
        overflow: visible;
    }

    .home-page:has(.home-record-search.has-results) .home-nav {
        position: static;
        width: 100%;
        justify-content: center;
    }

    .home-page .home-nav-link {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
        height: 34px;
        padding: 0 clamp(2px, 1.2vw, 6px);
        font-size: clamp(9px, 2.7vw, 11px);
        line-height: 1;
        word-break: keep-all;
    }

    .home-user-area {
        width: auto;
        min-width: 0;
        min-height: 34px;
        flex: 0 1 78px;
        gap: 4px;
        padding: 0 5px;
        font-size: clamp(9px, 2.5vw, 11px);
    }

    .home-user-area strong {
        max-width: 36px;
    }

    .home-page .home-nav.is-member .home-nav-link {
        flex: 0 1 auto;
        padding-right: clamp(2px, .8vw, 4px);
        padding-left: clamp(2px, .8vw, 4px);
        font-size: clamp(9px, 2.55vw, 10.5px);
    }

    .home-page .home-nav.is-member .home-user-area {
        flex: 1 1 108px;
        max-width: 132px;
    }

    .home-page .home-nav.is-member .home-user-area strong {
        max-width: 72px;
        flex: 1 1 auto;
    }

    .home-page .home-nav.is-member .home-user-area a {
        flex: 0 0 auto;
    }

    .menu-right {
        justify-content: center;
        gap: 8px;
    }

    .notification-toggle {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        font-size: 15px;
    }

    .menu-user {
        max-width: 110px;
        min-height: 44px;
        font-size: 15px;
        padding: 0 14px;
    }

    .menu-right a,
    .tier-apply-button {
        min-height: 44px;
        padding: 0 16px;
        font-size: 14px;
    }

    .notification-panel {
        top: 142px;
        right: 12px;
        left: 12px;
        max-width: calc(100vw - 24px);
    }

    .notification-panel.open,
    .notification-inner {
        width: calc(100vw - 24px);
    }

    .notification-inner {
        padding: 14px 16px 16px;
    }

    .notification-list li {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .home-page {
        padding-right: max(8px, env(safe-area-inset-right));
        padding-left: max(8px, env(safe-area-inset-left));
    }

    .home-logo {
        width: 154px;
        min-width: 154px;
        flex-basis: 154px;
    }

    .home-brand-action {
        left: calc(50% + 82px);
        width: 72px;
    }
}
