:root {
    --bg-space: #050510;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-gold: #d4af37;
    --accent-blue: #4a90e2;
    --error-red: #ff4a4a;

    --glass-bg: rgba(20, 20, 35, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);

    --font-main: 'Outfit', sans-serif;

    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    --radius-md: 12px;
    --radius-lg: 24px;

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-space);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden;
    /* Prevent scrolling, 3D scene handles dragging */
    -webkit-font-smoothing: antialiased;
}

.shared-chart-body {
    min-height: 100vh;
    overflow: hidden;
    background: #050510;
}

.shared-chart-shell {
    position: relative;
    z-index: 5;
    min-height: 100vh;
    padding: 24px;
    pointer-events: none;
}

.shared-chart-topbar {
    pointer-events: auto;
}

.shared-chart-topbar .profile-nav-shell {
    width: auto;
}

.shared-chart-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    pointer-events: auto;
}

.shared-chart-brand,
.shared-chart-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 900;
}

.shared-chart-brand {
    letter-spacing: 0.26em;
}

.shared-chart-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
}

.shared-chart-card {
    position: absolute;
    left: 24px;
    bottom: 24px;
    width: min(420px, calc(100vw - 48px));
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(12, 14, 28, 0.82), rgba(5, 7, 16, 0.72));
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    pointer-events: auto;
}

.shared-chart-kicker {
    color: var(--accent-gold);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.shared-chart-card h1 {
    margin: 8px 0 6px;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.shared-chart-card p {
    margin: 0;
    color: var(--text-secondary);
}

.shared-chart-summary {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.shared-chart-summary span {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-secondary);
}

.shared-chart-summary strong {
    color: var(--accent-gold);
}

.shared-chart-status {
    margin-top: 14px !important;
    color: var(--accent-gold) !important;
    font-weight: 800;
}

.shared-chart-status.error {
    color: var(--error-red) !important;
}

body.ai-reading-active #cosmos-canvas,
body.ai-reading-active .chart-wheel-view {
    opacity: 0;
}

/* 3D Canvas */
#cosmos-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    outline: none;
    transition: opacity 0.3s ease;
}

body.chart-mode-2d #cosmos-canvas {
    opacity: 0;
}

.chart-wheel-view {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 96px 28px 32px;
    background:
        radial-gradient(circle at 50% 12%, rgba(212, 175, 55, 0.1), transparent 26rem),
        #050510;
    overflow: auto;
    pointer-events: auto;
}

.chart-sheet {
    width: min(74vh, 760px, calc(100vw - 48px));
    min-height: min(92vh, 1080px);
    padding: 28px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(16, 14, 22, 0.98), rgba(7, 8, 15, 0.98));
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.55);
}

.chart-sheet-head {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    text-align: center;
}

.chart-sheet-head span {
    color: var(--accent-gold);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 3px;
}

.chart-sheet-head strong {
    color: var(--text-primary);
    font-size: clamp(1.3rem, 2vw, 2rem);
}

.chart-sheet-head small {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

/* UI Overlay */
#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through to canvas by default */
    display: flex;
    flex-direction: column;
    padding: var(--spacing-xl);
}

.app-header {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    box-sizing: border-box;
    max-width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-primary);
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

.logo:hover {
    color: var(--accent-gold);
    opacity: 0.92;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    order: 1;
    margin-left: auto;
}

.header-quick-actions {
    order: 2;
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 42px;
    min-width: 58px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.language-switcher > span {
    display: none;
}

.language-switcher select {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-light);
    font: inherit;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
}

.language-switcher.disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.language-switcher.disabled select {
    cursor: not-allowed;
}

.language-switcher option {
    background: #080b18;
    color: #ffffff;
}

.music-toggle {
    display: grid;
    align-items: center;
    place-items: center;
    gap: 0;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.music-toggle:hover {
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.1);
}

.music-toggle[aria-pressed="false"] {
    color: var(--text-secondary);
}

.music-toggle span:first-child {
    color: var(--accent-gold);
    font-size: 1.05rem;
}

#music-toggle-text {
    display: none;
}

.header-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
    transition: var(--transition-fast);
}

.header-action-link:hover {
    border-color: rgba(212, 175, 55, 0.42);
    background: rgba(212, 175, 55, 0.1);
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    pointer-events: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

/* Form Panel */
#birth-form-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 480px;
}

#birth-form-panel h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.home-discovery {
    position: absolute;
    left: 50%;
    bottom: 28px;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(180px, 0.48fr) minmax(0, 1fr);
    gap: 22px;
    align-items: end;
    width: min(1180px, calc(100vw - 48px));
    transform: translateX(-50%);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
}

.home-discovery.hidden {
    display: grid;
    opacity: 0;
    transform: translateX(-50%) translateY(18px);
    filter: blur(8px);
    pointer-events: none;
}

.home-discovery-copy {
    pointer-events: auto;
}

.home-discovery-copy span,
.home-discovery-heading span {
    color: var(--accent-gold);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.home-discovery-copy h2 {
    max-width: 330px;
    margin: 7px 0 8px;
    font-size: clamp(1.35rem, 2.4vw, 2.1rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.home-discovery-copy p {
    max-width: 310px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.9rem;
    line-height: 1.45;
}

.home-discovery-panel {
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: 14px;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    background:
        radial-gradient(circle at 12% 0%, rgba(212, 175, 55, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(10, 12, 24, 0.68), rgba(5, 7, 17, 0.52));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    pointer-events: auto;
}

.home-discovery-column {
    min-width: 0;
}

.home-discovery-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 4px 10px;
}

.discovery-strip {
    display: flex;
    gap: 10px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.discovery-strip::-webkit-scrollbar {
    display: none;
}

.discovery-member,
.discovery-chart {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-height: 70px;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.045);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.discovery-member {
    width: 186px;
    padding: 12px;
}

.discovery-chart {
    width: 238px;
    padding: 9px 12px 9px 9px;
}

.discovery-member:hover,
.discovery-chart:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.34);
    background: rgba(255, 255, 255, 0.075);
}

.discovery-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.42), transparent 28%),
        linear-gradient(145deg, rgba(212, 175, 55, 0.9), rgba(58, 188, 214, 0.34));
    color: #060712;
    font-size: 0.8rem;
    font-weight: 900;
}

.discovery-member strong,
.discovery-chart strong {
    display: block;
    max-width: 128px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.92rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discovery-member small,
.discovery-chart small {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discovery-chart-preview {
    display: grid;
    place-items: center;
    flex: 0 0 74px;
    width: 74px;
    height: 52px;
    overflow: hidden;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 45%, rgba(212, 175, 55, 0.32), rgba(16, 24, 42, 0.74) 58%, rgba(255, 255, 255, 0.04));
}

.discovery-chart-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discovery-chart-orb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 239, 177, 0.95), rgba(212, 175, 55, 0.35) 45%, transparent 68%);
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.42);
}

.discovery-empty,
.discovery-loading {
    display: inline-flex;
    align-items: center;
    min-height: 70px;
    padding: 0 16px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.86rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-xl);
}

.input-group {
    margin-bottom: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.input-row {
    display: flex;
    gap: var(--spacing-md);
}

.input-row .input-group {
    flex: 1;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition-fast);
}

input:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: rgba(0, 0, 0, 0.4);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.city-autocomplete {
    position: relative;
}

.city-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 90;
    max-height: 260px;
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(212, 175, 55, 0.26);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(8, 10, 18, 0.96), rgba(18, 24, 38, 0.92));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), 0 0 32px rgba(212, 175, 55, 0.12);
    backdrop-filter: blur(18px);
}

.city-suggestion {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.city-suggestion:hover,
.city-suggestion:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, 0.32);
    background: rgba(212, 175, 55, 0.1);
}

.city-suggestion strong {
    font-size: 0.95rem;
    color: #fff;
}

.city-suggestion span {
    color: var(--accent-gold);
    font-size: 0.82rem;
    font-weight: 700;
}

.city-suggestion small {
    grid-column: 1 / -1;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.72rem;
}

.city-suggestion-empty {
    padding: 13px 14px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.84rem;
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-gold), #b89020);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 1rem;
    font-weight: 800;
    font-family: var(--font-main);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--spacing-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-main);
    transition: var(--transition-fast);
    margin-bottom: var(--spacing-lg);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    color: var(--error-red);
    font-size: 0.85rem;
    margin-top: var(--spacing-md);
    text-align: center;
    min-height: 20px;
}

/* Data Panel */
#chart-data-panel {
    position: absolute;
    inset: 0;
    transform: none;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
}

#chart-data-panel.panels-collapsed {
    width: auto;
    min-width: 0;
}

/* Custom Scrollbar for Panel */
#chart-data-panel::-webkit-scrollbar {
    width: 6px;
}

#chart-data-panel::-webkit-scrollbar-track {
    background: transparent;
}

#chart-data-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.result-dock {
    position: absolute;
    top: 50%;
    right: var(--spacing-xl);
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    pointer-events: auto;
}

.chart-info-panel {
    position: absolute;
    top: 50%;
    left: clamp(16px, 2.4vw, 34px);
    z-index: 3;
    width: min(340px, calc(100vw - 150px));
    max-height: min(76vh, 640px);
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 26px;
    background:
        radial-gradient(circle at 0 0, rgba(212, 175, 55, 0.13), transparent 34%),
        linear-gradient(145deg, rgba(8, 10, 18, 0.78), rgba(16, 20, 34, 0.58));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    pointer-events: auto;
    transform: translateY(-50%);
    transition: opacity 0.24s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.24s ease;
}

.chart-info-panel .panel-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.chart-info-panel .panel-section-head h2 {
    font-size: clamp(1.2rem, 1.7vw, 1.65rem);
    line-height: 1.05;
}

.chart-info-panel .panel-section-body {
    display: grid;
    gap: 14px;
}

.chart-info-close {
    flex: 0 0 auto;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.chart-info-close:hover {
    transform: scale(1.06);
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(212, 175, 55, 0.12);
    color: #fff;
}

.chart-info-mobile-toggle {
    position: absolute;
    top: 50%;
    left: clamp(16px, 2.4vw, 34px);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 15px 0 11px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 999px;
    background: rgba(12, 13, 24, 0.72);
    color: #fff;
    font-family: var(--font-main);
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(-50%) translateX(-10px) scale(0.92);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.18s ease, background 0.18s ease;
}

.chart-info-mobile-toggle span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), #b89020);
    color: #000;
    font-weight: 900;
}

#chart-data-panel.info-collapsed .chart-info-panel {
    opacity: 0;
    pointer-events: none;
    filter: blur(8px);
    transform: translateY(-50%) translateX(-24px) scale(0.96);
}

#chart-data-panel.info-collapsed .chart-info-mobile-toggle {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0) scale(1);
}

.result-back {
    margin-bottom: 0;
}

.result-dock-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.dock-tool-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.dock-group-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.result-dock-btn,
.panel-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-fast);
}

.result-dock-btn {
    width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 26px rgba(0, 0, 0, 0.22);
    transform-origin: right center;
}

.result-dock-btn:hover,
.panel-collapse:hover {
    border-color: var(--accent-gold);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.08);
}

.result-dock-btn.active {
    color: #000;
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, var(--accent-gold), #b89020);
}

.dock-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    font-size: 1.08rem;
    line-height: 1;
}

.dock-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.dock-tool-menu {
    z-index: 4;
}

.tool-popover {
    position: absolute;
    top: 50%;
    right: calc(100% + 14px);
    transform: translateY(-50%);
    z-index: 10;
    display: grid;
    min-width: 220px;
    max-width: min(360px, calc(100vw - 130px));
    max-height: min(72vh, 620px);
    overflow-y: auto;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 18px;
    background: rgba(12, 13, 24, 0.96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(18px);
    scrollbar-width: none;
    -ms-overflow-style: none;
    animation: dockPopoverIn 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transform-origin: right center;
}

.tool-popover::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

@keyframes dockPopoverIn {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(-50%) translateX(10px) scale(0.94);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(-50%) translateX(0) scale(1);
    }
}

.tool-popover::before {
    content: "";
    position: absolute;
    top: 50%;
    right: -6px;
    width: 10px;
    height: 10px;
    border-right: 1px solid rgba(212, 175, 55, 0.24);
    border-top: 1px solid rgba(212, 175, 55, 0.24);
    background: rgba(12, 13, 24, 0.96);
    transform: translateY(-50%) rotate(45deg);
}

.tool-popover-btn {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-primary);
    font-family: var(--font-main);
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tool-popover-btn:hover {
    border-color: rgba(212, 175, 55, 0.48);
    background: rgba(255, 255, 255, 0.1);
}

.tool-popover-btn span {
    grid-row: 1 / span 2;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.14);
    color: var(--accent-gold);
}

.tool-popover-btn strong {
    font-size: 0.9rem;
}

.tool-popover-btn small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.tool-popover-panel {
    width: min(360px, calc(100vw - 130px));
}

.tool-popover-panel .panel-section-head {
    margin-bottom: var(--spacing-md);
}

.tool-popover-panel .big-three {
    margin-bottom: var(--spacing-lg);
}

.tool-popover-panel.scene-controls {
    padding-top: 12px;
    border-top: 0;
}

.save-status {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    background:
        radial-gradient(circle at 50% 44%, rgba(212, 175, 55, 0.14), transparent 34%),
        rgba(2, 3, 10, 0.58);
    backdrop-filter: blur(12px);
    animation: saveOverlayIn 180ms ease-out both;
    pointer-events: auto;
}

