
:root {
    --background: #21150f;
    --background-light: #2d1d14;
    --panel: rgba(57, 37, 25, 0.94);
    --panel-light: #49301f;

    --gold: #d6ad62;
    --gold-light: #f3d99d;
    --gold-dark: #94703a;

    --cream: #f1e6d3;
    --muted: #aa9881;

    --border: rgba(214, 173, 98, 0.22);

    --serif: 'Cormorant Garamond', serif;
    --sans: 'DM Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: #120c08;
    min-height: 100%;
}

body {
    font-family: var(--sans);
    background: #120c08;
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
}

button,
input,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#app {
    position: relative;
    width: 100%;
    max-width: 430px;
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--background);
    overflow: hidden;
    isolation: isolate;
    border-left: 1px solid rgba(214, 173, 98, 0.12);
    border-right: 1px solid rgba(214, 173, 98, 0.12);
}

/* WEBGL BACKGROUND */

#background3D {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 430px);
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

/* HEADER */

.app-header {
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 19px;
    background: rgba(33, 21, 15, 0.93);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-emblem {
    width: 43px;
    height: 43px;
    border: 1px solid var(--gold);
    color: var(--gold-light);
    display: grid;
    place-items: center;
    font-family: var(--serif);
    font-size: 30px;
    border-radius: 50%;
}

.brand h1 {
    font-family: var(--serif);
    font-size: 20px;
    letter-spacing: 2px;
    color: var(--gold-light);
}

.brand span {
    font-size: 8px;
    letter-spacing: 3px;
    color: var(--muted);
}

.header-date {
    font-size: 10px;
    color: var(--gold);
    letter-spacing: 1px;
}

/* MAIN */

#mainContent {
    padding: 23px 15px 105px;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
    animation: pageIn 0.35s ease;
}

.page.active {
    display: block;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HEADINGS */

.page-heading {
    margin-bottom: 23px;
}

.eyebrow {
    font-size: 9px;
    color: var(--gold);
    letter-spacing: 2px;
    font-weight: 600;
}

.page-heading h2 {
    font-family: var(--serif);
    font-size: 39px;
    font-weight: 500;
    color: var(--gold-light);
    margin-top: 3px;
}

.page-heading p {
    font-size: 12px;
    color: var(--muted);
}

/* STATS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.stat-card {
    min-width: 0;
    background: linear-gradient(145deg, #46301f, #2d1c13);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1.3px;
}

.stat-card strong {
    display: block;
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 600;
    color: var(--gold-light);
    margin: 5px 0;
    overflow-wrap: anywhere;
}

.stat-card small {
    font-size: 10px;
    color: var(--muted);
}

/* PANELS */

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 17px;
    margin-bottom: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(8px);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 17px;
}

.section-title h3 {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 500;
    color: var(--cream);
}

.panel-number {
    color: var(--gold);
    font-family: var(--serif);
    font-size: 24px;
}

.gold-dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 12px var(--gold);
}

/* FORMS */

label {
    display: block;
    color: var(--gold-light);
    font-size: 11px;
    margin: 14px 0 7px;
}

input,
select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 45px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: #251810;
    color: var(--cream);
    font-size: 13px;
    color-scheme: dark;
}

input:focus,
select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(214, 173, 98, 0.1);
}

input::placeholder {
    color: #887660;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* BUTTONS */

.gold-button {
    width: 100%;
    min-height: 48px;
    margin-top: 20px;
    border: none;
    border-radius: 8px;
    color: #24170d;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.5px;
    background: linear-gradient(
        110deg,
        #a77c39,
        #f1d493,
        #c49a52
    );
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, filter 0.2s;
}

.gold-button:active {
    transform: scale(0.97);
}

.gold-button:hover {
    filter: brightness(1.1);
}

.outline-button {
    width: 100%;
    min-height: 43px;
    margin-top: 15px;
    background: transparent;
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    color: var(--gold-light);
    font-size: 10px;
    letter-spacing: 1px;
}

/* CHARTS */

.chart-container {
    position: relative;
    height: 205px;
    width: 100%;
}

.chart-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
    margin-top: 10px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
}

