
:root {
    --black: #080708;
    --panel: #10090e;
    --tile: #21151c;
    --ruby: #e94c7b;
    --pink: #ff8eae;
    --white: #f8edf2;
    --muted: #bcaab3;
    --line: #3b2732;
    --gold: #efbb61;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--black);
    color: var(--white);
    font-family: "Inter", sans-serif;
}

button,
input {
    font: inherit;
}

.profile-page {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(233, 76, 123, 0.07),
            transparent 34%
        ),
        var(--black);
}

/* =====================================
   NAVIGATION
===================================== */

.profile-nav {
    min-height: 78px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
}

.logo {
    color: var(--white);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.07em;
}

.logo span {
    color: var(--pink);
}

.profile-nav nav {
    display: flex;
    gap: 30px;
}

.profile-nav nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    transition: color 0.2s ease;
}

.profile-nav nav a:hover,
.profile-nav nav a.active {
    color: var(--pink);
}

/* =====================================
   MAIN PROFILE
===================================== */

.profile-main {
    width: min(1000px, 92%);
    margin: auto;
    padding: 38px 0 60px;
}

.eyebrow {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 24px;
    letter-spacing: -0.02em;
}

.profile-card {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.035);
    border-radius: 22px;
    padding: 28px 20px 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

/* =====================================
   PROFILE HEADER
===================================== */

.profile-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 95px;
    height: 95px;
    flex: 0 0 95px;
    border: 2px solid var(--ruby);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(233, 76, 123, 0.1);
}

.avatar svg {
    width: 38px;
    height: 38px;
    fill: none;
    stroke: var(--pink);
    stroke-width: 1.8;
    stroke-linecap: round;
}

.profile-identity {
    min-width: 0;
    flex: 1;
}

.profile-label {
    color: var(--pink);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}

.profile-top h1 {
    font-size: clamp(24px, 3.2vw, 30px);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.country-line {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

/* =====================================
   XP AND LEVEL
===================================== */

.xp-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 13px;
    color: var(--muted);
    font-size: 12px;
}

.xp-meta span:first-child {
    color: var(--pink);
    font-weight: 700;
}

.xp-track {
    height: 8px;
    background: #3a2731;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 7px;
}

.xp-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--ruby);
    border-radius: inherit;
    transition: width 0.35s ease;
}

.xp-caption {
    color: var(--muted);
    font-size: 12px;
    margin-top: 7px;
}

/* =====================================
   EDIT PROFILE
===================================== */

.profile-actions {
    margin-top: 16px;
    display: flex;
}

.profile-edit-button {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--white);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: 0.2s ease;
}

.profile-edit-button:hover {
    background: var(--tile);
    border-color: var(--ruby);
}

.profile-editor {
    display: none;
    margin-top: 22px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.profile-editor.active {
    display: block;
}

.editor-field {
    margin-bottom: 16px;
}

.editor-field label {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    margin-bottom: 8px;
}

.editor-field input {
    width: 100%;
    max-width: 500px;
    padding: 12px 13px;
    background: #0b080a;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--white);
    outline: none;
}

.editor-field input:focus {
    border-color: var(--ruby);
}

.editor-buttons {
    display: flex;
    gap: 10px;
}

.save-profile,
.cancel-profile {
    padding: 12px 16px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.save-profile {
    border: 1px solid var(--ruby);
    background: var(--ruby);
    color: white;
}

.cancel-profile {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--white);
}

#profileMessage {
    margin-top: 12px;
    color: var(--pink);
    font-size: 11px;
}

/* =====================================
   STATISTICS CARDS
===================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 22px 0 28px;
}

.stat {
    min-width: 0;
    min-height: 112px;
    padding: 16px 12px;
    border-radius: 16px;
    background: var(--tile);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.stat-icon {
    color: var(--pink);
    font-size: 25px;
    line-height: 1;
    margin-bottom: 10px;
}

.stat strong {
    font-size: 19px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.stat small {
    color: var(--muted);
    font-size: 10px;
    margin-top: 8px;
}

/* =====================================
   TODAY'S ROUTE
===================================== */

.today-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
}