.save-status-card {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    width: min(420px, calc(100vw - 40px));
    padding: 18px 22px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(18, 20, 36, 0.94), rgba(7, 8, 18, 0.92)),
        rgba(10, 11, 22, 0.9);
    box-shadow:
        0 34px 120px rgba(0, 0, 0, 0.58),
        0 0 80px rgba(212, 175, 55, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    animation: saveStatusIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.save-status.done .save-status-card {
    border-color: rgba(90, 255, 160, 0.38);
    box-shadow:
        0 34px 120px rgba(0, 0, 0, 0.58),
        0 0 80px rgba(90, 255, 160, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.save-status.error .save-status-card {
    border-color: rgba(255, 74, 74, 0.45);
    box-shadow:
        0 34px 120px rgba(0, 0, 0, 0.58),
        0 0 80px rgba(255, 74, 74, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.save-status-orbit {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(212, 175, 55, 0.36);
    border-radius: 50%;
    animation: saveOrbit 1.1s linear infinite;
}

.save-status-orbit::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.9);
    transform: translateX(-50%);
}

.save-status.done .save-status-orbit,
.save-status.error .save-status-orbit {
    animation: none;
}

.save-status.done .save-status-orbit::before {
    top: 50%;
    background: #5affa0;
    box-shadow: 0 0 16px rgba(90, 255, 160, 0.9);
    transform: translate(-50%, -50%);
}

.save-status.error .save-status-orbit::before {
    top: 50%;
    background: var(--error-red);
    box-shadow: 0 0 16px rgba(255, 74, 74, 0.9);
    transform: translate(-50%, -50%);
}

.save-status-copy {
    display: grid;
    gap: 3px;
}

.save-status-copy strong {
    color: var(--text-primary);
    font-size: 0.94rem;
    line-height: 1.1;
}

.save-status-copy small {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

@keyframes saveStatusIn {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(18px) scale(0.94);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@keyframes saveOverlayIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(12px);
    }
}

@keyframes saveOrbit {
    to {
        transform: rotate(360deg);
    }
}

@keyframes aiPageIn {
    from {
        opacity: 0;
        transform: scale(1.015);
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
        backdrop-filter: blur(18px);
    }
}

.ai-interpretation-screen {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: block;
    padding: clamp(76px, 8vw, 118px) clamp(18px, 5vw, 72px) clamp(22px, 4vw, 54px);
    overflow: hidden;
    pointer-events: auto;
    background:
        linear-gradient(90deg, rgba(2, 3, 10, 0.94) 0%, rgba(6, 9, 20, 0.82) 52%, rgba(2, 3, 10, 0.94) 100%),
        radial-gradient(circle at 18% 18%, rgba(123, 223, 242, 0.18), transparent 30%),
        radial-gradient(circle at 82% 76%, rgba(212, 175, 55, 0.15), transparent 34%),
        #02030a;
    backdrop-filter: blur(18px);
    animation: aiPageIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ai-starscape {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.48;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.6px),
        radial-gradient(circle, rgba(212, 175, 55, 0.75) 0 1px, transparent 1.8px);
    background-size: 86px 86px, 132px 132px;
    animation: aiStarDrift 18s linear infinite;
}

.ai-interpretation-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1480px, 100%);
    height: 100%;
    max-height: none;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    pointer-events: auto;
}

.ai-reading-back {
    position: fixed;
    top: clamp(18px, 3vw, 34px);
    left: clamp(18px, 4vw, 54px);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(6, 8, 18, 0.76);
    color: var(--text-primary);
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 58px rgba(0, 0, 0, 0.28);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ai-reading-back:hover {
    transform: translateX(-2px);
    border-color: rgba(212, 175, 55, 0.55);
    background: rgba(18, 16, 25, 0.88);
}

.ai-interpretation-loader {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    gap: 22px;
    padding: 24px;
    text-align: center;
}

.ai-oracle {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.26);
    animation: saveOrbit 4.5s linear infinite;
}

.ai-oracle::before {
    content: "";
    position: absolute;
    inset: 34px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.42), rgba(123, 223, 242, 0.1), transparent 70%);
    box-shadow: 0 0 80px rgba(212, 175, 55, 0.25);
}

.ai-oracle span {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f3d977;
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.95);
}

.ai-oracle span:nth-child(1) {
    top: -7px;
    left: 68px;
}

.ai-oracle span:nth-child(2) {
    right: 12px;
    bottom: 24px;
    background: #7bdff2;
}

.ai-oracle span:nth-child(3) {
    left: 12px;
    bottom: 24px;
    width: 10px;
    height: 10px;
}

.ai-interpretation-loader p {
    max-width: 520px;
    margin: 0;
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.28rem);
    line-height: 1.6;
}

.ai-interpretation-result {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: none;
    padding: 0 clamp(4px, 1vw, 12px) 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.42) transparent;
}

.ai-interpretation-head {
    max-width: 760px;
    margin: 0 auto clamp(18px, 3vw, 32px);
    text-align: center;
}

.ai-interpretation-head span {
    color: var(--accent-gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 3px;
}

.ai-interpretation-head h2 {
    margin: 8px 0 10px;
    font-size: clamp(2.4rem, 6.2vw, 6.2rem);
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.ai-interpretation-head p,
.ai-opening-sentences {
    color: var(--text-secondary);
    line-height: 1.65;
}

.ai-opening-sentences {
    display: grid;
    gap: 8px;
    max-width: 760px;
    margin: 0 auto clamp(24px, 4vw, 42px);
    text-align: center;
}

.ai-reading-layout {
    display: grid;
    gap: clamp(20px, 3vw, 42px);
}

.ai-section-cards {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(14px, 1.6vw, 20px);
    align-items: center;
    min-height: min(48vh, 560px);
    perspective: 1100px;
}

.ai-section-cards::before {
    content: "";
    position: absolute;
    inset: 8% 5%;
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 50%;
    transform: rotate(-8deg);
    pointer-events: none;
    box-shadow:
        0 0 0 42px rgba(123, 223, 242, 0.015),
        inset 0 0 80px rgba(212, 175, 55, 0.035);
}

.ai-section-cards::after {
    content: "";
    position: absolute;
    inset: 18% 16%;
    border: 1px dashed rgba(123, 223, 242, 0.12);
    border-radius: 50%;
    transform: rotate(14deg);
    pointer-events: none;
}

.ai-reading-core {
    position: relative;
    z-index: 1;
    grid-column: 5 / span 4;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: center;
    display: grid;
    place-items: center;
    width: clamp(180px, 20vw, 280px);
    height: clamp(180px, 20vw, 280px);
    padding: 28px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(212, 175, 55, 0.14), rgba(123, 223, 242, 0.055) 42%, rgba(2, 3, 10, 0.22) 70%, transparent);
    text-align: center;
    box-shadow: 0 0 90px rgba(212, 175, 55, 0.1), inset 0 0 46px rgba(255, 255, 255, 0.035);
}

.ai-reading-core::before,
.ai-reading-core::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ai-reading-core::before {
    inset: -18px;
    border: 1px solid rgba(123, 223, 242, 0.18);
    animation: saveOrbit 16s linear infinite;
}

.ai-reading-core::after {
    inset: 26px -20px;
    border: 1px solid rgba(212, 175, 55, 0.16);
    transform: rotate(-18deg);
}

.ai-reading-core span,
.ai-reading-core small {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

.ai-reading-core span {
    color: var(--accent-gold);
    font-weight: 800;
    letter-spacing: 0.22em;
}

.ai-reading-core strong {
    display: block;
    max-width: 170px;
    margin: 8px 0;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
}

.ai-section-card {
    position: relative;
    display: flex;
    min-height: 190px;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 999px 30px 30px 999px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018) 44%, rgba(212, 175, 55, 0.045)),
        rgba(7, 10, 22, 0.44);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transform-style: preserve-3d;
    backdrop-filter: blur(12px);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.055);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
}

.ai-section-card:nth-of-type(1) {
    grid-column: 1 / span 4;
    grid-row: 1;
}

.ai-section-card:nth-of-type(2) {
    grid-column: 8 / span 4;
    grid-row: 1;
}

.ai-section-card:nth-of-type(3) {
    grid-column: 2 / span 4;
    grid-row: 2;
}

.ai-section-card:nth-of-type(4) {
    grid-column: 8 / span 4;
    grid-row: 2;
}

.ai-section-card:nth-of-type(5) {
    grid-column: 3 / span 4;
    grid-row: 3;
}

.ai-section-card:nth-of-type(6) {
    grid-column: 7 / span 4;
    grid-row: 3;
}

.ai-section-card:nth-of-type(n + 7) {
    grid-column: span 4;
}

.ai-section-card::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 24px;
    opacity: 0.6;
    pointer-events: none;
}

.ai-section-card::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -44px;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(123, 223, 242, 0.12);
    border-radius: 50%;
    box-shadow: 0 0 0 22px rgba(123, 223, 242, 0.025), 0 0 80px rgba(123, 223, 242, 0.08);
    pointer-events: none;
}

.ai-section-card-glow {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 16%, rgba(212, 175, 55, 0.18), transparent 26%),
        radial-gradient(circle at 78% 72%, rgba(123, 223, 242, 0.13), transparent 30%);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}

.ai-section-card:hover,
.ai-section-card.active {
    transform: translateY(-8px) rotateX(2deg);
    border-color: rgba(212, 175, 55, 0.58);
    background:
        linear-gradient(150deg, rgba(212, 175, 55, 0.14), rgba(255, 255, 255, 0.035) 46%, rgba(123, 223, 242, 0.08)),
        rgba(10, 12, 24, 0.72);
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.38), 0 0 42px rgba(212, 175, 55, 0.1);
}

.ai-section-card:hover .ai-section-card-glow,
.ai-section-card.active .ai-section-card-glow {
    opacity: 1;
    transform: scale(1);
}

.ai-section-card-orbit {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border: 1px solid rgba(212, 175, 55, 0.26);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.14), rgba(123, 223, 242, 0.06), transparent 72%);
}

.ai-section-card-orbit::before,
.ai-section-card-orbit::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(123, 223, 242, 0.16);
    border-radius: 50%;
    pointer-events: none;
}

.ai-section-card-orbit::before {
    inset: -8px;
}

.ai-section-card-orbit::after {
    inset: 13px -9px;
    transform: rotate(-22deg);
}

.ai-section-card-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(8, 13, 25, 0.76);
    color: var(--accent-gold);
    font-size: 1.95rem;
    line-height: 1;
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.45);
}

.ai-section-card-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
}

.ai-section-card-kicker {
    color: var(--accent-gold);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ai-section-card strong {
    display: block;
    max-width: 92%;
    font-size: clamp(1.1rem, 1.8vw, 1.45rem);
    line-height: 1.08;
}

.ai-section-card-copy span:not(.ai-section-card-kicker) {
    display: block;
    color: var(--text-secondary);
    line-height: 1.45;
    font-size: 0.92rem;
}

.ai-section-card-cta {
    position: relative;
    z-index: 1;
    width: fit-content;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ai-section-card.active .ai-section-card-cta {
    border-color: rgba(212, 175, 55, 0.48);
    color: var(--accent-gold);
}

.ai-section-content {
    position: fixed;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: clamp(18px, 4vw, 54px);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: auto;
    pointer-events: auto;
}

.ai-section-content::before {
    display: none;
}

.ai-section-modal-backdrop {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(212, 175, 55, 0.12), transparent 32%),
        rgba(1, 2, 8, 0.58);
    backdrop-filter: blur(16px);
}

.ai-section-modal-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(88px, 132px) minmax(0, 1fr);
    gap: clamp(18px, 3vw, 34px);
    width: min(1040px, calc(100vw - 36px));
    max-height: min(780px, calc(100vh - 72px));
    padding: clamp(24px, 4vw, 50px);
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 38px;
    background:
        radial-gradient(circle at 10% 12%, rgba(212, 175, 55, 0.14), transparent 28%),
        radial-gradient(circle at 82% 78%, rgba(123, 223, 242, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(14, 17, 32, 0.94), rgba(4, 6, 14, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 44px 150px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.ai-section-modal-card::before {
    content: "";
    position: absolute;
    inset: 22px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 28px;
    pointer-events: none;
}

.ai-section-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font: inherit;
    font-size: 1.35rem;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.ai-section-modal-close:hover {
    transform: rotate(90deg);
    border-color: rgba(212, 175, 55, 0.55);
}

.ai-section-content-orb {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    align-self: start;
    width: clamp(88px, 10vw, 132px);
    height: clamp(88px, 10vw, 132px);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.18), rgba(123, 223, 242, 0.06), rgba(255, 255, 255, 0.018) 68%);
    color: var(--accent-gold);
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    text-shadow: 0 0 34px rgba(212, 175, 55, 0.55);
    box-shadow: 0 0 0 18px rgba(212, 175, 55, 0.025), 0 0 80px rgba(212, 175, 55, 0.12);
}

.ai-section-content-orb::after {
    content: "";
    position: absolute;
    inset: -18px;
    border: 1px solid rgba(123, 223, 242, 0.14);
    border-radius: 50%;
    transform: rotate(-20deg) scaleY(0.62);
}

.ai-section-content-copy {
    position: relative;
    z-index: 1;
}

.ai-section-content-kicker {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--accent-gold);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ai-section-content h3 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 4.4vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.ai-section-content p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 1.45vw, 1.2rem);
    line-height: 1.78;
}

