:root {
    --app-max-width: 820px;
}

html {
    min-height: 100%;
    background: #e9e0d6;
}

body {
    width: 100%;
    max-width: var(--app-max-width);
    min-height: 100vh;
    margin: 0 auto;
    overflow-x: hidden;
    background: #fffdf9;
}

.app-header {
    width: 100%;
    max-width: var(--app-max-width);
    height: 60px;
    padding: 0 12px;
}

.app-header .app-brand img {
    width: 37px;
    height: 37px;
}

.app-header .app-brand b {
    font-size: 15px;
}

.app-header .app-brand small {
    font-size: 6px;
}

main {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.page-subheader {
    position: relative;
    width: 100%;
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 20px;
    padding: 20px 22px;
    overflow: hidden;
    background: linear-gradient(135deg, #4b1023 0%, #681a34 55%, #862a48 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 10px 24px rgba(80, 20, 38, .14);
}

.page > .page-subheader {
    width: calc(100% + 34px);
    margin: 0 -17px 20px;
}

.page > .page-subheader + .title {
    padding-top: 16px;
}

.page-subheader::before,
.page-subheader::after {
    position: absolute;
    content: '';
    pointer-events: none;
    border-radius: 50%;
}

.page-subheader::before {
    top: -42px;
    right: -28px;
    width: 132px;
    height: 132px;
    border: 1px solid rgba(237, 205, 146, .2);
}

.page-subheader::after {
    right: 56px;
    bottom: -54px;
    width: 104px;
    height: 104px;
    background: rgba(255, 255, 255, .035);
}

.page-subheader-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-subheader-copy > a {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: none;
    border: 0;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .11);
    font: 400 26px/1 sans-serif;
}

.page-subheader small {
    display: block;
    color: #edcd92;
    font: 700 8px 'Chakra Petch', sans-serif;
    letter-spacing: 2px;
}

.page-subheader h1 {
    margin: 4px 0 0;
    color: #fff;
    font: 700 20px/1.2 'Chakra Petch', sans-serif;
}

.page-subheader-profile {
    position: relative;
    z-index: 1;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: none;
    color: #fff;
    text-decoration: none;
}

.page-subheader-profile img,
.page-subheader-profile > span {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    object-fit: cover;
    border: 3px solid #f5dfb6;
    border-radius: 50%;
    background: #eadac7;
    color: #651d32;
    font: 800 23px 'Chakra Petch', sans-serif;
    box-shadow: 0 7px 18px rgba(38, 8, 18, .3);
}

.page-subheader-profile img.default-avatar {
    padding: 6px;
    object-fit: contain;
    background: #eadac7;
}

.page-subheader-profile b {
    max-width: 76px;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.app-header .app-user {
    display: none;
}

/* Keep the dashboard in the same two-column mobile composition everywhere. */
.page {
    max-width: 100%;
}

.hero {
    margin: 0 -17px 28px;
    padding: 42px 22px 32px;
    border-radius: 0 0 27px 27px;
}

.stats,
.people,
.games,
.more {
    grid-template-columns: 1fr 1fr;
}

.quick {
    grid-template-columns: 1fr;
}

.people article > div {
    height: 110px;
}

/* Authentication uses the same focused form view on every screen. */
.auth-page {
    padding: 0;
}

.auth-page main {
    display: block;
    height: auto;
    min-height: calc(100vh - 60px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.auth-page .story {
    display: none;
}

.auth-page .panel {
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 60px);
    padding: 28px 22px 34px;
    overflow: visible;
}

.auth-page .panel > * {
    width: 100%;
    max-width: 600px;
    margin-inline: auto;
}

.auth-page .cols {
    grid-template-columns: 1fr;
}

/* Profile pages keep the mobile card flow instead of switching structure. */
body > main > .profile-card,
body > main > .edit-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.profile-card {
    overflow: visible;
}

.profile-card .cover {
    height: 250px;
    background-image:
        url('../images/faculty-fountain-rectangular-transparent-cropped.png'),
        radial-gradient(circle at 80% 20%, #c99e6190, transparent 28%),
        linear-gradient(135deg, #501426, #822442);
    background-position: center bottom, center, center;
    background-size: contain, cover, cover;
    background-repeat: no-repeat;
}

.edit-card {
    padding: 22px 18px;
}

.identity {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 0 20px 22px;
}

.avatar {
    width: 86px;
    height: 86px;
}

.identity > div:nth-child(2) {
    min-width: calc(100% - 110px);
}

.identity .primary {
    width: 100%;
    text-align: center;
}

.two,
.report-grid {
    grid-template-columns: 1fr;
}

.details {
    grid-template-columns: 1fr;
}

.details article,
.story-box,
.form-section {
    min-width: 0;
}

.report-card,
.report-preview,
.form-section {
    margin-inline: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
}

.profile-card .report-card {
    margin: 18px clamp(16px, 4vw, 34px) 20px;
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(80, 20, 38, .16);
}

.report-form .report-inline-field {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
}

.report-form > .report-inline-field,
.report-form .report-grid {
    margin-top: 10px;
}

.report-form .report-grid {
    gap: 10px;
}

.report-form .suffix-choice {
    margin: 0;
}

.profile-actions .primary,
.profile-actions .secondary {
    width: auto;
    flex: 1 1 0;
    text-align: center;
}

.report-inline-field > span {
    flex: 0 0 58px;
    color: inherit;
    text-align: right;
}

.report-inline-field > input {
    width: auto;
    min-width: 0;
    flex: 1;
    margin-top: 0;
}

/* One bottom navigation model for dashboard and profile screens. */
body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

nav,
.app-nav {
    right: auto;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: var(--app-max-width);
    height: 72px;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateX(-50%);
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

nav > a,
nav > button,
.app-nav > a,
.app-nav > button {
    min-width: 0;
    overflow: hidden;
}

nav > a span,
nav > button span,
.app-nav > a span,
.app-nav > button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 699px) {
    nav,
    .app-nav {
        right: 0;
        left: 0;
        width: auto;
        max-width: none;
        transform: none;
    }
}

@media (min-width: 700px) {
    body {
        box-shadow: 0 0 60px rgba(67, 35, 45, .16);
    }

    .page {
        padding-inline: 28px;
    }

    .page > .page-subheader {
        width: calc(100% + 56px);
        margin-inline: -28px;
    }

    .hero {
        margin-inline: -28px;
    }

    .auth-page .panel,
    .edit-card {
        padding-inline: 42px;
    }
}

@media (max-width: 430px) {
    .app-header .app-brand span {
        display: block;
    }

    .app-header .app-brand small {
        display: block;
    }

    .profile-card .cover {
        height: 190px;
        background-position: center bottom, center, center;
    }

}

@media (max-width: 380px) {
    .stats,
    .people,
    .games,
    .more {
        grid-template-columns: 1fr;
    }
}
