/*-----------------------------------*
  #GAME PREVIEW SECTION
*-----------------------------------*/

.game-section {
    width: 100%;
    padding: var(--space-xl) 0;
    background: #080a12;
}

.game-preview-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    opacity: 0;
    transform: translateY(20px);
}

.game-preview-heading > div {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
}

.game-preview-heading h2 {
    margin-top: var(--space-sm);
}

.game-preview-kicker {
    display: inline-flex;
    color: var(--primary);
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-bold);
    letter-spacing: 1.6px;
    line-height: 1;
    text-transform: uppercase;
}

.game-preview-quick-link,
.game-start-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: var(--fs-body-md);
    font-weight: var(--fw-bold);
    line-height: 1;
    white-space: nowrap;
    transition:
        transform var(--motion-sm) var(--ease-standard),
        box-shadow var(--motion-sm) var(--ease-standard),
        background var(--motion-sm) var(--ease-standard),
        border-color var(--motion-sm) var(--ease-standard);
}

.game-preview-quick-link {
    padding: 0 var(--space-lg);
    background: var(--hover-bg);
    border: 1px solid var(--glass-border);
    color: var(--bright-snow);
}

.game-preview-quick-link:hover {
    opacity: 1;
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.game-embed {
    width: 100%;
    min-height: clamp(640px, calc(100dvh - 130px), 880px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(20, 20, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
}

.game-embed::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(79, 124, 255, 0.12), transparent 42%),
        linear-gradient(300deg, rgba(87, 242, 154, 0.08), transparent 34%);
    opacity: 0.9;
    pointer-events: none;
}

.game-preview-stage,
.game-server-panel {
    position: relative;
    z-index: 1;
}

.game-preview-stage {
    min-width: 0;
    display: grid;
    grid-template-rows: minmax(560px, 1fr) auto;
    gap: var(--space-md);
}

.game-window {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(520px, 1fr);
    overflow: hidden;
    background: rgba(10, 10, 15, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
}

.game-window-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-md);
    min-height: 46px;
    padding: 0 var(--space-md);
    background: rgba(20, 20, 28, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.game-window-dots {
    display: flex;
    gap: 6px;
}

.game-window-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
}

.game-window-dots span:nth-child(1) {
    background: var(--red-logout);
}

.game-window-dots span:nth-child(2) {
    background: #ffbd5a;
}

.game-window-dots span:nth-child(3) {
    background: #57f29a;
}

.game-window-title,
.game-window-state {
    min-width: 0;
    color: var(--text-light);
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-bold);
    letter-spacing: 1px;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-window-state {
    color: var(--primary);
}

.game-scene-preview {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    background:
        linear-gradient(180deg, rgba(79, 124, 255, 0.2), rgba(10, 10, 15, 0.18) 46%, rgba(10, 10, 15, 0.92)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent);
}

.game-scene-preview::before {
    content: "";
    position: absolute;
    inset: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    pointer-events: none;
}

.game-scene-preview.is-live::before {
    display: none;
}

.game-scene-art {
    position: absolute;
    inset: 0;
    transition: opacity var(--motion-sm) var(--ease-standard);
}

.game-scene-preview.is-live .game-scene-art {
    opacity: 0;
    pointer-events: none;
}

.game-play-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #080a12;
    overscroll-behavior: contain;
}

.game-preview-fullscreen {
    position: absolute;
    right: var(--space-md);
    bottom: var(--space-md);
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
    color: var(--bright-snow);
    background: rgba(8, 10, 18, 0.78);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
    touch-action: manipulation;
}

.game-preview-fullscreen:hover,
.game-preview-fullscreen:focus-visible {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(18, 24, 42, 0.88);
}

.game-preview-fullscreen[hidden] {
    display: none;
}

.game-preview-fullscreen-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
}

.game-preview-fullscreen-icon::before,
.game-preview-fullscreen-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-color: currentColor;
    border-style: solid;
}

.game-preview-fullscreen-icon::before {
    border-width: 2px 0 0 2px;
}

.game-preview-fullscreen-icon::after {
    border-width: 0 2px 2px 0;
}

.game-scene-preview.is-live {
    overscroll-behavior: contain;
    touch-action: none;
}

.game-scene-preview:fullscreen,
.game-scene-preview:-webkit-full-screen,
.game-scene-preview.preview-fullscreen-fallback {
    width: 100dvw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    background: #080a12;
}

.game-scene-preview:fullscreen .game-play-frame,
.game-scene-preview:-webkit-full-screen .game-play-frame,
.game-scene-preview.preview-fullscreen-fallback .game-play-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.game-scene-preview:fullscreen .game-preview-fullscreen,
.game-scene-preview:-webkit-full-screen .game-preview-fullscreen,
.game-scene-preview.preview-fullscreen-fallback .game-preview-fullscreen {
    top: max(var(--space-md), env(safe-area-inset-top));
    right: max(var(--space-md), env(safe-area-inset-right));
    bottom: auto;
}