.section-label {
    color: var(--pink);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.today-row h2 {
    font-size: 24px;
    margin-top: 7px;
}

.today-note {
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}

.open-stream {
    flex-shrink: 0;
    color: var(--white);
    text-decoration: none;
    border: 1px solid var(--ruby);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    transition: background 0.2s ease;
}

.open-stream span {
    color: var(--pink);
    margin-left: 5px;
}

.open-stream:hover {
    background: rgba(233, 76, 123, 0.12);
}

/* =====================================
   DAILY RESET
===================================== */

.reset {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding: 15px 0 22px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.1em;
}

.reset strong {
    color: var(--white);
    letter-spacing: 0;
    font-size: 11px;
}

/* =====================================
   14-DAY JOURNEY
===================================== */

.journey {
    margin-top: 25px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 15px;
}

.section-heading h2 {
    font-size: 17px;
}

.section-heading span {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 0.12em;
}

.journey-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.journey-day {
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px;
    background: rgba(255, 255, 255, 0.015);
    position: relative;
}

.journey-day span {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 0.1em;
}

.journey-day strong {
    display: block;
    font-size: 24px;
    margin-top: 7px;
}

.journey-day.completed {
    border-color: var(--ruby);
    background: rgba(233, 76, 123, 0.08);
}

.journey-day.completed small {
    position: absolute;
    right: 9px;
    bottom: 9px;
    color: var(--pink);
}

.journey-day.current {
    background: var(--ruby);
    border-color: var(--ruby);
}

.journey-day.current span {
    color: white;
}

.journey-day.locked {
    opacity: 0.42;
}

/* =====================================
   ACHIEVEMENTS AND STATISTICS
===================================== */

.journey-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 22px;
}

.journey-card {
    display: block;
    padding: 18px 15px;
    border-radius: 15px;
    background: var(--tile);
    text-decoration: none;
    color: var(--white);
    transition: transform 0.2s ease, background 0.2s ease;
}

.journey-card:hover {
    transform: translateY(-2px);
    background: #2a1a23;
}

.journey-card-icon {
    display: block;
    color: var(--gold);
    font-size: 24px;
    margin-bottom: 12px;
}

.journey-card h3 {
    font-size: 16px;
}

.journey-card p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 10px;
}

/* =====================================
   LOGOUT AND FOOTER
===================================== */

.logout-button {
    margin-top: 22px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    cursor: pointer;
}

.logout-button:hover {
    color: var(--white);
}

.page-footnote {
    color: #806d77;
    font-size: 11px;
    margin: 16px 4px 0;
}

/* =====================================
   MOBILE RESPONSIVE
===================================== */

@media (max-width: 700px) {
    .profile-nav {
        min-height: 72px;
        padding: 0 4%;
    }

    .profile-nav nav {
        display: none;
    }

    .profile-main {
        width: 92%;
        padding: 28px 0 40px;
    }

    .eyebrow {
        font-size: 15px;
        margin-bottom: 18px;
    }

    .profile-card {
        padding: 20px 14px;
        border-radius: 17px;
    }

    .profile-top {
        align-items: flex-start;
        gap: 13px;
    }

    .avatar {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
    }

    .avatar svg {
        width: 30px;
        height: 30px;
    }

    .profile-label {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .profile-top h1 {
        font-size: 23px;
    }

    .country-line {
        font-size: 11px;
    }

    .xp-meta {
        font-size: 10px;
        gap: 5px;
    }

    .stats {
        gap: 7px;
        margin: 18px 0 23px;
    }

    .stat {
        min-height: 100px;
        padding: 12px 5px;
        border-radius: 12px;
    }

    .stat strong {
        font-size: 15px;
    }

    .stat small {
        font-size: 8px;
    }

    .stat-icon {
        font-size: 21px;
    }

    .today-row {
        align-items: flex-start;
    }

    .today-row h2 {
        font-size: 21px;
    }

    .open-stream {
        padding: 11px 9px;
        font-size: 9px;
    }

    .journey-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .journey-day {
        min-height: 62px;
        padding: 8px;
    }

    .journey-day strong {
        font-size: 21px;
    }

    .journey-cards {
        gap: 8px;
    }

    .journey-card {
        padding: 14px 11px;
    }

    .journey-card h3 {
        font-size: 14px;
    }

    .journey-card p {
        font-size: 10px;
        line-height: 1.45;
    }
}

@media (max-width: 390px) {
    .profile-top {
        gap: 10px;
    }

    .avatar {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .profile-top h1 {
        font-size: 20px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .stat {
        min-height: 84px;
    }

    .today-row {
        flex-direction: column;
    }

    .open-stream {
        width: 100%;
        text-align: center;
    }

    .reset {
        flex-direction: column;
    }

    .journey-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .journey-cards {
        grid-template-columns: 1fr;
    }

    .editor-buttons {
        flex-direction: column;
    }

    .save-profile,
    .cancel-profile {
        width: 100%;
    }
}
