/* Page-specific overrides for Cosmic Crusaders */
/* All shared styles inherited from css/games/base.css */

@font-face {
  font-family: 'Crusaders';
  src: url('/webfonts/CCMainGameFont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body {
    background-color: #0C0F09;
    background-image: url("/img/games/cosmic-crusaders/tile-background.png");
    background-repeat: repeat;
    background-position: 50% 0;
    background-attachment: fixed;
    color: rgb(196, 196, 196);
    font-family: "Crusaders", sans-serif;
    font-size: 1.5rem;
}

.game-card {
    display: block;
    color: inherit;
    background: #151a11;
    border-radius: 8px;
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
	border-radius: 20px;
    width: 100%;
}

.game-card:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
    color: inherit;
    text-decoration: none;
}

.game-card h1, .game-card h2, .game-card h3, .game-card h4, .game-card h5, .game-card h6 {
    margin: 0;
    padding: 0;
}

.game-card p {
    margin: 0 0 1rem;
    padding: 0;
}

.game-card p:last-child {
    margin-bottom: 0;
}

.game-card ul {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.game-card ul:last-child {
    margin-bottom: 0;
}

.game-card li {
    margin-bottom: 0.25rem;
}

.game-card li:last-child {
    margin-bottom: 0;
}

.game-card h2 {
    font-size: 2.5rem;
    font-weight: normal;
    color: whitesmoke;
}

.game-card h3 {
    font-size: 1.5rem;
    font-weight: normal;
    color: whitesmoke;
}

.game-card b {
    color: whitesmoke;
}

.itch-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Crusaders", sans-serif;
    font-size: 1.25rem;
    color: var(--itchio);
    border: 2px solid var(--itchio);
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    transition: all 200ms ease;
    margin-top: 0.5rem;
}

.itch-button:hover {
    background: var(--itchio);
    color: #0C0F09;
    text-decoration: none;
}

.video-embed {
    width: 100%;
    max-width: 56rem;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.desktop-only {
    display: none;
}

.mobile-only {
    display: block;
}

@media (max-width: 767px) {
    body {
        font-size: 1.25rem;
    }

    .game-card h2 {
        font-size: 2rem;
    }
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.screenshot-grid a {
    display: block;
}

.screenshot-grid img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

@media (min-width: 768px) {
    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }
}

/* ==============================================
   Media Carousel (Steam-style)
   ============================================== */

.media-carousel {
    width: 100%;
    position: relative;
}

/* Viewport clips the track and establishes 16:9 ratio */
.carousel-viewport {
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    aspect-ratio: 16 / 9;
}

/* Flex track — slides sit side by side */
.carousel-track {
    display: flex;
    transition: transform 300ms ease;
    height: 100%;
}

.carousel-viewport:focus-visible {
    outline: 2px solid var(--brand-color, #FFC304);
    outline-offset: -2px;
}

/* Each slide fills the viewport width */
.carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* Override .video-embed constraints inside the carousel
   (viewport already controls aspect-ratio) */
.carousel-slide .video-embed {
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    aspect-ratio: auto;
    border-radius: 0;
}

/* -----------------------------------------------
   Prev / Next arrow buttons
   ----------------------------------------------- */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 200ms ease, background 200ms ease;
}

.carousel-prev:hover,
.carousel-next:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

.carousel-prev:focus-visible,
.carousel-next:focus-visible {
    opacity: 1;
    outline: 2px solid var(--brand-color, #FFC304);
    outline-offset: 2px;
}

.carousel-prev {
    left: 12px;
}

.carousel-next {
    right: 12px;
}

/* -----------------------------------------------
   Dot indicators
   ----------------------------------------------- */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 200ms ease;
}

.carousel-dot.active {
    background: var(--brand-color, #FFC304);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.carousel-dot:focus-visible {
    outline: 2px solid var(--brand-color, #FFC304);
    outline-offset: 2px;
}

/* -----------------------------------------------
   Mobile adjustments
   ----------------------------------------------- */
@media (max-width: 767px) {
    .carousel-prev,
    .carousel-next {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .carousel-dots {
        gap: 6px;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        transition: none;
    }
}