.ai-section-content ul {
    display: grid;
    gap: 8px;
    grid-column: 2;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.ai-section-content li {
    position: relative;
    padding: 12px 14px 12px 38px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
}

.ai-section-content li::before {
    content: "✦";
    position: absolute;
    top: 12px;
    left: 14px;
    color: var(--accent-gold);
}

.ai-interpretation-disclaimer {
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.84rem;
    line-height: 1.5;
}

@keyframes aiStarDrift {
    to {
        background-position: 86px 86px, -132px 132px;
    }
}

.panel-section {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.panel-section + .panel-section {
    margin-top: var(--spacing-lg);
}

.panel-section.collapsed {
    display: none;
}

.panel-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--spacing-md);
}

.panel-section-head h2,
.panel-section-head h3 {
    margin: 0;
}

.panel-collapse {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1rem;
}

.section-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.panel-section-head h2 {
    font-size: 1.5rem;
}

.big-three {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.placement {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 13px;
    border: 1px solid rgba(255, 255, 255, 0.045);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 16px;
}

.placement .label {
    font-weight: 600;
    color: var(--accent-gold);
}

.placement .value {
    font-weight: 300;
    text-align: right;
}

.aspects-list h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.aspects-list ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: min(30vh, 230px);
    overflow: auto;
    padding-right: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.aspects-list ul::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.aspects-list li {
    font-size: 0.84rem;
    line-height: 1.35;
    padding: 8px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scene-controls {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
}

.scene-controls-head {
    margin-bottom: var(--spacing-md);
}

.scene-controls-head h3 {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.scene-controls-head button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.scene-controls-head button:hover {
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.1);
}

.scene-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.scene-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.scene-toggle:hover {
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(255, 255, 255, 0.06);
}

.scene-toggle input {
    order: 2;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-gold);
    cursor: pointer;
}

.scene-toggle:has(input:not(:checked)) {
    color: var(--text-secondary);
    opacity: 0.72;
}

.chart-wheel-section {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
}

.chart-wheel {
    width: 100%;
    aspect-ratio: 1;
    margin: 0 auto var(--spacing-md);
}

.natal-wheel-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.wheel-bg {
    fill: rgba(0, 0, 0, 0.28);
    stroke: none;
}

.wheel-ring {
    fill: none;
    stroke: rgba(212, 175, 55, 0.72);
    stroke-width: 1.4;
}

.wheel-ring.faint {
    stroke: rgba(255, 255, 255, 0.18);
}

.wheel-sign-line,
.wheel-house-line,
.wheel-planet-tick {
    stroke: rgba(255, 255, 255, 0.22);
    stroke-width: 1;
}

.wheel-house-line {
    stroke: rgba(212, 175, 55, 0.36);
}

.wheel-axis.asc {
    stroke: var(--accent-gold);
    stroke-width: 2;
}

.wheel-aspect-line {
    stroke-width: 1.1;
    opacity: 0.72;
}

.wheel-aspect-line.soft {
    stroke: #4a90e2;
}

.wheel-aspect-line.hard {
    stroke: #ff4a4a;
}

.wheel-aspect-line.neutral {
    stroke: var(--accent-gold);
}

.wheel-zodiac-glyph {
    fill: var(--accent-gold);
    font-size: 24px;
    font-family: Georgia, 'Times New Roman', serif;
}

.wheel-planet-glyph {
    fill: var(--text-primary);
    font-size: 21px;
    font-family: Georgia, 'Times New Roman', serif;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, 0.55);
    stroke-width: 3px;
}

.wheel-house-number {
    fill: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    font-weight: 700;
}

.wheel-axis-label {
    fill: var(--accent-gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.chart-wheel-summary {
    display: grid;
    gap: 8px;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-wheel-summary div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.chart-wheel-summary span {
    color: var(--accent-gold);
    font-weight: 800;
}

.chart-wheel-summary strong {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.controls-hint {
    margin-top: var(--spacing-xl);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    padding-top: var(--spacing-md);
}

/* Responsive */
@media (max-width: 768px) {
    #ui-layer {
        padding: var(--spacing-lg);
    }

    .app-header {
        align-items: flex-start;
    }

    .header-actions {
        align-items: flex-end;
        flex-direction: column;
    }

    .music-toggle {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.86rem;
    }

    .language-switcher {
        min-height: 38px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    #birth-form-panel {
        width: 90%;
        padding: var(--spacing-lg);
    }

    .home-discovery {
        bottom: 14px;
        grid-template-columns: 1fr;
        gap: 10px;
        width: calc(100vw - 28px);
    }

    .home-discovery-copy {
        display: none;
    }

    .home-discovery-panel {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
        border-radius: 22px;
    }

    .home-discovery-heading {
        margin-bottom: 8px;
    }

    .discovery-member {
        width: 168px;
        min-height: 62px;
    }

    .discovery-chart {
        width: 214px;
        min-height: 62px;
    }

    .discovery-chart-preview {
        width: 62px;
        height: 44px;
        flex-basis: 62px;
    }

    #chart-data-panel {
        inset: 0;
        transform: none;
        width: auto;
        max-height: none;
        padding: 0;
        border-radius: 0;
    }

    #chart-data-panel.panels-collapsed {
        width: auto;
    }

    .result-dock {
        top: 50%;
        right: var(--spacing-md);
        transform: translateY(-50%);
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: 0;
        background: transparent;
        gap: 8px;
    }

    .result-dock-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .dock-tool-group {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .dock-group-title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .result-dock-btn {
        width: 46px;
        height: 46px;
        min-height: 46px;
        padding: 0;
        border-radius: 16px;
    }

    .chart-info-panel {
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 78px;
        width: auto;
        max-height: min(58vh, 520px);
        padding: 16px;
        border-radius: 24px;
        opacity: 0;
        pointer-events: none;
        transform: translateY(24px) scale(0.96);
        transform-origin: bottom center;
        transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    #chart-data-panel.info-open .chart-info-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .chart-info-panel .panel-section-head h2 {
        font-size: 1.22rem;
    }

    .chart-info-mobile-toggle {
        position: absolute;
        left: 14px;
        bottom: 18px;
        top: auto;
        z-index: 4;
        display: inline-flex;
        align-items: center;
        gap: 9px;
        min-height: 46px;
        padding: 0 15px 0 11px;
        border: 1px solid rgba(212, 175, 55, 0.28);
        border-radius: 999px;
        background: rgba(12, 13, 24, 0.72);
        color: #fff;
        font-family: var(--font-main);
        font-weight: 900;
        opacity: 1;
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        pointer-events: auto;
        transform: none;
    }

    .chart-info-mobile-toggle span {
        display: grid;
        width: 24px;
        height: 24px;
        place-items: center;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-gold), #b89020);
        color: #000;
        font-weight: 900;
    }

    .chart-info-mobile-toggle[aria-expanded="true"] {
        border-color: var(--accent-gold);
        background: rgba(22, 18, 8, 0.82);
    }

    .tool-popover {
        position: absolute;
        top: 50%;
        right: calc(100% + 12px);
        bottom: auto;
        left: auto;
        transform: translateY(-50%);
        grid-template-columns: 1fr;
        min-width: 0;
        max-width: none;
        width: calc(100vw - 92px);
        max-height: 72vh;
        padding: 8px;
    }

    .tool-popover::before {
        display: block;
    }

    .tool-popover-btn {
        min-height: 54px;
        padding: 9px;
    }

    .tool-popover-panel {
        width: calc(100vw - 92px);
    }

    .save-status {
        padding: var(--spacing-lg);
    }

    .save-status-card {
        width: min(360px, calc(100vw - 32px));
        padding: 16px 18px;
        border-radius: 22px;
    }

    .ai-interpretation-screen {
        padding: 76px 14px 16px;
    }

    .ai-interpretation-shell,
    .ai-interpretation-result {
        height: 100%;
        max-height: none;
    }

    .ai-reading-back {
        top: 14px;
        left: 14px;
        min-height: 42px;
        padding: 0 14px;
        font-size: 0.9rem;
    }

    .ai-interpretation-head h2 {
        font-size: clamp(2.3rem, 14vw, 4.2rem);
    }

    .ai-reading-layout {
        grid-template-columns: 1fr;
    }

    .ai-section-cards {
        grid-template-columns: 1fr;
        min-height: 0;
        position: static;
    }

    .ai-section-cards::before,
    .ai-section-cards::after {
        display: none;
    }

    .ai-reading-core {
        grid-column: 1;
        grid-row: auto;
        width: min(240px, 70vw);
        height: min(240px, 70vw);
        margin: 0 auto 6px;
    }

    .ai-section-card,
    .ai-section-card:nth-of-type(n) {
        grid-column: 1;
        grid-row: auto;
    }

    .ai-section-content {
        min-height: 0;
        padding: 14px;
    }

    .ai-section-modal-card {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 28px);
        border-radius: 28px;
    }

    .ai-section-content ul,
    .ai-section-modal-card ul {
        grid-column: 1;
    }

    .ai-section-content-orb {
        width: 86px;
        height: 86px;
        font-size: 2.5rem;
    }

    .ai-section-card {
        min-height: 178px;
        border-radius: 26px;
    }

    .dock-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .panel-section {
        margin-top: var(--spacing-md);
        max-height: 52vh;
        overflow-y: auto;
    }

    .scene-toggle-grid {
        grid-template-columns: 1fr;
    }

    .chart-wheel {
        max-width: 320px;
    }

    .chart-wheel-summary div {
        flex-direction: column;
        gap: 3px;
    }

    .chart-wheel-summary strong {
        text-align: left;
    }
}

/* =========================================
   Mystic Loader Overlay
========================================= */
#mystic-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000; /* Solid black base */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    overflow: hidden;
}

.mystic-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 9; /* Force it right below the text */
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 1; /* Full visibility */
}

/* Removed vignette overlay to eliminate any possibility of it hiding the video */

.loader-content {
    position: relative;
    z-index: 10; /* Make sure text and spinner are on top of everything */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xl);
}

.astrolabe-spinner {
    width: 120px;
    height: 120px;
    border: 2px solid transparent;
    border-top: 2px solid var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin-slow 4s linear infinite;
    position: relative;
}

.astrolabe-spinner::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid transparent;
    border-left: 1px solid var(--accent-blue);
    border-right: 1px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin-slow 3s linear infinite reverse;
}

.astrolabe-spinner::after {
    content: '✧';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--accent-gold);
    animation: pulse 2s ease-in-out infinite;
}

.mystic-text {
    font-family: var(--font-main);
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-align: center;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

@keyframes spin-slow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.8);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Ambient Cursor Glow */
#ambient-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    /* Below the glass panels but above canvas */
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* Magic Particles for Mystic Loader */
.magic-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 12px 3px var(--accent-gold);
    pointer-events: none;
    z-index: 101;
}

/* ==========================================================================
   Auth UI Components
   ========================================================================== */

/* Auth Navigation Header */
.auth-nav {
    display: flex;
    gap: 15px;
    min-width: 0;
}

.auth-nav .user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu {
    position: relative;
    min-width: 0;
}

.user-menu .user-profile-btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-height: 50px;
    border-radius: 20px;
    font-family: inherit;
}

.user-menu .user-profile-btn small {
    color: var(--accent-gold);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.user-menu-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 2200;
    display: grid;
    min-width: 220px;
    padding: 10px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(11, 13, 27, 0.98), rgba(5, 7, 16, 0.96)),
        radial-gradient(circle at 100% 0%, rgba(212, 175, 55, 0.16), transparent 42%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: userMenuIn 0.22s ease both;
}

.user-menu-popover a,
.user-menu-popover button {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.user-menu-popover a:hover,
.user-menu-popover button:hover {
    background: rgba(255, 255, 255, 0.07);
}

@keyframes userMenuIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-nav .user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold);
}

.auth-nav .btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.auth-nav .btn-logout:hover {
    color: #ff4d4d;
}

/* Auth Modal Specifics */
.auth-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 10px 0;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    position: relative;
    transition: color 0.3s ease;
}

.auth-tab:hover {
    color: var(--text-light);
}

.auth-tab.active {
    color: var(--accent-gold);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
}

.auth-form.hidden {
    display: none;
}

.form-error {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: none;
    text-align: center;
}

.auth-helper {
    margin: 0 0 15px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.95rem;
    line-height: 1.55;
    text-align: center;
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-light);
}

.full-width {
    width: 100%;
    margin-top: 10px;
}

/* Stabilized video layers and standalone interpretation CTA */
#mystic-loader {
    contain: layout paint;
}

.mystic-bg-video {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: cover;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: opacity;
}

