/* ── Golfy Golf — Cyan Theme ─────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #050e12;
    --bg-card: #0a171d;
    --bg-card-hover: #0f2229;
    --border-subtle: rgba(0, 229, 230, 0.08);
    --border-hover: rgba(0, 229, 230, 0.3);
    --text-primary: #e0f7fa;
    --text-secondary: #80cbc4;
    --text-muted: #4a7c78;
    --accent-primary: #00e5e6;
    --accent-secondary: #009a9b;
    --accent-glow: rgba(0, 229, 230, 0.2);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ── Animated background ─────────────────────────── */
.bg-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-effects .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
    animation: floatOrb 20s ease-in-out infinite;
}

.bg-effects .orb:nth-child(1) {
    width: 500px; height: 500px;
    background: var(--accent-primary);
    top: -15%; left: -10%;
}

.bg-effects .orb:nth-child(2) {
    width: 400px; height: 400px;
    background: var(--accent-secondary);
    bottom: -15%; right: -10%;
    animation-delay: -7s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-15px, 40px) scale(0.95); }
    75% { transform: translate(20px, 15px) scale(1.02); }
}

/* ── Top nav bar ─────────────────────────────────── */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid rgba(0, 229, 230, 0.1);
    backdrop-filter: blur(20px);
    background: rgba(5, 14, 18, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav .back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88em;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-smooth);
}

.top-nav .back-link:hover {
    color: var(--accent-primary);
    border-color: var(--border-hover);
    background: rgba(0, 229, 230, 0.06);
}

.top-nav .back-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.top-nav .game-title-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.05em;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

/* ── Page layout ─────────────────────────────────── */
.page-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 24px 20px;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ── Ad slots ────────────────────────────────────── */
.ad-slot {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    background: rgba(0, 229, 230, 0.03);
    border: 1px dashed rgba(0, 229, 230, 0.12);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75em;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ad-slot-sidebar {
    width: 160px;
    min-height: 600px;
    background: rgba(0, 229, 230, 0.03);
    border: 1px dashed rgba(0, 229, 230, 0.12);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.7em;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    flex-shrink: 0;
}

.game-and-ads {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

/* ── Game container ──────────────────────────────── */
.game-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5),
                0 0 0 1px var(--border-subtle);
    max-width: 1060px;
    width: 100%;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 15px;
}

.header h1 {
    color: var(--text-primary);
    font-size: 2.2em;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 10px;
    text-shadow: 0 0 25px rgba(0, 229, 230, 0.3);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 1em;
    font-weight: 600;
}

.stat {
    background: var(--bg-primary);
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03),
                0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
}

.stat span {
    color: var(--accent-primary);
    font-weight: 700;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    display: inline-block;
}

#gameCanvas {
    display: block;
    border: 2px solid rgba(0, 229, 230, 0.15);
    border-radius: var(--radius-md);
    background: #2a9d4e;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(0, 229, 230, 0.05);
    cursor: grab;
    width: 100%;
    height: auto;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#gameCanvas:active {
    cursor: grabbing;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.btn {
    padding: 10px 22px;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-secondary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    font-family: inherit;
    margin-left: 10px;
}

.btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 229, 230, 0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#nextHoleBtn {
    background: var(--accent-secondary);
    color: #fff;
    animation: pulse 1.5s infinite;
    border: 1px solid var(--accent-primary);
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: none;
    pointer-events: auto;
    font-size: 1em;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    margin-left: 0;
}

#nextHoleBtn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

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

.instructions {
    background: var(--bg-primary);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-top: 10px;
    border: 1px solid var(--border-subtle);
}

.instructions h3 {
    color: var(--accent-primary);
    margin-bottom: 8px;
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.instructions p {
    color: var(--text-muted);
    margin: 4px 0;
    font-size: 0.85em;
    line-height: 1.5;
}

/* ── Screen-reader only ──────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── SEO content ─────────────────────────────────── */
.seo-content {
    max-width: min(95vw, 700px);
    margin: 0 auto;
    color: var(--text-muted);
    padding: 16px 16px 0;
    text-align: center;
}

.seo-content h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.seo-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

/* ── More Games recommendation ───────────────────── */
.more-games {
    max-width: min(95vw, 600px);
    margin: 0 auto;
    padding: 20px 16px 0;
    text-align: center;
}

.more-games-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.more-games-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.rec-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 16px 10px 10px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    min-width: 260px;
    max-width: 360px;
}

.rec-card:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 229, 230, 0.06);
    transform: translateY(-2px);
}

.rec-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.rec-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.rec-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.rec-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.35;
}

