/* Shared visual override for legacy mockups.
   Keeps page structure intact while matching homepage-phosphor-copy.html. */

:root {
    --bg-main: #E3D0B8;
    --dot-color: #BFA88E;
    --card-bg: #F6E5CC;
    --surface-raised: #FFF1DC;
    --surface-soft: #EAD5B7;
    --surface-muted: #D7BE9F;
    --surface-inset: #DFC7AA;
    --text-primary: #37352F;
    --text-bold: #27251F;
    --text-writing: #42382E;
    --text-muted: #6F6A60;
    --border: #34392A;
    --border-soft: rgba(55, 53, 47, 0.24);
    --lime: #C9F24A;
    --lime-hover: #DDF976;
    --lime-shadow: #A7C93B;
    --green: #4A7C59;
    --green-hover: #3D684A;
    --green-shadow: #34583F;
    --red: #C45C4A;
    --red-hover: #A84D3D;
    --red-shadow: #8E4034;
    --blue: #5A7FA8;
    --blue-hover: #4A6B8F;
    --blue-shadow: #3D5F80;
    --disabled-bg: #D4BEA0;
    --disabled-text: #68705D;
    --shadow-offset: #C4B7A4;
    --line-outer: 2px;
    --line-inner: 1.5px;
    --shadow: 4px 4px 0 var(--shadow-offset);
    --radius-control: 8px;
    --radius-card: 12px;
    --radius-panel: 14px;
    --control-sm: 32px;
    --control-md: 40px;
    --control-lg: 48px;
    --icon-sm: 16px;
    --icon-md: 18px;
    --icon-lg: 22px;
}

body {
    color: var(--text-primary);
    background-color: var(--bg-main);
    background-image: radial-gradient(var(--dot-color) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    letter-spacing: 0;
}

.internal-fantasy-body {
    position: relative;
    overflow-x: hidden;
    color: #FFFDF8;
    background-color: #10251D !important;
    background-image: none !important;
}

.internal-fantasy-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 34%, rgba(255, 253, 248, 0.14), transparent 28%),
        linear-gradient(90deg, rgba(5, 17, 14, 0.72) 0%, rgba(5, 17, 14, 0.44) 42%, rgba(5, 17, 14, 0.22) 78%, rgba(5, 17, 14, 0.14) 100%),
        linear-gradient(180deg, rgba(5, 17, 14, 0.08) 0%, rgba(5, 17, 14, 0.42) 100%);
}

.fantasy-background-rotator {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #10251D url("../public-home-background.png") center center / cover no-repeat;
}

.fantasy-background-rotator span {
    position: absolute;
    inset: 0;
    opacity: 0;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    animation-duration: 75s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    transform: scale(1.02);
    will-change: opacity;
}

.fantasy-background-rotator span:nth-child(1) {
    background-image: url("../public-home-background.png");
    animation-name: fantasyBackgroundOne;
}

.fantasy-background-rotator span:nth-child(2) {
    background-image: url("../public-home-background-2.png");
    animation-name: fantasyBackgroundTwo;
}

.fantasy-background-rotator span:nth-child(3) {
    background-image: url("../public-home-background-3.png");
    animation-name: fantasyBackgroundThree;
}

.fantasy-background-rotator span:nth-child(4) {
    background-image: url("../public-home-background-4.png");
    animation-name: fantasyBackgroundFour;
}

.fantasy-background-rotator span:nth-child(5) {
    background-image: url("../public-home-background-5.png");
    animation-name: fantasyBackgroundFive;
}

@keyframes fantasyBackgroundOne {
    0%,
    16% {
        opacity: 1;
    }

    24%,
    92% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes fantasyBackgroundTwo {
    0%,
    16% {
        opacity: 0;
    }

    24%,
    36% {
        opacity: 1;
    }

    44%,
    100% {
        opacity: 0;
    }
}

@keyframes fantasyBackgroundThree {
    0%,
    36% {
        opacity: 0;
    }

    44%,
    56% {
        opacity: 1;
    }

    64%,
    100% {
        opacity: 0;
    }
}

@keyframes fantasyBackgroundFour {
    0%,
    56% {
        opacity: 0;
    }

    64%,
    76% {
        opacity: 1;
    }

    84%,
    100% {
        opacity: 0;
    }
}

@keyframes fantasyBackgroundFive {
    0%,
    76% {
        opacity: 0;
    }

    84%,
    92% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fantasy-background-rotator span {
        animation: none;
    }

    .fantasy-background-rotator span:first-child {
        opacity: 1;
    }
}

.internal-fantasy-body .container,
.internal-fantasy-body .page-container,
.internal-fantasy-body .library-shell {
    position: relative;
    z-index: 2;
}

.internal-fantasy-body .logo-heading img,
.internal-fantasy-body .library-brand img {
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.46));
}

