/* ============================================
   jigglephysics.com — Stylesheet
   Dark, sleek, mobile-first
   ============================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141f;
    --bg-card: #1a1a2e;
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --accent: #ff4488;
    --accent-glow: rgba(255, 68, 136, 0.3);
    --accent-secondary: #44aaff;
    --border: #2a2a3e;
    --success: #44ff88;
    --warning: #ffaa44;
    --ad-bg: #1e1e2e;
    --radius: 12px;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
header {
    text-align: center;
    padding: 20px 0 10px;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

header h1 .dot {
    color: var(--accent);
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Daily Header */
.daily-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin: 16px 0 12px;
    border: 1px solid var(--border);
}

.day-badge {
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 8px;
}

.challenge-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.visit-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.visit-divider {
    margin: 0 4px;
    color: var(--border);
}

.instructions {
    color: var(--accent-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Game Canvas */
.game-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 450px;
    cursor: pointer;
}

.score-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}

/* Rating Section */
.rating-section {
    text-align: center;
    padding: 20px 0;
    margin-top: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.rating-section h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.stars {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.star {
    font-size: 2.2rem;
    cursor: pointer;
    color: var(--border);
    transition: color 0.2s, transform 0.2s;
}

.star:hover {
    transform: scale(1.2);
}

.star.active {
    color: var(--warning);
    text-shadow: 0 0 10px rgba(255, 170, 68, 0.5);
}

.rating-text {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Countdown */
.countdown-section {
    text-align: center;
    padding: 20px;
    margin-top: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.countdown-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-sep {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 4px;
    padding-bottom: 16px;
}

/* Share */
.share-section {
    text-align: center;
    margin-top: 16px;
}

.share-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.share-btn:active {
    transform: translateY(0);
}

/* Ad Slots */
.ad-slot {
    margin: 12px 0;
}

.ad-banner {
    text-align: center;
    padding: 8px;
}

.ad-mid {
    text-align: center;
    padding: 8px;
}

.ad-placeholder {
    background: var(--ad-bg);
    color: var(--text-secondary);
    padding: 20px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    border: 1px dashed var(--border);
}

.ad-placeholder a {
    color: var(--accent-secondary);
}

/* Footer */
footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.footer-sub {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    #game-canvas {
        height: 350px;
    }

    .star {
        font-size: 1.8rem;
    }

    .countdown-num {
        font-size: 1.5rem;
    }

    .daily-header {
        flex-direction: column;
        gap: 6px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 24px;
    }

    #game-canvas {
        height: 500px;
    }
}
