/* ===========================================================================
   TheCowSaysMoo — Global Styles (Y2K direction)
   ---------------------------------------------------------------------------
   Palette and styling extracted from the Y2K homepage design (option 1a).
   Selectors are all prefixed `csm-` so they never collide with WP core blocks
   or other plugins. Where we override block-editor output (which has its own
   .wp-block-* selectors), the override is scoped to the inner csm- wrapper.
   ========================================================================= */

/* ---- Reset & base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: #f2fbe6;
    background-image: radial-gradient(circle, #cdeeb0 1.3px, transparent 1.3px);
    background-size: 22px 22px;
    color: #1a1230;
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ---- Reusable bits ------------------------------------------------------ */
:root {
    --csm-ink: #1a1230;
    --csm-paper: #f2fbe6;
    --csm-lime: #a6f34d;
    --csm-pink: #ff3d9a;
    --csm-pink-2: #ff5da2;
    --csm-yellow: #ffd23e;
    --csm-cyan: #36d3e0;
    --csm-lavender: #b9a7ff;
    --csm-mint: #7ee6a8;
}

.csm-btn {
    display: inline-block;
    font-family: 'Bagel Fat One', cursive;
    font-size: 14px;
    border: 3px solid var(--csm-ink);
    padding: 9px 16px;
    border-radius: 999px;
    box-shadow: 3px 3px 0 var(--csm-ink);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.1;
    transition: transform .12s ease, box-shadow .12s ease;
    color: var(--csm-ink);
}
.csm-btn:hover  { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--csm-ink); }
.csm-btn:active { transform: translate(2px, 2px);  box-shadow: 1px 1px 0 var(--csm-ink); }

.csm-btn-lg     { font-size: 18px; padding: 15px 26px; border-radius: 14px; box-shadow: 5px 5px 0 var(--csm-ink); }
.csm-btn-lg:hover  { box-shadow: 7px 7px 0 var(--csm-ink); }
.csm-btn-lg:active { box-shadow: 2px 2px 0 var(--csm-ink); }

