:root {
    --bg-black: #000000;
    --deep-teal: #008080;
    --electric-orange: #FF5733;
    --calm-teal: #00A6A6;
    --purple: #A020F0;
    --blue: #4169E1;
    --text-white: #ffffff;
    --font-inter: 'Inter', sans-serif;
}

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

body,
html {
    width: 100%;
    height: 100%;
    background: url('../common_assets/background-blur.png') no-repeat center center fixed;
    background-size: cover;
    font-family: var(--font-inter);
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 400px;
    max-height: 850px;
    background: url('../common_assets/background-blur.png') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 40px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.5);
    border: 8px solid #1a1a1a;
    overflow: hidden;
}

.cuesz-logo {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    z-index: 100;
}

/* Background Data Ring */
.data-ring-container {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
    transition: all 1s ease;
}

.data-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0.5;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    transition: border-color 1s ease;
}

.ring-1 {
    animation: spin-ring-slow 30s linear infinite;
}

.ring-2 {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border: 1px dotted rgba(255, 255, 255, 0.5);
    animation: spin-ring-slow-reverse 20s linear infinite;
}

.ring-3 {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: spin-ring-slow 40s linear infinite;
}

@keyframes spin-ring-slow {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-ring-slow-reverse {
    100% {
        transform: rotate(-360deg);
    }
}

.data-ring-container.vibe-orange .data-ring {
    border-color: var(--electric-orange);
}

.data-ring-container.vibe-teal .data-ring {
    border-color: var(--deep-teal);
}

.data-ring-container.vibe-purple .data-ring {
    border-color: var(--purple);
}

/* Master Processor: AI Orb */
.orb-container {
    position: absolute;
    top: 15%;
    z-index: 10;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 1s ease;
}

.orb-glow {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--electric-orange);
    filter: blur(25px);
    opacity: 0.6;
    z-index: 1;
    transition: background 1s ease;
}

.orb-outer-glass {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 3;
    animation: spin-ring-fast 4s linear infinite;
}

.orb-core {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff 0%, var(--electric-orange) 100%);
    box-shadow: 0 0 15px var(--electric-orange);
    z-index: 2;
    transition: background 1s ease, box-shadow 1s ease, transform 0.5s ease;
    animation: core-spin 3s linear infinite;
}

@keyframes spin-ring-fast {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes core-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(0.95);
    }

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

/* Orb focused state */
.orb-container.focused .orb-core {
    animation: core-spin 1s linear infinite;
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--electric-orange);
}