.ai-interpretation-loader {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.ai-loader-bg-video,
.ai-loader-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ai-loader-bg-video {
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    transform: translateZ(0) scale(1.04);
    filter: saturate(1.05) contrast(1.08) brightness(0.72);
}

.ai-loader-vignette {
    z-index: -1;
    background:
        radial-gradient(circle at 50% 46%, rgba(123, 249, 255, 0.12), transparent 22%),
        radial-gradient(circle at 50% 50%, transparent 18%, rgba(2, 3, 10, 0.48) 58%, rgba(2, 3, 10, 0.9) 100%);
}

.ai-interpretation-loader .ai-oracle,
.ai-interpretation-loader p {
    position: relative;
    z-index: 1;
}

.dock-tool-group[data-tool-group="interpret"] {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: clamp(22px, 4vh, 44px);
    z-index: 38;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: auto;
}

#interpret-chart-btn,
#return-interpretation-btn {
    position: relative;
    width: auto;
    min-width: 210px;
    height: 58px;
    min-height: 58px;
    gap: 10px;
    padding: 0 24px;
    border-radius: 999px;
    border-color: rgba(212, 175, 55, 0.42);
    background:
        radial-gradient(circle at 28% 18%, rgba(123, 249, 255, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(212, 175, 55, 0.92), rgba(166, 116, 28, 0.94));
    color: #070710;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 18px 60px rgba(212, 175, 55, 0.22),
        0 0 42px rgba(123, 249, 255, 0.12);
    overflow: visible;
    animation: interpretCtaFloat 4.2s ease-in-out infinite;
}

#return-interpretation-btn {
    min-width: 224px;
    border-color: rgba(123, 249, 255, 0.34);
    background:
        radial-gradient(circle at 28% 18%, rgba(212, 175, 55, 0.14), transparent 34%),
        linear-gradient(135deg, rgba(12, 17, 34, 0.92), rgba(7, 9, 18, 0.94));
    color: #ffffff;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 18px 52px rgba(0, 0, 0, 0.34),
        0 0 34px rgba(123, 249, 255, 0.12);
}

#interpret-chart-btn::before,
#interpret-chart-btn::after,
#return-interpretation-btn::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: inherit;
    pointer-events: none;
}

#interpret-chart-btn::before {
    border: 1px solid rgba(212, 175, 55, 0.24);
    animation: interpretCtaHalo 2.8s ease-out infinite;
}

#return-interpretation-btn::before {
    border: 1px solid rgba(123, 249, 255, 0.18);
    animation: interpretCtaHalo 3.2s ease-out infinite;
}

#interpret-chart-btn::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
    width: 42%;
    inset: 0 auto 0 -52%;
    transform: skewX(-18deg);
    opacity: 0.38;
    animation: interpretCtaSweep 3.6s ease-in-out infinite;
}

#interpret-chart-btn .dock-icon,
#return-interpretation-btn .dock-icon {
    width: 28px;
    height: 28px;
    font-size: 1.18rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.28));
}

#interpret-chart-btn .dock-icon {
    color: #080910;
}

#return-interpretation-btn .dock-icon {
    color: var(--accent-gold);
}

#interpret-chart-btn .dock-label,
#return-interpretation-btn .dock-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    color: #080910;
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#return-interpretation-btn .dock-label {
    color: #ffffff;
}

#interpret-chart-btn:hover,
#return-interpretation-btn:hover {
    transform: translateY(-3px) scale(1.04);
    border-color: rgba(123, 249, 255, 0.42);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14) inset,
        0 22px 76px rgba(212, 175, 55, 0.3),
        0 0 58px rgba(123, 249, 255, 0.2);
}

#interpret-chart-btn:disabled,
#return-interpretation-btn:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: translateY(0) scale(0.98);
}

@keyframes interpretCtaFloat {
    0%,
    100% {
        translate: 0 0;
    }
    50% {
        translate: 0 -6px;
    }
}

@keyframes interpretCtaHalo {
    0% {
        opacity: 0.8;
        transform: scale(0.96);
    }
    100% {
        opacity: 0;
        transform: scale(1.22);
    }
}

@keyframes interpretCtaSweep {
    0%,
    42% {
        left: -52%;
    }
    72%,
    100% {
        left: 112%;
    }
}

@media (max-width: 768px) {
    .dock-tool-group[data-tool-group="interpret"] {
        bottom: max(18px, env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
        gap: 8px;
    }

    #interpret-chart-btn,
    #return-interpretation-btn {
        min-width: 0;
        flex: 1 1 0;
        max-width: 230px;
        height: 54px;
        min-height: 54px;
        padding: 0 14px;
    }

    #interpret-chart-btn .dock-label,
    #return-interpretation-btn .dock-label {
        font-size: 0.72rem;
    }
}

/* AI Reading: scroll-free floating icon stage */
.ai-reading-screen {
    overflow: hidden;
}

.ai-reading-screen .ai-interpretation-shell,
.ai-reading-screen .ai-interpretation-result {
    height: 100%;
    overflow: hidden;
}

.ai-reading-screen .ai-interpretation-result {
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 0;
}

.ai-reading-screen .ai-interpretation-head {
    max-width: 620px;
    margin: 0 auto;
    padding-top: clamp(2px, 1vh, 10px);
    text-align: center;
}

.ai-reading-screen .ai-interpretation-head h2 {
    margin: 6px 0 6px;
    font-size: clamp(2.15rem, 5.2vw, 5.35rem);
}

.ai-reading-screen .ai-interpretation-head p {
    font-size: clamp(0.88rem, 1.2vw, 1.05rem);
}

.ai-reading-screen .ai-opening-sentences,
.ai-reading-screen .ai-interpretation-disclaimer {
    display: none;
}

.ai-reading-screen .ai-reading-layout {
    position: relative;
    min-height: 0;
    height: 100%;
}

.ai-reading-screen .ai-section-cards {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    perspective: 1200px;
}

.ai-reading-screen .ai-section-cards::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(82vw, 1120px);
    height: min(42vh, 420px);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(-8deg);
    box-shadow:
        0 0 0 32px rgba(123, 223, 242, 0.012),
        inset 0 0 90px rgba(212, 175, 55, 0.035);
    pointer-events: none;
}

.ai-reading-screen .ai-section-cards::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(62vw, 820px);
    height: min(28vh, 280px);
    border: 1px dashed rgba(123, 223, 242, 0.16);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(12deg);
    pointer-events: none;
}

.ai-reading-screen .ai-reading-core {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    display: grid;
    place-items: center;
    width: clamp(150px, 18vw, 230px);
    height: clamp(150px, 18vw, 230px);
    padding: 22px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.13), rgba(123, 223, 242, 0.055) 44%, rgba(2, 3, 10, 0.14) 68%, transparent);
    text-align: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 90px rgba(212, 175, 55, 0.1), inset 0 0 42px rgba(255, 255, 255, 0.035);
    pointer-events: none;
}

.ai-reading-screen .ai-reading-core::before {
    content: "";
    position: absolute;
    inset: -18px;
    border: 1px solid rgba(123, 223, 242, 0.18);
    border-radius: 50%;
    animation: saveOrbit 18s linear infinite;
}

.ai-reading-screen .ai-reading-core::after {
    content: "";
    position: absolute;
    inset: 28px -22px;
    border: 1px solid rgba(212, 175, 55, 0.16);
    border-radius: 50%;
    transform: rotate(-18deg);
}

.ai-reading-screen .ai-reading-core span,
.ai-reading-screen .ai-reading-core small {
    color: var(--text-secondary);
    font-size: clamp(0.68rem, 1vw, 0.78rem);
    line-height: 1.32;
}

.ai-reading-screen .ai-reading-core span {
    color: var(--accent-gold);
    font-weight: 800;
    letter-spacing: 0.22em;
}

.ai-reading-screen .ai-reading-core strong {
    display: block;
    max-width: 150px;
    margin: 8px 0;
    font-size: clamp(1.05rem, 1.7vw, 1.65rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.ai-reading-screen .ai-section-node {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(104px, 10vw, 148px);
    min-height: clamp(130px, 12vw, 176px);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transform: translate(-50%, -50%);
    animation: none;
    will-change: transform;
}

.ai-reading-screen .ai-section-node-aura {
    position: absolute;
    width: clamp(112px, 10vw, 154px);
    height: clamp(112px, 10vw, 154px);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(212, 175, 55, 0.22), rgba(123, 223, 242, 0.08) 42%, transparent 72%);
    filter: blur(2px);
    opacity: 0.58;
    animation: aiIconHeartbeat 3.2s ease-in-out infinite;
    animation-delay: var(--float-delay);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.ai-reading-screen .ai-section-node-orbit {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(92px, 8.6vw, 124px);
    height: clamp(92px, 8.6vw, 124px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(5, 8, 18, 0.32), rgba(5, 8, 18, 0.08) 65%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 34px rgba(212, 175, 55, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: aiIconGlowBeat 3.2s ease-in-out infinite;
    animation-delay: var(--float-delay);
}

.ai-reading-screen .ai-section-node-orbit::before,
.ai-reading-screen .ai-section-node-orbit::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ai-reading-screen .ai-section-node-orbit::before {
    inset: -9px;
    border: 1px solid rgba(123, 223, 242, 0.16);
    animation: saveOrbit 12s linear infinite;
}

.ai-reading-screen .ai-section-node-orbit::after {
    inset: 14px -11px;
    border: 1px solid rgba(212, 175, 55, 0.16);
    transform: rotate(-24deg);
}

.ai-reading-screen .ai-section-node-icon {
    display: grid;
    place-items: center;
    width: clamp(96px, 8.8vw, 132px);
    height: clamp(96px, 8.8vw, 132px);
    border-radius: 50%;
    background: transparent;
    color: var(--accent-gold);
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1;
    text-shadow: 0 0 22px rgba(212, 175, 55, 0.58);
}

.ai-reading-screen .ai-section-node-icon img,
.ai-reading-screen .ai-section-content-orb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(123, 249, 255, 0.46)) drop-shadow(0 0 18px rgba(74, 144, 226, 0.26));
    user-select: none;
    pointer-events: none;
}

.ai-reading-screen .ai-section-node:hover .ai-section-node-icon img,
.ai-reading-screen .ai-section-node.active .ai-section-node-icon img {
    filter: drop-shadow(0 0 16px rgba(123, 249, 255, 0.72)) drop-shadow(0 0 34px rgba(212, 175, 55, 0.26));
}

.ai-reading-screen .ai-section-node-label {
    position: absolute;
    top: calc(100% - 18px);
    left: 50%;
    width: max-content;
    max-width: 172px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(3, 5, 12, 0.58);
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(0.66rem, 1vw, 0.78rem);
    font-weight: 700;
    line-height: 1.18;
    text-align: center;
    transform: translateX(-50%);
    backdrop-filter: blur(8px);
    opacity: 0.82;
}

.ai-reading-screen .ai-section-node:hover .ai-section-node-aura,
.ai-reading-screen .ai-section-node.active .ai-section-node-aura {
    opacity: 1;
    transform: scale(1.2);
}

.ai-reading-screen .ai-section-node:hover .ai-section-node-orbit,
.ai-reading-screen .ai-section-node.active .ai-section-node-orbit {
    border-color: rgba(212, 175, 55, 0.68);
    box-shadow: 0 0 52px rgba(212, 175, 55, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ai-reading-screen .ai-section-content {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 42px);
    overflow: hidden;
    pointer-events: auto;
}

.ai-reading-screen .ai-section-modal-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 46%, rgba(123, 249, 255, 0.1), transparent 22%),
        radial-gradient(circle at 50% 54%, rgba(212, 175, 55, 0.16), transparent 34%),
        rgba(1, 2, 8, 0.48);
    backdrop-filter: blur(10px);
}

.ai-reading-screen .ai-section-modal-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: clamp(16px, 2.4vw, 28px);
    width: min(820px, calc(100vw - 34px));
    max-height: calc(100vh - 140px);
    padding: clamp(20px, 3vw, 38px);
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.26);
    border-radius: 34px;
    background:
        radial-gradient(circle at 10% 10%, rgba(212, 175, 55, 0.15), transparent 28%),
        radial-gradient(circle at 82% 78%, rgba(123, 223, 242, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(13, 16, 31, 0.93), rgba(4, 6, 14, 0.94));
    box-shadow: 0 48px 150px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform-origin: center;
    will-change: transform, opacity, filter;
}

.ai-reading-screen .ai-section-modal-card::before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 24px;
    pointer-events: none;
}

.ai-reading-screen .ai-section-content-orb {
    width: clamp(96px, 10vw, 136px);
    height: clamp(96px, 10vw, 136px);
    font-size: clamp(2rem, 4vw, 3.6rem);
    background: transparent;
    border: 0;
    box-shadow: none;
}

.ai-reading-screen .ai-section-content h3 {
    font-size: clamp(1.8rem, 4vw, 3.65rem);
}

.ai-reading-screen .ai-section-content p {
    display: -webkit-box;
    max-width: 620px;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: clamp(0.92rem, 1.25vw, 1.08rem);
    line-height: 1.62;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.ai-reading-screen .ai-section-content ul {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 2px 0 0;
    overflow: hidden;
}

.ai-reading-screen .ai-section-content li {
    min-height: 0;
    padding: 10px 12px 10px 30px;
    font-size: clamp(0.76rem, 1vw, 0.9rem);
    line-height: 1.3;
}

.ai-reading-screen .ai-section-modal-close {
    top: 14px;
    right: 14px;
}

@keyframes aiNodeFloat {
    0%,
    100% {
        transform: translate(-50%, -50%) translateY(-7px) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) translateY(8px) scale(1.025);
    }
}

@keyframes aiIconHeartbeat {
    0%,
    100% {
        opacity: 0.48;
        transform: scale(0.96);
        filter: blur(2px);
    }
    12% {
        opacity: 0.86;
        transform: scale(1.1);
        filter: blur(3px);
    }
    22% {
        opacity: 0.58;
        transform: scale(1);
        filter: blur(2px);
    }
    34% {
        opacity: 0.78;
        transform: scale(1.06);
    }
    48% {
        opacity: 0.5;
        transform: scale(0.98);
    }
}

