/* ============================================
   Squad — Group Regulation
   Connected, energetic, team aesthetic
   ============================================ */

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

:root {
    --bg-dark: #0a0a1a;
    --bg-mid: #121228;
    --cyan: #22d3ee;
    --cyan-light: #67e8f9;
    --cyan-dim: rgba(34, 211, 238, 0.15);
    --cyan-glow: rgba(34, 211, 238, 0.4);
    --purple: #a78bfa;
    --purple-glow: rgba(167, 139, 250, 0.4);
    --pink: #f472b6;
    --orange: #fb923c;
    --green: #4ade80;
    --yellow: #facc15;
    --text-primary: #f8fafc;
    --text-secondary: #a0aec0;
    --text-muted: #64748b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

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

/* Background */
.bg-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, var(--bg-mid) 0%, var(--bg-dark) 100%);
}

.bg-particles {
    position: absolute;
    inset: 0;
    opacity: 0.3;
}

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

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.5rem;
    opacity: 0.7;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-full);
}

.progress-dots {
    display: flex;
    gap: 8px;
}

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

.dot.active {
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-glow);
}

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

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

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

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

.squad-preview {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 25px;
}

.preview-orb {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    animation: orbit 3s ease-in-out infinite;
}

.preview-orb.o1 {
    background: var(--cyan);
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.preview-orb.o2 {
    background: var(--purple);
    bottom: 10px;
    left: 10px;
    animation-delay: 0.5s;
}

.preview-orb.o3 {
    background: var(--pink);
    bottom: 10px;
    right: 10px;
    animation-delay: 1s;
}

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

.preview-lines {
    position: absolute;
    inset: 0;
}

.preview-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan-glow), var(--purple-glow));
    opacity: 0.5;
}

.preview-line.l1 {
    width: 60px;
    top: 15px;
    left: 30px;
    transform: rotate(30deg);
}

.preview-line.l2 {
    width: 60px;
    top: 15px;
    left: 30px;
    transform: rotate(-30deg);
}

.preview-line.l3 {
    width: 80px;
    bottom: 25px;
    left: 20px;
}

.title {
    font-size: 4rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.start-btn {
    background: var(--cyan);
    color: var(--bg-dark);
    border: none;
    padding: 16px 48px;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 16px;
}

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

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

/* Phase Screens Common */
.phase-title {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
}

.phase-desc {
    color: var(--text-secondary);
    margin-bottom: 30px;
    text-align: center;
}

/* Size Screen */
.size-content {
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.size-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.size-btn {
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.size-btn:hover {
    border-color: var(--cyan);
    transform: translateY(-2px);
}

.size-btn.selected {
    border-color: var(--cyan);
    background: var(--cyan-dim);
}

.size-num {
    font-size: 2rem;
    font-weight: 600;
    color: var(--cyan);
}

.size-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Purpose Screen */
.purpose-content {
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.purpose-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.purpose-btn {
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.purpose-btn:hover {
    border-color: var(--cyan);
}

.purpose-btn.selected {
    border-color: var(--cyan);
    background: var(--cyan-dim);
}

.purpose-icon {
    font-size: 2rem;
}

.purpose-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.purpose-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
}

/* Sync Screen */
.sync-content {
    text-align: center;
    max-width: 380px;
    width: 100%;
}

.squad-circle {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 20px auto 30px;
}

.member-orb {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--bg-dark);
    transition: transform 0.5s ease;
    box-shadow: 0 0 20px var(--cyan-glow);
}

.member-orb.inhale {
    transform: scale(1.15);
}

.member-orb.exhale {
    transform: scale(0.9);
}

.member-orb:nth-child(1) { background: var(--cyan); }
.member-orb:nth-child(2) { background: var(--purple); }
.member-orb:nth-child(3) { background: var(--pink); }
.member-orb:nth-child(4) { background: var(--orange); }
.member-orb:nth-child(5) { background: var(--green); }
.member-orb:nth-child(6) { background: var(--yellow); }

.connection-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan-glow), var(--purple-glow));
    transform-origin: left center;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.connection-line.active {
    opacity: 0.8;
}

.center-breath {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breath-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--cyan);
    border-radius: 50%;
    opacity: 0.5;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.center-breath.inhale .breath-ring {
    transform: scale(1.3);
    opacity: 1;
}

.center-breath.exhale .breath-ring {
    transform: scale(0.7);
    opacity: 0.6;
}

.breath-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 2;
}

.sync-progress {
    margin-top: 20px;
}

.sync-bar {
    width: 200px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    margin: 0 auto 10px;
    overflow: hidden;
}

.sync-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.5s ease;
}

.sync-round {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Complete Screen */
.complete-content {
    text-align: center;
    max-width: 320px;
}

.complete-squad {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
}

.complete-orb {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    animation: pulse-sync 2s ease-in-out infinite;
}

@keyframes pulse-sync {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.complete-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    opacity: 0.6;
}

.complete-title {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.complete-message {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
}

.squad-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--cyan);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.complete-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-primary {
    background: var(--green);
    color: var(--bg-dark);
    border: none;
    padding: 16px 36px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(74, 222, 128, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 12px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 380px) {
    .title {
        font-size: 3rem;
    }
    
    .squad-circle {
        width: 240px;
        height: 240px;
    }
    
    .member-orb {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .center-breath {
        width: 80px;
        height: 80px;
    }
    
    .size-btn {
        padding: 16px;
        min-width: 70px;
    }
}



