/* ============================================================
   CCG FOOTER — OMEGA SHARED SYSTEM (PARITY LOCK)
   W5.1 — MICRO POLISH (ACCESSIBILITY + LINK CLARITY)
   ------------------------------------------------------------
   • Fully isolated footer styling
   • Safe for all pages (root + nested)
   • C64 / Amiga mode aware
   • Mobile-first spacing
   • Cinematic fade-out & grounding
   • Subtle neon divider glow (non-distracting)
   • Footer-scoped link + focus-visible polish (W5.1)
============================================================ */

/* ------------------------------------------------------------
   FOOTER ROOT
------------------------------------------------------------ */

.ccg-footer {
    position: relative;
    margin-top: var(--ccg-footer-gap);
    padding: 22px 16px 26px;

    text-align: center;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,0.85),
            rgba(0,0,0,0.55),
            rgba(0,0,0,0.35)
        );
    background-image: none;

    border-top: 1px solid rgba(255,255,255,0.06);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 -18px 60px rgba(0,0,0,0.7);

    isolation: isolate;
    overflow: hidden;
    opacity: 1;
}

@media (min-width: 1024px) {
    .ccg-footer {
        margin-top: clamp(24px, 4vh, 42px);
        padding: 18px 16px 22px;
    }

    .ccg-footer__hint {
        margin-top: 12px;
    }

    .ccg-footer__counter-wrap {
        padding: 4px 0;
    }

    .ccg-footer-signature {
        margin-top: 6px;
        padding: 12px 16px;
    }
}

/* ------------------------------------------------------------
   ATMOSPHERIC FADE (DEPTH LAYER)
------------------------------------------------------------ */

.ccg-footer::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;

    background:
        radial-gradient(
            ellipse at center top,
            rgba(255,255,255,0.06),
            transparent 60%
        );

    pointer-events: none;
    opacity: 0.6;
}

/* ------------------------------------------------------------
   NEON DIVIDER STRIP (HORIZON LINE)
------------------------------------------------------------ */

.ccg-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 14%;
    right: 14%;
    height: 1px;
    z-index: 1;

    background:
        linear-gradient(
            to right,
            transparent,
            rgba(var(--ccg-neon-blue-rgb),0.6),
            transparent
        );

    box-shadow:
        0 0 8px rgba(var(--ccg-neon-blue-rgb),0.30);

    opacity: 0.75;
}

/* ------------------------------------------------------------
   FOOTER CONTENT WRAPPING (PARITY SAFE)
------------------------------------------------------------ */