.game-scene-preview.preview-fullscreen-fallback {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

html.preview-fullscreen-active,
body.preview-fullscreen-active {
    overflow: hidden;
}

.game-skyline {
    position: absolute;
    inset: clamp(12px, 3vw, 20px) clamp(12px, 3vw, 20px) auto;
    height: min(44%, 340px);
}

.game-skyline span {
    position: absolute;
    display: block;
    border-radius: 50%;
    background: rgba(79, 124, 255, 0.12);
    border: 1px solid rgba(79, 124, 255, 0.14);
}

.game-skyline span:nth-child(1) {
    width: clamp(96px, 24vw, 160px);
    height: clamp(96px, 24vw, 160px);
    top: clamp(8px, 2vw, 12px);
    left: clamp(16px, 8%, 64px);
}

.game-skyline span:nth-child(2) {
    width: clamp(64px, 14vw, 92px);
    height: clamp(64px, 14vw, 92px);
    top: clamp(30px, 8vw, 42px);
    right: clamp(58px, 22%, 180px);
}

.game-skyline span:nth-child(3) {
    width: clamp(136px, 34vw, 210px);
    height: clamp(136px, 34vw, 210px);
    right: clamp(-62px, -9vw, -18px);
    bottom: clamp(-64px, -9vw, -20px);
    background: rgba(87, 242, 154, 0.08);
}

.game-preview-copy {
    display: grid;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(10, 10, 15, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
}

.game-preview-pill {
    width: fit-content;
    padding: 5px 9px;
    color: var(--primary);
    background: rgba(79, 124, 255, 0.12);
    border: 1px solid rgba(79, 124, 255, 0.26);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: var(--fw-bold);
    letter-spacing: 1.2px;
    line-height: 1;
    text-transform: uppercase;
}

.game-preview-copy h3 {
    font-size: var(--fs-display-md);
}

.game-preview-copy p {
    max-width: 620px;
    color: rgba(255, 255, 255, 0.58);
    font-size: var(--fs-body-md);
}

.game-server-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: var(--space-lg);
    background: rgba(10, 10, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
}

.game-server-panel-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.game-server-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.game-server-panel h3 {
    margin-top: var(--space-xs);
    font-size: var(--fs-display-md);
}

.game-server-updated {
    color: var(--text-light);
    font-size: var(--fs-body-sm);
    opacity: 0.72;
    white-space: nowrap;
}

.game-server-refresh {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--bright-snow);
    background: var(--hover-bg);
    font-size: var(--fs-body-md);
    font-weight: var(--fw-bold);
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform var(--motion-sm) var(--ease-standard),
        box-shadow var(--motion-sm) var(--ease-standard),
        background var(--motion-sm) var(--ease-standard),
        border-color var(--motion-sm) var(--ease-standard);
}

.game-server-refresh:hover {
    opacity: 1;
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.game-server-refresh.is-loading,
.game-server-refresh.is-cooling-down {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border);
    color: var(--text-light);
}

.game-server-refresh.is-loading {
    cursor: progress;
}

.game-server-refresh.is-cooling-down {
    cursor: pointer;
}

.game-server-list {
    display: grid;
    gap: var(--space-sm);
    max-height: 510px;
    margin-bottom: var(--space-md);
    padding: 3px;
    overflow-y: auto;
}

.game-server-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-sm);
    align-items: center;
    width: 100%;
    min-height: 74px;
    padding: var(--space-md);
    color: var(--bright-snow);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    text-align: left;
    transition:
        transform var(--motion-sm) var(--ease-standard),
        background var(--motion-sm) var(--ease-standard),
        border-color var(--motion-sm) var(--ease-standard);
}

.game-server-option:hover,
.game-server-option.is-selected {
    opacity: 1;
    transform: translateY(-1px);
    background: rgba(79, 124, 255, 0.12);
    border-color: rgba(79, 124, 255, 0.38);
}

.game-server-option.is-full {
    cursor: not-allowed;
    opacity: 0.62;
}

.game-server-option.is-full:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.07);
}

.game-server-name-line {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.game-server-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #57f29a;
    box-shadow: 0 0 12px rgba(87, 242, 154, 0.55);
}

.game-server-option.is-full .game-server-status-dot {
    background: #ffbd5a;
    box-shadow: 0 0 12px rgba(255, 189, 90, 0.42);
}

.game-server-name {
    min-width: 0;
    color: var(--bright-snow);
    font-size: var(--fs-body-md);
    font-weight: var(--fw-bold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-server-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: 6px;
    color: var(--text-light);
    font-size: var(--fs-body-sm);
    opacity: 0.78;
}

.game-server-capacity {
    display: grid;
    gap: 6px;
    min-width: 74px;
    color: var(--bright-snow);
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-bold);
    text-align: right;
}

