:root {
    --dark-orchid: #704868;
    --background: #1a1a1d;
    --accent: #ff00ff;
    --text-color: #e8e8e8;
    --dark-gray: #333333;
    --font-pixel: 'Press Start 2P', cursive;
    --font-ui: 'Pixelify Sans', sans-serif;
}

* {
    box-sizing: border-box;
}

/* Decorative icons/logos: prevent a text caret from appearing next to them
   (they sit inline between text nodes inside links, so the browser would
   otherwise place a selection caret beside the image). */
.logo,
.nav-icon,
.newsletter-popup__icon,
.newsletter-compact__icon,
.game-unavailable__icon {
    user-select: none;
    -webkit-user-select: none;
}

.site-wrapper {
    max-width: 1200px;
    margin: 1rem auto;
    min-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

body {
    background-color: var(--background);
    background-image: url("../images/background_01.061b5a8aaaa9.png");
    background-repeat: repeat;
    background-size: 128px 128px;
    image-rendering: pixelated;
    color: var(--text-color);
    font-family: var(--font-pixel);
    margin: 0;
    padding: 0;
    font-size: 14px;
}


nav {
    background-color: rgba(26, 26, 29, 0.94);
    padding: 0.25rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
    border: 3px solid var(--dark-orchid);
    border-radius: 12px;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 75px;
    width: auto;
    image-rendering: pixelated;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-right: 0.5rem;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: transform 0.2s;
}

.nav-icon {
    height: 60px;
    width: auto;
    image-rendering: pixelated;
}

.nav-item:hover {
    transform: scale(1.1);
}

.nav-hamburger {
    display: none;
}

/* Blog */
.blog-list {
    max-width: 800px;
    margin: 0 auto;
}

.blog-list-title {
    font-size: 1rem;
    color: #e8e0f5;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--dark-orchid);
}

.post-card {
    display: flex;
    gap: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    background: var(--dark-gray);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: background 0.2s;
}

.post-card:hover {
    background: #444;
}

.post-cover {
    width: 140px;
    height: 90px;
    object-fit: cover;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.post-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.post-title {
    font-size: 0.7rem;
    margin: 0;
    color: #e8e0f5;
}

.post-date {
    font-size: 0.5rem;
    color: var(--dark-orchid);
    margin: 0;
}

.post-excerpt {
    font-size: 0.5rem;
    line-height: 1.6;
    margin: 0;
    color: #ccc;
    font-family: sans-serif;
}

/* Blog detail */
.post-detail {
    max-width: 800px;
    margin: 0 auto;
}

.post-detail-cover {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    display: block;
    margin-bottom: 1.5rem;
    image-rendering: pixelated;
}

.post-detail-title {
    font-size: 1rem;
    color: #e8e0f5;
    margin-bottom: 0.5rem;
}

.post-detail-date {
    font-size: 0.5rem;
    color: var(--dark-orchid);
    margin-bottom: 1.5rem;
}

.post-detail-content {
    font-size: 0.75rem;
    font-family: sans-serif;
    line-height: 1.8;
    color: #ddd;
}

.post-detail-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0 0;
}

.post-detail-row__reactions {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-left: auto;
}

.post-detail-row .reactions {
    margin: 0;
}

.post-back {
    display: inline-block;
    margin-top: 2rem;
    font-size: 0.55rem;
    color: var(--dark-orchid);
    text-decoration: none;
}

.post-back:hover {
    color: #e8e0f5;
}

main {
    padding: 2rem;
    flex: 1;
    background-color: rgba(26, 26, 29, 0.94);
    border: 3px solid var(--dark-orchid);
    border-radius: 12px;
}

/* Home layout: featured banner as a fixed-width left column (Nitrome-style
   sidebar ad), main content (carousel + catalog) to its right. Stacks on
   narrow viewports where there's no room for a side column. */
.home-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.home-main {
    flex: 1;
    min-width: 0;
}

/* Featured banner (Advertising) + compact newsletter signup below it */
.featured-column {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.featured-banner img {
    width: 100%;
    display: block;
    image-rendering: pixelated;
    aspect-ratio: 1 / 3;
    object-fit: cover;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.social-links__coffee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.5rem;
    background: #ffdd00;
    border: 3px solid #7a5c00;
    border-radius: 4px;
    color: #1a1305;
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    transition: filter 0.15s, transform 0.1s;
}

.social-links__coffee:hover {
    filter: brightness(1.08);
}

.social-links__coffee:active {
    transform: scale(0.97);
}

.social-links__row {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
}

.newsletter-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    background-color: rgba(26, 26, 29, 0.94);
    border: 3px solid var(--dark-orchid);
    border-radius: 12px;
    padding: 1rem 0.85rem;
}

.newsletter-compact__icon {
    height: 48px;
    width: auto;
    image-rendering: pixelated;
}

.newsletter-compact__form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.newsletter-compact__form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
    background: transparent;
    border: 2px solid var(--dark-orchid);
    border-radius: 4px;
    color: var(--text-color);
    font-family: var(--font-ui);
    font-size: 0.7rem;
}

