/* ===================================
   Game Section (CryptoMagnate)
   =================================== */

:root {
    --color-game-bg: var(--color-bg-primary);
    --color-card-bg: var(--color-bg-card);
    --color-game-accent: var(--color-primary);
    /* Cyan */
    --gradient-card-intro: linear-gradient(180deg, rgba(65, 209, 236, 0.1) 0%, rgba(249, 73, 239, 0.1) 100%);
    --gradient-card-level: linear-gradient(180deg, #1e1b4b 0%, #4c1d95 100%);
    --gradient-card-mining: linear-gradient(180deg, #27272a 0%, #18181b 100%);
}

.game-section {
    position: relative;
    padding: var(--space-4xl) var(--container-padding);
    background: var(--color-bg-secondary);
    color: white;
    overflow: hidden;
    border-top: 1px solid var(--color-border);
}

.game-container {
    max-width: var(--container-max);
    margin: 0 auto;
}

/* --- Header --- */
.game-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centered */
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    /* Allowed wrapping if needed */
    gap: var(--space-xl);
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.game-brand-block {
    flex: 0 0 auto;
}

.game-title-main {
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    font-style: normal;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-logo-img {
    height: 60px;
    /* Fixed smaller height */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(65, 209, 236, 0.2));
}

.game-intro-text {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    padding-left: var(--space-lg);
    border-left: 1px solid var(--color-border);
}

/* --- Showcase / Carousel --- */
.game-showcase {
    margin-bottom: var(--space-3xl);
    overflow: visible;
}

.showcase-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
}

.showcase-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Phone Cards */
.phone-card {
    flex: 0 0 auto;
    width: 220px;
    /* Reduced width */
    aspect-ratio: 9/19;
    background: transparent;
    /* Was #000 */
    border-radius: 0px;
    padding: 0;
    /* Removed padding */
    position: relative;
    scroll-snap-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.phone-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0px var(--color-primary);
    border-color: var(--color-primary);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    border-radius: 0px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
}

.screen-img,
.screen-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

/* Card Specific Styling */

/* Intro Card */
.card-intro .phone-screen {
    background: var(--gradient-card-intro);
    justify-content: flex-end;
}

.intro-content {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.intro-logo {
    text-align: center;
    margin-top: 40px;
}

.intro-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.intro-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    line-height: 1;
    font-style: italic;
    color: var(--color-game-accent);
}

.intro-chars {
    display: flex;
    justify-content: center;
    gap: -15px;
    font-size: 4rem;
    margin: 20px 0;
}

.char {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s;
}

.char:hover {
    transform: scale(1.2) translateY(-10px);
}

.intro-cta-box {
    background: rgba(46, 16, 101, 0.9);
    border-radius: 0px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid var(--color-game-accent);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
}

.intro-cta-box h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 800;
}

.intro-cta-box p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    line-height: 1.4;
}

.btn-game-primary {
    background: var(--color-game-accent);
    color: #1a0b2e;
    border: 2px solid var(--color-game-accent);
    width: 100%;
    padding: 12px;
    border-radius: 0px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    transition: all 0.1s ease;
}

.btn-game-primary:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

/* Level Card */
.level-content {
    background: var(--gradient-card-level);
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.level-info {
    margin-top: 60px;
    text-align: center;
}

.chapter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
}

.location-badge {
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 10px;
}

.level-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.dialogue-box {
    background: #4c1d95;
    padding: 15px;
    border-radius: 0px;
    position: relative;
    border-left: 4px solid var(--color-game-accent);
}

.npc-name {
    display: block;
    font-size: 0.7rem;
    color: var(--color-game-accent);
    font-weight: bold;
    margin-bottom: 5px;
}