.internal-fantasy-body .page-title,
.internal-fantasy-body .library-title,
.internal-fantasy-body .subtitle,
.internal-fantasy-body .page-subtitle,
.internal-fantasy-body .library-note {
    color: #FFFDF8;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.5);
}

.internal-fantasy-body .card,
.internal-fantasy-body .data-card,
.internal-fantasy-body .drop-card,
.internal-fantasy-body .library-card,
.internal-fantasy-body .modal,
.internal-fantasy-body .delete-modal-card,
.internal-fantasy-body .select-modal-card {
    color: var(--text-primary);
}

.internal-fantasy-body .home-chip,
.internal-fantasy-body .account-chip {
    color: #FFFDF8;
    background: rgba(9, 20, 17, 0.3);
    border-color: rgba(255, 253, 248, 0.72);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.24);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
}

.internal-fantasy-body .home-chip:hover,
.internal-fantasy-body .account-chip:hover {
    color: #FFFDF8;
    background: rgba(9, 20, 17, 0.44);
}

button,
input,
select,
textarea {
    font: inherit;
}

h1,
h2,
h3,
.header h1 {
    color: var(--text-bold);
    letter-spacing: 0;
}

.label,
.stat-label,
.stat-lbl,
.big-stat-label,
.date-sub,
.date-range,
.progress-labels,
.chart-labels {
    color: var(--text-muted);
    letter-spacing: 0;
}

.card,
.modal,
.loading-card,
.stat-card,
.stat-item,
.big-stat,
.finding-box,
.exercise-card,
.summary-card,
.recommendation-card,
.improvement-card,
.week-chart-container,
.analysis-section,
.report-section,
.source-card,
.prompt-card,
.constraint-card,
.metric-card {
    background: var(--card-bg);
    border: var(--line-outer) solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.card .card,
.modal .card {
    box-shadow: 3px 3px 0 var(--shadow-offset);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--control-md);
    padding: 0 14px;
    border: var(--line-outer) solid var(--border);
    border-radius: var(--radius-control);
    box-shadow: 3px 3px 0 var(--shadow-offset);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
}

.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--shadow-offset);
}

.btn-primary,
.btn-green {
    background: var(--lime);
    color: var(--text-bold);
    box-shadow: 3px 3px 0 var(--lime-shadow);
}

.btn-primary:hover,
.btn-green:hover {
    background: var(--lime-hover);
    box-shadow: 1px 1px 0 var(--lime-shadow);
}

.btn-blue {
    background: var(--blue);
    color: white;
    box-shadow: 3px 3px 0 var(--blue-shadow);
}

.btn-blue:hover {
    box-shadow: 1px 1px 0 var(--blue-shadow);
}

.btn-red {
    background: var(--red);
    color: white;
    box-shadow: 3px 3px 0 var(--red-shadow);
}

.btn-red:hover {
    box-shadow: 1px 1px 0 var(--red-shadow);
}

.btn-outline,
.btn-text {
    background: var(--card-bg);
    color: var(--text-primary);
}

.btn-outline:hover,
.btn-text:hover {
    background: var(--surface-soft);
    border-color: var(--border);
}

.btn-outline-red {
    background: var(--card-bg);
    border-color: var(--red);
    color: var(--red);
    box-shadow: 3px 3px 0 var(--red-shadow);
}

.btn-outline-red:hover {
    box-shadow: 1px 1px 0 var(--red-shadow);
}

