
/* =========================================
   PROFILE + INTERFACE WRAPPER
========================================= */

.profile-wrapper {
    display: flex;
    flex-direction: column;

    width: 100%;
    flex: 1 1 0;

    min-height: 0;
    overflow: hidden;
}


/* =========================================
   PROFILE CARD
========================================= */

.profile-card {
    width: 100%;
    margin: 0;

    flex: 0 0 auto;
    flex-shrink: 0;

    background: var(--white);
    overflow: hidden;
}


/* BANNER */

.profile-banner {
    width: 100%;
    height: 190px;
    overflow: hidden;
}

.profile-banner img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
}


/* PROFILE CONTENT */

.profile-content {
    padding: 0 30px 0;
}


/* PROFILE HEADER */

.profile-header {
    display: flex;
    align-items: flex-end;
    gap: 20px;

    margin-top: -55px;
    position: relative;
}

.profile-avatar {
    width: 130px;
    height: 130px;
    flex-shrink: 0;

    border: 5px solid var(--white);
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
}

.profile-identity {
    padding-bottom: 8px;
}

.profile-identity h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    margin: 0;
    line-height: 1;
}

.profile-username {
    font-family: var(--font-body);
    font-size: 13px;

    margin: 0;
    opacity: 0.65;
    color: #B4331F;
}


/* PROFILE DETAILS */

.profile-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 20px;
    line-height: normal;

    font-family: var(--font-body);
    font-size: 12px;
    color: var(--muted);
}


/* PROFILE BIO */

.profile-bio {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
}

.profile-bio p {
    margin-top: 4px;
}
.profile-bio span {
color: var(--muted);
}

/* =========================================
   SITE INTERFACE
========================================= */

.site-interface {
    display: flex;
    flex-direction: column;

    width: 100%;
    flex: 1 1 0;

    min-height: 0;
    overflow: hidden;
}


/* =========================================
   TAB NAVIGATION
========================================= */

.tab-navigation {
    display: flex;
    width: 100%;

    flex: 0 0 auto;

    margin-top: 0px;

    border-bottom: 1px solid rgba(180, 51, 31, 0.4);

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;
}

.tab-navigation::-webkit-scrollbar {
    display: none;
}


/* TAB BUTTONS */

.tab-button {
    position: relative;
    flex: 1;

    padding: 16px 12px;

    border: none;
    background: #F1F2ED;

    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;

    color: var(--red);
    cursor: pointer;
    white-space: nowrap;

    transition:
        color 0.3s ease,
        transform 0.3s ease,
        text-shadow 0.3s ease;
}


/* HOVER ANIMATION */

.tab-button:hover {
    color: var(--red);
}


/* ACTIVE TAB */

.tab-button.active {
    color: var(--red);
    font-weight: 600;

    text-shadow: 0 0 8px rgba(180, 51, 31, 0.2);
}


/* ANIMATED UNDERLINE */

.tab-button::after {
    content: "";

    position: absolute;
    bottom: 0;
    left: 20%;

    width: 60%;
    height: 3px;

    background: var(--red);
    border-radius: 3px 3px 0 0;

    transform: scaleX(0);
    transform-origin: center;

    transition: transform 0.3s ease;
}

.tab-button.active::after {
    transform: scaleX(1);
}


/* KEYBOARD ACCESSIBILITY */

.tab-button:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: -3px;
}


/* =========================================
   TAB CONTENT
========================================= */

.tab-content {
    width: 100%;

    flex: 1 1 0;
    min-height: 0;

    background-color: #E8DFCE;

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: var(--red) transparent;
}


/* TAB PANELS */

.tab-panel {
    display: none;
    padding: 25px;
}

.tab-panel.active {
    display: block;
}


/* PANEL HEADINGS */

.tab-panel h2 {
    margin-top: 0;

    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--red);
}