.rec-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(0, 229, 230, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 2px;
}

.more-games-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
}

.more-games-link:hover {
    text-decoration: underline;
}

/* ── Footer ──────────────────────────────────────── */
.page-footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

.page-footer p {
    color: var(--text-muted);
    font-size: 0.82em;
}

.page-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.page-footer a:hover {
    text-decoration: underline;
}

/* ── Fullscreen button ───────────────────────────── */
.fullscreen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 20;
    font-size: 1.4em;
    padding: 4px 10px;
    line-height: 1;
    min-width: 0;
    background: rgba(10, 23, 29, 0.85);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}
.fullscreen-btn:hover {
    background: rgba(0, 229, 230, 0.15);
    color: var(--accent-primary);
}

/* ── Fullscreen mode ─────────────────────────────── */
.game-container:fullscreen {
    background: var(--bg-primary);
    border-radius: 0;
    padding: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
}

.game-container:fullscreen .header,
.game-container:fullscreen .controls,
.game-container:fullscreen .instructions {
    display: none;
}

.game-container:fullscreen .canvas-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-container:fullscreen #gameCanvas {
    border-radius: 0;
    width: auto;
    height: auto;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

/* ── Mobile responsive ───────────────────────────── */
@media (max-width: 1100px) {
    .ad-slot-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .top-nav {
        padding: 10px 16px;
    }

    .top-nav .game-title-nav {
        font-size: 0.9em;
    }

    .page-content {
        padding: 12px 0;
        gap: 12px;
    }

    .ad-slot {
        max-width: 100%;
        min-height: 60px;
        border-radius: 0;
    }

    .game-container {
        border-radius: 0;
        padding: 8px;
        max-width: 100vw;
    }

    .header h1 {
        font-size: 1.4em;
        letter-spacing: 2px;
        margin-bottom: 6px;
    }

    .stats {
        gap: 6px;
        font-size: 0.8em;
    }

    .stat {
        padding: 5px 10px;
    }

    .controls {
        padding: 8px;
        margin: 6px 0;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.8em;
    }

    .fullscreen-btn {
        top: 4px;
        right: 4px;
        padding: 6px 12px;
        font-size: 1.6em;
    }

    #gameCanvas {
        border-radius: 6px;
        border-width: 1px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.1em;
        letter-spacing: 1px;
    }

    .stats {
        gap: 4px;
        font-size: 0.7em;
    }

    .stat {
        padding: 4px 8px;
        border-radius: 6px;
    }

    .controls {
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* ── Landscape mobile — maximize canvas, keep sleek look ─ */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 0;
        margin: 0;
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
        background: var(--bg-primary);
    }

    /* Compact nav — thin strip with back link + title */
    .top-nav {
        padding: 4px 14px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        border-bottom: 1px solid rgba(0, 229, 230, 0.12);
        background: rgba(5, 14, 18, 0.92);
        backdrop-filter: blur(16px);
    }

    .top-nav .back-link {
        font-size: 0.75em;
        padding: 3px 10px;
    }

    .top-nav .game-title-nav {
        font-size: 0.85em;
    }

    .bg-effects .orb {
        opacity: 0.1;
    }

    .page-content {
        padding: 28px 0 0 0;
        gap: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        justify-content: center;
    }

    .game-and-ads {
        width: 100%;
        height: calc(100vh - 28px);
        height: calc(100dvh - 28px);
        flex: 1;
        min-height: 0;
        justify-content: center;
        align-items: center;
    }

    .ad-slot, .ad-slot-sidebar {
        display: none;
    }

    .game-container {
        padding: 4px;
        border-radius: var(--radius-sm);
        max-width: 100%;
        width: auto;
        height: calc(100vh - 36px);
        height: calc(100dvh - 36px);
        background: var(--bg-card);
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6),
                    0 0 0 1px var(--border-subtle),
                    0 0 30px rgba(0, 229, 230, 0.04);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header, .controls, .instructions {
        display: none;
    }

    .canvas-wrapper {
        width: auto;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #gameCanvas {
        border-radius: var(--radius-sm);
        border: 1px solid rgba(0, 229, 230, 0.15);
        width: auto;
        height: 100%;
        max-height: calc(100vh - 44px);
        max-height: calc(100dvh - 44px);
        box-shadow: 0 0 16px rgba(0, 229, 230, 0.06);
    }

    .fullscreen-btn {
        top: 2px;
        right: 2px;
        z-index: 10;
        padding: 2px 8px;
        font-size: 1.1em;
    }

    .page-footer {
        display: none;
    }

    .seo-content {
        display: none;
    }

    .more-games {
        display: none;
    }
}