.newsletter-compact__form input[type="email"]::placeholder {
    color: #999;
}

.newsletter-compact__form button {
    width: 100%;
    padding: 0.5rem;
    background: var(--dark-orchid);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    cursor: pointer;
}

.newsletter-compact__form button:hover {
    filter: brightness(1.15);
}

/* The 200x600 banner doesn't fit well as a stacked block on narrow
   screens — hide the whole sidebar column there (banner + the desktop
   copy of the promo block). The mobile copy of the same promo block
   (.home-promo--mobile) takes over instead, placed after the Mobile
   games section. */
@media (max-width: 768px) {
    .featured-column {
        display: none;
    }
}

.home-promo {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.home-promo--mobile {
    display: none;
    max-width: 320px;
    margin: 2rem auto 0;
}

@media (max-width: 768px) {
    .home-promo--mobile {
        display: flex;
    }
}

/* Carousel */
.carousel {
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease;
}

.carousel-slide {
    min-width: 100%;
    display: block;
}

.carousel-slide img {
    width: 100%;
    display: block;
    image-rendering: pixelated;
    aspect-ratio: 12 / 5;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 2.5rem;
    padding: 0.2rem 0.7rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: background 0.2s;
}

.carousel-btn:hover {
    background: var(--dark-orchid);
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.carousel-dots {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.2s;
}

.carousel-dot.active {
    background: var(--dark-orchid);
}


.catalog {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.catalog-section {
    flex: 1;
    min-width: 0;
}

.section-title {
    font-size: 0.75rem;
    color: #e8e0f5;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--dark-orchid);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.game-card {
    display: block;
    min-width: 0;
    text-decoration: none;
    color: var(--text-color);
    background: var(--dark-gray);
    overflow: hidden;
    transition: transform 0.15s ease-in-out;
}

.game-card:hover {
    transform: scale(1.04);
}

.game-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    image-rendering: pixelated;
}

.game-title {
    display: block;
    font-size: 0.45rem;
    padding: 0.4rem 0.3rem;
    text-align: center;
    background-color: var(--dark-orchid);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-msg {
    font-size: 0.6rem;
    color: var(--dark-orchid);
    opacity: 0.6;
}

/* Game Detail Page */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.preview-banner {
    background: #504848;
    color: var(--text-color);
    border: 2px solid #888888;
    border-radius: 4px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    text-align: center;
}

.game-container h1 {
    font-size: 2.5rem;
    text-align: center;
    text-shadow: 4px 4px 0px var(--dark-orchid);
}

.game-embed {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 Aspect Ratio */
    margin: 2rem 0;
    border: 4px solid var(--dark-orchid);
    box-shadow: 0 0 15px var(--dark-orchid);
}

.game-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Reactions row: sits below the game, right-aligned under it. Width
   matches the iframe's own cap per orientation so it hugs the game
   instead of drifting to the edge of a wider fixed container. */
.game-play-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1vh auto 0;
}

.game-play-row__reactions {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-left: auto;
}

.game-play-row--landscape {
    max-width: 960px;
}

.game-play-row--portrait {
    max-width: 480px;
}

@media (min-width: 901px) {
    .game-play-row--portrait {
        max-width: min(480px, calc(70vh * 9 / 16));
    }
}

.game-play-row .reactions {
    margin: 0;
}

/* Description (i) popover */
.game-description-info {
    position: relative;
}

.description-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: #383030;
    color: #888888;
    border: 3px solid #504848;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.description-toggle:hover,
.description-toggle[aria-expanded="true"] {
    border-color: #888888;
    color: var(--text-color);
}

/* Fixed + centered on all screen sizes, not anchored to the toggle: the
   toggle can sit near the bottom of the page (e.g. desktop, tall
   descriptions), so an anchored popover can open below the fold with no
   way to reach it. A centered overlay is always fully on-screen. */
.game-description {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 30;
    transform: translate(-50%, -50%);
    width: min(320px, 90vw);
    max-height: min(70vh, 500px);
    overflow-y: auto;
    background: var(--dark-gray);
    border: 3px solid var(--dark-orchid);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    font-family: var(--font-ui);
    font-size: 1rem;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    scrollbar-color: var(--dark-orchid) var(--dark-gray);
    scrollbar-width: thin;
}

.game-description p {
    margin: 0;
}

/* Desktop has room for a roomier, more readable popover. */
@media (min-width: 901px) {
    .game-description {
        width: min(480px, 90vw);
        max-height: min(70vh, 640px);
    }
}

.game-description::-webkit-scrollbar {
    width: 10px;
}

.game-description::-webkit-scrollbar-track {
    background: var(--dark-gray);
}

.game-description::-webkit-scrollbar-thumb {
    background-color: var(--dark-orchid);
    border-radius: 8px;
}

.game-description::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

/* Iframe wrapper: aspect ratio varies by game orientation so portrait
   games don't get squeezed into a landscape box and vice versa. */
.iframe-wrapper {
    position: relative;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid #000;
}

.iframe-wrapper--landscape {
    max-width: 960px;
    aspect-ratio: 16 / 9;
}

.iframe-wrapper--portrait {
    max-width: 480px;
    aspect-ratio: 9 / 16;
}

/* Desktop only: a 480x853 portrait box dwarfs the page on tall viewports —
   cap the width so the derived height never exceeds 70vh, keeping the
   ratio. Scoped to min-width so phone portrait keeps its full-width box. */
@media (min-width: 901px) {
    .iframe-wrapper--portrait {
        width: min(480px, calc(70vh * 9 / 16));
    }
}

.fullscreen-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 20;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.iframe-wrapper--landscape .fullscreen-toggle {
    top: auto;
    bottom: 8px;
}

.iframe-wrapper:fullscreen .game-iframe {
    width: 100vw;
    height: 100vh;
}

.iframe-wrapper .game-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-unavailable {
    margin-top: 20px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding: 3rem 1rem;
    border: 4px solid var(--dark-orchid);
    box-shadow: 0 0 15px var(--dark-orchid);
}

.game-unavailable__icon {
    width: 64px;
    height: 64px;
    opacity: 0.6;
    margin-bottom: 1rem;
}

.suggested-banner {
    max-width: 300px;
    margin: 2rem auto 0;
    text-align: center;
}

.suggested-banner .section-title {
    display: block;
    text-align: center;
}

.suggested-banner__link {
    display: block;
    text-decoration: none;
    color: var(--text-color);
}

.suggested-banner__link img {
    width: 100%;
    aspect-ratio: 300 / 250;
    object-fit: cover;
    display: block;
    image-rendering: pixelated;
    border: 2px solid var(--dark-orchid);
}

.suggested-banner__title {
    display: block;
    font-size: 0.55rem;
    padding: 0.5rem 0;
}

/* Doesn't read well on mobile (the 300x250 box dominates a narrow
   screen) — desktop/tablet only for now. */
@media (max-width: 768px) {
    .suggested-banner {
        display: none;
    }
}

.game-info h3 {
    font-size: 1.5rem;
    color: var(--dark-gray);
    border-bottom: 4px solid var(--dark-orchid);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.game-info p {
    font-size: 1rem;
    line-height: 1.5;
}

.game-links {
    text-align: center;
    padding: 20px 0;
}

.badge {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-pixel);
    font-size: 1rem;
    border: 2px solid;
    transition: all 0.2s ease-in-out;
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px;
}

.badge .fab {
    margin-right: 8px;
}

.google-play { border-color: #a4c639; color: #a4c639; }
.apple-store { border-color: #ffffff; color: #ffffff; }
.windows-download { border-color: #00a4ef; color: #00a4ef; }

.google-play:hover { background-color: #a4c639; color: var(--background); }
.apple-store:hover { background-color: #ffffff; color: var(--background); }
.windows-download:hover { background-color: #00a4ef; color: var(--background); }


footer {
    text-align: center;
    padding: 0.5rem 0;
    margin-top: 1rem;
}

/* ── Newsletter section (between main and footer) ── */
.newsletter-section {
    margin-top: 1rem;
}

.newsletter-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background-color: rgba(26, 26, 29, 0.94);
    border: 3px solid var(--dark-orchid);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-align: center;
}

.newsletter-box .section-title {
    margin: 0;
}

.newsletter-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.newsletter-icon {
    height: 72px;
    width: auto;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.newsletter-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.newsletter-hook {
    font-family: var(--font-ui);
    color: var(--text-color);
    margin: 0;
}

.newsletter-social {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.newsletter-social__link {
    --outline: #504848;   /* Dark Warm Gray */
    --dark:    #383030;   /* Dark Brown-Black */
    --highlight: #888888; /* Mid Gray */

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    background: var(--dark);
    color: var(--text-color);
    border: 3px solid var(--outline);
    border-radius: 4px;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}

.newsletter-social__link:hover {
    border-color: var(--highlight);
}

.newsletter-social__link:active {
    transform: scale(0.96);
}

/* ── Newsletter popup (first-visit, one-time) ── */
.newsletter-popup {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.newsletter-popup[hidden] {
    display: none;
}

.newsletter-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.newsletter-popup__box {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 360px;
    width: 90%;
    background-color: rgba(26, 26, 29, 0.98);
    border: 3px solid var(--dark-orchid);
    border-radius: 12px;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.newsletter-popup__close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.newsletter-popup__close:hover {
    color: var(--dark-orchid);
}

.newsletter-popup__icon {
    height: 64px;
    width: auto;
    image-rendering: pixelated;
}

.newsletter-popup__box .section-title {
    margin: 0;
    line-height: 1.6;
}

.newsletter-popup__box .newsletter-form {
    width: 100%;
    flex-direction: column;
}

.newsletter-popup__box .newsletter-form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
}

.newsletter-popup__box .newsletter-form button {
    width: 100%;
}

/* ── Contact form modal ── */
.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-modal[hidden] {
    display: none;
}

.contact-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.contact-modal__box {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    width: 90%;
    background-color: rgba(26, 26, 29, 0.98);
    border: 3px solid var(--dark-orchid);
    border-radius: 12px;
    padding: 2rem 1.5rem 1.5rem;
}

.contact-modal__box .section-title {
    margin: 0 0 0.5rem;
    text-align: center;
}

.contact-modal__close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.contact-modal__close:hover {
    color: var(--dark-orchid);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.contact-form label {
    font-family: var(--font-ui);
    color: var(--text-color);
    font-size: 0.8rem;
}

.contact-form input,
.contact-form textarea {
    background: var(--background);
    border: 2px solid var(--dark-orchid);
    color: var(--text-color);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    padding: 0.55rem 0.7rem;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
    width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--dark-orchid);
    box-shadow: 0 0 0 2px rgba(112, 72, 104, 0.4);
}

.contact-form button {
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--dark-orchid);
    color: var(--text-color);
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    padding: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contact-form button:hover {
    background: var(--dark-orchid);
}

.contact-form button:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

.contact-form button:disabled:has(.pixel-loader:not([hidden])) {
    opacity: 1;
}

.pixel-loader {
    display: inline-flex;
    align-items: flex-end;
    gap: 4px;
    height: 0.9rem;
}

.pixel-loader[hidden] {
    display: none;
}

.pixel-loader__block {
    width: 6px;
    height: 6px;
    background: var(--muted-orchid, #b890b0);
    animation: pixel-loader-bounce 0.9s infinite steps(1);
}

.pixel-loader__block:nth-child(1) { animation-delay: 0s; }
.pixel-loader__block:nth-child(2) { animation-delay: 0.15s; }
.pixel-loader__block:nth-child(3) { animation-delay: 0.3s; }

@keyframes pixel-loader-bounce {
    0%, 60%, 100% { transform: translateY(0); background: var(--muted-orchid, #b890b0); }
    30% { transform: translateY(-6px); background: var(--pale-orchid, #d0a8c8); }
}

@media (prefers-reduced-motion: reduce) {
    .pixel-loader__block {
        animation: pixel-loader-fade 1.2s infinite steps(1);
    }

    @keyframes pixel-loader-fade {
        0%, 100% { opacity: 0.4; }
        50% { opacity: 1; }
    }
}

.contact-form__status {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    margin: 0;
}

.contact-form__status--success {
    color: #68c840;
}

.contact-form__status--error {
    color: #f86000;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
    background: var(--background);
    border: 2px solid var(--dark-orchid);
    color: var(--text-color);
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    padding: 0.6rem 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    width: 260px;
    max-width: 100%;
}

.newsletter-form input[type="email"]:focus {
    border-color: var(--dark-orchid);
    box-shadow: 0 0 0 2px rgba(112, 72, 104, 0.4);
}

.newsletter-form input[type="email"]::placeholder {
    color: #555;
}

.newsletter-form button {
    background: transparent;
    border: 2px solid var(--dark-orchid);
    color: var(--text-color);
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.newsletter-form button:hover {
    background: var(--dark-orchid);
    color: #fff;
}

.newsletter-messages {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.newsletter-messages li {
    font-size: 0.45rem;
    padding: 0.4rem 0.8rem;
    margin-bottom: 0.3rem;
    display: inline-block;
}

.newsletter-messages .success {
    background: rgba(80, 200, 80, 0.12);
    border: 1px solid #4caf50;
    color: #81c784;
}

.newsletter-messages .error {
    background: rgba(220, 60, 60, 0.12);
    border: 1px solid #e53935;
    color: #ef9a9a;
}

/* ── Unsubscribe confirmation page ── */
.newsletter-unsubscribed {
    text-align: center;
    padding: 4rem 1rem;
}

.newsletter-unsubscribed h1 {
    font-size: 0.85rem;
    color: var(--dark-orchid);
    margin-bottom: 1.5rem;
}

.newsletter-unsubscribed p {
    font-size: 0.55rem;
    color: var(--text-color);
    line-height: 2.2;
}

/* Games List Page */
.gl-page {
    padding-bottom: 2rem;
}

.gl-title {
    font-size: 0.9rem;
    color: #e8e0f5;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--dark-orchid);
}

.gl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.gl-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-decoration: none;
    color: var(--text-color);
    background: var(--dark-gray);
    transition: transform 0.15s ease, background 0.15s ease;
}

.gl-card:hover {
    transform: translateY(-4px);
    background: #444;
}

.gl-thumb-wrap {
    position: relative;
}

.gl-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    image-rendering: pixelated;
}

.gl-badges {
    position: absolute;
    bottom: 0.4rem;
    right: 0.4rem;
    display: flex;
    gap: 0.3rem;
}

.gl-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 0.6rem;
    background: rgba(0,0,0,0.7);
    color: #e8e0f5;
}

.gl-badge--browser { color: #a0d4ff; }
.gl-badge--mobile  { color: #b8f0a0; }

.gl-info {
    padding: 0.6rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.gl-name {
    font-size: 0.5rem;
    color: #e8e0f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-desc {
    font-size: 0.55rem;
    font-family: sans-serif;
    color: #aaa;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .gl-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .gl-name {
        font-size: 0.4rem;
    }

    .gl-desc {
        display: none;
    }
}

/* Kanban */
.kanban-page {
    max-width: 1100px;
    margin: 0 auto;
}

.kanban-btn {
    display: inline-block;
    background-color: var(--dark-orchid);
    color: var(--text-color);
    border: 2px solid var(--dark-orchid);
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font-size: 0.6rem;
    text-decoration: none;
    margin: 0.5rem 0 1rem;
}

.kanban-btn:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--background);
}

.kanban-error {
    color: #ff4d4d;
    font-size: 0.6rem;
}

.kanban-board-list {
    list-style: none;
    padding: 0;
}

.kanban-board-link {
    display: block;
    color: var(--text-color);
    background: var(--dark-gray);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    border: 2px solid var(--dark-orchid);
    border-radius: 8px;
}

.kanban-board-link:hover {
    border-color: var(--accent);
}

.kanban-form,
.kanban-inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 420px;
    margin-bottom: 1rem;
}

.kanban-inline-form {
    flex-direction: row;
    align-items: center;
    max-width: none;
    display: inline-flex;
}

.kanban-form label {
    font-size: 0.6rem;
    color: var(--text-color);
}

.kanban-form input,
.kanban-form textarea,
.kanban-form select,
.kanban-inline-form input {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    color: var(--text-color);
    background-color: var(--background);
    border: 2px solid var(--dark-orchid);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
}

.kanban-form input[type="color"],
.kanban-inline-form input[type="color"] {
    padding: 2px;
    width: 2.4rem;
    height: 2.1rem;
    cursor: pointer;
}

.kanban-form input[type="color"]::-webkit-color-swatch-wrapper,
.kanban-inline-form input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.kanban-form input[type="color"]::-webkit-color-swatch,
.kanban-inline-form input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

.kanban-form input[type="color"]::-moz-color-swatch,
.kanban-inline-form input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 5px;
}

.kanban-form button,
.kanban-inline-form button {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    color: var(--text-color);
    background-color: var(--dark-orchid);
    border: 2px solid var(--dark-orchid);
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    width: fit-content;
}

.kanban-form button:hover,
.kanban-inline-form button:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--background);
}

.kanban-label-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-color: var(--dark-orchid) var(--background);
    scrollbar-width: thin;
}

.kanban-board::-webkit-scrollbar {
    height: 10px;
}

.kanban-board::-webkit-scrollbar-track {
    background: var(--background);
}

.kanban-board::-webkit-scrollbar-thumb {
    background-color: var(--dark-orchid);
    border-radius: 8px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

.kanban-column {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    background: var(--dark-gray);
    border: 2px solid var(--dark-orchid);
    border-radius: 8px;
    padding: 0.75rem;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    cursor: grab;
}

.kanban-column-header:active {
    cursor: grabbing;
}

.kanban-column.dragging-column {
    opacity: 0.4;
}

.kanban-column-title {
    font-size: 0.6rem;
    color: #e8e0f5;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kanban-column-add-btn {
    background: none;
    border: none;
    color: var(--dark-orchid);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    line-height: 1;
}

.kanban-column-add-btn:hover {
    color: var(--accent);
}

.kanban-hidden {
    display: none !important;
}

.kanban-column-cards {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1 1 auto;
    min-height: 120px;
}

.kanban-column-cards.drag-over {
    outline: 2px dashed var(--accent);
    outline-offset: 4px;
}

.kanban-card {
    position: relative;
    background: var(--background);
    border: 2px solid var(--dark-orchid);
    border-radius: 6px;
    padding: 0.6rem 2.4rem 0.6rem 0.6rem;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: element;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.4;
}

.kanban-card-title {
    font-size: 0.6rem;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

.kanban-card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.kanban-label {
    font-size: 0.5rem;
    color: #fff;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
}

.kanban-card-assignee {
    font-size: 0.5rem;
    color: #ccc;
    margin-bottom: 0.4rem;
}

.kanban-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    font-size: 0.7rem;
}

.kanban-card-actions a,
.kanban-card-actions button {
    color: var(--dark-orchid);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
}

.kanban-card-actions a:hover,
.kanban-card-actions button:hover {
    color: var(--accent);
}

.kanban-priority--urgent {
    border-left: 4px solid #ff4d4d;
}

.kanban-priority--high {
    border-left: 4px solid var(--accent);
}

/* --- Reactions widget --- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.reactions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.25rem 0;
}

/* Master palette (visual_identity.md), 4-color-per-material rule:
   outline / dark / mid / highlight. Outline is never pure black. */
.reactions__btn {
    --outline: #504848;   /* Dark Warm Gray */
    --dark:    #383030;   /* Dark Brown-Black */
    --mid:     #504848;   /* Dark Warm Gray */
    --highlight: #888888; /* Mid Gray */

    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: var(--dark);
    color: var(--text-color);
    border: 3px solid var(--outline);
    border-radius: 4px;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
}

.reactions__btn:hover {
    border-color: var(--highlight);
}

.reactions__btn:active {
    transform: scale(0.96);
}

/* Like — green material */
.reactions__btn[data-value="like"].reactions__btn--active {
    --outline: #105020;   /* Deep Forest */
    --dark:    #105020;   /* Deep Forest */
    --mid:     #40A018;   /* Vivid Green */
    --highlight: #68C840; /* Bright Green */
    background: var(--mid);
    border-color: var(--outline);
}

/* Dislike — red material */
.reactions__btn[data-value="dislike"].reactions__btn--active {
    --outline: #682000;   /* Dark Burnt Brown */
    --dark:    #682000;   /* Dark Burnt Brown */
    --mid:     #E80000;   /* Pure Red */
    --highlight: #F86000; /* Vivid Orange */
    background: var(--mid);
    border-color: var(--outline);
}

.reactions__icon {
    font-size: 0.9rem;
    line-height: 1;
    color: var(--highlight);
}

.share-bar {
    display: flex;
    align-items: center;
}

.share-bar__fallback {
    display: flex;
    gap: 0.75rem;
}

.share-bar__fallback[hidden] {
    display: none;
}

.share-bar__btn {
    --outline: #504848;   /* Dark Warm Gray */
    --dark:    #383030;   /* Dark Brown-Black */
    --highlight: #888888; /* Mid Gray */

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: var(--dark);
    color: var(--text-color);
    border: 3px solid var(--outline);
    border-radius: 4px;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: border-color 0.15s, transform 0.1s;
}

.share-bar__btn i {
    pointer-events: none;
}

.share-bar__btn[hidden] {
    display: none;
}

.share-bar__btn:hover {
    border-color: var(--highlight);
}

.share-bar__btn:active {
    transform: scale(0.96);
}

.share-bar__fallback .share-bar__btn {
    padding: 0.5rem 0.7rem;
}

/* --- Media Queries for Responsiveness --- */

@media (max-width: 768px) {
    .catalog {
        flex-direction: column;
        align-items: stretch;
    }
    main {
        padding: 1rem;
    }
    .game-container h1 {
        font-size: 2rem;
    }
    .game-info h3 {
        font-size: 1.3rem;
    }
}

/* Phone in landscape: portrait games have plenty of viewport height but
   little width, so let the wrapper grow to a taller box instead of staying
   pinned to the narrow desktop max-width. */
@media (max-width: 900px) and (orientation: landscape) {
    .iframe-wrapper--portrait {
        max-width: none;
        width: auto;
        height: 90vh;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.75rem;
    }
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .game-container {
        padding: 1rem;
    }
    .game-container h1 {
        font-size: 1.5rem;
    }
    .badge {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    /* ── Wrapper ── */
    .site-wrapper {
        margin: 0.5rem 0.4rem;
    }

    /* ── Navbar ── */
    .logo {
        height: 44px;
    }

    nav {
        flex-wrap: wrap;
        padding: 0.4rem 1rem;
    }

    .nav-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 2px solid var(--dark-orchid);
        border-radius: 6px;
        color: var(--text-color);
        font-size: 1.1rem;
        width: 36px;
        height: 36px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.4rem 0 0.1rem;
        margin-top: 0.4rem;
        border-top: 1px solid var(--dark-orchid);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0.6rem 0.25rem;
        font-size: 0.65rem;
        border-bottom: 1px solid rgba(112, 72, 104, 0.35);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-icon {
        height: 28px;
    }

    /* ── Carousel ── */
    .carousel-slide img {
        aspect-ratio: 4 / 3;
    }

    /* ── Footer ── */
    footer {
        font-size: 0.45rem;
        padding: 0.35rem 0;
        margin-top: 0.5rem;
    }

    .newsletter-row {
        flex-direction: column;
    }

    .newsletter-form {
        flex-direction: column;
        padding: 0.6rem 0.75rem;
    }

    .newsletter-form input[type="email"],
    .newsletter-form button {
        width: 100%;
        min-width: 0;
    }

    .newsletter-social {
        justify-content: center;
    }

    .kanban-board {
        flex-direction: column;
    }

    .kanban-column {
        flex: 1 1 auto;
    }
}
/* Playtest feedback (dev-only, under a game) */

.playtest-feedback {
    max-width: 560px;
    margin: 2rem auto 0;
    padding: 1.25rem;
    border: 2px dashed var(--dark-orchid);
    border-radius: 8px;
}

.playtest-feedback__devtag {
    font-size: 0.4rem;
    color: var(--background);
    background: var(--accent);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    vertical-align: middle;
}

.playtest-rating {
    display: flex;
    gap: 0.5rem;
}

.playtest-rating__option {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-ui);
    cursor: pointer;
}
