/* ==========================================================================
   DUMB ARCADE STYLES. Loads after style.css.
   Everything starts with .gm- so nothing leaks into the other pages.
   ========================================================================== */
[hidden] { display: none !important; }
.gm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- NEW BACKGROUND: retro sunset with a moving grid floor ---------- */
body.gm-page::before { display: none; }          /* hide the usual dark gradient */
.gm-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(#12062e 0%, #3a1278 34%, #c2349b 58%, #ff7a59 72%, #ffc95c 78%, #12062e 78.1%);
}
.gm-sun {
    position: absolute;
    left: 50%; bottom: 20%;
    width: min(46vw, 340px); aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: linear-gradient(#fff08a 10%, #ff6fa8 70%);
    box-shadow: 0 0 80px rgba(255, 110, 160, .55);
    -webkit-mask-image: linear-gradient(to bottom, #000 0 52%, transparent 52% 56%, #000 56% 66%, transparent 66% 72%, #000 72% 80%, transparent 80% 87%, #000 87%);
            mask-image: linear-gradient(to bottom, #000 0 52%, transparent 52% 56%, #000 56% 66%, transparent 66% 72%, #000 72% 80%, transparent 80% 87%, #000 87%);
    animation: gmSun 6s ease-in-out infinite alternate;
}
@keyframes gmSun { to { transform: translateX(-50%) translateY(-14px); } }
.gm-floor {
    position: absolute;
    left: -60%; right: -60%; bottom: 0;
    height: 22%;
    background:
        repeating-linear-gradient(90deg, rgba(255, 90, 200, .85) 0 2px, transparent 2px 70px),
        repeating-linear-gradient(0deg, rgba(0, 230, 255, .75) 0 2px, transparent 2px 55px),
        linear-gradient(#1c0a44, #0a0220);
    transform: perspective(260px) rotateX(58deg);
    transform-origin: 50% 0;
    animation: gmGrid 1.1s linear infinite;
}
@keyframes gmGrid { to { background-position: 0 0, 0 55px, 0 0; } }
.gm-float {
    position: absolute;
    display: block;
    opacity: .9;
    animation: gmBob 5s ease-in-out infinite alternate;
}
.gm-float.f1 { left: 8%;  top: 24%; width: 46px; height: 46px; border-radius: 50%; border: 9px solid #ff8ad0; animation-duration: 4.2s; }
.gm-float.f2 { right: 9%; top: 18%; width: 0; height: 0; border-left: 26px solid transparent; border-right: 26px solid transparent; border-bottom: 46px solid #5ff2ff; animation-duration: 5.6s; }
.gm-float.f3 { left: 18%; top: 52%; width: 34px; height: 34px; background: #ffe45e; transform: rotate(18deg); animation-duration: 6.4s; }
.gm-float.f4 { right: 17%; top: 46%; width: 38px; height: 38px; border-radius: 50%; border: 7px solid #ffe45e; animation-duration: 3.8s; }
.gm-float.f5 { left: 46%; top: 12%; width: 24px; height: 24px; background: #8cff9d; border-radius: 6px; transform: rotate(-20deg); animation-duration: 5s; }
@keyframes gmBob { from { translate: 0 0; rotate: 0deg; } to { translate: 0 -22px; rotate: 25deg; } }

/* ---------- hero ---------- */
.gm-hero { padding: clamp(34px, 5vw, 58px) 0 20px; text-align: center; }
.gm-eyebrow { color: #ffe45e; animation: gmFade .8s ease both; }
.gm-hero h1 {
    font-size: clamp(34px, 5.6vw, 64px);
    line-height: 1.06;
    letter-spacing: -2.4px;
    font-weight: 600;
    margin: 14px 0;
    text-shadow: 0 4px 0 rgba(120, 20, 120, .55);
    animation: gmRise .8s .1s cubic-bezier(.2, .9, .3, 1.25) both;
}
.gm-hero mark { background: linear-gradient(transparent 62%, rgba(255, 79, 163, .75) 62%) !important; }
.gm-lede { max-width: 560px; margin: 0 auto; color: #e3d9ff !important; font-size: 15px; line-height: 1.7; animation: gmFade 1s .35s both; }
@keyframes gmRise { from { opacity: 0; transform: translateY(26px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes gmFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- game tabs ---------- */
.gm-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 560px; margin: 8px auto 22px; }
.gm-tab {
    appearance: none;
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 12px 8px;
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, .22);
    background: rgba(20, 6, 50, .6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 6px 0 rgba(10, 2, 30, .8);
    transition: transform .12s, border-color .2s, background .2s, box-shadow .12s;
}
.gm-ico { font-size: 34px; line-height: 1.15; display: inline-block; transition: transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.gm-tab strong { font-size: 13px; }
.gm-tab small { font: 10px 'Courier New', monospace; color: #c9b9ff; letter-spacing: .5px; }
.gm-tab:hover { border-color: #ff8ad0; }
.gm-tab:hover .gm-ico { transform: scale(1.25) rotate(-12deg); }
.gm-tab:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(10, 2, 30, .8); }
.gm-tab[aria-pressed="true"] { border-color: #5ff2ff; background: linear-gradient(160deg, rgba(95, 242, 255, .22), rgba(255, 79, 163, .22)); }
.gm-tab[aria-pressed="true"] .gm-ico { animation: gmWiggle 1.2s ease-in-out infinite; }
@keyframes gmWiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) scale(1.12); } }

/* ---------- stage ---------- */
.gm-stage { max-width: 480px; margin: 0 auto; padding-bottom: 70px; }
.gm-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
    padding: 10px 8px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, .2);
    background: rgba(20, 6, 50, .65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    text-align: center;
}
.gm-hud div { display: grid; gap: 2px; min-width: 0; }
.gm-k { font: 9px 'Courier New', monospace; letter-spacing: 1.5px; color: #c9b9ff; }
.gm-hud b { font: 700 18px 'Courier New', monospace; color: #fff; }
.gm-hud b.pop { animation: gmPop .3s ease; }
@keyframes gmPop { 40% { transform: scale(1.4); color: #ffe45e; } }

.gm-board {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 24px;
    border: 3px solid #fff;
    box-shadow: 0 8px 0 #5a1a8a, 0 26px 70px rgba(0, 0, 0, .55);
    background: #8fd3ff;
    touch-action: none;
}
#gl { display: block; width: 100%; height: 100%; }

.gm-toast {
    position: absolute;
    left: 50%; top: 16%;
    z-index: 4;
    transform: translateX(-50%);
    pointer-events: none;
    white-space: nowrap;
    font: 800 clamp(20px, 6vw, 30px) 'Courier New', monospace;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 3px 0 #b01a73, 0 0 18px rgba(255, 79, 163, .8);
    opacity: 0;
}
.gm-toast.show { animation: gmToast 1.1s ease-out both; }
@keyframes gmToast {
    0%   { opacity: 0; transform: translate(-50%, 14px) scale(.6) rotate(-6deg); }
    20%  { opacity: 1; transform: translate(-50%, 0) scale(1.15) rotate(3deg); }
    70%  { opacity: 1; transform: translate(-50%, -8px) scale(1) rotate(0); }
    100% { opacity: 0; transform: translate(-50%, -34px) scale(.9); }
}

.gm-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 26px;
    text-align: center;
    background: rgba(18, 6, 46, .78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity .3s;
}
.gm-overlay.hide { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.gm-overlay h2 { font-size: clamp(28px, 7vw, 38px); margin: 0; letter-spacing: -1.2px; animation: gmRise .5s both; }
.gm-overlay p { margin: 0; max-width: 310px; color: #ece6ff; font-size: 14px; line-height: 1.6; }
.gm-overlay small { color: #b6a6ee; font: 10px/1.6 'Courier New', monospace; letter-spacing: .5px; max-width: 300px; }
.gm-go {
    appearance: none;
    margin-top: 6px;
    padding: 14px 32px;
    border-radius: 14px;
    border: 2px solid #fff;
    background: linear-gradient(#ff7ac8, #e0338f);
    color: #fff;
    font: 800 14px 'Courier New', monospace;
    letter-spacing: 2px;
    box-shadow: 0 6px 0 #8a1a5a, 0 14px 26px rgba(255, 60, 160, .35);
    transition: transform .08s, box-shadow .08s;
    animation: gmPulse 1.5s ease-in-out infinite;
}
.gm-go:hover { background: linear-gradient(#ff94d4, #ee45a0); }
.gm-go:active { transform: translateY(5px); box-shadow: 0 1px 0 #8a1a5a; animation: none; }
@keyframes gmPulse { 50% { transform: scale(1.06) rotate(-1deg); } }

.gm-under { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.gm-hint { font: 10px 'Courier New', monospace; color: #c9b9ff; }
.gm-mini {
    appearance: none;
    padding: 6px 12px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(20, 6, 50, .6);
    font: 700 10px 'Courier New', monospace;
    letter-spacing: 1px;
}
.gm-mini[aria-pressed="true"] { color: #ff9cb8; border-color: rgba(255, 150, 180, .6); }

/* ---------- Potato Whack (2D game) ---------- */
.gm-whack {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: linear-gradient(#8fe0ff 0%, #c8f59a 55%, #7bc44f 100%);
}
.gm-holes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 3vw, 18px); width: 100%; }
.gm-hole {
    appearance: none;
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.gm-hole::before {          /* the dark hole */
    content: "";
    position: absolute;
    left: 6%; right: 6%; bottom: 6%;
    height: 34%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 40%, #2a170a, #120a04);
    box-shadow: 0 4px 0 #5d3a1b;
}
.gm-pop {
    position: absolute;
    left: 0; right: 0; bottom: 16%;
    text-align: center;
    font-size: clamp(38px, 11vw, 62px);
    line-height: 1;
    transform: translateY(120%);
    transition: transform .11s ease-out;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .25));
}
.gm-hole.up .gm-pop { transform: translateY(0); }
.gm-hole.hit .gm-pop { animation: gmSplat .28s ease-out both; }
.gm-hole::after {           /* dirt lip in front of the creature */
    content: "";
    position: absolute;
    left: 4%; right: 4%; bottom: 3%;
    height: 22%;
    border-radius: 50%;
    background: #7a4a24;
    box-shadow: inset 0 5px 0 #96602f;
}
@keyframes gmSplat { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(0) scale(1.5, .45); } 100% { transform: translateY(120%) scale(1); } }

@media (max-width: 520px) {
    .gm-tabs { gap: 8px; }
    .gm-tab small { display: none; }
    .gm-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .gm-sun, .gm-floor, .gm-float, .gm-eyebrow, .gm-hero h1, .gm-lede, .gm-overlay h2, .gm-go,
    .gm-tab[aria-pressed="true"] .gm-ico { animation: none; }
    .gm-ico, .gm-tab, .gm-pop { transition: none; }
}