.csm-btn-cyan   { background: var(--csm-cyan); color: var(--csm-ink); }
.csm-btn-pink   { background: var(--csm-pink); color: #fff; }
.csm-btn-yellow { background: var(--csm-yellow); color: var(--csm-ink); }
.csm-btn-white  { background: #fff; color: var(--csm-ink); }

.csm-pill {
    display: inline-block;
    font-family: 'Bagel Fat One', cursive;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 2.5px solid var(--csm-ink);
    background: #fff;
    color: var(--csm-ink);
    white-space: nowrap;
}
.csm-pill-cyan  { background: var(--csm-cyan); color: var(--csm-ink); box-shadow: 2px 2px 0 var(--csm-ink); }
.csm-pill-lime  { background: var(--csm-lime); color: var(--csm-ink); }
.csm-pill-grey  { background: #eee; color: var(--csm-ink); }

.csm-badge {
    display: inline-block;
    font-family: 'Bagel Fat One', cursive;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 3px solid var(--csm-ink);
    box-shadow: 3px 3px 0 var(--csm-ink);
}
.csm-badge-yellow { background: var(--csm-yellow); color: var(--csm-ink); }
.csm-badge-ink    { background: var(--csm-ink);    color: var(--csm-lime); }
.csm-badge-tilt   { transform: rotate(-3deg); }

/* ---- Marquee ------------------------------------------------------------ */
.csm-marquee {
    background: var(--csm-ink);
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 4px solid var(--csm-ink);
}
.csm-marquee-track {
    display: inline-block;
    animation: csm-mq 18s linear infinite;
    font-family: 'Bagel Fat One', cursive;
    color: var(--csm-lime);
    font-size: 15px;
    padding: 8px 0;
    letter-spacing: .04em;
    will-change: transform;
}
@keyframes csm-mq { to { transform: translateX(-50%); } }

/* ---- Header ------------------------------------------------------------- */
.csm-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(242,251,230,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 3px solid var(--csm-ink);
}
.csm-header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 28px;
    max-width: 1180px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.csm-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--csm-ink);
}
.csm-logo-img img {
    height: 42px;
    width: auto;
    background: #fff;
    border: 3px solid var(--csm-ink);
    border-radius: 10px;
    padding: 4px 8px;
    box-shadow: 3px 3px 0 var(--csm-ink);
}
.csm-logo-cow { font-size: 26px; }
.csm-logo-word {
    font-family: 'Bagel Fat One', cursive;
    font-size: 19px;
    color: var(--csm-ink);
}
.csm-nav {
    display: flex;
    gap: 18px;
    margin-left: auto;
    align-items: center;
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 15px;
    flex-wrap: wrap;
}
.csm-nav a {
    text-decoration: none;
    color: var(--csm-ink);
    padding: 4px 2px;
    transition: color .12s ease;
}
.csm-nav a:hover { color: var(--csm-pink); }

/* ---- Hero --------------------------------------------------------------- */
.csm-hero { position: relative; }
.csm-hero-inner {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 28px 0;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 30px;
    align-items: center;
}
.csm-hero-text { position: relative; z-index: 2; }
.csm-hero-title {
    font-family: 'Bagel Fat One', cursive;
    font-size: clamp(40px, 6.4vw, 76px);
    line-height: .92;
    margin: 18px 0 18px;
    color: var(--csm-ink);
    text-shadow: 4px 4px 0 #fff, 8px 8px 0 var(--csm-lime);
}
.csm-hero-sub {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.5;
    max-width: 42ch;
    margin: 0 0 26px;
    color: var(--csm-ink);
}
.csm-hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.csm-hero-art { position: relative; }
.csm-hero-frame {
    border: 4px solid var(--csm-ink);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 8px 8px 0 var(--csm-ink);
    transform: rotate(2deg);
    background: #fff;
}
.csm-hero-frame img {
    width: 100%;
    height: 340px;
    object-fit: cover;
}
.csm-hero-sparkle {
    position: absolute;
    top: -22px;
    right: -10px;
    font-size: 44px;
    animation: csm-spinslow 9s linear infinite;
    z-index: 3;
}
.csm-hero-star {
    position: absolute;
    bottom: 18px;
    left: -22px;
    font-size: 30px;
    animation: csm-floaty 4s ease-in-out infinite;
    z-index: 3;
}
.csm-hero-stamp {
    position: absolute;
    bottom: -16px;
    right: 14px;
    background: var(--csm-lime);
    font-family: 'Bagel Fat One', cursive;
    font-size: 13px;
    border: 3px solid var(--csm-ink);
    border-radius: 999px;
    padding: 8px 14px;
    box-shadow: 3px 3px 0 var(--csm-ink);
    transform: rotate(-5deg);
}
@keyframes csm-spinslow { to { transform: rotate(360deg); } }
@keyframes csm-floaty {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50%      { transform: translateY(-14px) rotate(var(--r, 0deg)); }
}

/* ---- Meandering mascot strip ------------------------------------------- */
.csm-meadow {
    position: relative;
    height: 84px;
    margin: 8px auto 0;
    max-width: 1180px;
}
.csm-grass {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(#9be25a, #6fbf3a);
    border-top: 3px solid var(--csm-ink);
}
.csm-flora {
    position: absolute;
    bottom: 24px;
    font-size: 22px;
}
.csm-flora-1 { left: 12%; }
.csm-flora-2 { left: 30%; font-size: 20px; }
.csm-flora-3 { left: 62%; }
.csm-flora-4 { left: 88%; font-size: 20px; }

.csm-meander {
    position: absolute;
    bottom: 22px;
    animation: csm-meander 24s ease-in-out infinite;
}
.csm-meander-face { animation: csm-face 24s ease-in-out infinite; }
.csm-meander-graze { animation: csm-graze 24s ease-in-out infinite; }
.csm-meander-cow {
    display: inline-block;
    font-size: 46px;
    animation: csm-mbob .9s ease-in-out infinite;
    filter: drop-shadow(2px 3px 0 rgba(26,18,48,.25));
}
@keyframes csm-meander {
    0%   { left: 2%;  }
    42%  { left: 84%; }
    50%  { left: 84%; }
    92%  { left: 2%;  }
    100% { left: 2%;  }
}
@keyframes csm-face {
    0%, 49%   { transform: scaleX(-1); }
    50%, 100% { transform: scaleX(1); }
}
@keyframes csm-graze {
    0%, 36%   { transform: translateY(0) rotate(0); }
    43%       { transform: translateY(5px) rotate(10deg); }
    50%       { transform: translateY(0) rotate(0); }
    86%       { transform: translateY(0) rotate(0); }
    93%       { transform: translateY(5px) rotate(10deg); }
    100%      { transform: translateY(0) rotate(0); }
}
@keyframes csm-mbob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

/* ---- Section titles ---------------------------------------------------- */
.csm-section-title {
    font-family: 'Bagel Fat One', cursive;
    font-size: clamp(28px, 4vw, 42px);
    margin: 0;
    color: var(--csm-ink);
}

/* ---- Games grid -------------------------------------------------------- */
.csm-games-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 28px 10px;
}
.csm-games-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.csm-empty {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border: 3px dashed var(--csm-ink);
    border-radius: 16px;
}

.csm-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.csm-gcard {
    background: #fff;
    border: 4px solid var(--csm-ink);
    border-radius: 18px;
    box-shadow: 5px 5px 0 var(--csm-ink);
    overflow: hidden;
    text-decoration: none;
    color: var(--csm-ink);
    display: block;
    transition: transform .18s cubic-bezier(.2,1.4,.4,1), box-shadow .18s ease;
}
.csm-gcard.is-live { cursor: pointer; }
.csm-gcard.is-live:hover {
    transform: translate(-2px, -2px) rotate(-1deg);
    box-shadow: 8px 8px 0 var(--csm-ink);
}
.csm-gcard.is-soon {
    cursor: default;
    opacity: .85;
}
.csm-gcard-tile {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 4px solid var(--csm-ink);
    overflow: hidden;
}
.csm-gcard-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.csm-gcard-emoji {
    font-size: 54px;
    line-height: 1;
}
.csm-gcard-body { padding: 16px; }
.csm-gcard-title {
    font-family: 'Bagel Fat One', cursive;
    font-size: 19px;
    margin: 0 0 6px;
    line-height: 1;
}
.csm-gcard-tag {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 13.5px;
    line-height: 1.4;
    margin: 0 0 12px;
    color: #3a3350;
}

/* ---- Featured spotlight ------------------------------------------------ */
.csm-spotlight {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 28px;
}
.csm-spotlight-inner {
    position: relative;
    background: linear-gradient(120deg, var(--csm-lime), var(--csm-cyan) 60%, var(--csm-pink-2));
    border: 4px solid var(--csm-ink);
    border-radius: 26px;
    box-shadow: 8px 8px 0 var(--csm-ink);
    padding: 34px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: center;
    overflow: hidden;
}
.csm-spotlight-title {
    font-family: 'Bagel Fat One', cursive;
    font-size: clamp(30px, 4.4vw, 48px);
    margin: 14px 0 12px;
    line-height: .95;
    color: var(--csm-ink);
    text-shadow: 3px 3px 0 #fff;
}
.csm-spotlight-tag {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.5;
    margin: 0 0 22px;
    max-width: 40ch;
    color: var(--csm-ink);
}
.csm-spotlight-card {
    background: #fff;
    border: 4px solid var(--csm-ink);
    border-radius: 18px;
    box-shadow: 5px 5px 0 var(--csm-ink);
    padding: 22px;
    text-align: center;
    transform: rotate(2deg);
}
.csm-spotlight-emoji { font-size: 60px; line-height: 1; }
.csm-spotlight-quip {
    font-family: 'Bagel Fat One', cursive;
    font-size: 15px;
    margin: 14px 0 4px;
}
.csm-spotlight-quip-sub {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: #3a3350;
    margin: 0;
}

/* ---- Newsletter -------------------------------------------------------- */
.csm-newsletter {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 28px 56px;
}
.csm-newsletter-inner {
    background: var(--csm-ink);
    border-radius: 26px;
    padding: 40px 34px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.csm-newsletter-sparkle {
    position: absolute;
    top: 14px;
    left: 24px;
    font-size: 26px;
}
.csm-newsletter-cow {
    position: absolute;
    bottom: 14px;
    right: 30px;
    font-size: 26px;
}
.csm-newsletter-title {
    font-family: 'Bagel Fat One', cursive;
    font-size: clamp(26px, 3.6vw, 38px);
    margin: 0 0 10px;
    color: var(--csm-lime);
}
.csm-newsletter-sub {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 16px;
    margin: 0 auto 22px;
    max-width: 46ch;
    color: #d7d2e8;
}
.csm-newsletter-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 480px;
    margin: 0 auto;
}
.csm-newsletter-form input {
    flex: 1 1 220px;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 3px solid var(--csm-lime);
    background: #2a2145;
    color: #fff;
    outline: none;
}
.csm-newsletter-form input::placeholder { color: #9a90b8; }
.csm-newsletter-form .csm-btn {
    border-color: var(--csm-lime);
    box-shadow: 3px 3px 0 var(--csm-lime);
    padding: 14px 24px;
    font-size: 16px;
    border-radius: 12px;
}
.csm-newsletter-status {
    display: block;
    margin-top: 12px;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--csm-lime);
    min-height: 1.2em;
}

@keyframes csm-sway {
    0%, 100% { transform: rotate(-4deg); }
    50%      { transform: rotate(4deg); }
}
.csm-sway   { animation: csm-sway 3s ease-in-out infinite; }
.csm-floaty { animation: csm-floaty 4s ease-in-out infinite; }

/* ---- Footer ------------------------------------------------------------ */
.csm-footer {
    background: var(--csm-ink);
    border-top: 4px solid var(--csm-lime);
    padding: 26px 28px;
}
.csm-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    color: #9a90b8;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 13px;
}
.csm-footer-logo {
    height: 34px;
    background: #fff;
    border-radius: 8px;
    padding: 3px 7px;
}
.csm-footer-copy { margin-left: auto; }