.chart-note {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
    margin-top: 12px;
}

/* INTENSITY */

.intensity-content {
    height: 165px;
    position: relative;
    display: grid;
    place-items: center;
}

#intensity3D {
    position: absolute;
    width: 100%;
    height: 165px;
    inset: 0;
}

.intensity-info {
    text-align: center;
    pointer-events: none;
    z-index: 1;
}

.intensity-info strong {
    display: block;
    font-family: var(--serif);
    font-size: 43px;
    color: var(--gold-light);
}

.intensity-info span {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--gold);
}

.intensity-info small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-top: 5px;
}

/* ACTIVITY GOAL */

.goal-visual {
    position: relative;
    height: 220px;
    display: grid;
    place-items: center;
}

#goal3D {
    position: absolute;
    width: 100%;
    height: 220px;
    inset: 0;
}

.goal-center {
    z-index: 1;
    pointer-events: none;
    text-align: center;
}

.goal-center strong {
    display: block;
    font-family: var(--serif);
    font-size: 39px;
    color: var(--gold-light);
}

.goal-center span {
    display: block;
    color: var(--gold);
    font-size: 10px;
    letter-spacing: 2px;
}

.goal-center small {
    display: block;
    color: var(--cream);
    margin-top: 8px;
    font-size: 12px;
}

.goal-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--muted);
}

.goal-footer strong {
    color: var(--gold-light);
}

.progress-track {
    width: 100%;
    height: 6px;
    background: #21150f;
    border-radius: 10px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #98703b, #f4d38b);
    border-radius: 10px;
    transition: width 0.5s;
}

/* RECENT LIST */

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.14);
    border-left: 2px solid var(--gold-dark);
    border-radius: 5px;
}

.recent-item strong {
    display: block;
    font-size: 13px;
    color: var(--gold-light);
}

.recent-item small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
    font-size: 10px;
}

/* TIMELINE */

.timeline {
    position: relative;
    padding-left: 22px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: 1px;
    background: linear-gradient(
        to bottom,
        var(--gold),
        rgba(214, 173, 98, 0.05)
    );
}

.timeline-item {
    position: relative;
    margin-bottom: 22px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 10px var(--gold);
}

.timeline-date {
    font-size: 9px;
    color: var(--gold);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.timeline-content {
    padding: 12px;
    background: #302015;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.timeline-content strong {
    font-family: var(--serif);
    font-size: 20px;
    color: var(--gold-light);
}

.timeline-content p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
    line-height: 1.6;
}

.delete-entry {
    border: none;
    background: transparent;
    color: #d68e74;
    font-size: 10px;
    margin-top: 10px;
    padding: 5px 0;
}

/* EMPTY */

.empty-message {
    font-size: 12px;
    color: var(--muted);
    padding: 15px 0;
    text-align: center;
}

/* NAVIGATION */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 430px);
    height: 76px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(30, 19, 13, 0.98);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    color: var(--muted);
}

.nav-icon {
    font-size: 23px;
    line-height: 1;
}

.nav-button small {
    font-size: 9px;
}

.nav-button.active {
    color: var(--gold-light);
}

.nav-button.active .nav-icon {
    text-shadow: 0 0 12px var(--gold);
}

/* TOAST */

.toast {
    position: fixed;
    bottom: 92px;
    left: 50%;
    transform: translate(-50%, 20px);
    width: max-content;
    max-width: calc(100% - 40px);
    padding: 12px 20px;
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    background: #392719;
    color: var(--gold-light);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* SMALL SCREENS */

@media (max-width: 350px) {

    #mainContent {
        padding-left: 10px;
        padding-right: 10px;
    }

    .panel {
        padding: 13px;
    }

    .page-heading h2 {
        font-size: 34px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-card strong {
        font-size: 25px;
    }

}
