/* ============================================
   BASEBALL SUDOKU - APP HOMEPAGE
   "The Clubhouse"
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Color system */
    --green-deep: #0a1f0f;
    --green-dark: #14532d;
    --green-mid: #166534;
    --green-field: #22753a;
    --green-light: #4ade80;
    --green-glow: #bbf7d0;
    --navy: #1e3a5f;
    --navy-deep: #0c1929;
    --cream: #fefce8;
    --red-stitch: #dc2626;
    --red-dark: #b91c1c;
    --white: #ffffff;
    --text: #f0fdf4;
    --text-muted: #bbf7d0;
    --gold: #facc15;
    --gold-bright: #fde047;

    /* Dynamic league color (set by JS) */
    --league-color: #f92f60;
    --league-color-dark: rgba(249, 47, 96, 0.6);
    --league-next-color: #ff822d;

    /* Layout sections - simplified */
    --header-h: 9dvh;
    --logo-h: 5dvh;
    --hero-h: 37dvh;
    --cta-h: 8dvh;
    --league-h: 10dvh;
    --stats-h: 8dvh;
    --nav-h: 7dvh;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100dvh;
    height: 100vh; /* fallback */
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--green-deep);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   BACKGROUND: BLURRED WALLPAPER PHOTO
   ============================================ */
.bg-photo {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: blur(6px) brightness(0.55) saturate(1.2);
    transform: scale(1.05); /* prevent blur edge bleed */
    z-index: 0;
}

/* Light vignette overlay for readability without killing the image */
.bg-photo::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.35) 100%);
}

/* ============================================
   MAIN WRAPPER
   ============================================ */
.home-wrapper {
    position: relative;
    z-index: 1;
    height: 100dvh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    overflow: hidden;
}

/* ============================================
   1. HEADER (10%)
   ============================================ */
.home-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--league-color);
    flex-shrink: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.profile-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.league-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--league-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 5px 12px;
}

.stat-icon {
    font-size: 0.8rem;
}

.stat-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
}

/* Win rate tooltip (drops down from record) */
.record-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(0, 0, 0, 0.88);
    color: var(--gold);
    padding: 5px 12px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border: 1px solid rgba(250, 204, 21, 0.25);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.record-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 14px;
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.88);
    border-left: 1px solid rgba(250, 204, 21, 0.25);
    border-top: 1px solid rgba(250, 204, 21, 0.25);
    transform: rotate(45deg);
}

.record-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.stat-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================
   LOGO AREA (6%)
   ============================================ */
.logo-area {
    height: var(--logo-h);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.home-logo {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.6));
}

/* ============================================
   2. HERO BOARD (40%)
   ============================================ */
.hero-board {
    height: var(--hero-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 0;
    flex-shrink: 0;
    position: relative;
}

.hero-board-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 3px;
    width: 100%;
}

.challenge-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--white);
    text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

/* Help button: sits in pills row below the grid */
.help-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.25);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.help-btn:hover,
.help-btn:active {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255,255,255,0.4);
}

/* Board preview container (clickable link to today's puzzle) */
.board-preview-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: transform 0.15s ease;
    width: 100%;
    min-height: 0;
}

/* The 9x9 mini grid - league colored frame */
.mini-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 1px;
    background: var(--league-color);
    padding: 5px;
    border-radius: 14px;
    aspect-ratio: 1;
    height: 100%;
    max-height: calc(var(--hero-h) - 60px);
    width: auto;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.5),
        0 0 0 3px var(--league-color),
        0 0 30px var(--league-color-dark);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

/* Cells: white with dark text (matches game.html look) */
.preview-cell {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #1e3a5f;
    transition: background 0.2s ease;
    position: relative;
    overflow: hidden;
}

.preview-cell.filled {
    background: #ffffff;
    color: #1e3a5f;
    font-weight: bold;
}

.preview-cell.highlight-cell {
    background: rgba(74, 222, 128, 0.2);
}

