/* Black & white MV aesthetic. Single accent: gold flash on purchase. */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a0a;
    --fg: #f2f2f2;
    --dim: #8a8a8a;
    --line: #2c2c2c;
    --gold: #e8c34a;
    /* poster display face (also the classic meme font) + clean grotesque body */
    --font-display: Impact, "Haettenschweiler", "Arial Narrow Bold", sans-serif;
    --font-body: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    /* stage spotlight: subtle radial glow behind the counter, vignette at edges */
    background:
        radial-gradient(ellipse 90% 55% at 50% 18%, #1f1f1f 0%, var(--bg) 65%),
        var(--bg);
    background-attachment: fixed;
    color: var(--fg);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
}

/* film grain overlay */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

header h1 {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    color: var(--dim);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

#count {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 7rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.25), 0 0 80px rgba(255, 255, 255, 0.1);
}

#rate {
    color: var(--dim);
    margin: 0.4rem 0 2rem;
    font-size: 0.95rem;
}

/* The big spacebar */
#spacebar {
    display: block;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 2.2rem 1rem;
    background: linear-gradient(#242424, #101010);
    border: 2px solid var(--fg);
    border-bottom-width: 8px;
    border-radius: 14px;
    color: var(--fg);
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: normal;
    letter-spacing: 0.18em;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: transform 0.05s, border-bottom-width 0.05s, box-shadow 0.3s;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 0 24px rgba(255, 255, 255, 0.07);
    animation: breathe 3s ease-in-out infinite;
}
#spacebar:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 0 40px rgba(255, 255, 255, 0.16);
}
#spacebar.pressed {
    transform: translateY(5px);
    border-bottom-width: 3px;
    animation: none;
}
@keyframes breathe {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 0 18px rgba(255,255,255,0.05); }
    50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 0 34px rgba(255,255,255,0.14); }
}
#spacebar small {
    display: block;
    margin-top: 0.6rem;
    color: var(--dim);
    font-family: var(--font-body);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    font-weight: normal;
}

#controls {
    margin: 1rem 0 2.5rem;
}
#controls button {
    background: none;
    border: 1px solid var(--line);
    color: var(--dim);
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
    margin: 0 0.25rem;
    border-radius: 6px;
    cursor: pointer;
}
#controls button:hover { color: var(--fg); border-color: var(--dim); }

/* Upgrade list */
#upgrades {
    list-style: none;
    text-align: left;
}
.upgrade {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    position: relative;
    opacity: 0.45;
    cursor: not-allowed;
    background: linear-gradient(rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: opacity 0.2s, border-color 0.2s, transform 0.15s;
}
.upgrade.buyable {
    opacity: 1;
    cursor: pointer;
    border-color: var(--fg);
}
.upgrade.buyable:hover {
    background: linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    transform: translateX(4px);
}
.upgrade.hidden { display: none; }
.upgrade.bought {
    border-color: var(--gold);
    box-shadow: 0 0 18px rgba(232, 195, 74, 0.4);
}
.upgrade h2 {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    padding-right: 3rem;
}
.upgrade .up-desc {
    color: var(--dim);
    font-size: 0.85rem;
    line-height: 1.5;
}
.upgrade .up-desc b { color: var(--fg); }
.upgrade .up-owned {
    position: absolute;
    top: 0.9rem;
    right: 1.1rem;
    color: var(--dim);
    font-size: 0.85rem;
}
.upgrade .up-owned b { color: var(--fg); font-size: 1.1rem; }
.upgrade .up-cost {
    margin-top: 0.55rem;
    font-weight: bold;
    font-size: 0.95rem;
}

/* Click popups */
.popup {
    position: fixed;
    z-index: 10;
    pointer-events: none;
    font-weight: bold;
    font-size: 1.1rem;
    animation: floatup 1.2s ease-out forwards;
    white-space: nowrap;
}
.popup.shout {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 1.8rem;
    letter-spacing: 0.08em;
    -webkit-text-stroke: 1px var(--bg);
}
@keyframes floatup {
    0%   { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); }
    100% { opacity: 0; transform: translate(-50%, -120px) rotate(3deg); }
}

/* Background rain */
.drop {
    position: fixed;
    top: -8rem;
    z-index: 1;
    color: var(--line);
    pointer-events: none;
    animation: fall linear forwards;
    filter: grayscale(1) brightness(0.85);
    opacity: 0.5;
    border-radius: 6px;
}
@keyframes fall {
    to { transform: translateY(110vh) rotate(25deg); }
}

/* Buy shake */
.shake { animation: shake 0.3s; }
@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-6px, 4px) rotate(-0.5deg); }
    50% { transform: translate(5px, -3px) rotate(0.4deg); }
    75% { transform: translate(-3px, 2px) rotate(-0.3deg); }
}

/* Site nav */
#site-nav {
    text-align: center;
    padding: 1rem 0 0;
    position: relative;
    z-index: 2;
}
#site-nav a {
    color: var(--dim);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0 0.9rem;
    border-bottom: 1px solid transparent;
}
#site-nav a:hover, #site-nav a[aria-current="page"] {
    color: var(--fg);
    border-bottom-color: var(--fg);
}

/* Inner pages */
.prose {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 2;
}
.prose h1 {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 2.2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 1.5rem 0 1rem;
}
.prose h2 {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 1.3rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 2.2rem 0 0.8rem;
}
.prose p, .prose li {
    color: var(--dim);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 0.9rem;
}
.prose b, .prose strong { color: var(--fg); }
.prose a { color: var(--fg); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose .crumbs {
    font-size: 0.75rem;
    color: var(--dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.prose .crumbs a { color: var(--dim); }

/* SEO content below the fold */
#about {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 1rem 2rem;
    border-top: 1px solid var(--line);
    position: relative;
    z-index: 2;
    text-align: left;
}
#about h2 {
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 2rem 0 0.8rem;
}
#about p {
    color: var(--dim);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.8rem;
}
#about a { color: var(--fg); }

footer {
    text-align: center;
    color: var(--dim);
    font-size: 0.72rem;
    padding: 2rem 1rem 3rem;
    line-height: 1.8;
    position: relative;
    z-index: 2;
}

@media (max-width: 600px) {
    #count { font-size: 4.5rem; }
    #spacebar { padding: 1.6rem 1rem; font-size: 1.05rem; }
}