.ccg-footer,
.ccg-footer-inner {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------------------------
   FOOTER TEXT
------------------------------------------------------------ */

.ccg-footer__text,
.ccg-footer-text {
    margin: 0;
    padding: 6px 0;

    font-family: var(--ccg-font-body, 'Roboto', sans-serif);
    font-size: 0.85rem;
    line-height: 1.45;

    color: rgba(232,236,255,0.78);
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

.ccg-footer-text--small {
    font-size: 0.78rem;
    opacity: 0.72;
}

/* ------------------------------------------------------------
   FOOTER COUNTER WRAP — CENTER ALIGN
------------------------------------------------------------ */

.ccg-footer__counter-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: rgba(232,236,255,0.78);
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

/* ------------------------------------------------------------
   FOOTER COUNTER — NEON NUMERAL BADGE
------------------------------------------------------------ */

.ccg-footer__counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 7ch;
    padding: 6px 14px;

    font-family: var(--ccg-font-main, 'Orbitron', sans-serif);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    font-variant-numeric: tabular-nums;

    color: rgba(232, 246, 255, 0.98);

    background:
        linear-gradient(160deg, rgba(8, 20, 40, 0.95), rgba(16, 34, 64, 0.75));
    border: 1px solid rgba(var(--ccg-neon-blue-rgb), 0.55);
    border-radius: 999px;

    box-shadow:
        0 0 14px rgba(var(--ccg-neon-blue-rgb), 0.38),
        inset 0 0 12px rgba(var(--ccg-neon-blue-rgb), 0.15);
    text-shadow:
        0 0 12px rgba(var(--ccg-neon-blue-rgb), 0.65),
        0 2px 4px rgba(0, 0, 0, 0.65);
}

/* ------------------------------------------------------------
   FOOTER LINKS — CLARITY & ACCESSIBILITY (W5.1)
------------------------------------------------------------ */

.ccg-footer a {
    position: relative;
    z-index: 2;

    color: rgba(232,236,255,0.85);
    text-decoration: none;

    transition:
        color 0.18s ease,
        text-shadow 0.18s ease;
}

.ccg-footer a:hover {
    color: #ffffff;
    text-shadow:
        0 0 6px rgba(255,255,255,0.35);
}

/* Keyboard focus — visible but calm */
.ccg-footer a:focus-visible {
    outline: none;
    text-shadow:
        0 0 0 2px rgba(0,0,0,0.9),
        0 0 8px rgba(0,170,255,0.55);
}

/* ------------------------------------------------------------
   MODE TINTING (NEON HORIZON)
------------------------------------------------------------ */

/* C64 MODE (BLUE) */
[data-ccg-mode="c64"] .ccg-footer::before {
    background:
        linear-gradient(
            to right,
            transparent,
            rgba(0,170,255,0.65),
            transparent
        );

    box-shadow:
        0 0 10px rgba(0,170,255,0.40);
}

[data-ccg-mode="c64"] .ccg-footer a:focus-visible {
    text-shadow:
        0 0 0 2px rgba(0,0,0,0.9),
        0 0 8px rgba(0,170,255,0.65);
}

/* AMIGA MODE (PINK) */
[data-ccg-mode="amiga"] .ccg-footer::before {
    background:
        linear-gradient(
            to right,
            transparent,
            rgba(255,41,224,0.65),
            transparent
        );

    box-shadow:
        0 0 12px rgba(255,41,224,0.40);
}

[data-ccg-mode="amiga"] .ccg-footer a:focus-visible {
    text-shadow:
        0 0 0 2px rgba(0,0,0,0.9),
        0 0 10px rgba(255,41,224,0.65);
}

/* ------------------------------------------------------------
   MOBILE REFINEMENT
------------------------------------------------------------ */

@media (max-width: 640px) {

    .ccg-footer {
        padding: 18px 14px 22px;
    }

    .ccg-footer::before {
        left: 8%;
        right: 8%;
    }

    .ccg-footer::after {
        opacity: 0.45;
    }

    .ccg-footer__text,
    .ccg-footer-text {
        font-size: 0.82rem;
    }

    .ccg-footer__counter {
        font-size: 1rem;
        letter-spacing: 0.14em;
        min-width: 6.5ch;
    }
}

/* ------------------------------------------------------------
   REDUCED MOTION — ACCESSIBILITY (W5)
------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

    .ccg-footer::before,
    .ccg-footer::after {
        opacity: 0.45;
    }

    .ccg-footer a {
        transition: none;
    }
}

/* ============================================================
   FOOTER SIGNATURE MODULE — OMEGA SAFE
============================================================ */

.ccg-footer-signature {
    position: relative;
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    font-family: var(--ccg-font-robotron);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(0,0,0,0.85), rgba(0,0,0,0.65));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 10px 28px rgba(0,0,0,0.75),
        inset 0 0 0 1px rgba(255,255,255,0.04);
}

/* Panels */
.ccg-footer-signature__panel {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
}

.ccg-footer-signature__panel.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Archive panel */
.ccg-footer-archive-title {
    font-weight: 800;
    letter-spacing: 0.22em;
}

.ccg-footer-archive-sub {
    font-size: 0.66rem;
    opacity: 0.75;
    letter-spacing: 0.14em;
    line-height: 1.4;
}

/* Phrase panel */
.ccg-footer-phrase {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    opacity: 0.9;
}

/* Mode colouring */
body[data-ccg-mode="c64"] .ccg-footer-signature {
    box-shadow:
        0 10px 28px rgba(0,0,0,0.75),
        0 0 18px rgba(0,180,255,0.35);
}

body[data-ccg-mode="amiga"] .ccg-footer-signature {
    box-shadow:
        0 10px 28px rgba(0,0,0,0.7),
        0 0 14px rgba(160,170,190,0.25);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ccg-footer-signature__panel {
        transition: none;
        opacity: 0;
    }
    .ccg-footer-signature__panel[data-footer-panel="status"] {
        opacity: 1;
        position: relative;
        transform: none;
    }
}

/* ============================================================
   GOATCOUNTER VIEW COUNTER — NEON GREEN ENHANCEMENT
   (OMEGA SAFE ADDITIVE PATCH)
============================================================ */

/* Base neon green counter (C64 default) */
.ccg-footer__counter {
    color: rgba(210, 255, 235, 0.98);

    border-color: rgba(0, 255, 170, 0.65);

    box-shadow:
        0 0 16px rgba(0, 255, 170, 0.55),
        inset 0 0 14px rgba(0, 255, 170, 0.22);

    text-shadow:
        0 0 14px rgba(0, 255, 170, 0.85),
        0 2px 4px rgba(0, 0, 0, 0.65);
}

/* C64 MODE — GREEN / TEAL CRT */
body[data-ccg-mode="c64"] .ccg-footer__counter {
    border-color: rgba(0, 255, 190, 0.7);
    box-shadow:
        0 0 18px rgba(0, 255, 190, 0.6),
        inset 0 0 16px rgba(0, 255, 190, 0.25);
}

