/* ============================================
   Anchor — Anxiety Grounding
   Ocean depth theme, rising to surface
   ============================================ */

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

:root {
    --ocean-deep: #0a1628;
    --ocean-mid: #0d2847;
    --ocean-light: #1a4a6e;
    --ocean-surface: #2d7d9a;
    --text-primary: #e8f4f8;
    --text-secondary: #8ab4c7;
    --text-muted: #5a8a9d;
    --accent: #4ecdc4;
    --accent-dim: rgba(78, 205, 196, 0.15);
    --accent-glow: rgba(78, 205, 196, 0.4);
    --calm: #4ecdc4;
    --moderate: #ffe66d;
    --intense: #ff6b6b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
    --transition: 0.4s ease;
    --transition-slow: 1s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--ocean-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Ocean Background */
.ocean-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        var(--ocean-deep) 0%,
        var(--ocean-mid) 50%,
        var(--ocean-light) 100%);
    transition: background 3s ease;
}

.water-layer {
    position: absolute;
    inset: 0;
    opacity: 0.3;
}

.water-layer.layer-1 {
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 Q25 0 50 10 T100 10 V20 H0Z' fill='%234ecdc4' opacity='0.1'/%3E%3C/svg%3E") repeat-x;
    background-size: 200px 40px;
    animation: wave 8s linear infinite;
}

.water-layer.layer-2 {
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 Q25 0 50 10 T100 10 V20 H0Z' fill='%232d7d9a' opacity='0.15'/%3E%3C/svg%3E") repeat-x;
    background-size: 150px 30px;
    animation: wave 6s linear infinite reverse;
}

.water-layer.layer-3 {
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 Q25 0 50 10 T100 10 V20 H0Z' fill='%231a4a6e' opacity='0.2'/%3E%3C/svg%3E") repeat-x;
    background-size: 180px 35px;
    animation: wave 10s linear infinite;
}

@keyframes wave {
    from { background-position-x: 0; }
    to { background-position-x: 200px; }
}

/* Light Rays */
.light-rays {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 100%;
    background: 
        linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 50%),
        repeating-linear-gradient(
            -15deg,
            transparent,
            transparent 50px,
            rgba(255,255,255,0.02) 50px,
            rgba(255,255,255,0.02) 100px
        );
    opacity: 0.5;
    pointer-events: none;
}

/* Bubbles */
.bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, 
        rgba(255,255,255,0.4) 0%, 
        rgba(255,255,255,0.1) 50%, 
        transparent 70%);
    animation: rise var(--rise-duration, 8s) linear infinite;
    animation-delay: var(--rise-delay, 0s);
}

@keyframes rise {
    0% {
        transform: translateY(100vh) scale(1);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(-20vh) scale(1.2);
        opacity: 0;
    }
}

/* Depth Indicator */
.depth-indicator {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    gap: 10px;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.depth-indicator.visible {
    opacity: 1;
}

.depth-track {
    width: 6px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    position: relative;
    overflow: visible;
}

.depth-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, var(--accent) 0%, var(--ocean-surface) 100%);
    border-radius: var(--radius-full);
    transition: height 1s ease;
}

.anchor-icon {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    font-size: 1.5rem;
    transition: bottom 1s ease;
}

.depth-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 200px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Navigation */
.game-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.back-link:hover {
    opacity: 1;
}

.phase-counter {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 500;
}

/* Screens */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Title Screen */
.title-content {
    text-align: center;
    padding: 20px;
    max-width: 420px;
}

.anchor-symbol {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: float 4s ease-in-out infinite;
}

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

.title {
    font-size: 3.5rem;
    font-weight: 200;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: 20px;
    font-weight: 300;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 35px;
    font-weight: 300;
}

/* Technique Preview */
.technique-preview {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 30px;
}

.technique-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.technique-steps {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.technique-steps span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.technique-steps strong {
    color: var(--accent);
    font-size: 1.2rem;
    margin-right: 3px;
}

/* Buttons */
.start-btn, .continue-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #3db8b0 100%);
    color: var(--ocean-deep);
    border: none;
    padding: 18px 50px;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 15px;
}