@keyframes aiIconGlowBeat {
    0%,
    100% {
        box-shadow: 0 0 26px rgba(212, 175, 55, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    }
    16% {
        box-shadow: 0 0 48px rgba(123, 249, 255, 0.2), 0 0 68px rgba(212, 175, 55, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }
    34% {
        box-shadow: 0 0 34px rgba(212, 175, 55, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 768px) {
    .ai-reading-screen {
        padding: 68px 12px 12px;
    }

    .ai-reading-screen .ai-interpretation-head h2 {
        font-size: clamp(2rem, 12vw, 3.6rem);
    }

    .ai-reading-screen .ai-interpretation-head p {
        display: none;
    }

    .ai-reading-screen .ai-reading-core {
        width: 128px;
        height: 128px;
        padding: 18px;
    }

    .ai-reading-screen .ai-reading-core small {
        display: none;
    }

    .ai-reading-screen .ai-section-node {
        width: 78px;
        min-height: 98px;
    }

    .ai-reading-screen .ai-section-node:nth-of-type(n) {
        left: 50%;
        top: 50%;
    }

    .ai-reading-screen .ai-section-node-orbit {
        width: 72px;
        height: 72px;
    }

    .ai-reading-screen .ai-section-node-icon {
        width: 78px;
        height: 78px;
        font-size: 1.55rem;
    }

    .ai-reading-screen .ai-section-node-label {
        max-width: 96px;
        padding: 5px 7px;
        font-size: 0.62rem;
    }

    .ai-reading-screen .ai-section-modal-card {
        grid-template-columns: 1fr;
        gap: 12px;
        max-height: calc(100vh - 108px);
        padding: 22px;
        border-radius: 26px;
        text-align: center;
    }

    .ai-reading-screen .ai-section-content-orb {
        justify-self: center;
        width: 92px;
        height: 92px;
        font-size: 2rem;
    }

    .ai-reading-screen .ai-section-content p {
        -webkit-line-clamp: 4;
    }

    .ai-reading-screen .ai-section-content ul {
        grid-column: 1;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ai-reading-screen .ai-section-content {
        padding: 10px;
    }

    .ai-reading-screen .ai-section-modal-card {
        width: min(390px, calc(100vw - 20px));
        max-height: calc(100svh - 96px);
        gap: 14px;
        padding: 24px 22px 22px;
        border-radius: 28px;
    }

    .ai-reading-screen .ai-section-modal-card::before {
        inset: 12px;
        border-radius: 22px;
    }

    .ai-reading-screen .ai-section-content-orb {
        width: 104px;
        height: 104px;
        margin-bottom: 2px;
    }

    .ai-reading-screen .ai-section-content-kicker {
        margin-bottom: 8px;
        font-size: 0.78rem;
        letter-spacing: 0.18em;
    }

    .ai-reading-screen .ai-section-content h3 {
        margin-bottom: 12px;
        font-size: clamp(2rem, 8vw, 2.6rem);
        line-height: 1.02;
        letter-spacing: -0.045em;
    }

    .ai-reading-screen .ai-section-content p {
        display: block;
        max-width: none;
        font-size: 1.04rem;
        line-height: 1.62;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
    }

    .ai-reading-screen .ai-section-content ul {
        gap: 9px;
        margin-top: 4px;
    }

    .ai-reading-screen .ai-section-content li {
        padding: 11px 12px 11px 34px;
        border-radius: 16px;
        font-size: 0.92rem;
        line-height: 1.38;
    }

    .ai-reading-screen .ai-section-modal-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 380px) {
    .ai-reading-screen .ai-section-modal-card {
        width: calc(100vw - 16px);
        padding: 22px 18px 18px;
    }

    .ai-reading-screen .ai-section-content-orb {
        width: 92px;
        height: 92px;
    }

    .ai-reading-screen .ai-section-content h3 {
        font-size: 1.9rem;
    }

    .ai-reading-screen .ai-section-content p {
        font-size: 0.98rem;
        line-height: 1.56;
    }
}

/* Premium auth and responsive header */
.mobile-menu-toggle {
    display: none;
    position: relative;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 20%, rgba(212, 175, 55, 0.22), transparent 38%),
        rgba(10, 12, 24, 0.72);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mobile-menu-toggle span {
    position: absolute;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.28s ease, opacity 0.2s ease;
}

.mobile-menu-toggle span:nth-child(1) {
    transform: translateY(-6px);
}

.mobile-menu-toggle span:nth-child(3) {
    transform: translateY(6px);
}

body.header-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: rotate(45deg);
}

body.profile-menu-open .profile-menu-toggle span:nth-child(1) {
    transform: rotate(45deg);
}

body.header-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.profile-menu-open .profile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.header-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: rotate(-45deg);
}

body.profile-menu-open .profile-menu-toggle span:nth-child(3) {
    transform: rotate(-45deg);
}

.auth-nav .btn-primary,
.auth-nav .btn-secondary {
    width: auto;
    min-height: 46px;
    padding: 0 18px;
    white-space: nowrap;
}

#auth-modal.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 44px);
    background:
        radial-gradient(circle at 50% 35%, rgba(212, 175, 55, 0.1), transparent 34%),
        rgba(2, 3, 10, 0.68);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

#auth-modal.modal-overlay.hidden {
    display: none !important;
}

#auth-modal .modal-content {
    position: relative;
    width: min(462px, calc(100vw - 32px));
    max-height: calc(100svh - 44px);
    overflow: auto;
    padding: 32px;
    border-radius: 32px;
    background:
        linear-gradient(145deg, rgba(14, 16, 30, 0.94), rgba(5, 7, 16, 0.92)),
        radial-gradient(circle at 20% 0%, rgba(212, 175, 55, 0.18), transparent 34%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow:
        0 34px 90px rgba(0, 0, 0, 0.62),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: authModalIn 0.38s cubic-bezier(0.2, 0.82, 0.2, 1);
}

#auth-modal .modal-content::before {
    content: 'ARCANAFY';
    display: block;
    margin-bottom: 22px;
    color: var(--accent-gold);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.34em;
}

#auth-modal .modal-close-btn {
    position: absolute;
    top: 22px;
    right: 22px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

#auth-modal .modal-close-btn:hover {
    transform: rotate(90deg);
    border-color: rgba(212, 175, 55, 0.55);
    background: rgba(212, 175, 55, 0.1);
}

#auth-modal .auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 54px 24px 0;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
}

#auth-modal .auth-tab {
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 800;
}

#auth-modal .auth-tab.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.95), rgba(184, 144, 32, 0.92));
    color: #06060a;
    box-shadow: 0 12px 28px rgba(212, 175, 55, 0.22);
}

#auth-modal .auth-tab.active::after {
    display: none;
}

#auth-modal .auth-form {
    animation: authFormIn 0.26s ease both;
}

#auth-modal .auth-form .input-group {
    position: relative;
    margin-bottom: 14px;
}

#auth-modal .auth-form input {
    width: 100%;
    height: 58px;
    padding: 22px 16px 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.12);
}

#auth-modal .auth-form label {
    position: absolute;
    top: 8px;
    left: 16px;
    margin: 0;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.7rem;
    letter-spacing: 0.11em;
    pointer-events: none;
}

#auth-modal .form-error {
    margin: 0 0 16px;
    border: 1px solid rgba(255, 77, 77, 0.22);
    border-radius: 16px;
    background: rgba(255, 77, 77, 0.12);
}

#auth-modal .full-width {
    height: 56px;
    margin-top: 8px;
    border-radius: 18px;
}

#auth-modal .auth-recaptcha-slot {
    display: grid;
    justify-content: center;
    max-width: 100%;
    margin: 4px 0 14px;
    overflow: hidden;
}

#auth-modal .auth-recaptcha-slot:empty {
    display: none;
}

@keyframes authModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes authFormIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-header {
        position: relative;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .logo {
        min-width: 0;
        font-size: clamp(1.05rem, 5.8vw, 1.45rem);
        letter-spacing: 0.22em;
    }

    .header-quick-actions {
        flex: 0 0 auto;
        gap: 8px;
        margin-left: auto;
    }

    .mobile-menu-toggle {
        display: grid;
        order: 0;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        margin-left: 0;
        margin-right: 0;
    }

    .header-actions {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        left: auto;
        z-index: 2000;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: min(284px, calc(100vw - 28px));
        max-width: calc(100vw - 28px);
        box-sizing: border-box;
        padding: 14px;
        border: 1px solid rgba(212, 175, 55, 0.18);
        border-radius: 28px;
        background:
            linear-gradient(145deg, rgba(10, 12, 24, 0.96), rgba(4, 6, 14, 0.94)),
            radial-gradient(circle at 80% 0%, rgba(212, 175, 55, 0.14), transparent 40%);
        box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px) scale(0.96);
        transform-origin: top right;
        transition: opacity 0.24s ease, transform 0.24s ease;
        overflow: hidden;
        contain: layout paint;
    }

    body.header-menu-open .header-actions {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .header-actions::before {
        content: 'ARCANAFY';
        padding: 4px 6px 8px;
        color: var(--accent-gold);
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0.22em;
        text-transform: uppercase;
    }

    .header-action-link {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        border-radius: 18px;
    }

    .header-quick-actions .music-toggle,
    .header-quick-actions .language-switcher,
    .header-quick-actions .auth-nav .user-profile-btn,
    .header-quick-actions .auth-nav .btn-secondary {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        display: grid;
        place-items: center;
        border-radius: 50%;
    }

    .header-quick-actions .music-toggle {
        gap: 0;
    }

    .header-quick-actions #music-toggle-text {
        display: none;
    }

    .header-quick-actions #music-toggle-icon {
        font-size: 1.05rem;
    }

    .language-switcher {
        justify-content: center;
        min-width: 0;
        padding-inline: 0;
    }

    .language-switcher select {
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        text-align: center;
        text-align-last: center;
    }

    .auth-nav {
        display: flex;
        align-items: center;
        gap: 0;
        min-width: 0;
    }

    .header-quick-actions .auth-nav .btn-primary {
        display: none;
    }

    .header-quick-actions .auth-nav .btn-secondary {
        position: relative;
        color: transparent;
        font-size: 0;
        overflow: hidden;
    }

    .header-quick-actions .auth-nav .btn-secondary::before {
        content: "◌";
        color: var(--text-primary);
        font-size: 1.25rem;
        line-height: 1;
    }

    .user-menu {
        position: relative;
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        overflow: visible;
    }

    .user-menu .user-profile-btn {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        overflow: hidden;
    }

    .user-menu .user-profile-btn span,
    .user-menu .user-profile-btn small {
        display: none;
    }

    .user-menu .user-profile-btn::before {
        content: "";
        width: 22px;
        height: 22px;
        background:
            radial-gradient(circle at 50% 30%, var(--accent-gold) 0 4.6px, transparent 4.9px),
            radial-gradient(ellipse at 50% 82%, var(--accent-gold) 0 8px, transparent 8.3px);
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.42));
    }

    .user-menu-popover {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        z-index: 2600;
        display: grid;
        min-width: min(220px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        margin-top: 0;
        pointer-events: auto;
    }

    .user-menu-popover.hidden {
        display: none !important;
    }

    .auth-nav .btn-logout {
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.045);
    }

    #auth-modal .modal-content {
        width: min(420px, calc(100vw - 22px));
        padding: 26px 20px 22px;
        border-radius: 28px;
    }

    #auth-modal .auth-tabs {
        margin-right: 48px;
    }
}

/* Profile dashboard and public profile */
.profile-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--text-primary);
    font-family: var(--font-main);
    background:
        radial-gradient(circle at 18% 8%, rgba(123, 223, 242, 0.12), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(212, 175, 55, 0.12), transparent 30%),
        #050711;
}

.profile-body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.52) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(212,175,55,.5) 0 1px, transparent 1.5px);
    background-size: 120px 120px, 190px 190px;
    opacity: 0.26;
}

.profile-page-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 64px;
}

.profile-page-shell > .app-header,
.shared-chart-shell > .app-header {
    position: sticky;
    top: 18px;
    z-index: 80;
    width: 100%;
    margin-bottom: 24px;
    pointer-events: auto;
}

.shared-chart-shell > .app-header {
    position: relative;
    top: auto;
}

.profile-topbar {
    position: sticky;
    top: 18px;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    min-height: 58px;
}

.profile-brand {
    position: relative;
    z-index: 3;
    color: var(--text-primary);
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 0.26em;
    text-decoration: none;
}

.profile-nav-shell {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: flex;
    justify-content: flex-end;
    width: auto;
    pointer-events: auto;
}

.profile-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 54px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background:
        radial-gradient(circle at 12% 0%, rgba(212, 175, 55, 0.12), transparent 36%),
        rgba(8, 10, 22, 0.64);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    pointer-events: auto;
}

.profile-menu-toggle {
    position: relative;
    z-index: 4;
}

.profile-language-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 42px;
    min-width: 58px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-language-switcher > span {
    display: none;
}

.profile-language-switcher select {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: center;
    text-align-last: center;
}

.profile-language-switcher option {
    background: #080b18;
    color: #fff;
}

.profile-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.profile-nav-link:hover,
.profile-language-switcher:hover {
    border-color: rgba(212, 175, 55, 0.26);
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-1px);
}

.profile-nav-button {
    font-family: inherit;
}

.profile-hero {
    position: relative;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    grid-template-areas:
        "avatar kicker actions"
        "avatar title actions"
        "avatar subtitle actions"
        "avatar stats actions";
    align-items: end;
    gap: 8px 18px;
    min-height: 190px;
    margin-bottom: 22px;
    padding: 92px 24px 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    background:
        linear-gradient(145deg, rgba(12, 14, 28, 0.9), rgba(5, 7, 16, 0.82)),
        radial-gradient(circle at 86% 0%, rgba(212, 175, 55, 0.12), transparent 34%);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    text-align: left;
}