.btn-disabled {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    box-shadow: none;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-icon {
    width: var(--icon-md);
    height: var(--icon-md);
    font-size: var(--icon-md);
    line-height: 1;
}

.success-icon,
.check-icon,
.empty-state-icon {
    width: auto;
    height: auto;
    font-size: 22px;
    line-height: 1;
}

.empty-state-icon {
    font-size: 64px;
}

i.btn-icon,
.btn i,
.step-icon i,
.empty-state-icon,
.settings-section-title i,
.success-banner i,
.streak-badge i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-bar {
    background: var(--disabled-bg);
    border: var(--line-inner) solid var(--border);
    border-radius: 999px;
}

.progress-fill {
    background: var(--lime);
    border-radius: 999px;
}

.bar,
.day-bar .bar-fill,
.step-icon {
    border: var(--line-inner) solid var(--border);
}

.bar.active,
.bar-fill,
.step-icon.complete,
.dot {
    background: var(--lime);
}

.spinner {
    border-color: var(--border);
    border-top-color: var(--lime);
}

.modal-overlay {
    background: rgba(37, 41, 31, 0.38);
}

.finding-box::before {
    display: none;
}

.modal-body .warning-box,
.recommendation-item,
.insight-item,
.focus-item,
.growth-item,
.weakness-item,
.strength-item,
.improvement-item,
.prompt-card {
    border: var(--line-outer) solid var(--border);
    border-left: var(--line-outer) solid var(--border);
    border-radius: 12px;
    box-shadow: 3px 3px 0 var(--shadow-offset);
}

.close-btn {
    appearance: none;
    width: var(--control-md);
    height: var(--control-md);
    min-width: var(--control-md);
    min-height: var(--control-md);
    aspect-ratio: 1 / 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    background: var(--card-bg);
    color: var(--text-primary);
    border: var(--line-outer) solid var(--border);
    border-radius: var(--radius-control);
    box-shadow: 2px 2px 0 var(--shadow-offset);
    font-size: 1.3rem;
    line-height: 1;
    opacity: 1;
    text-decoration: none;
    text-align: center;
}

.close-btn:hover {
    opacity: 1;
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--shadow-offset);
}

.close-btn i {
    font-size: var(--icon-md);
    line-height: 1;
}

.icon-btn,
.api-key-toggle {
    appearance: none;
    min-width: var(--control-md);
    min-height: var(--control-md);
    aspect-ratio: 1 / 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: var(--line-outer) solid var(--border);
    border-radius: var(--radius-control);
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 2px 2px 0 var(--shadow-offset);
    opacity: 1;
}

.icon-btn i,
.api-key-toggle i {
    font-size: var(--icon-md);
}

.api-key-toggle {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    right: 6px;
}

.left-panel {
    background-color: var(--bg-main);
    background-image: radial-gradient(var(--dot-color) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    border-right: var(--line-outer) solid var(--border);
}

.right-panel {
    background: var(--card-bg);
}

.writing-area {
    color: var(--text-writing);
    background: transparent;
}

.left-panel::-webkit-scrollbar-thumb,
.writing-area::-webkit-scrollbar-thumb {
    background: var(--border);
}

.success-banner,
.save-indicator,
.streak-badge {
    background: var(--lime);
    color: var(--text-bold);
    border: var(--line-outer) solid var(--border);
    box-shadow: 3px 3px 0 var(--shadow-offset);
}

.toggle {
    border: var(--line-outer) solid var(--border);
    background: var(--disabled-bg);
}

.toggle::after {
    border: var(--line-inner) solid var(--border);
    background: var(--card-bg);
}

.toggle.on {
    background: var(--lime);
}

.app-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
    z-index: 10;
}

.dashboard-header {
    justify-content: flex-end;
}

.home-chip,
.account-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--control-md);
    border: var(--line-outer) solid var(--border);
    border-radius: var(--radius-control);
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 0 12px;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 3px 3px 0 var(--shadow-offset);
}

.home-chip i,
.account-chip i {
    font-size: var(--icon-md);
}

.account-chip {
    cursor: pointer;
}

.home-chip {
    cursor: pointer;
    text-decoration: none;
}

.account-area {
    position: relative;
}

.account-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 220px;
    display: none;
    background: var(--card-bg);
    border: var(--line-outer) solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: 4px 4px 0 var(--shadow-offset);
    padding: 8px;
    z-index: 30;
}

.account-area.open .account-menu {
    display: block;
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-control);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
}

.account-menu-item:hover {
    background: var(--surface-soft);
}

.account-menu-item i {
    font-size: var(--icon-sm);
}

.account-menu-divider {
    height: var(--line-inner);
    background: var(--border-soft);
    margin: 6px 0;
}

