/* ============================================
   ZONE — Find Your Calm | PNEUOMA
   A regulation game using the Zones framework
   ============================================ */

/* CSS Variables - Zone Colors */
:root {
    /* Zone Colors */
    --zone-blue: #5B9BD5;
    --zone-blue-light: #A5C8E4;
    --zone-blue-dark: #2E5A87;
    --zone-blue-bg: #1a2a3a;

    --zone-green: #70C490;
    --zone-green-light: #A8E0BC;
    --zone-green-dark: #3D8B5A;
    --zone-green-bg: #1a2d24;

    --zone-yellow: #F5C842;
    --zone-yellow-light: #FAE08A;
    --zone-yellow-dark: #C49A1A;
    --zone-yellow-bg: #2d2a1a;

    --zone-red: #E85D5D;
    --zone-red-light: #F5A0A0;
    --zone-red-dark: #B83A3A;
    --zone-red-bg: #2d1a1a;

    /* Neutral */
    --bg-dark: #0f1419;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Sizing */
    --nav-height: 60px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Game Container */
.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
    transition: background-color 1s ease;
}

.game-container.zone-blue { background: var(--zone-blue-bg); }
.game-container.zone-green { background: var(--zone-green-bg); }
.game-container.zone-yellow { background: var(--zone-yellow-bg); }
.game-container.zone-red { background: var(--zone-red-bg); }

/* Navigation */
.game-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

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

.back-link:hover {
    color: var(--text-primary);
}

.current-zone-indicator {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

/* ========== TITLE SCREEN ========== */
.title-screen {
    background: linear-gradient(135deg, #1a1f25 0%, #0f1419 100%);
}

.title-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    padding: 20px;
}

/* Zone Logo - Concentric Rings */
.zone-logo {
    margin-bottom: 30px;
}

.zone-rings {
    position: relative;
    width: 140px;
    height: 140px;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid currentColor;
    animation: ring-pulse 3s ease-in-out infinite;
}

.ring-red {
    width: 140px;
    height: 140px;
    top: 0;
    left: 0;
    color: var(--zone-red);
    animation-delay: 0s;
}

.ring-yellow {
    width: 105px;
    height: 105px;
    top: 17.5px;
    left: 17.5px;
    color: var(--zone-yellow);
    animation-delay: 0.2s;
}

.ring-green {
    width: 70px;
    height: 70px;
    top: 35px;
    left: 35px;
    color: var(--zone-green);
    animation-delay: 0.4s;
}

.ring-blue {
    width: 35px;
    height: 35px;
    top: 52.5px;
    left: 52.5px;
    color: var(--zone-blue);
    animation-delay: 0.6s;
}

.ring-center {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 64px;
    left: 64px;
    background: var(--zone-green);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--zone-green);
}

@keyframes ring-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 1; }
}

.game-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--zone-green) 0%, var(--zone-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 40px;
}

.title-description {
    max-width: 400px;
    margin-bottom: 40px;
}

.title-description p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--zone-green) 0%, var(--zone-green-dark) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(112, 196, 144, 0.3);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

.title-footer {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.age-badge, .time-badge, .control-badge {
    padding: 6px 14px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Ambient Background */
.ambient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.ambient-bg::before,
.ambient-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: ambient-float 15s ease-in-out infinite;
}

.ambient-bg::before {
    width: 400px;
    height: 400px;
    background: var(--zone-green);
    top: -100px;
    right: -100px;
}

.ambient-bg::after {
    width: 300px;
    height: 300px;
    background: var(--zone-blue);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

@keyframes ambient-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

/* ========== CHECK-IN SCREEN ========== */
.checkin-screen {
    padding: 80px 20px 40px;
    overflow-y: auto;
}

.checkin-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.checkin-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

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

/* Zones Grid */
.zones-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
}

.zone-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.zone-card:hover {
    transform: translateY(-4px);
}

.zone-card.zone-blue {
    color: var(--zone-blue);
}
.zone-card.zone-blue:hover {
    background: rgba(91, 155, 213, 0.1);
    border-color: var(--zone-blue);
    box-shadow: 0 10px 40px rgba(91, 155, 213, 0.2);
}

.zone-card.zone-green {
    color: var(--zone-green);
}
.zone-card.zone-green:hover {
    background: rgba(112, 196, 144, 0.1);
    border-color: var(--zone-green);
    box-shadow: 0 10px 40px rgba(112, 196, 144, 0.2);
}

.zone-card.zone-yellow {
    color: var(--zone-yellow);
}
.zone-card.zone-yellow:hover {
    background: rgba(245, 200, 66, 0.1);
    border-color: var(--zone-yellow);
    box-shadow: 0 10px 40px rgba(245, 200, 66, 0.2);
}

.zone-card.zone-red {
    color: var(--zone-red);
}
.zone-card.zone-red:hover {
    background: rgba(232, 93, 93, 0.1);
    border-color: var(--zone-red);
    box-shadow: 0 10px 40px rgba(232, 93, 93, 0.2);
}

.zone-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
}