.profile-hero::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 110px;
    background:
        linear-gradient(135deg, rgba(123, 223, 242, 0.18), rgba(212, 175, 55, 0.16)),
        radial-gradient(circle at 18% 34%, rgba(255,255,255,.18), transparent 14rem),
        linear-gradient(90deg, rgba(9, 12, 28, 0.4), rgba(9, 12, 28, 0.05));
    opacity: 0.95;
}

.profile-orb {
    grid-area: avatar;
    position: relative;
    z-index: 1;
    width: 84px;
    height: 84px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 42%, rgba(212,175,55,.6), transparent 18%),
        radial-gradient(circle, rgba(123,223,242,.18), transparent 58%),
        #0b1020;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), 0 0 34px rgba(123, 223, 242, 0.18);
}

.profile-kicker,
.profile-hero h1,
.profile-hero p,
.profile-actions {
    position: relative;
    z-index: 1;
}

.profile-social-stats {
    grid-area: stats;
    position: relative;
    z-index: 1;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.profile-social-stats span {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
}

.profile-social-stats strong {
    color: var(--text-primary);
    font-weight: 900;
}

.profile-kicker {
    grid-area: kicker;
    margin: 0;
    color: var(--accent-gold);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.profile-hero h1 {
    grid-area: title;
    max-width: 840px;
    margin: 0;
    font-size: clamp(1.8rem, 3.2vw, 3rem);
    line-height: 1;
    letter-spacing: -0.035em;
}

.profile-hero > p:not(.profile-kicker) {
    grid-area: subtitle;
    max-width: 620px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.profile-actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0;
}

.profile-primary-action,
.profile-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.profile-primary-action {
    border: 0;
    background: linear-gradient(135deg, var(--accent-gold), #b89020);
    color: #050509;
}

.profile-primary-action:disabled,
.profile-secondary-action:disabled,
.profile-chart-actions button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.profile-secondary-action {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
}

.profile-dashboard {
    display: grid;
    gap: 18px;
}

.profile-settings-deck {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.profile-panel {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(12, 14, 28, 0.84), rgba(5, 7, 16, 0.74)),
        radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.055), transparent 34%);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0;
    overflow: hidden;
}

.profile-panel h2 {
    margin: 0;
    padding: 20px 22px 0;
    font-size: 1.18rem;
}

.profile-panel p {
    color: var(--text-secondary);
}

.profile-panel > p {
    margin: 6px 0 0;
    padding: 0 22px 16px;
    font-size: 0.92rem;
}

.profile-settings-panel form,
.profile-account-panel form {
    display: grid;
    gap: 0;
    padding: 0 22px 22px;
}

#account-settings-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#account-settings-form .profile-fieldset,
#account-settings-form .profile-primary-action,
#account-settings-form .profile-status {
    grid-column: 1 / -1;
}

.profile-settings-panel form {
    grid-template-columns: minmax(0, 1fr);
}

.profile-settings-panel label,
.profile-account-panel label {
    display: grid;
    grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 62px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-settings-panel label > span,
.profile-account-panel label > span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
    font-weight: 800;
}

.profile-settings-panel input,
.profile-settings-panel textarea,
.profile-account-panel input,
.profile-account-panel select {
    width: 100%;
}

.profile-account-panel select {
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
    font-family: var(--font-main);
}

.profile-account-panel option {
    background: #080b18;
    color: #fff;
}

.profile-password-form {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 8px solid rgba(255, 255, 255, 0.035);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.profile-password-form h3 {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0 0 4px;
    color: var(--accent-gold);
    font-size: 0.88rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.profile-password-form .profile-secondary-action,
.profile-password-form .profile-status {
    grid-column: 1 / -1;
}

.profile-fieldset {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 14px;
    margin-top: 8px;
    padding: 14px 0 0;
    border-top: 8px solid rgba(255, 255, 255, 0.035);
}

.profile-fieldset h3 {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0 0 4px;
    color: var(--accent-gold);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.slug-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.045);
}

.slug-input-row span {
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.slug-input-row input {
    border: 0;
    background: transparent;
}

.profile-switch {
    display: grid !important;
    grid-template-columns: 18px 1fr !important;
    align-items: center;
    gap: 10px !important;
}

.profile-switch input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold);
}

.profile-section-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 0;
    padding: 20px 22px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.profile-section-head h2 {
    padding: 0;
}

.profile-section-head p {
    margin: 4px 0 0;
}

.profile-stats {
    display: flex;
    gap: 10px;
}

.profile-stats span {
    min-width: 96px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    text-align: center;
}

.profile-stats strong {
    display: block;
    color: var(--accent-gold);
    font-size: 1.35rem;
}

.profile-chart-list {
    display: grid;
    gap: 0;
}

.profile-chart-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.075);
    background: transparent;
    transition: background 0.18s ease, transform 0.18s ease;
}

.profile-chart-card:hover {
    background: rgba(255, 255, 255, 0.035);
}

.profile-chart-avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 44%, rgba(212, 175, 55, 0.45), transparent 25%),
        rgba(123, 223, 242, 0.08);
    color: var(--accent-gold);
    font-size: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.profile-chart-main {
    min-width: 0;
}

.profile-chart-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-chart-date {
    color: var(--accent-gold);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.profile-chart-card h3 {
    margin: 0;
    font-size: 1.02rem;
}

.profile-chart-card p {
    margin: 4px 0 0;
    font-size: 0.92rem;
}

.profile-chart-preview {
    width: min(100%, 520px);
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 30%, rgba(123, 223, 242, 0.12), transparent 36%),
        rgba(255, 255, 255, 0.035);
    aspect-ratio: 16 / 9;
}

.profile-chart-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-chart-preview-empty {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 800;
}

.profile-chart-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.profile-chart-actions a,
.profile-chart-actions button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.05);
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.profile-chart-actions button.liked {
    border-color: rgba(255, 72, 132, 0.34);
    background: rgba(255, 72, 132, 0.1);
    color: #ff6f9f;
}

.profile-chart-actions button.danger {
    border-color: rgba(255, 74, 74, 0.28);
    color: #ff8f8f;
}

.profile-status,
.profile-loading,
.profile-empty {
    color: var(--text-secondary);
}

.profile-loading,
.profile-empty {
    padding: 20px 22px;
}

.public-profile-panel {
    width: min(860px, 100%);
    margin: 0 auto;
}

.profile-public-birth {
    display: inline-grid;
    gap: 4px;
    margin-top: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 18px;
    background: rgba(212, 175, 55, 0.06);
}

.profile-public-birth span {
    color: var(--accent-gold);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.profile-public-birth strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

@keyframes profileOrb {
    0%, 100% {
        transform: translateY(-8px) rotate(0deg);
    }
    50% {
        transform: translateY(10px) rotate(8deg);
    }
}

@media (max-width: 1080px) {
    .profile-settings-deck {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .profile-page-shell {
        width: min(100% - 22px, 680px);
        padding-top: 18px;
    }

    .profile-actions,
    .profile-section-head,
    .profile-chart-card {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-topbar {
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
    }

    .profile-menu-toggle {
        display: grid;
        order: 0;
        margin-left: auto;
        margin-right: 0;
    }

    .profile-nav-shell {
        position: fixed;
        top: max(78px, calc(env(safe-area-inset-top) + 72px));
        right: max(12px, env(safe-area-inset-right));
        left: auto;
        z-index: 2100;
        width: min(284px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        box-sizing: border-box;
        transform: translateY(-10px) scale(0.96);
        transform-origin: top right;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease, transform 0.24s ease;
    }

    body.profile-menu-open .profile-nav-shell {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .profile-nav {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        min-height: 0;
        padding: 14px;
        border-radius: 28px;
        background:
            linear-gradient(145deg, rgba(10, 12, 24, 0.96), rgba(4, 6, 14, 0.94)),
            radial-gradient(circle at 80% 0%, rgba(212, 175, 55, 0.14), transparent 40%);
        box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
    }

    .profile-nav::before {
        content: 'ARCANAFY';
        padding: 4px 6px 2px;
        color: var(--accent-gold);
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0.22em;
        text-transform: uppercase;
    }

    .profile-nav-link,
    .profile-language-switcher {
        justify-content: center;
        width: 100%;
        min-width: 0;
        min-height: 48px;
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.055);
    }

    .profile-language-switcher select {
        width: 100%;
        min-width: 42px;
        max-width: 74px;
        text-align: center;
        text-align-last: center;
    }

    .profile-dashboard,
    .profile-settings-deck,
    #account-settings-form,
    .profile-password-form,
    .profile-fieldset {
        grid-template-columns: 1fr;
    }

    .profile-settings-panel label,
    .profile-account-panel label {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .profile-chart-card {
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: start;
    }

    .profile-chart-actions {
        grid-column: 2;
        justify-content: flex-start;
    }

    #account-settings-form .profile-fieldset,
    #account-settings-form .profile-primary-action,
    #account-settings-form .profile-status,
    .profile-password-form h3,
    .profile-password-form .profile-secondary-action,
    .profile-password-form .profile-status,
    .profile-fieldset h3 {
        grid-column: auto;
    }

    .profile-hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            "avatar"
            "kicker"
            "title"
            "subtitle"
            "stats"
            "actions";
        justify-items: center;
        min-height: 0;
        margin-bottom: 18px;
        padding: 74px 18px 20px;
        text-align: center;
    }

    .profile-hero::before {
        height: 94px;
    }

    .profile-orb {
        width: 78px;
        height: 78px;
    }

    .profile-hero h1 {
        font-size: clamp(1.7rem, 8vw, 2.5rem);
    }

    .profile-hero > p:not(.profile-kicker) {
        font-size: 0.94rem;
    }

    .profile-social-stats {
        justify-content: center;
    }

    .profile-stats,
    .profile-chart-actions {
        justify-content: stretch;
    }

.profile-stats span,
    .profile-chart-actions a,
    .profile-chart-actions button {
        flex: 1;
    }
}

.house-insight-tooltip {
    position: fixed;
    z-index: 72;
    width: min(320px, calc(100vw - 32px));
    padding: 16px 18px 17px;
    border: 1px solid rgba(212, 175, 55, 0.38);
    border-radius: 18px;
    background:
        radial-gradient(circle at 20% 0%, rgba(212, 175, 55, 0.13), transparent 42%),
        linear-gradient(145deg, rgba(10, 13, 28, 0.94), rgba(5, 8, 18, 0.88));
    color: var(--text-primary);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38), 0 0 26px rgba(212, 175, 55, 0.12);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    animation: houseInsightIn 0.22s ease both;
}

.house-insight-tooltip.hidden {
    display: none;
}

.house-insight-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.13);
    color: var(--accent-gold);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.house-insight-title {
    display: block;
    margin-top: 10px;
    padding-right: 28px;
    font-size: 1.14rem;
    line-height: 1.1;
}

.house-insight-copy {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.94rem;
    line-height: 1.5;
}

.house-insight-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
}

@keyframes houseInsightIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@media (max-width: 640px) {
    .house-insight-tooltip {
        inset: auto 16px 18px 16px !important;
        width: auto;
        padding: 18px 18px 19px;
    }

    .house-insight-title {
        font-size: 1.24rem;
    }

    .house-insight-copy {
        font-size: 1rem;
    }
}

/* Homepage landing revamp */
body.home-body {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

body.home-body.chart-active {
    overflow: hidden;
}

body.home-body:not(.chart-active) #cosmos-canvas {
    opacity: 0.72;
    pointer-events: none;
}

body.home-body.chart-active #cosmos-canvas {
    opacity: 1;
    pointer-events: auto;
}

body.home-body #ui-layer {
    position: relative;
    width: 100%;
    min-height: 100vh;
    height: auto;
    padding: 28px clamp(18px, 4vw, 56px) 72px;
    overflow: visible;
}

body.home-body.chart-active #ui-layer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-height: 0;
    padding: var(--spacing-xl);
    overflow: hidden;
}

body.home-body .app-header {
    position: sticky;
    top: 22px;
    z-index: 35;
    width: 100%;
}

body.home-body.chart-active .app-header {
    position: relative;
    top: auto;
}

.home-landing {
    position: relative;
    z-index: 2;
    display: grid;
    gap: clamp(58px, 8vw, 104px);
    width: min(1180px, 100%);
    margin: clamp(54px, 8vh, 96px) auto 0;
    pointer-events: auto;
}

.home-landing.hidden {
    display: none;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    min-height: min(690px, calc(100svh - 150px));
}

.home-hero-copy {
    max-width: 620px;
}

.home-hero-copy > span,
.form-kicker,
.home-explainer-head > span,
.home-final-cta span {
    color: var(--accent-gold);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.home-hero-copy h1 {
    margin: 16px 0 20px;
    max-width: 680px;
    font-size: clamp(3.3rem, 7.5vw, 7.2rem);
    line-height: 0.85;
    letter-spacing: -0.08em;
    text-wrap: balance;
}

.home-hero-copy p {
    max-width: 520px;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(1.02rem, 1.5vw, 1.24rem);
    line-height: 1.55;
}

.home-hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.home-hero-points span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
    font-weight: 800;
}