.game-server-bar {
    width: 74px;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.game-server-bar-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #57f29a, var(--primary));
}

.game-server-skeleton {
    min-height: 74px;
    border-radius: var(--radius-md);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        rgba(255, 255, 255, 0.04);
    background-size: 220% 100%;
    animation: gameSkeleton 1.2s var(--ease-smooth) infinite;
}

@keyframes gameSkeleton {
    from { background-position: 120% 0; }
    to { background-position: -120% 0; }
}

.game-server-empty[hidden] {
    display: none;
}

.game-server-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-md);
    padding: 12px 14px;
    background: var(--carbon-mid);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
}

.game-server-empty-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 146, 60, 0.10);
    border: 1px solid rgba(251, 146, 60, 0.22);
    border-radius: 8px;
    color: #fb923c;
}

.game-server-empty-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.game-server-empty-copy {
    flex: 1;
    min-width: 0;
}

.game-server-empty h3 {
    margin: 0 0 3px;
    font-size: var(--fs-body-md);
    font-weight: var(--fw-bold);
    color: var(--bright-snow);
}

.game-server-empty p {
    font-size: var(--fs-body-sm);
    color: #fb923c;
    opacity: 0.82;
    margin: 0;
}

.game-start-btn {
    width: 100%;
    min-width: 0;
    margin-top: auto;
    padding: 0 var(--space-lg);
    background: var(--primary);
    color: var(--text-dark);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-start-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    background: var(--primary-dark);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/*-----------------------------------*
  #RESPONSIVE
*-----------------------------------*/

@media (max-width: 1100px) {
    .game-embed {
        grid-template-columns: 1fr;
    }

    .game-server-panel {
        min-height: 360px;
    }

    .game-server-list {
        max-height: 300px;
    }
}

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

    .game-preview-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .game-preview-quick-link {
        width: 100%;
    }

    .game-embed {
        min-height: unset;
        gap: var(--space-md);
        padding: var(--space-sm);
    }

    .game-preview-stage {
        grid-template-rows: auto auto;
    }

    .game-window {
        grid-template-rows: auto minmax(430px, 62dvh);
    }

    .game-skyline {
        height: 50%;
    }

    .game-skyline span:nth-child(1) {
        width: clamp(132px, 22vw, 160px);
        height: clamp(132px, 22vw, 160px);
        top: 12px;
        left: 9%;
    }

    .game-skyline span:nth-child(2) {
        width: clamp(72px, 12vw, 92px);
        height: clamp(72px, 12vw, 92px);
        top: 34px;
        left: 48%;
        right: auto;
    }

    .game-skyline span:nth-child(3) {
        width: clamp(150px, 28vw, 190px);
        height: clamp(150px, 28vw, 190px);
        top: clamp(130px, 22vw, 152px);
        right: 5%;
        bottom: auto;
    }

    .game-window-state {
        display: none;
    }

    .game-server-panel {
        min-height: 300px;
        padding: var(--space-md);
    }

    .game-server-list {
        max-height: 220px;
    }
}

@media (max-width: 520px) {
    .game-preview-heading h2 {
        font-size: 24px;
    }

    .game-preview-fullscreen {
        width: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 50%;
    }

    .game-preview-fullscreen-text {
        display: none;
    }

    .game-window-bar {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .game-window-title {
        font-size: 10px;
    }

    .game-window {
        grid-template-rows: auto minmax(390px, 58dvh);
    }

    .game-skyline {
        inset: 18px 18px auto;
        height: 46%;
    }

    .game-skyline span:nth-child(1) {
        width: clamp(84px, 25vw, 108px);
        height: clamp(84px, 25vw, 108px);
        top: 18px;
        left: 8%;
    }

    .game-skyline span:nth-child(2) {
        width: clamp(48px, 15vw, 64px);
        height: clamp(48px, 15vw, 64px);
        top: 26px;
        left: 50%;
        right: auto;
    }

    .game-skyline span:nth-child(3) {
        width: clamp(96px, 31vw, 128px);
        height: clamp(96px, 31vw, 128px);
        top: clamp(102px, 26vw, 118px);
        right: 4%;
        bottom: auto;
    }

    .game-preview-copy,
    .game-server-panel {
        padding: var(--space-sm);
    }

    .game-server-panel-top {
        flex-direction: column;
    }

    .game-server-panel-actions {
        width: 100%;
        justify-content: space-between;
    }

    .game-server-updated {
        white-space: normal;
    }

    .game-server-option {
        grid-template-columns: 1fr;
    }

    .game-server-capacity {
        text-align: left;
    }

    .game-server-bar {
        width: 100%;
    }
}