.start-btn:hover, .continue-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px var(--accent-glow);
}

.time-estimate {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Check-in Screen */
.checkin-content, .checkout-content {
    text-align: center;
    padding: 20px;
    max-width: 400px;
    width: 100%;
}

.checkin-title, .checkout-title {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.checkin-subtitle, .checkout-subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Anxiety Scale */
.anxiety-scale {
    margin-bottom: 40px;
}

.scale-track {
    position: relative;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    margin-bottom: 15px;
}

.scale-track input[type="range"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.scale-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, var(--calm) 0%, var(--moderate) 50%, var(--intense) 100%);
    border-radius: var(--radius-full);
    transition: width 0.2s ease;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.scale-value {
    font-size: 3rem;
    font-weight: 200;
    color: var(--accent);
    margin-top: 20px;
}

/* Grounding Screen */
.grounding-content {
    padding: 80px 30px 30px;
    max-width: 500px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sense-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.sense-number {
    font-size: 4rem;
    font-weight: 200;
    color: var(--accent);
    line-height: 1;
}

.sense-info {
    flex: 1;
}

.sense-name {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 5px;
}

.sense-instruction {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.sense-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Items Container */
.items-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-content: center;
    padding: 20px 0;
}

.item-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.5rem;
    color: var(--text-muted);
}

.item-circle:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.item-circle.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ocean-deep);
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.item-circle .checkmark {
    display: none;
}

.item-circle.active .checkmark {
    display: block;
}

.item-circle.active .item-num {
    display: none;
}

/* Sense Progress */
.sense-progress {
    text-align: center;
    padding-top: 20px;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all var(--transition);
}

.progress-dot.complete {
    background: var(--accent);
}

.progress-dot.current {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.progress-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Breath Screen */
.breath-content {
    text-align: center;
}

.breath-circle {
    width: 180px;
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.breath-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--accent);
    opacity: 0.3;
    animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(0.8); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.breath-text {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--accent);
}

#breathInstruction {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Checkout/Results */
.grounded-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #3db8b0 100%);
    color: var(--ocean-deep);
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    animation: checkPop 0.5s ease;
}

@keyframes checkPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Results */
.results-content {
    text-align: center;
    padding: 20px;
    max-width: 400px;
}

.results-title {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 30px;
}

.results-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.result-before, .result-after {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 200;
}

.result-before .result-value {
    color: var(--intense);
}

.result-after .result-value {
    color: var(--calm);
}

.result-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.results-change {
    background: var(--accent-dim);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
}

.change-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
}

.change-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.results-message {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 30px;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

.btn {
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--ocean-deep);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    border-color: var(--accent);
}

.results-tip {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Rising Effect - As grounding progresses, background lightens */
.game-container.depth-1 .ocean-bg {
    background: linear-gradient(180deg, var(--ocean-deep) 0%, var(--ocean-mid) 60%, var(--ocean-light) 100%);
}

.game-container.depth-2 .ocean-bg {
    background: linear-gradient(180deg, var(--ocean-mid) 0%, var(--ocean-light) 60%, var(--ocean-surface) 100%);
}

.game-container.depth-3 .ocean-bg {
    background: linear-gradient(180deg, var(--ocean-light) 0%, var(--ocean-surface) 70%, #4fa8b8 100%);
}

.game-container.depth-4 .ocean-bg {
    background: linear-gradient(180deg, var(--ocean-surface) 0%, #4fa8b8 60%, #6bc5d0 100%);
}

.game-container.depth-5 .ocean-bg {
    background: linear-gradient(180deg, #4fa8b8 0%, #6bc5d0 50%, #8dd8e0 100%);
}

/* Responsive */
@media (max-width: 600px) {
    .title {
        font-size: 2.5rem;
    }
    
    .sense-header {
        flex-wrap: wrap;
    }
    
    .sense-number {
        font-size: 3rem;
    }
    
    .item-circle {
        width: 60px;
        height: 60px;
    }
    
    .depth-indicator {
        right: 15px;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}