/* AMIGA MODE — PINK / PURPLE (PARITY) */
body[data-ccg-mode="amiga"] .ccg-footer__counter {
    border-color: rgba(255, 80, 220, 0.6);
    box-shadow:
        0 0 16px rgba(255, 80, 220, 0.5),
        inset 0 0 14px rgba(255, 80, 220, 0.22);

    text-shadow:
        0 0 14px rgba(255, 80, 220, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.65);
}

/* Reduced motion — no glow pulsing */
@media (prefers-reduced-motion: reduce) {
    .ccg-footer__counter {
        box-shadow:
            0 0 10px rgba(var(--accent-rgb), 0.35),
            inset 0 0 8px rgba(var(--accent-rgb), 0.18);
    }
}

/* ============================================================
   FOOTER VISITOR COUNTER — NEON LED STYLE
   ------------------------------------------------------------
   • Retro LED / VFD inspired
   • High contrast, CRT-friendly
   • Respects Omega footer layout
============================================================ */

.ccg-footer__counter-wrap {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0 1.25rem;
}

.ccg-footer__counter {
    font-family: "Orbitron", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    text-transform: lowercase;

    color: #4cff9a; /* neon green */
    background: rgba(10, 30, 20, 0.6);

    padding: 0.45rem 0.9rem;
    border-radius: 999px;

    border: 1px solid rgba(76, 255, 154, 0.35);

    text-shadow:
        0 0 4px rgba(76, 255, 154, 0.6),
        0 0 10px rgba(76, 255, 154, 0.45),
        0 0 18px rgba(76, 255, 154, 0.25);

    box-shadow:
        inset 0 0 12px rgba(76, 255, 154, 0.18),
        0 0 12px rgba(76, 255, 154, 0.25);

    backdrop-filter: blur(2px);
}

/* Emphasise the numeric part slightly */
.ccg-footer__counter span {
    font-weight: 600;
}

/* Optional subtle pulse (very restrained) */
@media (prefers-reduced-motion: no-preference) {
    .ccg-footer__counter {
        animation: ccg-led-glow 4.5s ease-in-out infinite;
    }

    @keyframes ccg-led-glow {
        0%, 100% {
            box-shadow:
                inset 0 0 12px rgba(76, 255, 154, 0.18),
                0 0 12px rgba(76, 255, 154, 0.25);
        }
        50% {
            box-shadow:
                inset 0 0 16px rgba(76, 255, 154, 0.28),
                0 0 20px rgba(76, 255, 154, 0.45);
        }
    }
}

/* ============================================================
   OMEGA FOOTER CTA (SHARED)
============================================================ */

body[data-ccg-mode="c64"] {
    --ccg-support-rgb: 255, 198, 120;
}

body[data-ccg-mode="amiga"] {
    --ccg-support-rgb: 255, 155, 220;
}

.ccg-footer--game {
    margin-top: clamp(24px, 4vw, 48px);
}

.ccg-footer-inner--game {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    text-align: center;
}

.ccg-footer--game .ccg-footer__col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.ccg-footer__tagline,
.ccg-footer__note {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ccg-soft);
}

.ccg-footer__btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 16px;
    text-align: center;
    gap: 4px;
    flex-direction: column;
}

.ccg-footer__btn-icon {
    font-size: 1.1rem;
}

.ccg-footer__btn-subtext {
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    opacity: 0.75;
}

.ccg-footer__btn--support {
    border-color: rgba(var(--ccg-support-rgb), 0.55);
    box-shadow:
        0 12px 26px rgba(0,0,0,0.78),
        0 0 20px rgba(var(--ccg-support-rgb), 0.35);
}

.ccg-footer__btn--support:hover,
.ccg-footer__btn--support:focus-visible {
    border-color: rgba(var(--ccg-support-rgb), 0.85);
    box-shadow:
        0 16px 32px rgba(0,0,0,0.82),
        0 0 26px rgba(var(--ccg-support-rgb), 0.55);
}

.ccg-footer__btn--top {
    border-color: rgba(var(--accent-rgb), 0.55);
    background: rgba(var(--accent-rgb), 0.1);
}

.ccg-footer__btn--top:hover,
.ccg-footer__btn--top:focus-visible {
    border-color: rgba(var(--accent-rgb), 0.8);
}

@media (min-width: 860px) {
    .ccg-footer-inner--game {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        text-align: left;
    }

    .ccg-footer--game .ccg-footer__col {
        align-items: flex-start;
    }

    .ccg-footer__col--center {
        align-items: center;
        text-align: center;
    }
}