/* ---- "Join the Herd" modal --------------------------------------------- */
.csm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,18,48,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.csm-modal-overlay[hidden] { display: none; }
.csm-modal {
    background: #fff;
    border: 4px solid var(--csm-ink);
    border-radius: 22px;
    box-shadow: 8px 8px 0 var(--csm-ink);
    padding: 28px;
    max-width: 440px;
    width: 100%;
    position: relative;
}
.csm-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--csm-ink);
    line-height: 1;
    padding: 4px 8px;
}
.csm-modal-title {
    font-family: 'Bagel Fat One', cursive;
    font-size: 26px;
    margin: 0 0 6px;
    color: var(--csm-ink);
}
.csm-modal-subtitle {
    font-size: 14px;
    color: #3a3350;
    margin: 0 0 18px;
    font-weight: 500;
}
.csm-form-label {
    display: block;
    font-family: 'Bagel Fat One', cursive;
    font-size: 12px;
    color: var(--csm-ink);
    margin-bottom: 6px;
    letter-spacing: .04em;
}
.csm-form-input {
    width: 100%;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 3px solid var(--csm-ink);
    background: #f7f2ff;
    color: var(--csm-ink);
    outline: none;
    margin-bottom: 14px;
}
.csm-form-input:focus { background: #fff; box-shadow: 0 0 0 3px var(--csm-lime); }
.csm-form-status {
    font-size: 13px;
    color: #3a3350;
    font-weight: 600;
}
.csm-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 760px) {
    .csm-hero-inner {
        grid-template-columns: 1fr;
        padding: 20px 18px 0;
    }
    .csm-hero-frame img { height: 240px; }
    .csm-hero-title { text-shadow: 3px 3px 0 #fff, 6px 6px 0 var(--csm-lime); }
    .csm-spotlight-inner {
        grid-template-columns: 1fr;
        padding: 26px;
    }
    .csm-games-inner { padding: 24px 18px 10px; }
    .csm-spotlight   { padding: 20px 18px; }
    .csm-newsletter  { padding: 18px 18px 40px; }
    .csm-header-inner { padding: 12px 18px; }
    .csm-nav { gap: 14px; font-size: 14px; }
    .csm-nav a:nth-child(n+4) { display: none; } /* hide About/Blog on tight nav; keep Games + CTA */
    .csm-nav a:nth-child(1)   { display: inline; }
}

@media (max-width: 480px) {
    .csm-hero-cta .csm-btn-lg { font-size: 15px; padding: 13px 18px; }
    .csm-section-title { font-size: 28px; }
    .csm-hero-title { font-size: 38px; }
}