/* 3x3 box borders using margin on specific cells */
.preview-cell:nth-child(3n) {
    margin-right: 2px;
}
.preview-cell:nth-child(9n) {
    margin-right: 0;
}

/* Row 3 and Row 6 bottom borders */
.preview-cell:nth-child(n+19):nth-child(-n+27) {
    margin-bottom: 2px;
}
.preview-cell:nth-child(n+46):nth-child(-n+54) {
    margin-bottom: 2px;
}

/* Status pills below board */
.status-pills {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}

.pill-streak {
    color: var(--gold);
    border-color: rgba(250, 204, 21, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.pill-invite {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.pill-invite:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.55);
}

.board-preview-container:active {
    transform: scale(0.98);
}

/* Hit animation canvas overlay */
#hit-animation-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* ============================================
   3. PRIMARY CTA (9%) - Two buttons side by side
   ============================================ */
.primary-cta {
    height: var(--cta-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 0 8px;
}

.btn-play-ball {
    flex: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    background: var(--league-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    box-shadow:
        0 4px 15px var(--league-color-dark),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    animation: ctaPulse 3s ease-in-out infinite;
}

.btn-play-ball:hover,
.btn-play-ball:active {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

@keyframes ctaPulse {
    0%, 100% {
        box-shadow: 0 4px 15px var(--league-color-dark), inset 0 1px 0 rgba(255,255,255,0.2);
    }
    50% {
        box-shadow: 0 4px 25px var(--league-color-dark), inset 0 1px 0 rgba(255,255,255,0.2), 0 0 20px var(--league-color-dark);
    }
}

.btn-daily-puzzle {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--white);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-daily-puzzle:hover,
.btn-daily-puzzle:active {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.55);
}

/* ============================================
   4. LEAGUE PROGRESS (11%)
   ============================================ */
.league-progress {
    height: var(--league-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 4px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.league-card {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid var(--league-color, rgba(255, 255, 255, 0.15));
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 10px var(--league-color-dark, rgba(0,0,0,0.1));
}

.league-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 52px;
}

.badge-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.badge-name {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--league-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    white-space: nowrap;
}

.progress-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--league-color), var(--league-next-color));
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 8px var(--league-color);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    border-radius: 5px;
}

.progress-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
}

/* ============================================
   5. STATS ROW (8%) - Coins, Hints, Streak
   ============================================ */
.stats-row {
    height: var(--stats-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 4px;
    margin: 0;
    flex-shrink: 0;
}

.stat-tile {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.69);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.stat-tile:hover {
    border-color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.5);
}

.stat-tile-icon {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
}

.stat-tile-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0px;
    min-width: 0;
}

.stat-tile-label {
    font-size: 0.5rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.stat-tile-value {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
}

/* ============================================
   7. BOTTOM NAV
   ============================================ */
.bottom-nav {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: 16px;
    margin: 0 4px 6px;
    padding: 0 8px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    transition: color 0.2s ease, transform 0.15s ease;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
    transform: scale(0.92);
    color: var(--white);
}

.nav-item.active {
    color: var(--white);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--league-color);
    border-radius: 0 0 2px 2px;
}

.nav-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.nav-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Coming Soon Toast */
.coming-soon-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid var(--league-color, rgba(255,255,255,0.2));
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 200;
}

.coming-soon-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   MODALS
   ============================================ */
.home-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
}

.home-overlay.active {
    display: block;
}

.home-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 380px;
    max-height: 80vh;
    background: rgba(10, 20, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 28px 24px;
    z-index: 110;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
}

.home-modal.active {
    display: block;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rule-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.rule-card:last-child {
    border-bottom: none;
}

.rule-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--league-color);
    flex-shrink: 0;
}

.rule-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}

.rule-card p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
}