body.home-body #birth-form-panel {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    transform: none;
    padding: clamp(26px, 3vw, 40px);
    border-color: rgba(212, 175, 55, 0.2);
    border-radius: 34px;
    background:
        radial-gradient(circle at 88% 0%, rgba(212, 175, 55, 0.18), transparent 32%),
        linear-gradient(145deg, rgba(17, 20, 37, 0.84), rgba(6, 8, 18, 0.72));
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.home-body #birth-form-panel h2 {
    margin-top: 12px;
    font-size: clamp(2.25rem, 4vw, 3.45rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
}

body.home-body #birth-form-panel .subtitle {
    max-width: 380px;
    margin-bottom: 28px;
    font-size: 1rem;
    line-height: 1.5;
}

body.home-body #chart-form {
    display: grid;
    gap: 16px;
}

body.home-body #chart-form .input-group {
    margin-bottom: 0;
}

body.home-body #generate-btn {
    min-height: 58px;
    margin-top: 4px;
    border-radius: 18px;
    font-size: 1rem;
}

body.home-body .home-discovery {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 2;
    display: grid;
    grid-template-columns: 0.36fr 0.64fr;
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
    width: 100%;
    transform: none;
    pointer-events: auto;
}

body.home-body .home-discovery.hidden {
    display: none;
}

body.home-body .home-discovery-copy {
    position: sticky;
    top: 120px;
}

body.home-body .home-discovery-copy h2 {
    max-width: 360px;
    margin: 14px 0 12px;
    font-size: clamp(2.3rem, 4.4vw, 4.4rem);
    line-height: 0.88;
    letter-spacing: -0.07em;
}

body.home-body .home-discovery-copy p {
    max-width: 340px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 1rem;
    line-height: 1.55;
}

body.home-body .home-discovery-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.home-discovery-featured {
    min-width: 0;
    padding: clamp(18px, 2.4vw, 28px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 34px;
    background:
        radial-gradient(circle at 10% 0%, rgba(123, 223, 242, 0.12), transparent 36%),
        linear-gradient(145deg, rgba(12, 15, 29, 0.78), rgba(5, 7, 16, 0.6));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

body.home-body .home-discovery-heading {
    margin: 0 0 16px;
}

body.home-body .discovery-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    overflow: visible;
}

body.home-body .discovery-member,
body.home-body .discovery-chart {
    width: auto;
    min-height: 116px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.052);
}

body.home-body .discovery-member {
    padding: 18px;
}

body.home-body .discovery-chart {
    padding: 14px;
}

body.home-body .discovery-avatar {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    font-size: 1rem;
}

body.home-body .discovery-chart-preview {
    width: 96px;
    height: 72px;
    flex-basis: 96px;
    border-radius: 20px;
}

body.home-body .discovery-member strong,
body.home-body .discovery-chart strong {
    max-width: 190px;
    font-size: 1.05rem;
}

body.home-body .discovery-member small,
body.home-body .discovery-chart small {
    font-size: 0.82rem;
}

.home-explainer {
    display: grid;
    gap: 34px;
    padding: clamp(28px, 5vw, 56px);
    border-block: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent);
}

.home-explainer-head {
    display: grid;
    gap: 12px;
    max-width: 820px;
}

.home-explainer-head h2 {
    font-size: clamp(2.4rem, 5vw, 5rem);
    line-height: 0.9;
    letter-spacing: -0.07em;
    text-wrap: balance;
}

.home-explainer-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.home-explainer-steps article {
    padding-top: 22px;
    border-top: 1px solid rgba(212, 175, 55, 0.24);
}

.home-explainer-steps span {
    color: var(--accent-gold);
    font-weight: 900;
}

.home-explainer-steps h3 {
    margin: 14px 0 10px;
    font-size: 1.35rem;
}

.home-explainer-steps p {
    color: rgba(255, 255, 255, 0.64);
    line-height: 1.55;
}

.home-testimonials {
    display: grid;
    grid-template-columns: 0.42fr 0.58fr;
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
}

.home-testimonials-head {
    position: sticky;
    top: 120px;
}

.home-testimonials-head span {
    color: var(--accent-gold);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.home-testimonials-head h2 {
    margin-top: 14px;
    font-size: clamp(2.3rem, 4.6vw, 4.7rem);
    line-height: 0.88;
    letter-spacing: -0.07em;
    text-wrap: balance;
}

.home-testimonial-list {
    display: grid;
    gap: 16px;
}

.home-testimonial-list figure {
    position: relative;
    margin: 0;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    background:
        radial-gradient(circle at 94% 0%, rgba(212, 175, 55, 0.14), transparent 30%),
        linear-gradient(145deg, rgba(13, 16, 31, 0.78), rgba(5, 7, 16, 0.58));
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

.home-testimonial-list figure::before {
    content: "✦";
    position: absolute;
    top: 18px;
    right: 22px;
    color: rgba(212, 175, 55, 0.72);
    font-size: 1.1rem;
}

.home-testimonial-list blockquote {
    margin: 0;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(1.08rem, 1.6vw, 1.38rem);
    font-weight: 700;
    line-height: 1.42;
    letter-spacing: -0.02em;
}

.home-testimonial-list figcaption {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}

.home-testimonial-list figcaption::before {
    content: "";
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.48), transparent 28%),
        linear-gradient(145deg, rgba(212, 175, 55, 0.92), rgba(123, 223, 242, 0.36));
}

.home-testimonial-list strong {
    display: block;
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.94rem;
}

.home-testimonial-list span {
    display: block;
    color: rgba(255, 255, 255, 0.54);
    font-size: 0.78rem;
}

.home-final-cta {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(28px, 5vw, 56px);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 38px;
    background:
        radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(19, 18, 33, 0.82), rgba(8, 10, 20, 0.7));
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
}

.home-final-cta h2 {
    margin: 12px 0 10px;
    font-size: clamp(2.2rem, 4.5vw, 4.8rem);
    line-height: 0.88;
    letter-spacing: -0.07em;
}

.home-final-cta p {
    color: rgba(255, 255, 255, 0.66);
    font-size: 1rem;
}

.home-final-cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--accent-gold);
    color: #080912;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .home-hero,
    body.home-body .home-discovery {
        grid-template-columns: 1fr;
    }

    body.home-body .home-discovery-copy {
        position: relative;
        top: auto;
    }

    body.home-body .discovery-strip,
    .home-explainer-steps,
    .home-testimonials {
        grid-template-columns: 1fr;
    }

    .home-testimonials-head {
        position: relative;
        top: auto;
    }
}

@media (max-width: 768px) {
    body.home-body #ui-layer {
        padding: 18px 14px 44px;
    }

    body.home-body.chart-active #ui-layer {
        padding: var(--spacing-lg);
    }

    .home-landing {
        gap: 54px;
        margin-top: 42px;
    }

    .home-hero {
        min-height: 0;
    }

    .home-hero-copy h1 {
        font-size: clamp(3rem, 16vw, 4.7rem);
    }

    .home-hero-points {
        gap: 8px;
    }

    body.home-body #birth-form-panel {
        width: 100%;
        padding: 22px;
        border-radius: 28px;
    }

    body.home-body .input-row {
        flex-direction: column;
        gap: 16px;
    }

    body.home-body .home-discovery-copy {
        display: block;
    }

    body.home-body .home-discovery-copy h2,
    .home-explainer-head h2,
    .home-final-cta h2 {
        font-size: clamp(2.3rem, 13vw, 3.8rem);
    }

    body.home-body .home-discovery-panel {
        gap: 16px;
    }

    .home-discovery-featured {
        padding: 16px;
        border-radius: 28px;
    }

    body.home-body .discovery-strip {
        display: flex;
        gap: 12px;
        overflow-x: auto;
    }

    body.home-body .discovery-member {
        width: 230px;
        min-height: 98px;
    }

    body.home-body .discovery-chart {
        width: 284px;
        min-height: 108px;
    }

    .home-explainer,
    .home-testimonials,
    .home-final-cta {
        padding: 24px 18px;
    }

    .home-testimonial-list figure {
        padding: 20px;
        border-radius: 26px;
    }

    .home-final-cta {
        display: grid;
        align-items: start;
    }

    .home-final-cta a {
        width: 100%;
    }
}

/* Tarot reading page */
.tarot-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--text-primary);
    font-family: var(--font-main);
    background: radial-gradient(circle at 18% 8%, rgba(212, 175, 55, 0.16), transparent 30%), radial-gradient(circle at 78% 24%, rgba(80, 168, 255, 0.12), transparent 32%), #03050d;
}

.tarot-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,.82) 0 1px, transparent 1.6px), radial-gradient(circle, rgba(212,175,55,.72) 0 1px, transparent 1.7px);
    background-size: 92px 92px, 148px 148px;
    opacity: 0.38;
}

.tarot-header {
    position: relative;
    z-index: 5;
    width: min(1180px, calc(100vw - 48px));
    margin: 28px auto 0;
}

.tarot-shell {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100vw - 48px));
    margin: clamp(54px, 8vh, 86px) auto 80px;
}

.tarot-flow-shell {
    min-height: calc(100svh - 150px);
    display: grid;
    place-items: center;
    margin-top: clamp(22px, 4vh, 48px);
    margin-bottom: 40px;
}

.tarot-flow-stage {
    display: none;
    width: min(980px, 100%);
    min-height: min(720px, calc(100svh - 170px));
    place-items: center;
    align-content: center;
    gap: clamp(24px, 4vw, 40px);
    text-align: center;
}

.tarot-flow-stage.is-active {
    display: grid;
    animation: tarotStageIn 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.tarot-flow-stage:not(.is-active) {
    display: none !important;
}

.tarot-flow-copy {
    display: grid;
    justify-items: center;
}

.tarot-flow-copy h1,
.tarot-flow-copy h2 {
    max-width: 860px;
    margin: 12px 0 18px;
    font-size: clamp(3.6rem, 8vw, 7.8rem);
    line-height: 0.86;
    letter-spacing: -0.075em;
}

.tarot-flow-copy h2 {
    font-size: clamp(3rem, 6.8vw, 6.2rem);
}

.tarot-flow-copy p {
    max-width: 620px;
    margin: 0 auto;
}

.tarot-stage-panel {
    width: min(560px, 100%);
    display: grid;
    gap: 16px;
    justify-items: stretch;
    margin: 0 auto;
}

.tarot-stage-panel > label {
    color: var(--accent-gold);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-align: left;
}

.tarot-stage-panel .tarot-spread-select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.tarot-spread-choices {
    display: grid;
    gap: 12px;
}

.tarot-spread-choice {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon title"
        "icon desc";
    gap: 4px 14px;
    align-items: center;
    padding: 18px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(12, 14, 28, 0.78), rgba(4, 6, 16, 0.62));
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.tarot-spread-choice:hover,
.tarot-spread-choice.active {
    border-color: rgba(212, 175, 55, 0.68);
    background: linear-gradient(145deg, rgba(28, 22, 8, 0.82), rgba(6, 8, 18, 0.76));
    transform: translateY(-2px);
}

.tarot-spread-choice i {
    grid-area: icon;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent-gold);
    font-style: normal;
    font-size: 1.6rem;
}

.tarot-spread-choice strong {
    grid-area: title;
    font-size: 1rem;
}

.tarot-spread-choice span {
    grid-area: desc;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.9rem;
    line-height: 1.4;
}

.tarot-back-btn,
.tarot-new-reading {
    justify-self: center;
}

.tarot-flow-stage.tarot-reading-area {
    margin-top: 0;
}

.tarot-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.72fr);
    gap: clamp(34px, 6vw, 82px);
    align-items: center;
}

.tarot-hero-copy span,
.tarot-result > span {
    color: var(--accent-gold);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.tarot-hero-copy h1 {
    max-width: 760px;
    margin: 12px 0 18px;
    font-size: clamp(4rem, 9vw, 8.8rem);
    line-height: 0.82;
    letter-spacing: -0.08em;
}

.tarot-hero-copy p {
    max-width: 570px;
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.65;
}

.tarot-intention {
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(12, 14, 28, 0.82), rgba(4, 6, 16, 0.72)), radial-gradient(circle at 80% 0%, rgba(212, 175, 55, 0.16), transparent 40%);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.tarot-intention textarea {
    width: 100%;
    resize: vertical;
    min-height: 132px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font: inherit;
    line-height: 1.5;
    outline: 0;
}

.tarot-intention textarea:focus {
    border-color: rgba(212, 175, 55, 0.52);
}

.tarot-spread-select {
    width: 100%;
    min-height: 54px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0 18px;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font: inherit;
    font-weight: 800;
    outline: 0;
}

.tarot-reading-area {
    display: grid;
    gap: 34px;
    margin-top: clamp(48px, 8vw, 90px);
}

.tarot-loader {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-self: center;
    gap: 4px 12px;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
}

.tarot-loader span {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(212, 175, 55, 0.25);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tarot-loader span {
    grid-row: span 2;
}

.tarot-loader-subtitle {
    display: block;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.86rem;
    font-weight: 700;
}

.tarot-picker-note {
    justify-self: center;
    max-width: 520px;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 800;
    text-align: center;
}

.tarot-shuffle-stage {
    position: relative;
    min-height: clamp(260px, 34vw, 430px);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.tarot-shuffle-stage::before {
    content: "";
    position: absolute;
    width: min(620px, 86vw);
    aspect-ratio: 1;
    border: 1px solid rgba(212, 175, 55, 0.16);
    border-radius: 50%;
    box-shadow: inset 0 0 80px rgba(212, 175, 55, 0.04), 0 0 90px rgba(123, 223, 242, 0.04);
    animation: tarotShuffleHalo 1.15s ease-in-out both;
}

.tarot-shuffle-card {
    position: absolute;
    overflow: hidden;
    width: clamp(82px, 10vw, 118px);
    height: clamp(126px, 15vw, 178px);
    display: grid;
    place-items: center;
    gap: 6px;
    border: 1px solid rgba(212, 175, 55, 0.32);
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 34%, rgba(212, 175, 55, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(11, 14, 30, 0.98), rgba(3, 5, 13, 0.98));
    color: var(--accent-gold);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
    animation: tarotShuffleCard 1.12s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: var(--delay);
    transform-origin: 50% 120%;
}

.tarot-shuffle-card img,
.tarot-pick-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    opacity: 0.96;
}

.tarot-shuffle-card span {
    position: relative;
    z-index: 1;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(3, 5, 12, 0.66);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.22em;
}

.tarot-shuffle-card i {
    font-style: normal;
    font-size: clamp(2rem, 4vw, 3.3rem);
    text-shadow: 0 0 28px rgba(212, 175, 55, 0.34);
}

.tarot-deck-picker {
    display: grid;
    grid-template-columns: repeat(6, minmax(86px, 1fr));
    gap: clamp(10px, 1.8vw, 18px);
}

.tarot-pick-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 5 / 8;
    min-height: clamp(126px, 15vw, 190px);
    display: grid;
    place-items: center;
    gap: 8px;
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 32%, rgba(212, 175, 55, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(11, 14, 30, 0.96), rgba(3, 5, 13, 0.98));
    color: var(--accent-gold);
    cursor: pointer;
    opacity: 0;
    transform: translateY(18px) rotate(-1deg);
    animation: tarotCardEnter 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: var(--delay);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.tarot-pick-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 28%, rgba(0, 0, 0, 0.24));
    pointer-events: none;
}

