/**
 * Connect by Zoccio - Split Screen Layout
 * 
 * 60% Game (left) | 40% Zoccio Promo (right)
 * 100vh height, no scroll on desktop
 */

/* ================================
   CSS Variables - Zoccio Brand
   ================================ */

:root {
    --zoccio-green: #16a34a;
    --zoccio-green-dark: #15803d;
    --zoccio-green-light: #dcfce7;
    --zoccio-green-bright: #22c55e;
    --zoccio-text: #0f172a;
    --zoccio-text-muted: #64748b;
    --zoccio-border: #e2e8f0;
    --zoccio-bg: #f9fafb;
    --zoccio-white: #ffffff;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ================================
   Global Styles
   ================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    color: var(--zoccio-text);
    overflow: hidden; /* No scroll on desktop */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   Split Container - 100vh
   ================================ */

.split-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ================================
   Split Panels
   ================================ */

.split-panel {
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Left Panel - Game (60%) */
.split-panel--game {
    flex: 0 0 60%;
    background: var(--zoccio-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    gap: 0;
}

/* Right Panel - Promo (40%) */
.split-panel--promo {
    flex: 0 0 40%;
    background: var(--zoccio-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    border-left: 1px solid var(--zoccio-border);
}

/* ================================
   Game Section
   ================================ */

.game {
    width: 100%;
    max-width: 500px;
}

/* ================================
   Digital Timer (centered above grid)
   ================================ */

.game__digital-timer {
    text-align: center;
    margin-bottom: 1.5rem;
}

.game__digital-timer--hidden {
    display: none;
}

.game__digital-timer-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #16a34a !important;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
    display: inline-block;
    min-width: 200px;
    text-align: center;
}

/* ================================
   Victory Time Display
   ================================ */

.game__victory-time {
    text-align: center;
    margin-bottom: 0.75rem;
    animation: game-fade-in 0.5s ease;
}

.game__victory-time--hidden {
    display: none;
}

.game__victory-time-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--zoccio-green);
    line-height: 1;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

@keyframes game-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================
   Game Grid
   ================================ */

.game__grid-container {
    position: relative;
    margin-bottom: 1rem;
}

.game__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    box-sizing: border-box;
    overflow: hidden;
    border: 2px solid var(--zoccio-border);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease;
}

.game__grid--victory {
    transform: rotate(3deg) scale(0.88);
    box-shadow: 12px 12px 30px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

/* ================================
   Grid Cells
   ================================ */

.game__cell {
    background: var(--zoccio-white);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--zoccio-border);
}

.game__cell--number {
    background: var(--zoccio-white);
    z-index: 2;
}

.game__cell--number::before {
    content: attr(data-number);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55%;
    height: 55%;
    background: #1e293b;
    color: var(--zoccio-white);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
    z-index: 3;
    position: relative;
}

.game__cell--start {
    background: #dcfce7; /* Light green to match Zoccio */
}

.game__cell--path.game__cell--start {
    background: #dcfce7;
}

/* Path styling - orange gradient */
.game__cell--path {
    background: var(--zoccio-white);
}

.game__cell--path::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
    border-radius: 50%;
    z-index: 1;
}

/* Connection lines */
.game__line-up {
    position: absolute;
    top: 0;
    left: 50%;
    width: 60%;
    height: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
    z-index: 1;
}

.game__line-down {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 60%;
    height: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
    z-index: 1;
}

.game__line-left {
    position: absolute;
    left: 0;
    top: 50%;
    width: 50%;
    height: 60%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
    z-index: 1;
}

.game__line-right {
    position: absolute;
    right: 0;
    top: 50%;
    width: 50%;
    height: 60%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
    z-index: 1;
}

.game__cell--path.game__cell--number::before {
    z-index: 3;
    background: #1e293b;
    color: var(--zoccio-white);
}