@media (max-width: 640px) {
    .app-header {
        margin-bottom: 24px;
    }

    .home-chip span,
    .account-chip span {
        display: none;
    }

    .account-menu {
        right: 0;
        width: 205px;
    }
}

/* Logged-in home/main screen sizing. */
.app-header + h1 {
    font-size: 2.5rem;
    line-height: 1.05;
    font-weight: 800;
}

.app-header ~ .subtitle {
    margin-top: 8px;
    margin-bottom: 32px;
}

.app-header ~ .card {
    border-radius: var(--radius-card);
    padding: 20px;
    margin-bottom: 24px;
}

.app-header ~ .card .stats-grid {
    margin-bottom: 16px;
}

.app-header ~ .card .stat-value {
    font-size: 2rem;
    line-height: 1;
}

.app-header ~ .card .stat-label {
    font-size: 0.75rem;
    margin-top: 4px;
}

.app-header ~ .card .progress-bar {
    height: 10px;
    padding: 0;
    overflow: hidden;
}

.app-header ~ .card .progress-fill {
    height: 100%;
    min-height: 100%;
    border-right: var(--line-inner) solid var(--border);
}

.app-header ~ .btn-primary {
    min-height: 52px;
    padding: 0 22px;
    margin-bottom: 16px;
}

.app-header ~ .btn-row {
    gap: 12px;
    margin-bottom: 32px;
}

.dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-header ~ .btn-row .btn {
    min-height: 44px;
    padding: 0 16px;
}

.app-header ~ .card .toggle-row {
    min-height: 64px;
    padding: 12px 0;
    border-bottom: var(--line-inner) solid var(--border-soft);
}

.app-header ~ .card .toggle-row:last-child {
    border-bottom: none;
}

.exercise-list-card .toggle-row,
.app-header ~ .exercise-list-card .toggle-row {
    min-height: 56px;
    padding: 10px 0;
}

.exercise-list-card .toggle-label small {
    line-height: 1.35;
}

.exercise-list-card .label {
    margin-bottom: 6px;
}

.exercise-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.exercise-settings-btn {
    appearance: none;
    width: var(--control-sm);
    height: var(--control-sm);
    min-width: var(--control-sm);
    min-height: var(--control-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: var(--line-outer) solid var(--border);
    border-radius: var(--radius-control);
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 2px 2px 0 var(--shadow-offset);
    cursor: pointer;
}

.exercise-settings-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--shadow-offset);
}

.exercise-settings-btn i {
    font-size: var(--icon-sm);
}

.toggle-row.locked {
    color: var(--text-muted);
    cursor: not-allowed;
}

.toggle-row.locked .toggle-label {
    opacity: 0.52;
    text-decoration: none;
}

.toggle-row.locked .toggle-label small {
    opacity: 1;
}

.locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border: var(--line-outer) solid rgba(52, 57, 42, 0.42);
    border-radius: var(--radius-control);
    background: var(--disabled-bg);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.locked-badge i {
    font-size: var(--icon-sm);
}

.exercise-settings-modal {
    max-width: 560px;
}

.exercise-settings-summary {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 0.9rem;
    line-height: 1.65;
}

.exercise-settings-note {
    margin-top: 14px;
    padding: 12px 14px;
    border: var(--line-inner) dashed rgba(52, 57, 42, 0.45);
    border-radius: var(--radius-control);
    color: var(--text-muted);
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 0.82rem;
    line-height: 1.55;
}

.toggle {
    width: 46px;
    height: 26px;
    min-width: 46px;
    min-height: 26px;
    border-radius: 999px;
    position: relative;
}

.toggle::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border: var(--line-inner) solid var(--border);
    border-radius: 50%;
    background: var(--card-bg);
    transition: transform 0.2s ease;
    box-shadow: none;
}

.toggle.on::after {
    transform: translateX(20px);
}

@media (max-width: 640px) {
    .app-header + h1 {
        font-size: 2.15rem;
    }

    .app-header ~ .card {
        padding: 18px;
    }

    .app-header ~ .card .stats-grid,
    .app-header ~ .btn-row {
        grid-template-columns: 1fr;
    }

    .app-header ~ .card .stat-value {
        font-size: 1.75rem;
    }

    .app-header ~ .btn-row .btn,
    .app-header ~ .btn-primary {
        min-height: 54px;
    }

    .toggle-row {
        gap: 12px;
    }
}