.tarot-pick-card span {
    position: relative;
    z-index: 1;
    align-self: end;
    margin-bottom: 12px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(3, 5, 12, 0.64);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.24em;
}

.tarot-pick-card i,
.tarot-pick-card strong {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(42px, 5vw, 62px);
    height: clamp(42px, 5vw, 62px);
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background: rgba(3, 5, 12, 0.76);
    font-style: normal;
    font-size: clamp(2rem, 4vw, 3.3rem);
    text-shadow: 0 0 28px rgba(212, 175, 55, 0.36);
}

.tarot-pick-card.selected {
    border-color: rgba(212, 175, 55, 0.72);
    background:
        radial-gradient(circle at 50% 46%, rgba(212, 175, 55, 0.32), transparent 42%),
        linear-gradient(145deg, rgba(28, 22, 8, 0.96), rgba(7, 6, 12, 0.98));
    transform: translateY(-6px) scale(1.02);
}

.tarot-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(230px, 1fr));
    gap: clamp(16px, 3vw, 32px);
}

.tarot-card {
    min-height: clamp(430px, 38vw, 540px);
    perspective: 1200px;
    opacity: 0;
    transform: translateY(24px);
    animation: tarotCardEnter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: var(--delay);
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.tarot-card:focus-visible .tarot-card-back,
.tarot-card:focus-visible .tarot-card-front {
    border-color: rgba(212, 175, 55, 0.72);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18), 0 28px 78px rgba(0, 0, 0, 0.4);
}

.tarot-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: clamp(430px, 38vw, 540px);
    transform-style: preserve-3d;
    transition: transform 0.72s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tarot-card.revealed .tarot-card-inner {
    transform: rotateY(180deg);
}

.tarot-card-back,
.tarot-card-front {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(14px, 2vw, 22px);
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 28px;
    backface-visibility: hidden;
    box-shadow: 0 28px 78px rgba(0, 0, 0, 0.4);
}

.tarot-card-back {
    overflow: hidden;
    background:
        linear-gradient(rgba(3, 5, 12, 0.18), rgba(3, 5, 12, 0.18)),
        url('../images/tarot/rws/card-back.webp') center / cover no-repeat,
        linear-gradient(145deg, rgba(8, 10, 22, 0.95), rgba(3, 5, 12, 0.95));
}

.tarot-card-back span {
    position: relative;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(3, 5, 12, 0.7);
    color: var(--accent-gold);
    font-weight: 900;
    letter-spacing: 0.34em;
}

.tarot-card-back i,
.tarot-card-front i {
    font-style: normal;
    font-size: 4.5rem;
    color: rgba(212, 175, 55, 0.9);
    text-shadow: 0 0 28px rgba(212, 175, 55, 0.32);
}

.tarot-card-art {
    width: min(92%, 310px);
    max-height: 68%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
    filter: saturate(1.04) contrast(1.02) drop-shadow(0 0 22px rgba(212, 175, 55, 0.22));
}

.tarot-card-front {
    align-content: center;
    gap: 9px;
    text-align: center;
    background: linear-gradient(145deg, rgba(246, 231, 180, 0.08), rgba(255, 255, 255, 0.02)), rgba(10, 13, 25, 0.94);
    transform: rotateY(180deg);
}

.tarot-card-front span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tarot-card-front h3 {
    margin: 0;
    font-size: clamp(1.25rem, 2.1vw, 1.7rem);
}

.tarot-card-front small,
.tarot-card-readings strong,
.tarot-guidance strong {
    color: var(--accent-gold);
    font-weight: 900;
}

.tarot-card-front p,
.tarot-result p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.7;
}

.tarot-card-front p {
    font-size: 0.92rem;
    line-height: 1.45;
}

.tarot-result {
    display: grid;
    gap: 18px;
    max-width: 920px;
    margin: 0 auto;
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 34px;
    background: rgba(7, 9, 20, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.tarot-result h2 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 0.95;
}

.tarot-card-readings {
    display: grid;
    gap: 12px;
}

.tarot-card-readings section,
.tarot-guidance {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.045);
}

.tarot-result small {
    color: rgba(255, 255, 255, 0.48);
}

@keyframes tarotCardEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tarotShuffleHalo {
    0% {
        opacity: 0;
        transform: scale(0.72) rotate(0deg);
    }
    42% {
        opacity: 1;
        transform: scale(1) rotate(7deg);
    }
    100% {
        opacity: 0.4;
        transform: scale(0.92) rotate(18deg);
    }
}

@keyframes tarotShuffleCard {
    0% {
        opacity: 0;
        transform: translateX(-42vw) rotate(-28deg) translateY(calc((var(--i) - 6) * 8px));
    }
    42% {
        opacity: 1;
        transform: translateX(calc((var(--i) - 5.5) * 18px)) rotate(calc((var(--i) - 6) * 5deg)) translateY(calc((var(--i) - 6) * -4px));
    }
    72% {
        opacity: 1;
        transform: translateX(calc((5.5 - var(--i)) * 16px)) rotate(calc((6 - var(--i)) * 4deg)) translateY(calc((var(--i) - 6) * 5px));
    }
    100% {
        opacity: 0;
        transform: translateX(42vw) rotate(28deg) translateY(calc((var(--i) - 6) * -8px));
    }
}

@keyframes tarotStageIn {
    0% {
        opacity: 0;
        filter: blur(14px);
        transform: translateY(28px) scale(0.975);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .tarot-header,
    .tarot-shell {
        width: calc(100vw - 28px);
    }

    .tarot-header {
        margin-top: 18px;
    }

    .tarot-hero {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .tarot-flow-shell {
        min-height: calc(100svh - 110px);
        margin-top: 18px;
    }

    .tarot-flow-stage {
        min-height: calc(100svh - 130px);
    }

    .tarot-flow-copy h1,
    .tarot-flow-copy h2 {
        font-size: clamp(3rem, 15vw, 5rem);
    }

    .tarot-hero-copy h1 {
        font-size: clamp(3.3rem, 17vw, 5.2rem);
    }

    .tarot-cards {
        grid-template-columns: 1fr;
    }

    .tarot-deck-picker {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tarot-card,
    .tarot-card-inner {
        min-height: 460px;
    }

    .tarot-card-art {
        width: min(88%, 260px);
        max-height: 66%;
    }
}

@media (max-width: 768px) {
    .tarot-body {
        min-height: 100svh;
        background:
            radial-gradient(circle at 8% 4%, rgba(212, 175, 55, 0.18), transparent 34%),
            radial-gradient(circle at 92% 18%, rgba(80, 168, 255, 0.12), transparent 34%),
            linear-gradient(180deg, #050711 0%, #07101b 100%);
    }

    .tarot-stars {
        opacity: 0.3;
        background-size: 86px 86px, 136px 136px;
    }

    .tarot-header {
        width: calc(100vw - 24px);
        margin-top: 14px;
    }

    .tarot-shell {
        width: 100%;
        margin: clamp(12px, 3vh, 22px) 0 34px;
        padding: 0 12px;
    }

    .tarot-flow-shell {
        min-height: calc(100svh - 84px);
        place-items: start center;
        margin-top: 10px;
    }

    .tarot-flow-stage {
        width: 100%;
        min-height: auto;
        align-content: start;
        gap: 18px;
        padding-top: 4px;
    }

    .tarot-flow-copy {
        width: 100%;
    }

    .tarot-hero-copy span,
    .tarot-result > span {
        font-size: 0.68rem;
        letter-spacing: 0.22em;
    }

    .tarot-flow-copy h1,
    .tarot-flow-copy h2,
    .tarot-hero-copy h1 {
        max-width: 100%;
        margin: 8px 0 12px;
        font-size: clamp(2.65rem, 13.5vw, 4.15rem);
        line-height: 0.86;
        letter-spacing: -0.078em;
    }

    body[data-tarot-stage="deck"] .tarot-flow-copy h2 {
        font-size: clamp(2.55rem, 13vw, 3.95rem);
    }

    .tarot-flow-copy p,
    .tarot-hero-copy p {
        max-width: 350px;
        font-size: 0.94rem;
        line-height: 1.48;
    }

    .tarot-picker-note {
        max-width: 330px;
        font-size: 0.92rem;
    }

    .tarot-shuffle-stage {
        width: 100%;
        min-height: min(44svh, 360px);
    }

    .tarot-shuffle-card {
        width: clamp(72px, 22vw, 96px);
        height: clamp(112px, 34vw, 148px);
    }

    .tarot-deck-picker {
        width: min(100%, 430px);
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(10px, 3vw, 14px);
        padding: 4px 4px 22px;
    }

    .tarot-pick-card {
        min-height: clamp(130px, 34vw, 164px);
        border-radius: 15px;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
    }

    .tarot-pick-card.selected {
        transform: translateY(-4px) scale(1.025);
        box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.6), 0 22px 62px rgba(212, 175, 55, 0.12);
    }

    .tarot-pick-card span {
        margin-bottom: 10px;
        font-size: 0.56rem;
        letter-spacing: 0.2em;
    }

    .tarot-pick-card strong {
        width: 40px;
        height: 40px;
        font-size: 1.55rem;
    }

    body[data-tarot-stage="result"] .tarot-flow-stage {
        gap: 18px;
        padding-bottom: 40px;
    }

    body[data-tarot-stage="result"] .tarot-cards {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(7px, 2.2vw, 10px);
    }

    body[data-tarot-stage="result"] .tarot-card,
    body[data-tarot-stage="result"] .tarot-card-inner {
        min-height: clamp(238px, 62vw, 292px);
    }

    body[data-tarot-stage="result"] .tarot-card {
        cursor: default;
    }

    body[data-tarot-stage="result"] .tarot-card-back,
    body[data-tarot-stage="result"] .tarot-card-front {
        border-radius: 18px;
        padding: 8px;
    }

    body[data-tarot-stage="result"] .tarot-card-front {
        gap: 4px;
        align-content: start;
        background:
            radial-gradient(circle at 50% 16%, rgba(212, 175, 55, 0.14), transparent 44%),
            rgba(9, 12, 24, 0.96);
    }

    body[data-tarot-stage="result"] .tarot-card-art {
        width: 100%;
        max-height: 62%;
        border-radius: 7px;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.44);
    }

    body[data-tarot-stage="result"] .tarot-card-front span {
        font-size: 0.52rem;
        letter-spacing: 0.08em;
    }

    body[data-tarot-stage="result"] .tarot-card-front h3 {
        font-size: clamp(0.82rem, 3.2vw, 1rem);
        line-height: 1.05;
    }

    body[data-tarot-stage="result"] .tarot-card-front small {
        font-size: 0.68rem;
    }

    body[data-tarot-stage="result"] .tarot-card-front p {
        display: none;
    }

    .tarot-result {
        width: 100%;
        gap: 14px;
        padding: 18px;
        border-radius: 24px;
        background:
            linear-gradient(180deg, rgba(10, 13, 25, 0.92), rgba(5, 7, 16, 0.86)),
            radial-gradient(circle at 90% 0%, rgba(212, 175, 55, 0.14), transparent 38%);
    }

    .tarot-result h2 {
        font-size: clamp(1.85rem, 9vw, 2.7rem);
        line-height: 0.98;
    }

    .tarot-result p {
        font-size: 0.96rem;
        line-height: 1.62;
    }

    .tarot-card-readings section,
    .tarot-guidance {
        padding: 14px;
        border-radius: 17px;
    }

    .tarot-new-reading {
        margin-bottom: 8px;
    }
}

@media (max-width: 380px) {
    body[data-tarot-stage="result"] .tarot-card,
    body[data-tarot-stage="result"] .tarot-card-inner {
        min-height: 224px;
    }

    .tarot-deck-picker {
        gap: 8px;
    }
}
