/* Rowdy Rounds — sidebar scorecard rail */

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    background-color: var(--felt);
    background-image: linear-gradient(180deg, var(--felt-light) 0%, var(--felt) 40%);
    color: var(--chalk);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    transition: width 0.3s ease;
    z-index: 1000;
    border-right: 3px solid var(--foil-dark);
}

.sidebar.collapsed {
    width: 84px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px;
    border-bottom: 1px solid var(--line);
}

.wordmark {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--chalk);
    font-family: var(--font-display);
    line-height: 0.92;
    font-size: 1.5rem;
    letter-spacing: 0.01em;
}

.wordmark-line:last-child {
    color: var(--foil);
}

.sidebar.collapsed .wordmark {
    font-size: 0;
}

.sidebar.collapsed .wordmark::before {
    content: "RR";
    font-size: 1.4rem;
}

.toggle-btn {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.toggle-btn .line {
    width: 22px;
    height: 2px;
    background-color: var(--foil);
}

.nav {
    flex-grow: 1;
    padding: 12px 16px;
    overflow-y: auto;
}

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

.nav-item {
    margin: 4px 0;
    border-bottom: 1px solid var(--line);
}

.nav-link {
    text-decoration: none;
    color: var(--chalk);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item > .nav-link {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 14px 4px;
}

.suit {
    color: var(--foil);
    font-size: 1.1rem;
    width: 1em;
    text-align: center;
}

.sidebar.collapsed .nav-item > .nav-link {
    justify-content: center;
    font-size: 0;
    padding: 14px 0;
}

.sidebar.collapsed .suit {
    font-size: 1.3rem;
}

.dropdown {
    list-style: none;
    padding-left: 30px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.nav-item.active .dropdown,
.nav-item:hover .dropdown {
    max-height: 300px;
    opacity: 1;
    padding-bottom: 12px;
}

.dropdown-item {
    margin: 2px 0;
}

.dropdown-item .nav-link {
    font-size: 0.92rem;
    font-weight: 400;
    padding: 7px 4px;
    color: rgba(244, 239, 228, 0.85);
    border-radius: 3px;
}

.dropdown-item .nav-link:hover {
    color: var(--foil);
}

.dropdown-item .nav-link.current {
    color: var(--foil);
    font-weight: 600;
    background-color: rgba(244, 239, 228, 0.08);
}

.sidebar.collapsed .nav ul .dropdown,
.sidebar.collapsed .username,
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.profile {
    /* Reset button defaults - this is a <button> so it's keyboard-focusable. */
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid var(--line);
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;

    padding: 18px 20px;
    display: flex;
    align-items: center;
    transition: background-color 0.15s ease;
}

.profile:hover {
    background-color: rgba(244, 239, 228, 0.06);
}

.profile-icon {
    font-size: 22px;
    margin-right: 10px;
}

.username {
    font-size: 0.95rem;
    margin-right: 15px;
}

.sidebar-footer {
    padding: 0 20px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.sidebar-footer a {
    font-size: 0.75rem;
    color: rgba(244, 239, 228, 0.5);
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: var(--foil);
    text-decoration: underline;
}

.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 84px;
    width: calc(100% - 84px);
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        border-right: none;
        border-bottom: 3px solid var(--foil-dark);
    }

    .sidebar.collapsed {
        width: 100%;
    }

    .sidebar.collapsed .wordmark {
        font-size: 1.5rem;
    }

    .sidebar.collapsed .wordmark::before {
        content: none;
    }

    .main-content,
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Profile modal */
.profile-modal-content {
    text-align: left;
    max-width: 340px;
}

.profile-modal-content h2 {
    text-align: center;
    color: var(--felt);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.profile-modal-hint {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(27, 27, 23, 0.6);
    margin: 0 0 18px;
}

.profile-modal-hint a {
    color: inherit;
}

.profile-form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--felt);
    margin-bottom: 6px;
}

#profile-name-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 2px solid var(--felt);
    border-radius: 6px;
    margin-bottom: 18px;
}

.profile-avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-avatar-option {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    background-color: transparent;
    border: 2px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.profile-avatar-option:hover {
    border-color: var(--foil);
}

.profile-avatar-option.selected {
    border-color: var(--felt);
    background-color: rgba(18, 53, 36, 0.08);
}

/* Age gate: full-screen and opaque so nothing behind it is readable.
   The inline script in layout.html adds .age-verified to <html> before
   first paint for returning visitors, so they never see it flash. */
.age-gate {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: var(--felt-dark, #0b241a);
}

html.age-verified .age-gate {
    display: none;
}

.age-gate-content {
    background-color: var(--chalk);
    padding: 28px;
    border-radius: 10px;
    border: 2px solid var(--felt);
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.age-gate-content h2 {
    margin-top: 0;
}

.age-gate.denied .modal-actions {
    display: none;
}