/* =========================================================
   PROFILE AVATAR — CAPTAIN'S QUARTERS TRIGGER
========================================================= */

.profile-avatar {
    padding: 0;
    margin: 0;

    display: block;

    background: none;
    border: 5px solid var(--white);

    cursor: pointer;
    overflow: hidden;

    /* Preserve existing avatar dimensions */
    border-radius: inherit;

    transition:
        filter 0.25s ease,
        transform 0.25s ease;
}

.profile-avatar img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.3s ease;
}

.profile-avatar:hover {
    filter: brightness(1.1);
}

.profile-avatar:hover img {
    transform: scale(1.04);
}

.profile-avatar:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 4px;
}


/* =========================================================
   CAPTAIN'S QUARTERS — MODAL
========================================================= */

.captain-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.captain-modal[hidden] {
    display: none;
}

.captain-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(25, 23, 20, 0.75);
}

.captain-modal-window {
    position: relative;

    width: min(440px, 100%);
    max-height: 85vh;
    overflow-y: auto;

    padding: 35px 30px;

    background: #E8DFCE;
    border: 1px solid rgba(180, 51, 31, 0.6);

    outline: 1px solid rgba(199, 151, 79, 0.5);
    outline-offset: 5px;

    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.captain-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;

    background: none;
    border: none;

    color: #B4331F;
    font-size: 18px;

    cursor: pointer;
    z-index: 2;
}


/* =========================================================
   CAPTAIN'S QUARTERS — LOGIN FORM
========================================================= */

.captain-login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.captain-login-form h3 {
    margin: 0;

    color: #B4331F;
    font-family: var(--font-heading);
    text-align: center;
}

