/* Corgi Carnival Hub - Styles */

:root {
    --color-bg: #0a0a12;
    --color-bg-light: #1c2a4a;
    --color-accent: #d4a030;
    --color-accent-hover: #e8b840;
    --color-gold-border: #9a7520;
    --color-gold-border-hover: #d4a030;
    --color-text: #f0e6c8;
    --color-text-muted: #b8a878;
    --color-card-bg: #1c2a4a;
    --color-card-hover: #243558;
    --font-display: 'Rye', 'Georgia', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(212, 160, 48, 0.2);

    /* Circus tent stripe colors */
    --stripe-dark: #0c0c16;
    --stripe-red: #3d1414;
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;

    /* Circus tent vertical stripes */
    background-image: repeating-linear-gradient(
        90deg,
        var(--stripe-dark) 0px,
        var(--stripe-dark) 50px,
        var(--stripe-red) 50px,
        var(--stripe-red) 100px
    );
    background-size: 100px 100%;
}

/* Sparkle canvas */
#sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Searchlight effects */
.searchlight {
    position: fixed;
    bottom: -60px;
    pointer-events: none;
    z-index: 0;
    width: 600px;
    height: 130vh;
    clip-path: polygon(47% 100%, 53% 100%, 78% 0%, 22% 0%);
}

.searchlight-left {
    left: -80px;
    background: linear-gradient(
        to top,
        rgba(212, 160, 48, 0.05) 0%,
        rgba(212, 160, 48, 0.15) 30%,
        rgba(232, 190, 80, 0.35) 60%,
        rgba(255, 220, 100, 0.5) 85%,
        rgba(255, 235, 140, 0.6) 100%
    );
    transform-origin: 50% 100%;
    animation: sweep-left 7s ease-in-out infinite;
}

.searchlight-right {
    right: -80px;
    background: linear-gradient(
        to top,
        rgba(212, 160, 48, 0.05) 0%,
        rgba(212, 160, 48, 0.15) 30%,
        rgba(232, 190, 80, 0.35) 60%,
        rgba(255, 220, 100, 0.5) 85%,
        rgba(255, 235, 140, 0.6) 100%
    );
    transform-origin: 50% 100%;
    animation: sweep-right 9s ease-in-out infinite;
}

/* Light rig housings - wider than the beam */
.searchlight::after {
    content: '';
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 34px;
    background: linear-gradient(to bottom, #4a4a4a, #1a1a1a);
    border-radius: 8px 8px 4px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.12);
    border: 1px solid #555;
}

/* Small lens glow on the housing */
.searchlight::before {
    content: '';
    position: absolute;
    bottom: 52px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 8px;
    background: rgba(212, 160, 48, 0.4);
    border-radius: 50%;
    filter: blur(3px);
    z-index: 1;
}

@keyframes sweep-left {
    0%, 100% { transform: rotate(-12deg); }
    50% { transform: rotate(25deg); }
}

@keyframes sweep-right {
    0%, 100% { transform: rotate(12deg); }
    50% { transform: rotate(-25deg); }
}

/* Container */
.hub-container {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.hub-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo-area {
    margin-bottom: 0;
}

.hub-logo {
    display: block;
    max-width: 300px;
    width: 100%;
    height: auto;
    animation: logo-breathe 4s ease-in-out infinite;
}

@keyframes logo-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.hub-tagline {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: var(--color-text-muted);
    font-style: italic;
}

/* Bunting pennants */
.bunting {
    width: 100%;
    max-width: 600px;
    overflow: visible;
}

.bunting-svg {
    width: 100%;
    height: 40px;
    overflow: visible;
}

.pennant {
    transform-origin: top center;
    animation: pennant-sway 3s ease-in-out infinite;
}

.p1 { animation-delay: 0s; }
.p2 { animation-delay: 0.2s; }
.p3 { animation-delay: 0.4s; }
.p4 { animation-delay: 0.6s; }
.p5 { animation-delay: 0.8s; }
.p6 { animation-delay: 1.0s; }
.p7 { animation-delay: 1.2s; }
.p8 { animation-delay: 1.4s; }
.p9 { animation-delay: 1.6s; }

@keyframes pennant-sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Game Cards */
.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    background: var(--color-card-bg);
    border: 2px solid var(--color-gold-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
    min-width: 44px;
    min-height: 44px;
}

.game-card:hover,
.game-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--color-gold-border-hover);
}

.game-card:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Golden shimmer sweep on hover */
.card-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212, 160, 48, 0.08) 40%,
        rgba(212, 160, 48, 0.15) 50%,
        rgba(212, 160, 48, 0.08) 60%,
        transparent 100%
    );
    pointer-events: none;
    transition: none;
}

.game-card:hover .card-shimmer {
    animation: shimmer-sweep 0.8s ease forwards;
}

@keyframes shimmer-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}



.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-thumb {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
}

.card-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
}

.card-tagline {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    min-height: 2.4em;
}

/* Footer */
.hub-footer {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-copyright {
    margin: 0;
}

.footer-copyright a {
    color: var(--color-accent);
    text-decoration: none;
    opacity: 0.85;
}

.footer-copyright a:hover {
    opacity: 1;
    text-decoration: underline;
}

.tip-jar-section {
    margin-top: 4px;
    text-align: center;
}

.tip-jar-text {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin: 0 0 6px;
}

.tip-jar-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.tip-jar-btn {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s;
}

.tip-jar-btn:hover {
    transform: scale(1.08);
}

.qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    top: -4px;
}

#qr-code {
    background: #fff;
    padding: 4px;
    border-radius: 4px;
}



/* Responsive */
@media (max-width: 600px) {
    .game-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .game-card {
        flex-direction: row;
        padding: 10px;
        gap: 10px;
    }

    .card-content {
        text-align: left;
        align-items: flex-start;
    }

    .card-icon {
        flex-shrink: 0;
    }

    .card-thumb {
        width: 80px;
        height: 80px;
    }

    .hub-container {
        gap: 10px;
    }

    .hub-logo {
        max-width: 180px;
    }

    .logo-area {
        margin-bottom: 0;
    }

    .bunting {
        max-width: 100%;
    }



    .hub-footer {
        padding-top: 4px;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 12px;
    }

    .hub-container {
        gap: 12px;
    }

    .hub-header {
        gap: 6px;
    }

    .logo-area {
        margin-bottom: 0;
    }

    .hub-logo {
        max-width: 150px;
    }

    .bunting {
        display: none;
    }

    .game-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .game-card {
        padding: 12px 10px;
        gap: 8px;
    }

    .card-thumb {
        width: 80px;
        height: 80px;
    }
}