/* Vibe Colors for Master Processor */
.orb-container.vibe-teal .orb-core {
    background: radial-gradient(circle at 30% 30%, #fff 0%, var(--deep-teal) 100%);
    box-shadow: 0 0 20px var(--deep-teal);
}

.orb-container.vibe-teal .orb-glow {
    background: var(--deep-teal);
}

.orb-container.vibe-purple .orb-core {
    background: radial-gradient(circle at 30% 30%, #fff 0%, var(--purple) 100%);
    box-shadow: 0 0 20px var(--purple);
}

.orb-container.vibe-purple .orb-glow {
    background: var(--purple);
}

.message-wrapper {
    position: absolute;
    top: 18%;
    width: 100%;
    padding: 0 24px;
    text-align: center;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-text {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    min-height: 60px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--electric-orange);
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Synergy Lines */
.synergy-lines-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.synergy-line {
    fill: none;
    stroke: var(--electric-orange);
    stroke-width: 1.5;
    opacity: 0.6;
    filter: url(#glow);
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-line 1s ease forwards;
}

@keyframes draw-line {
    100% {
        stroke-dashoffset: 0;
    }
}

/* Glass Stack & Matrix */
.glass-stack {
    position: absolute;
    top: 32%;
    width: 90%;
    max-width: 360px;
    height: 60%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.glass-stack.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Part A: Mission Section */
.mission-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.5s ease;
}

.goal-card {
    width: 100%;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.card-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    transition: all 0.4s ease;
    text-align: center;
}

.mission-section.has-selection .goal-card:not(.active) {
    opacity: 0.4;
    transform: scale(0.95);
    padding: 14px 20px;
}

.goal-card.active {
    transform: scale(1.05);
    border-color: rgba(255, 87, 51, 0.6);
    box-shadow: 0 10px 30px rgba(255, 87, 51, 0.2), inset 0 0 15px rgba(255, 87, 51, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.goal-card.active .card-text {
    color: var(--electric-orange);
}

/* Part B: Lifestyle Matrix */
.lifestyle-matrix {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 1;
    transition: all 0.5s ease;
}

.lifestyle-matrix.hidden {
    display: none;
    opacity: 0;
}

.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.matrix-tile {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 24px 0;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.4s, transform 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.matrix-tile:active {
    transform: scale(0.95);
}

.matrix-tile.active {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.tile-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tile-content svg {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.4s;
}

.tile-content span {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.liquid-fill {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.matrix-tile.active .liquid-fill {
    bottom: 0;
}

.matrix-tile.active .tile-content svg {
    color: white;
    filter: drop-shadow(0 0 5px white);
}

.matrix-tile.active .tile-content span {
    color: white;
    font-weight: 600;
}

.liquid-orange {
    background: linear-gradient(to top, rgba(255, 87, 51, 0.6), transparent);
}

.liquid-teal {
    background: linear-gradient(to top, rgba(0, 128, 128, 0.6), transparent);
}

.liquid-purple {
    background: linear-gradient(to top, rgba(160, 32, 240, 0.6), transparent);
}

.liquid-blue {
    background: linear-gradient(to top, rgba(65, 105, 225, 0.6), transparent);
}

/* Ghost -> Active Button */
.btn-confirm {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: auto;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.btn-confirm.ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.btn-confirm.active-btn {
    background: var(--electric-orange);
    color: white;
    border: none;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(255, 87, 51, 0.3);
    animation: btn-pulse 2s infinite;
}

.btn-confirm:active {
    transform: scale(0.98);
}

@keyframes btn-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 87, 51, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 87, 51, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 87, 51, 0);
    }
}

/* 
 * The Secondary Layer (Lifestyle Audit Sheet) 
 */

.blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(0, 0, 0, 0.4);
    z-index: 50;
    transition: opacity 0.4s ease;
}

.blur-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.audit-sheet {
    position: absolute;
    bottom: -70%;
    left: 0;
    width: 100%;
    height: 70%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    z-index: 60;
    transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.audit-sheet.visible {
    bottom: 0;
}

.audit-sheet.hidden {
    bottom: -70%;
}

.sheet-content {
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sheet-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: 0.05em;
}

.audit-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
}

.flex-between {
    justify-content: space-between;
    width: 100%;
}

/* Diet Chips */
.chip-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Hide scrollbar */
}

.chip-scroll::-webkit-scrollbar {
    display: none;
}

.glass-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.glass-chip svg {
    transition: transform 0.3s ease;
}

.glass-chip:active {
    transform: scale(0.95);
}

.glass-chip.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--deep-teal);
    color: white;
    box-shadow: 0 0 15px rgba(0, 128, 128, 0.4);
}

.glass-chip.active svg {
    transform: scale(1.1);
    color: var(--deep-teal);
}

/* Alcohol Toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--purple);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Sub Grid for alcohol */
.sub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    opacity: 1;
    transition: all 0.4s;
    overflow: hidden;
    max-height: 200px;
}

.sub-grid.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

.glass-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.glass-icon:active {
    transform: scale(0.95);
}

.glass-icon.active {
    background: rgba(160, 32, 240, 0.2);
    border-color: var(--purple);
    color: white;
    box-shadow: 0 0 15px rgba(160, 32, 240, 0.4);
}

.btn-confirm-audit {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--electric-orange);
    color: white;
    border: none;
    margin-top: auto;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(255, 87, 51, 0.3);
}

.btn-confirm-audit:active {
    transform: scale(0.98);
}

/* Particle Stream Dissolve fx */
#particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white;
    animation: particle-fly 0.8s ease-in forwards;
}

@keyframes particle-fly {
    100% {
        opacity: 0;
        transform: translateY(-300px) scale(0);
    }
}