.captain-login-form > p {
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.captain-login-form input {
    width: 100%;
    box-sizing: border-box;
}

.captain-login-form button[type="submit"] {
    cursor: pointer;
}


/* =========================================================
   CAPTAIN'S QUARTERS — DASHBOARD
========================================================= */

.captain-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.captain-dashboard-header h3 {
    margin-top: 0;

    color: var(--red);
    font-family: var(--font-heading);
}

.captain-dashboard-header p {
    font-size: 11px;
}




/* =========================================================
   RESPONSIVE LAYOUT — THE DAWNBREAKER FLEET
========================================================= */


/* =========================================================
   1. DESKTOP — ORIGINAL LAYOUT
========================================================= */

@media (min-width: 1024px) {

    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .site-container {
        position: absolute;
        top: 1vh;
        left: 5vw;

        width: min(700px, 92vw);
        height: 90vh;

        margin: 0;
        overflow: hidden;
    }

    .profile-wrapper,
    .site-interface {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }

    .tab-content {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
}


/* =========================================================
   2. TABLET LANDSCAPE — COMPACT DESKTOP
========================================================= */

@media (min-width: 1024px) and (max-height: 800px) {

    .site-container {
        position: absolute;
        top: 20px;
        left: 5vw;

        width: min(620px, 90vw);
        height: calc(100svh - 40px);

        margin: 0;
        overflow: hidden;
    }

    /* MUSIC PLAYER */

    .music-player {
        left: 300%;
        right: auto;
    }

    /* ELEONORE */

    .eleonore-sticker-01 {
        left: 45%;
    }
}


/* =========================================================
   3. TABLET PORTRAIT + MOBILE
   FULL PAGE SCROLLING
========================================================= */

@media
(max-width: 767px),
(min-width: 768px) and (max-width: 1023px) and (orientation: portrait),
(max-width: 900px) and (max-height: 450px) and (orientation: landscape) {

    /* PAGE SCROLLING */

    html,
    body {
        width: 100%;
        height: auto;
        min-height: 100%;

        overflow-x: hidden;
        overflow-y: auto;
    }


    /* SITE CONTAINER */

    .site-container {
        position: relative;

        top: auto;
        right: auto;
        bottom: auto;
        left: auto;

        width: min(700px, calc(100% - 24px));
        height: auto;
        min-height: 0;

        margin: 10px auto 0;

        display: flex;
        flex-direction: column;

        overflow: visible;
        box-sizing: border-box;
    }


    /* NATURAL CONTENT HEIGHT */

    .profile-wrapper,
    .site-interface {
        flex: 0 0 auto;

        width: 100%;
        min-height: 0;

        overflow: visible;
        box-sizing: border-box;
    }

    .tab-content {
        flex: 0 0 auto;

        width: 100%;
        min-height: 0;

        overflow: visible;
        box-sizing: border-box;
    }


    /* HIDE ORNAMENTAL DECORATIONS */

    .site-corner,
    .bookmark,
    .sword-decoration,
    .site-decoration,
    .eleonore-sticker-01 {
        display: none;
    }


    /* DISCLAIMER */

    .site-disclaimer {
        position: relative;

        top: auto;
        right: auto;
        bottom: auto;
        left: auto;

        width: fit-content;
        min-width: 0;
        max-width: calc(100% - 30px);

        margin: 20px auto 12px;
        padding: 9px 20px;

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 12px;
        text-align: center;

        box-sizing: border-box;
    }

    .site-disclaimer:hover {
        padding-right: 24px;
    }
}


/* =========================================================
   4. TABLET PORTRAIT + MOBILE
   MINIMAL MUSIC PLAYER
========================================================= */

@media
(max-width: 767px),
(min-width: 768px) and (max-width: 1023px) and (orientation: portrait),
(max-width: 900px) and (max-height: 450px) and (orientation: landscape) {

    .music-player {
        position: relative !important;

        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        width: 27px !important;
        height: 27px !important;

        margin: 30px auto 30px !important;
        padding: 0;

        display: block;

        background: transparent !important;
        border: none !important;
        border-radius: 0;

        box-shadow: none !important;
        backdrop-filter: none;

        overflow: visible;
    }

    /* HIDE PLAYER DETAILS */

    .music-artwork,
    .music-info,
    .music-progress-container {
        display: none !important;
    }

    /* CONTROLS */

    .music-controls {
        position: static;

        width: 27px;
        height: 27px;

        display: block;
    }

    /* PLAY BUTTON */

    #music-toggle {
        width: 50px !important;
        height: 50px !important;

        flex-shrink: 0;

        display: grid;
        place-items: center;

        padding: 0;

        background: var(--red);
        color: var(--white);

        border: 1px solid var(--yellow);
        border-radius: 50%;

        cursor: pointer;
        transition: background 0.2s ease;

        box-sizing: border-box;
    }

    #music-toggle i {
        font-size: 20px !important;
    }

    #music-toggle:hover {
        background: var(--yellow);
        color: var(--red);
    }
}


/* =========================================================
   5. PHONE PORTRAIT — TYPOGRAPHY
========================================================= */

@media (max-width: 767px) and (orientation: portrait) {

    .profile-identity h1 {
        font-size: 21px;
    }
}


/* =========================================================
   6. TABLET — CREDITS WINDOW
========================================================= */

@media (min-width: 768px) and (max-width: 1023px) {

    .credits-window {
        width: min(480px, 85vw);
    }
}


/* =========================================================
   7. PHONE — CREDITS WINDOW
========================================================= */

@media (max-width: 767px) {

    .credits-overlay {
        padding: 15px;
    }

    .credits-window {
        width: 100%;
        max-width: 480px;
        max-height: 85dvh;

        padding: 24px 18px;

        overflow-y: auto;
        box-sizing: border-box;
    }

    .credits-window h2 {
        font-size: 17px;
    }
}


/* =========================================================
   8. CAPTAIN'S MODAL — PHONE
========================================================= */

@media (max-width: 480px) {

    .captain-modal-window {
        padding: 30px 20px;
    }

    .captain-dashboard-header {
        flex-direction: column;
    }
}