.btn-got-it {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-got-it:hover {
    border-color: rgba(255,255,255,0.3);
    color: var(--white);
}

/* ============================================
   WELCOME/ONBOARDING OVERLAY
   ============================================ */
.welcome-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--green-deep);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    text-align: center;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-logo {
    height: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.welcome-screen h1 {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 12px;
    color: var(--white);
}

.welcome-screen h1 .highlight {
    background: linear-gradient(135deg, var(--green-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 32px;
    max-width: 340px;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.btn-welcome {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-welcome-primary {
    background: linear-gradient(135deg, var(--green-field) 0%, var(--green-mid) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(34, 117, 58, 0.4);
}

.btn-welcome-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(34, 117, 58, 0.5);
}

.btn-welcome-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid rgba(74, 222, 128, 0.25);
}

.btn-welcome-secondary:hover {
    border-color: var(--green-light);
    color: var(--white);
}

/* Onboarding carousel */
.onboarding-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--green-deep);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    text-align: center;
}

.onboarding-screen.hidden {
    display: none;
}

.onboarding-card {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 340px;
    animation: fadeInUp 0.4s ease;
}

.onboarding-card.active {
    display: flex;
}

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

.onboarding-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.onboarding-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
}

.onboarding-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.onboarding-dots {
    display: flex;
    gap: 8px;
    margin: 24px 0;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.2);
    transition: all 0.3s ease;
}

.onboarding-dot.active {
    background: var(--green-light);
    width: 24px;
    border-radius: 4px;
}

.btn-onboarding-next {
    padding: 12px 32px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--green-field), var(--green-mid));
    color: var(--white);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 117, 58, 0.3);
    transition: all 0.2s ease;
}

.btn-onboarding-skip {
    padding: 8px 16px;
    border: none;
    background: none;
    color: rgba(187, 247, 208, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

/* Position icons grid (onboarding card 1) */
.positions-diamond {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
    gap: 6px;
    margin: 12px 0;
}

.pos-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.pos-icon img {
    width: 32px;
    height: 32px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Short phones */
@media (max-height: 667px) {
    :root {
        --header-h: 9dvh;
        --logo-h: 5dvh;
        --hero-h: 37dvh;
        --cta-h: 8dvh;
        --league-h: 10dvh;
        --stats-h: 7dvh;
        --nav-h: 7dvh;
    }

    .mini-grid {
        max-height: calc(37dvh - 50px);
    }

    .btn-play-ball {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .btn-daily-puzzle {
        padding: 10px 12px;
        font-size: 0.75rem;
    }

    .league-card {
        padding: 8px 10px;
    }

    .stat-tile {
        padding: 4px 4px;
    }
}

/* Very short phones (SE, older devices) */
@media (max-height: 568px) {
    :root {
        --header-h: 8dvh;
        --logo-h: 4dvh;
        --hero-h: 35dvh;
        --cta-h: 8dvh;
        --league-h: 9dvh;
        --stats-h: 7dvh;
        --nav-h: 7dvh;
    }

    .home-logo {
        height: 34px;
    }

    .profile-avatar {
        width: 30px;
        height: 30px;
    }

    .stats-row {
        gap: 6px;
    }
}

/* Tablets */
@media (min-width: 768px) {
    .home-wrapper {
        max-width: 420px;
    }

    .mini-grid {
        max-height: min(calc(var(--hero-h) - 60px), 300px);
    }
}

/* Landscape */
@media (orientation: landscape) and (max-height: 500px) {
    .home-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 100%;
        padding: 0 24px;
    }

    .home-header {
        width: 100%;
        height: 48px;
    }

    .logo-area {
        display: none;
    }

    .hero-board {
        flex: 1;
        height: calc(100dvh - 96px);
    }

    .primary-cta {
        width: 200px;
        height: calc(100dvh - 96px);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 20px;
    }

    .league-progress,
    .stats-row {
        display: none;
    }

    .bottom-nav {
        width: 100%;
        height: 48px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