.game__cell--current::after {
    background: linear-gradient(135deg, #fdba74 0%, #fb923c 50%, #f97316 100%);
}

/* Wall styling */
.game__cell--wall-top {
    border-top: 3px solid #000000;
}

.game__cell--wall-bottom {
    border-bottom: 3px solid #000000;
}

.game__cell--wall-left {
    border-left: 3px solid #000000;
}

.game__cell--wall-right {
    border-right: 3px solid #000000;
}

/* ================================
   Game Controls
   ================================ */

.game__controls {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
    margin: 0 auto;
}

.game__controls--hidden {
    display: none;
}

.game__button--hidden {
    display: none;
}

.game__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--font-main);
    height: 38px;
    box-sizing: border-box;
}

.game__button--primary {
    background: var(--zoccio-green);
    color: var(--zoccio-white);
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.game__button--primary:hover {
    background: var(--zoccio-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
}

.game__button--primary:active {
    transform: translateY(0);
}

.game__button--secondary {
    background: var(--zoccio-white);
    color: #374151;
    border: 1px solid #e5e7eb;
}

.game__button--secondary:hover {
    background: #f3f4f6;
}

.game__button--ghost {
    background: var(--zoccio-white);
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.game__button--ghost:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ================================
   Game Message (below game)
   ================================ */

.game-message {
    margin-top: 1.5rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
    padding: 1.25rem;
    background: var(--zoccio-white);
    border-radius: 12px;
    border: 2px solid var(--zoccio-green-light);
}

.game-message__text {
    font-size: 1.125rem;
    color: var(--zoccio-text);
    margin: 0;
    line-height: 1.5;
    font-weight: 600;
}

/* ================================
   Game Disclaimer (bottom of game)
   ================================ */

.game-disclaimer {
    margin-top: 1.5rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.game-disclaimer__text {
    font-size: 0.625rem;
    color: var(--zoccio-text-muted);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.game-disclaimer__text:last-child {
    margin-bottom: 0;
}

/* Mobile Disclaimer (only shows on mobile) */
.game-disclaimer-mobile {
    display: none;
}

.game-disclaimer-mobile__text {
    font-size: 0.625rem;
    color: var(--zoccio-text-muted);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    text-align: center;
}

.game-disclaimer-mobile__text:last-child {
    margin-bottom: 0;
}

/* ================================
   Game Start Overlay
   ================================ */

.game-start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 60%; /* Match game panel width */
    height: 100vh;
    background: rgba(249, 250, 251, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-start-overlay--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.game-start-button {
    background: linear-gradient(135deg, var(--zoccio-green) 0%, var(--zoccio-green-dark) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 2rem 4rem;
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-main);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

.game-start-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(22, 163, 74, 0.5);
}

.game-start-button:active {
    transform: translateY(-2px);
}

/* ================================
   Promo Section (Zoccio Hero)
   ================================ */

.promo {
    max-width: 450px;
    width: 100%;
}

.promo__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.promo__logo-icon {
    width: 40px;
    height: 40px;
    background: var(--zoccio-green-bright);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--zoccio-white);
}

.promo__logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--zoccio-text);
}

.promo__headline {
    font-size: 2rem;
    font-weight: 800;
    color: var(--zoccio-text);
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

/* Hide mobile headline by default (desktop) */
.promo__headline--mobile {
    display: none;
}

/* Show desktop headline by default */
.promo__headline--desktop {
    display: block;
}

.promo__subtitle {
    font-size: 1.125rem;
    color: var(--zoccio-text-muted);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.promo__benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.promo__benefit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    font-size: 1.125rem;
    color: var(--zoccio-text);
}

.promo__benefit i {
    color: var(--zoccio-green);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.promo__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--zoccio-green);
    color: var(--zoccio-white);
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.promo__cta:hover {
    background: var(--zoccio-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.promo__cta:active {
    transform: translateY(0);
}

.promo__note {
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: var(--zoccio-text-muted);
}

/* ================================
   Responsive Design
   ================================ */

/* Tablet and below - Stack vertically */
@media (max-width: 1024px) {
    body {
        overflow-y: auto; /* Allow scroll on tablet/mobile */
    }
    
    .split-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .split-panel--game,
    .split-panel--promo {
        flex: 1 1 auto;
        width: 100%;
    }
    
    .split-panel--promo {
        order: 1; /* Show promo first on mobile */
        border-left: none;
        border-top: none;
        border-bottom: 1px solid var(--zoccio-border);
        padding: 3rem 2rem; /* More left/right padding */
        text-align: center; /* Center all content */
    }
    
    /* Center promo content on mobile */
    .promo {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .promo__logo {
        justify-content: center;
    }
    
    /* Add more padding to headline and subtitle */
    .promo__headline {
        padding: 0 1.5rem;
    }
    
    .promo__subtitle {
        padding: 0 1.5rem;
    }
    
    /* Center bullets as a group but keep them left-justified */
    .promo__benefits {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Left-justify within the centered container */
        width: auto; /* Shrink to content width */
        max-width: 100%;
    }
    
    .promo__benefit {
        justify-content: flex-start; /* Left-align text within benefit */
        text-align: left; /* Left-align text */
        width: 100%;
    }
    
    /* Mobile overlay - full width */
    .game-start-overlay {
        width: 100%;
    }
    
    .game-start-button {
        padding: 1.5rem 3rem;
        font-size: 2rem;
    }
    
    .split-panel--game {
        order: 2; /* Show game second on mobile */
        min-height: 100vh;
        padding: 2rem 1.5rem;
    }
    
    /* Hide disclaimer in game panel on mobile */
    .game-disclaimer {
        display: none;
    }
    
    /* Show mobile disclaimer at end */
    .game-disclaimer-mobile {
        display: block;
        padding: 2rem 1.5rem;
        text-align: center;
        background: var(--zoccio-bg);
    }
    
    /* Mobile-specific headline */
    .promo__headline--mobile {
        display: block;
    }
    
    .promo__headline--desktop {
        display: none;
    }
    
    .promo__headline {
        font-size: 1.75rem;
    }
    
    .promo__subtitle {
        font-size: 1rem;
    }
    
    .promo__benefit {
        font-size: 1rem;
    }
    
    .promo__cta {
        font-size: 1.125rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .split-panel--game {
        padding: 1.5rem 1rem;
    }
    
    .split-panel--promo {
        padding: 2.5rem 1rem;
    }
    
    .game__title {
        font-size: 1.25rem;
    }
    
    .game__subtitle {
        font-size: 0.8125rem;
    }
    
    .game__cell--number::before {
        font-size: 0.75rem;
    }
    
    .game__button {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .game__controls {
        gap: 0.5rem;
    }
    
    .game-message {
        padding: 1rem;
    }
    
    .game-message__text {
        font-size: 0.9375rem;
    }
    
    .game-message__link {
        font-size: 1rem;
    }
    
    .promo__logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }
    
    .promo__logo-text {
        font-size: 1.5rem;
    }
    
    .promo__headline {
        font-size: 1.5rem;
    }
    
    .promo__subtitle {
        font-size: 0.9375rem;
    }
    
    .promo__benefit {
        font-size: 0.9375rem;
        padding: 0.5rem 0;
    }
    
    .promo__benefit i {
        font-size: 1.125rem;
    }
    
    .promo__cta {
        font-size: 1rem;
        padding: 0.875rem 1.75rem;
    }
    
    .promo__note {
        font-size: 0.875rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .game__victory-time-value {
        font-size: 2rem;
    }
    
    .game-message__text {
        font-size: 0.875rem;
    }
    
    .promo__headline {
        font-size: 1.375rem;
    }
}

/* ==========================================
   LAPTOP OPTIMIZATION (avoid scrollbar)
   Target: 1366x768, 1440x900, etc.
   ========================================== */

@media (min-width: 1025px) and (max-height: 900px) {
    /* Reduce game panel padding */
    .split-panel--game {
        padding: 1rem;
    }
    
    /* Scale down game container */
    .game {
        max-width: 420px;
    }
    
    /* Smaller timer */
    .game__digital-timer-value {
        font-size: 2rem !important;
        min-width: 160px;
    }
    
    .game__victory-time-value {
        font-size: 2.25rem;
    }
    
    /* Reduce margins */
    .game__grid-container {
        margin-bottom: 0.75rem;
    }
    
    /* Smaller buttons */
    .game__button {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    /* Smaller message box */
    .game-message {
        margin-top: 1rem;
        padding: 0.875rem;
    }
    
    .game-message__text {
        font-size: 0.9375rem;
        line-height: 1.4;
    }
    
    /* Much smaller disclaimer */
    .game-disclaimer {
        margin-top: 0.75rem;
    }
    
    .game-disclaimer__text {
        font-size: 0.5rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
    }
    
    /* Reduce promo panel padding and sizes */
    .split-panel--promo {
        padding: 2rem 1.5rem;
    }
    
    .promo {
        max-width: 380px;
    }
    
    .promo__logo {
        margin-bottom: 1.5rem;
    }
    
    .promo__logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .promo__logo-text {
        font-size: 1.125rem;
    }
    
    .promo__headline {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .promo__subtitle {
        font-size: 0.9375rem;
        margin-bottom: 1.5rem;
    }
    
    .promo__benefits {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .promo__benefit {
        font-size: 0.875rem;
    }
    
    /* Laptop start button */
    .game-start-button {
        padding: 1.5rem 3rem;
        font-size: 2rem;
    }
    
    .promo__cta {
        padding: 0.875rem 2rem;
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .promo__note {
        font-size: 0.8125rem;
    }
}

/* Extra tight for very short laptops (like 768px height) */
@media (min-width: 1025px) and (max-height: 800px) {
    .game {
        max-width: 380px;
    }
    
    .game__digital-timer-value {
        font-size: 1.75rem !important;
        min-width: 140px;
    }
    
    .game-message {
        padding: 0.625rem;
    }
    
    .game-message__text {
        font-size: 0.875rem;
    }
    
    .game-disclaimer__text {
        font-size: 0.45rem;
        line-height: 1.2;
    }
    
    .promo__headline {
        font-size: 1.375rem;
    }
    
    .promo__subtitle {
        font-size: 0.875rem;
    }
}

/* ==========================================
   ZOCCIO MODAL (Every 3 plays)
   ========================================== */

.zoccio-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.zoccio-modal-overlay.active {
    display: flex;
}

.zoccio-modal {
    background: var(--zoccio-white);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.4s ease-out;
    padding: 3rem 2.5rem;
}

.zoccio-modal__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--zoccio-text-muted);
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.zoccio-modal__close:hover {
    background: var(--zoccio-bg);
    color: var(--zoccio-text);
}

.zoccio-modal__content {
    text-align: center;
}

.zoccio-modal__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.zoccio-modal__logo-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--zoccio-green) 0%, #15803d 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.zoccio-modal__logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--zoccio-text);
    letter-spacing: -0.02em;
}

.zoccio-modal__headline {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--zoccio-text);
    margin: 0 0 1.25rem 0;
    line-height: 1.3;
}

.zoccio-modal__text {
    font-size: 1.125rem;
    color: var(--zoccio-text-muted);
    line-height: 1.6;
    margin: 0 0 2rem 0;
}

.zoccio-modal__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--zoccio-green) 0%, #15803d 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
    margin-bottom: 1rem;
}

.zoccio-modal__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.zoccio-modal__note {
    font-size: 0.875rem;
    color: var(--zoccio-text-muted);
    margin: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Mobile adjustments */
@media (max-width: 768px) {
    .zoccio-modal {
        padding: 2.5rem 2rem;
    }
    
    .zoccio-modal__headline {
        font-size: 1.5rem;
    }
    
    .zoccio-modal__text {
        font-size: 1rem;
    }
    
    .zoccio-modal__cta {
        font-size: 1rem;
        padding: 0.875rem 2rem;
    }
}

/* Print */
@media print {
    .split-panel--promo {
        display: none;
    }
}