.dialogue-box p {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Mining Card */
.mining-content {
    background: #111;
    height: 100%;
    padding: 20px;
    padding-top: 70px;
}

.miner-rack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gpu-slot {
    background: #222;
    padding: 10px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #333;
}

.gpu-slot.active {
    border-color: var(--color-game-accent);
    box-shadow: 0 0 10px rgba(252, 211, 77, 0.1);
}

.gpu-stats {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
}

.hashrate {
    color: var(--color-primary);
    font-size: 0.7rem;
}

.gpu-slot.locked {
    opacity: 0.5;
    justify-content: center;
}

.collect-bar {
    margin-top: auto;
    background: var(--color-primary);
    padding: 15px;
    border-radius: 0px;
    color: #000;
    font-weight: bold;
    text-align: center;
    font-size: 0.9rem;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    border: 1px solid #000;
}

/* Info Card */
.card-info .phone-screen {
    background: #000;
    align-items: center;
    justify-content: center;
}

.info-content {
    padding: 30px;
    text-align: center;
}

.info-visual-3d {
    font-size: 6rem;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

.info-text-box {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* --- Footer --- */
.game-footer {
    display: grid;
    grid-template-columns: 1.5fr 1.2fr 1fr 1fr auto auto;
    /* Socials now take minimal space */
    align-items: center;
    /* Vertical center for all */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-xl);
    padding-left: var(--space-xl);
    /* Increased left margin */
    gap: 20px;
}

.footer-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Vertical center within item */
    min-height: 42px;
    /* Match smaller social box height */
}

.footer-item.hackathon {
    flex-direction: row;
    align-items: center;
    gap: 15px;
    grid-column: span 1;
}

.footer-item.hackathon .stat-icon-large {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.footer-item.hackathon .stat-icon-img {
    height: 36px;
    width: 36px;
    object-fit: contain;
}

.footer-item.hackathon .stat-text {
    line-height: 1 !important;
    /* Force parent container to tighten */
}

.footer-item.hackathon .stat-full-text {
    display: block;
    /* Required for spans to respect line-height properly with <br> */
    font-weight: 400;
    /* Normal weight like item-value */
    color: #ccc;
    /* Lighter color like item-value */
    font-size: 0.95rem;
    /* Matches item-value size */
    line-height: 1.25 !important;
    max-width: 180px;
}

.footer-item.installs {
    justify-content: center;
}

.footer-item.installs h3 {
    font-size: 1.8rem;
    /* Slightly smaller for better balance */
    font-weight: 700;
    line-height: 1;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-item.installs .val-sub {
    font-size: 0.95rem;
    /* Matches item-value size */
    font-weight: 400;
    color: #ccc;
    /* Lighter color like item-value */
    display: block;
}

.footer-item.status,
.footer-item.genre {
    gap: 4px;
}

.footer-item .item-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.footer-item .item-value {
    font-size: 0.95rem;
    color: #ccc;
    font-weight: 400;
}

.footer-item.social-box {
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: transparent;
    justify-self: end;
}

.footer-item.social-box:hover {
    transform: translate(-4px, -4px);
    box-shadow: 6px 6px 0px var(--color-primary);
    border-color: var(--color-primary);
}

.footer-item.social-box .social-icon-img {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Responsive Adjustments */
@media (max-width: 1100px) {
    .game-section {
        padding: var(--space-3xl) var(--container-padding);
    }

    .game-footer {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px 30px;
        /* Reduced from 30x40 (roughly 30%) */
        align-items: start;
    }

    .footer-item {
        justify-self: start !important;
        text-align: left;
    }

    /* Tablet: 3 columns, 2 rows. */
    .footer-item.hackathon {
        grid-row: 1;
        grid-column: 1;
        justify-self: start;
    }

    .footer-item.installs {
        grid-row: 2;
        grid-column: 1;
        justify-self: start;
    }

    .footer-item.status {
        grid-row: 1;
        grid-column: 2;
        justify-self: center;
    }

    .footer-item.genre {
        grid-row: 2;
        grid-column: 2;
        justify-self: center;
    }

    .footer-item.social-box:nth-of-type(5) {
        grid-row: 1;
        grid-column: 3;
        justify-self: end !important;
    }

    .footer-item.social-box:nth-of-type(6) {
        grid-row: 2;
        grid-column: 3;
        justify-self: end !important;
    }

    /* Disable hover highlight on tablet */
    .footer-item.social-box:hover {
        transform: none;
        box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
        border-color: rgba(255, 255, 255, 0.1);
    }

    /* Edge-to-edge slider for tablets */
    .game-showcase {
        margin-right: calc(var(--container-padding) * -1);
    }

    .showcase-carousel {
        padding-left: 0;
        scroll-padding-left: 0;
    }

    .phone-card:last-child {
        margin-right: var(--container-padding);
    }
}

@media (max-width: 768px) {
    .game-section {
        padding: var(--space-2xl) var(--container-padding);
    }

    .game-logo-img {
        height: 48px;
    }

    .game-header-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-lg);
    }

    .game-intro-text {
        border-left: none;
        border-top: 1px solid var(--color-border);
        padding-left: 0;
        padding-top: var(--space-lg);
        min-width: 100%;
        font-size: 1rem;
        text-align: center;
    }

    .game-footer {
        grid-template-columns: 1fr auto;
        grid-template-rows: repeat(4, auto);
        gap: 16px;
        padding-top: var(--space-lg);
        padding-right: var(--space-xl);
        align-items: start;
    }

    .footer-item {
        min-height: auto;
    }

    /* Mobile: 2 columns.
       Col 1 (Left): 1, 2, 3, 4
       Col 2 (Right): 5, 6
    */
    .footer-item.hackathon {
        grid-row: 1;
        grid-column: 1;
    }

    .footer-item.installs {
        grid-row: 2;
        grid-column: 1;
    }

    .footer-item.status {
        grid-row: 3;
        grid-column: 1;
    }

    .footer-item.genre {
        grid-row: 4;
        grid-column: 1;
    }

    .footer-item.social-box:nth-of-type(5) {
        grid-row: 1;
        grid-column: 2;
        margin-top: 5px;
    }

    .footer-item.social-box:nth-of-type(6) {
        grid-row: 2;
        grid-column: 2;
    }

    .footer-item.installs h3 {
        font-size: 1.6rem;
    }

    .footer-item.social-box {
        width: 46px;
        height: 46px;
    }

    .footer-item.social-box .social-icon-img {
        width: 28px;
        height: 28px;
    }

    .game-showcase {
        margin-right: calc(var(--container-padding) * -1);
    }

    .showcase-carousel {
        padding: 10px 0;
        padding-left: 0;
        scroll-padding-left: 0;
        gap: 15px;
    }

    .phone-card {
        width: 180px;
    }

    .phone-card:first-child {
        margin-left: 0;
    }

    .phone-card:last-child {
        margin-right: var(--container-padding);
    }

    .phone-card:hover {
        transform: none;
        box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Video Card Styles */
.screen-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-card {
    cursor: pointer;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
}

.video-card:hover .video-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.play-icon {
    font-size: 2.5rem;
    color: white;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.8;
}

.video-card:hover .play-icon {
    transform: scale(1.2);
    opacity: 1;
}

.video-card.is-playing .video-overlay {
    opacity: 0;
    pointer-events: none;
}

.video-card.is-playing .play-icon {
    opacity: 0;
    transform: scale(0.5);
}

.video-card.is-playing:hover .video-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

.video-card.is-playing:hover .play-icon {
    opacity: 0;
    transform: scale(0.5);
}

/* Carousel Navigation Styles */
.game-showcase {
    position: relative;
    padding: 0;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: var(--color-bg-primary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
}

.carousel-nav:hover {
    border-color: var(--color-primary);
    transform: translateY(-50%) translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--color-primary);
    color: var(--color-primary);
}

.carousel-nav:active {
    transform: translateY(-50%) translate(1px, 1px);
    box-shadow: 2px 2px 0px var(--color-primary);
}

.carousel-nav.prev {
    left: 0;
}

.carousel-nav.next {
    right: 0;
}

.nav-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Toggle navigation visibility */
.carousel-nav {
    display: none;
}

/* Show on desktop */
@media (min-width: 1025px) {
    .carousel-nav {
        display: flex;
    }

    .game-showcase {
        padding: 0 50px;
    }
}

/* Show on horizontal (landscape) mobile/tablets */
@media (orientation: landscape) and (max-width: 1024px) {
    .carousel-nav {
        display: flex;
    }

    .game-showcase {
        padding: 0 50px;
        /* Ensure it doesn't break mobile scroll logic */
        margin-right: 0;
    }
}

/* Mobile Portrait specific adjustments */
@media (max-width: 768px) and (orientation: portrait) {
    .game-showcase {
        padding: 0;
        margin-right: calc(var(--container-padding) * -1);
    }
}