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

html,
body {
    width: 100%;
    height: 100%;
    /* Ensures full viewport height */
    padding: 0;
    margin: 0;
    background: #1a1a1a;
    /* Charcoal */
    /* Allow vertical scroll for SEO content, but visually hide scrollbar */
    overflow-y: auto;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    touch-action: none;
    /* Prevent browser touch gestures */
    overscroll-behavior: none;
    /* Prevent bounce effects */
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body.scroll-mode-active {
    touch-action: pan-y !important;
}

body::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.game-container {
    display: flex;
    height: 100%;
    /* Uses body's 100% height for perfect centering */
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    position: relative;
}

canvas {
    padding: 0;
    margin: 0;
    /* Glass Conservatory at Night */
    /* Solid Sky Color per User Request */
    background: #0f1c2e;
    /* Deep Hunter Green -> Midnight Blue */
    /* Brass/Bronze Border */
    border: 4px solid #a69050 !important;
    /* Antique Brass */
    border-radius: 4px;
    /* Slight rounding on frame */
    box-shadow:
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        /* Inner depth */
        0 10px 30px rgba(0, 0, 0, 0.5);
    /* Outer float */
}

/* SEO Article Styles */
article {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 40px;
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    line-height: 1.7;
    color: #1f1f1f;
    /* Ink */
    /* Field Journal / Parchment Look */
    background-color: #dcd0b3;
    /* Darker, Richer Parchment */
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.06) 100%);
    /* Vignette for age */
    border: 1px solid #b8a888;
    border-radius: 2px;
    /* Paper corners */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    /* Force native touch behavior for reading */
    touch-action: auto !important;
    position: relative;
    z-index: 10;
}

article h2 {
    font-family: 'Playfair Display', serif;
    color: #5C0120;
    /* Deep Burgundy (Ink/Seal) */
    margin-top: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 5px;
}

article h3 {
    font-family: 'Playfair Display', serif;
    color: #6f8f72;
    /* Sage Green */
    margin-top: 20px;
}

article p {
    margin-bottom: 15px;
}

/* Privacy Link Container for Article */
.privacy-link-container {
    text-align: center;
    padding: 20px;
    background-color: #dcd0b3;
    /* Match Article Parchment */
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.06) 100%);
    /* Vignette continuance */
    margin-top: -1px;
    /* visual blending */
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
    /* Spacing from bottom of screen */
    border-radius: 0 0 2px 2px;
    border: 1px solid #b8a888;
    /* border-top: none; REMOVED to show line */
    /* Merge with article */
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    /* Force native touch behavior for links */
    touch-action: auto !important;
    position: relative;
    z-index: 10;
}

.privacy-link-container a {
    color: #555;
    /* Pencil Grey */
    text-decoration: none;
    font-size: 0.9em;
}

.privacy-link-container a:hover {
    color: #5C0120;
    /* Burgundy */
    text-decoration: underline;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Ensure it's above the canvas */
}

.modal-content {
    position: relative;
    background-color: #262626;
    /* Dark Card */
    /* Matches bodyC */
    color: #e5e5e5;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 85%;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-family: 'Inter', sans-serif;
    border: 1px solid #444;
    font-weight: normal;
}

#modalTimer {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.2em;
    color: #ccc;
}

#ad-container {
    /* Dynamic sizing for Google Ads */
    width: fit-content;
    height: auto;
    min-width: 200px;
    min-height: 200px;
    max-width: 100%;
    overflow: hidden;
    background-color: #e0e0e0;
    color: #333;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 8px;
    /* Consistent rounding with Modal/Article */
}

#modalHeader {
    font-family: 'Playfair Display', serif;
    color: #c8b653;
    /* Gold */
    font-size: 2.2em;
    margin-bottom: 10px;
}

#modalScore {
    font-size: 1.2em;
    margin-bottom: 15px;
}

#modalInstructions {
    font-size: 1.1em;
    margin-top: 15px;
}

/* Share Button */
#shareBtn {
    background-color: transparent;
    border: 1px solid #c8b653;
    /* Gold Border */
    color: #c8b653;
    padding: 10px 24px;
    font-size: 1em;
    border-radius: 20px;
    /* Pill shape */
    cursor: pointer;
    margin-top: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: all 0.2s;
}

#shareBtn:hover {
    background-color: #c8b653;
    color: #1a1a1a;
}

/* Scroll Toggle Button */
#scrollToggleBtn {
    display: none;
    /* Hidden by default (Desktop) */
    position: absolute;
    /* Moves with content if inside relative container */
    bottom: 20px;
    /* Push below the canvas */
    left: 50%;
    /* Center horizontally */
    /* Center horizontally */
    transform: translateX(-50%);
    background-color: #262626;
    /* Matches Modal/Body Theme */
    color: #888;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 20px;
    /* Pill */
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    z-index: 500;
    /* Below modal (1000) */
    /* Above modal if needed, but mainly page content */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 0.9;
}

/* Only show on touch devices */
@media (pointer: coarse) {
    #scrollToggleBtn {
        display: block;
    }
}

#scrollToggleBtn:hover,
#scrollToggleBtn:active {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

#scrollToggleBtn.active {
    background-color: #1a1a1a;
    color: #c8b653;
    border-color: #c8b653;
}