/* ===========================
   PISTO PLAY — HOME.CSS
   Landing Page & Player Setup — Fully Responsive
   =========================== */

/* ── Page Layout ── */
.home-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: var(--z-base);
}

/* ── Desktop two-column grid ── */
@media (min-width: 768px) {
    .home-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: clamp(2rem, 4vw, 4rem);
        max-width: 960px;
        margin: 0 auto;
        align-items: start;
        padding: clamp(2rem, 5vh, 4rem) clamp(1.5rem, 3vw, 3rem);
        min-height: 100dvh;
        width: 100%;
    }

    body {
        overflow: hidden;
    }

    .home-page {
        min-height: 100dvh;
        overflow: hidden;
    }

    .home-footer {
        display: none;
    }
}

/* ── Mobile single column ── */
@media (max-width: 767px) {
    .home-layout {
        display: flex;
        flex-direction: column;
    }
}

/* ── Hero Section ── */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 6vh, 4rem) var(--space-5) var(--space-6);
    text-align: center;
    position: relative;
    z-index: var(--z-base);
}

@media (min-width: 768px) {
    .hero {
        padding: 0;
        text-align: left;
        align-items: flex-start;
        justify-content: center;
        min-height: auto;
        position: sticky;
        top: 0;
    }
}

.hero-logo {
    margin-bottom: var(--space-5);
    animation: logoBounce 0.8s var(--transition-spring) both;
}

.logo-emoji {
    font-size: clamp(3rem, 8vw, 5rem);
    display: block;
    filter: drop-shadow(0 0 20px rgba(249, 115, 22, 0.5));
    animation: floatBounce 4s ease-in-out infinite;
}

.logo-text {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--cream) 0%, var(--purple-300) 50%, var(--coral-400) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: var(--space-2);
    line-height: 1;
}

.logo-tagline {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: var(--space-2);
}

@keyframes logoBounce {
    from { opacity: 0; transform: scale(0.6) translateY(-20px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ── Hero Description (desktop only) ── */
.hero-desc {
    display: none;
    color: var(--text-muted);
    font-size: var(--fs-base);
    line-height: 1.6;
    max-width: 340px;
    margin-top: var(--space-4);
}

@media (min-width: 768px) {
    .hero-desc { display: block !important; }
}

/* ── Feature Pills ── */
.features-row {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    flex-wrap: wrap;
    padding: var(--space-5) var(--space-5);
    position: relative;
    z-index: var(--z-base);
}

@media (min-width: 768px) {
    .features-row {
        justify-content: flex-start;
        padding: var(--space-4) 0;
        margin-top: var(--space-5);
    }
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.feature-pill:hover {
    border-color: var(--border-accent);
    color: var(--text-secondary);
}

/* ── Player Setup Card ── */
.setup-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 1.75rem);
    position: relative;
    z-index: var(--z-base);
    animation: slideUpFade 0.6s ease 0.3s both;
}

@media (min-width: 768px) {
    .setup-card {
        margin: 0;
        max-width: 100%;
        padding: 1.75rem;
        /* Scrollable on desktop if many players */
        max-height: calc(100dvh - 4rem);
        overflow-y: auto;
    }
}

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

.setup-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ── Tab Bar ── */
.tab-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 1.25rem;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: var(--space-2) var(--space-1);
    border-radius: calc(var(--radius-md) - 4px);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-base);
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
    min-height: 36px;
    touch-action: manipulation;
    white-space: nowrap;
}

@media (min-width: 400px) {
    .tab-btn { font-size: var(--fs-sm); padding: var(--space-2) var(--space-2); }
}

.tab-btn.active {
    background: var(--purple-600);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

/* ── Tab Panels ── */
.tab-panel         { display: none; }
.tab-panel.active  { display: block; }

/* ── Register/Login Form ── */
.register-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* ── Auth Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: var(--space-2) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Save Badge ── */
.save-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--fs-xs);
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

/* ── Or Guest Link ── */
.or-guest {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-2);
    transition: color var(--transition-fast);
    touch-action: manipulation;
}

.or-guest:hover { color: var(--text-secondary); }

/* ── Players List ── */
.players-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    max-height: 260px;
    overflow-y: auto;
    padding-right: var(--space-1);
}

@media (min-width: 768px) {
    .players-list { max-height: 240px; }
}

.player-input-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: slideUpFade 0.3s ease both;
}

.player-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-600), var(--purple-800));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.player-input { flex: 1; }

.remove-player-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    touch-action: manipulation;
}

.remove-player-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ── Add Player Button ── */
.add-player-btn {
    width: 100%;
    padding: var(--space-3);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    min-height: 44px;
    touch-action: manipulation;
}

.add-player-btn:hover {
    border-color: var(--purple-500);
    color: var(--purple-400);
    background: rgba(124, 58, 237, 0.05);
}

/* ── Start Button ── */
.start-btn {
    font-size: var(--fs-lg);
    padding: var(--space-4) var(--space-6);
    letter-spacing: 0.02em;
    min-height: 52px;
}

@media (min-width: 480px) {
    .start-btn { font-size: var(--fs-xl); }
}

/* ── Validation Message ── */
.validation-msg {
    font-size: var(--fs-xs);
    color: #f87171;
    margin-top: var(--space-2);
    display: none;
    padding-left: var(--space-1);
}

.validation-msg.show {
    display: block;
    animation: slideUpFade 0.2s ease;
}

/* ── Orb Decorations ── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: clamp(200px, 40vw, 400px);
    height: clamp(200px, 40vw, 400px);
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12), transparent);
    top: -80px;
    right: -80px;
}

.orb-2 {
    width: clamp(150px, 30vw, 300px);
    height: clamp(150px, 30vw, 300px);
    background: radial-gradient(circle, rgba(249, 115, 22, 0.08), transparent);
    bottom: 80px;
    left: -60px;
}