.zone-icon svg {
    width: 100%;
    height: 100%;
}

.zone-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: currentColor;
    margin-bottom: 4px;
}

.zone-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.zone-feelings {
    display: flex;
    gap: 8px;
    font-size: 1.5rem;
}

.checkin-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* ========== ACTIVITY SCREEN ========== */
.activity-screen {
    padding: 0;
}

.activity-landscape {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.activity-landscape canvas {
    width: 100%;
    height: 100%;
}

.activity-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    text-align: center;
}

.activity-progress {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 10;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--zone-yellow), var(--zone-green));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-zones {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ========== ACTIVITY OVERLAYS ========== */
.activity-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    padding: 20px;
}

.activity-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Breathing Activity */
#breathingActivity {
    background: radial-gradient(circle at center, rgba(112, 196, 144, 0.1) 0%, transparent 70%);
}

.breathing-circle {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breath-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid var(--zone-green);
    border-radius: 50%;
    opacity: 0.3;
}

.breath-core {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--zone-green) 0%, var(--zone-green-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 60px rgba(112, 196, 144, 0.4);
    transition: transform 4s ease-in-out;
}

.breathing-circle.inhale .breath-core {
    transform: scale(1.4);
}

.breathing-circle.exhale .breath-core {
    transform: scale(1);
}

.breath-text {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-align: center;
}

.breath-instruction {
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.breath-counter {
    margin-top: 20px;
    padding: 10px 20px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Grounding Activity */
#groundingActivity {
    background: radial-gradient(circle at center, rgba(91, 155, 213, 0.1) 0%, transparent 70%);
}

.grounding-content {
    text-align: center;
    max-width: 400px;
}

.grounding-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--zone-blue);
}

.grounding-prompt {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.grounding-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.step-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--zone-blue);
}

.step-sense {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.grounding-items {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ground-item {
    width: 40px;
    height: 40px;
    border: 2px solid var(--zone-blue);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ground-item.found {
    background: var(--zone-blue);
    transform: scale(1.1);
}

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

/* Movement Activity */
#movementActivity {
    background: radial-gradient(circle at center, rgba(232, 93, 93, 0.1) 0%, transparent 70%);
}

.movement-content {
    text-align: center;
}

.movement-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--zone-red);
}

.movement-figure {
    width: 150px;
    height: 200px;
    margin: 0 auto 30px;
}

.figure-svg {
    width: 100%;
    height: 100%;
}

.figure-head, .figure-body, .figure-arm, .figure-leg {
    stroke: var(--zone-red);
    stroke-width: 4;
    stroke-linecap: round;
    fill: none;
}

.figure-head {
    fill: var(--zone-red);
}

.movement-figure.shaking .figure-arm-left {
    animation: shake-left 0.1s ease-in-out infinite;
}

.movement-figure.shaking .figure-arm-right {
    animation: shake-right 0.1s ease-in-out infinite;
}

@keyframes shake-left {
    0%, 100% { transform: rotate(-5deg); transform-origin: 50px 50px; }
    50% { transform: rotate(5deg); transform-origin: 50px 50px; }
}

@keyframes shake-right {
    0%, 100% { transform: rotate(5deg); transform-origin: 50px 50px; }
    50% { transform: rotate(-5deg); transform-origin: 50px 50px; }
}

.movement-instruction {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.movement-timer {
    width: 200px;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    width: 0%;
    background: var(--zone-red);
    border-radius: 4px;
    transition: width 0.1s linear;
}

/* ========== COMPLETE SCREEN ========== */
.complete-screen {
    background: var(--zone-green-bg);
}

.complete-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    max-width: 500px;
}

.complete-visual {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

.complete-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--zone-green) 0%, transparent 70%);
    opacity: 0.3;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
}

.complete-icon {
    position: relative;
    width: 100%;
    height: 100%;
    color: var(--zone-green);
}

.complete-icon svg {
    width: 100%;
    height: 100%;
}

.complete-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--zone-green);
    margin-bottom: 10px;
}

.complete-message {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

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

.journey-start, .journey-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.journey-zone {
    font-size: 2.5rem;
}

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

.journey-arrow {
    color: var(--text-muted);
    width: 50px;
}

.complete-tip {
    background: var(--bg-card);
    padding: 20px 30px;
    border-radius: 16px;
    margin-bottom: 40px;
}

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

.tip-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

.complete-actions {
    display: flex;
    gap: 16px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .game-title {
        font-size: 2.5rem;
        letter-spacing: 0.2em;
    }

    .zones-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .zone-card {
        flex-direction: row;
        text-align: left;
        gap: 16px;
    }

    .zone-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .zone-feelings {
        justify-content: flex-start;
    }

    .complete-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

