/* ══════════════════════════════════════════════════════════════════════
   AETHER — layout v2
   Top navigation bar, centred content shell, card-based home, roomy spacing
   and responsive behaviour down to phones. Layout only: no markup, IDs or
   handlers are changed, so every existing feature keeps working.
   ══════════════════════════════════════════════════════════════════════ */

/* The palette is enforced with !important because the theme picker writes a
   saved accent colour onto :root, which would otherwise keep the old cyan. */
:root {
    --bg: #0a0a0a !important;
    --sidebar-bg: rgba(16, 16, 16, 0.92) !important;
    --accent: #e5e5e5 !important;
    --accent-glow: rgba(255, 255, 255, 0.25) !important;
    --text-primary: #f5f5f5 !important;
    --text-dim: #9a9a9a !important;
    --border: rgba(255, 255, 255, 0.16) !important;
    --card-bg: rgba(24, 24, 24, 0.72) !important;
    --input-bg: rgba(24, 24, 24, 0.62) !important;
}

html,
body {
    overflow-x: hidden;
}

/* Ambient violet glow behind the shell. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(1100px 720px at 10% -12%, rgba(255, 255, 255, 0.07), transparent 62%),
        radial-gradient(900px 620px at 92% -4%, rgba(255, 255, 255, 0.05), transparent 58%),
        radial-gradient(900px 760px at 50% 118%, rgba(255, 255, 255, 0.05), transparent 62%);
}

/* ── 1. The icon rail becomes a top bar ─────────────────────────────── */
.sidebar {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 76px;
    flex-direction: row;
    align-items: center;
    padding: 0 30px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.96), rgba(13, 13, 13, 0.90));
    backdrop-filter: blur(18px) saturate(160%);
}

.sidebar:hover { width: 100%; }

.logo-box {
    margin: 0 34px 0 0;
    font-size: 30px;
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: 2px;
}

.nav-group {
    flex-direction: row;
    flex-grow: 0;
    align-items: center;
    height: 100%;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.nav-group::-webkit-scrollbar { display: none; }

.nav-item {
    width: auto;
    height: 46px;
    min-height: 46px;
    padding: 0 18px;
    gap: 10px;
    border-radius: 12px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item::before { display: none; }

.nav-item svg {
    min-width: 0;
    width: 19px;
    height: 19px;
}

.nav-item span {
    position: static;
    left: auto;
    opacity: 1;
    font-size: 0.74rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.07); }
.nav-item.active { background: var(--accent); color: #0b0b0b; }
.nav-item.active svg { stroke: #0b0b0b; }

.sidebar-bottom {
    flex-direction: row;
    align-items: center;
    width: auto;
    margin-left: auto;
    padding: 0 0 0 16px;
    gap: 6px;
    border-top: 0;
    border-left: 1px solid var(--border);
}

/* ── 2. Content shell ──────────────────────────────────────────────── */
.main-view {
    margin-left: 0;
    padding-top: 76px;
}

.view-section {
    height: auto;
    min-height: calc(100vh - 76px);
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: clamp(30px, 4vw, 64px) clamp(20px, 6vw, 88px) 180px;
}

#games-content {
    height: auto;
    min-height: calc(100vh - 76px);
    max-width: 1360px;
    margin: 0 auto;
    padding: clamp(28px, 3.5vw, 56px) clamp(20px, 6vw, 88px) 180px !important;
}

#proxy-content {
    height: calc(100vh - 76px) !important;
    min-height: 0 !important;
    max-width: none;
    padding: 0 !important;
}

#app-frame { top: 76px; }

#zoneViewer {
    top: 0;
    left: 0;
}

/* ── 3. Home: two cards, generous gutters ──────────────────────────── */
/* Scoped to #home-content because the inline stylesheet also targets it. */
#home-content .home-main {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(22px, 3vw, 44px);
    align-items: stretch;
    width: 100%;
}

#home-content .home-main .hero,
#home-content .home-main .clock-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: clamp(30px, 4vw, 62px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

#home-content .home-main .hero { align-items: flex-start; }
#home-content .home-main .hero h1 { margin-top: 0; margin-bottom: 18px; }

#home-content .home-main .clock-container {
    text-align: left;
    align-items: flex-start;
}

.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.9rem); line-height: 1.12; }

.btn-start {
    padding: 16px 40px;
    letter-spacing: 1.5px;
    margin-top: 8px;
}

#home-clock {
    font-size: clamp(2.8rem, 6.8vw, 5.4rem);
    margin-bottom: 6px;
}

#home-date {
    font-size: clamp(0.74rem, 1.4vw, 0.98rem);
    letter-spacing: 3px;
}

.home-ads { width: 100%; }

.ad-slot.has-ad { padding: 26px 0; }

/* ── 4. Games ──────────────────────────────────────────────────────── */
.games-featured-wrapper {
    max-width: 1360px;
    padding: 0 56px;
    margin-bottom: 56px;
}

.games-search-container {
    position: sticky;
    top: 76px;
    z-index: 30;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto 38px;
    padding: 16px 0;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(12px);
}

#gamesContainer {
    max-width: 1360px;
    grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 14vw, 196px), 1fr));
    gap: clamp(18px, 2vw, 30px);
}

.zone-item {
    padding: 0;
    border-radius: 16px;
}

.zone-item p { margin: 0; }

/* ── 5. Settings, tools and registry ───────────────────────────────── */
.settings-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 28px;
}

.settings-card {
    padding: 32px;
    margin-bottom: 28px;
    border-radius: 20px;
}

.settings-header { margin-bottom: 32px !important; }

.app-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 28px;
    margin-top: 36px;
}

/* ── 6. Floating HUDs sit in the new corners ───────────────────────── */
.status-hud {
    left: 26px;
    bottom: 26px;
    min-width: 0;
    padding: 14px 18px;
}

.social-hud {
    right: 26px;
    bottom: 26px;
    min-width: 0;
    padding: 14px 18px;
}

.social-hud .social-container { gap: 12px; }

/* ── 7. Tablets: stack the home cards, tighten gutters ─────────────── */
@media (max-width: 900px) {
    .view-section {
        padding: 26px 22px 150px;
    }

    #games-content {
        padding: 26px 22px 150px !important;
    }

    #home-content .home-main {
        grid-template-columns: 1fr;
    }

    #home-content .home-main .hero,
    #home-content .home-main .clock-container {
        padding: 30px;
    }

    #home-clock { font-size: clamp(2.2rem, 9vw, 3.6rem); }

    .games-featured-wrapper { padding: 0 10px; }

    .status-hud,
    .social-hud { display: none; }
}

/* ── 8. Small screens: compact icon-only bar ───────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        height: 62px;
        padding: 0 14px;
    }

    .logo-box {
        margin-right: 12px;
        font-size: 24px;
    }

    .nav-item {
        height: 40px;
        min-height: 40px;
        padding: 0 12px;
    }

    .nav-item svg { width: 20px; height: 20px; }

    .sidebar-bottom {
        border-left: 0;
        padding-left: 6px;
    }

    .main-view { padding-top: 62px; }

    .view-section { min-height: calc(100vh - 62px); }
    #games-content { min-height: calc(100vh - 62px); }

    #proxy-content { height: calc(100vh - 62px) !important; }

    #app-frame { top: 62px; }

    .games-search-container { top: 62px; }
}

@media (max-width: 700px) {
    .nav-item span { display: none; }
}

@media (min-width: 901px) {
    .nav-item span { display: inline; }
}

@media (max-width: 520px) {
    .hero h1 { font-size: 1.85rem; }
    .games-search-container { flex-wrap: wrap; }
}

@media (min-width: 1800px) {
    .view-section { max-width: 1520px; }
    #games-content { max-width: 1520px; }
}

/* ── 9. "Create your own" entry points ─────────────────────────────── */
.create-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    margin-left: auto;
    border: 1px solid rgba(200, 200, 200, 0.35);
    border-radius: 12px;
    background: rgba(200, 200, 200, 0.14);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.7rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.create-cta:hover {
    background: rgba(200, 200, 200, 0.24);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.create-cta svg { stroke: var(--accent); flex-shrink: 0; }

/* The CTA now takes the auto margin, so the gear/user cluster sits next to it. */
.sidebar-bottom { margin-left: 14px; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.hero-actions .btn-start { margin-top: 0; }

.btn-ghost {
    padding: 14px 26px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.8rem;
    letter-spacing: 1.4px;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn-ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 18px var(--accent-glow);
}

/* Anchor form of the ghost button (the single-file download). */
a.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1.2;
}

/* ── 10. Make-your-own guide overlay ──────────────────────────────── */
.build-overlay {
    position: fixed;
    inset: 0;
    z-index: 9700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(14px);
}

.build-overlay.open { display: flex; animation: fadeIn 0.18s ease; }

.build-panel {
    width: min(1060px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(200, 200, 200, 0.3);
    border-radius: 22px;
    background: linear-gradient(168deg, rgba(30, 30, 30, 0.98), rgba(13, 13, 13, 0.99));
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.65);
}

.build-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-shrink: 0;
    padding: 26px clamp(20px, 3vw, 40px) 20px;
    border-bottom: 1px solid var(--border);
    background: radial-gradient(700px 200px at 0% 0%, rgba(200, 200, 200, 0.18), transparent 70%);
}

.build-kicker {
    font-size: 0.61rem;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.build-head h2 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 3vw, 2rem);
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.build-head p { margin: 0; font-size: 0.84rem; line-height: 1.6; color: var(--text-dim); }

.build-close {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: 0.18s ease;
}

.build-close:hover { color: var(--accent); border-color: var(--accent); }

.build-body { overflow-y: auto; padding: 6px clamp(20px, 3vw, 40px) 34px; }

.build-block { padding: 30px 0; border-bottom: 1px solid var(--border); }
.build-block:last-child { border-bottom: 0; }

.build-block-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }

.build-num {
    padding: 3px 8px;
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 8px;
    font-size: 0.68rem;
    letter-spacing: 2px;
    color: var(--accent);
}

.build-block h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.build-copy { margin: 0 0 18px; font-size: 0.84rem; line-height: 1.75; color: var(--text-dim); }

.build-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }

.build-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.72rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: 0.18s ease;
}

.build-action:hover { border-color: var(--accent); color: var(--accent); }

.build-action.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0b0b0b;
    font-weight: bold;
}

.build-action.primary:hover { background: #ffffff; color: #0b0b0b; }

.build-figures { display: grid; gap: 16px; }
.build-figures.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.build-figures figure { margin: 0; }

.build-figures img,
.build-host figure img {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
}

.build-figures figcaption,
.build-host figcaption {
    margin-top: 9px;
    font-size: 0.71rem;
    line-height: 1.55;
    color: var(--text-dim);
}

.build-host figure { margin: 18px 0 0; }

.build-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.build-tab {
    flex: 1 1 auto;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.71rem;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.16s ease;
}

.build-tab:hover { color: var(--text-primary); }

.build-tab.active {
    background: var(--accent);
    color: #0b0b0b;
    font-weight: bold;
}

.build-host { display: none; }
.build-host.active { display: block; animation: fadeIn 0.2s ease; }

.build-steps { margin: 0 0 6px; padding-left: 22px; font-size: 0.85rem; line-height: 1.9; color: var(--text-dim); }
.build-steps li { margin-bottom: 6px; }
.build-steps strong, .build-steps em { color: var(--text-primary); font-style: normal; }

.build-host code,
.build-block code {
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(200, 200, 200, 0.16);
    color: #ededed;
    font-size: 0.92em;
}

.build-note {
    margin: 18px 0 0;
    padding: 10px 0 10px 14px;
    border-left: 2px solid var(--accent);
    font-size: 0.79rem;
    line-height: 1.7;
    color: var(--text-dim);
}

.build-list { margin: 0; padding-left: 20px; font-size: 0.84rem; line-height: 1.9; color: var(--text-dim); }
.build-list strong { color: var(--text-primary); }

.worker-code { margin: 18px 0 2px; }

.worker-code summary {
    padding: 10px 0;
    list-style: none;
    cursor: pointer;
    font-size: 0.74rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.worker-code summary::-webkit-details-marker { display: none; }
.worker-code summary::before { content: '▸ '; color: var(--accent); }
.worker-code[open] summary::before { content: '▾ '; }
.worker-code summary:hover { color: var(--text-primary); }

.worker-code pre {
    margin: 0 0 14px;
    max-height: 320px;
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: #cfcfcf;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.7rem;
    line-height: 1.55;
    white-space: pre;
}

.worker-setup {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.worker-setup label {
    display: block;
    margin-bottom: 9px;
    font-size: 0.7rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.worker-row { display: flex; flex-wrap: wrap; gap: 8px; }

.worker-row input {
    flex: 1 1 240px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.8rem;
}

.worker-row input:focus { outline: none; border-color: var(--accent); }
.worker-row .build-action { padding: 9px 14px; }

.worker-status {
    margin: 10px 0 0;
    font-size: 0.76rem;
    line-height: 1.65;
    color: var(--text-dim);
}


.build-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 16px clamp(20px, 3vw, 40px);
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-dim);
}

body.build-open { overflow: hidden; }

@media (max-width: 900px) {
    .create-cta { padding: 0 12px; height: 38px; }
    .create-cta span { display: none; }
    .hero-actions { width: 100%; }
    .hero-actions .btn-start, .btn-ghost { flex: 1 1 auto; padding-inline: 18px; }
    .build-overlay { padding: 0; }
    .build-panel { width: 100%; max-height: 100vh; border-radius: 0; border: 0; }
    .build-figures.two { grid-template-columns: 1fr; }
    .build-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .build-tabs::-webkit-scrollbar { display: none; }
    .build-tab { flex: 0 0 auto; }
}


/* ── 10. Sponsored partner card (TextNexus) ─────────────────────────── */
.promo-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    max-width: 620px;
    margin-top: 26px;
    padding: 16px 20px;
    border: 1px solid rgba(200, 200, 200, 0.30);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(200, 200, 200, 0.16), rgba(170, 170, 170, 0.07) 70%),
        var(--card-bg);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.promo-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 0 26px var(--accent-glow);
}

.promo-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.promo-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1 1 280px;
}

.promo-badge {
    align-self: flex-start;
    font-size: 0.55rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(200, 200, 200, 0.35);
    border-radius: 4px;
    padding: 2px 6px;
}

.promo-title {
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.4px;
    color: var(--text-primary);
}

.promo-ver {
    color: var(--accent);
    font-size: 0.85em;
    margin-left: 2px;
}

.promo-desc {
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text-dim);
}

.promo-cta {
    flex-shrink: 0;
    font-size: 0.72rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.18s ease;
}

.promo-card:hover .promo-cta { border-bottom-color: var(--accent); }

@media (max-width: 900px) {
    .promo-card { max-width: 100%; }
    .promo-cta { width: 100%; }
}


/* ══════════════════════════════════════════════════════════════════════
   11. Game player: side ads, pre-game ad, fullscreen, iPad behaviour
   ══════════════════════════════════════════════════════════════════════ */

body.zone-open { overflow: hidden; }

html.zone-fs-lock,
html.zone-fs-lock body { overflow: hidden; }

#zoneViewer {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.zone-header {
    flex-shrink: 0;
    gap: 12px;
    padding: 12px 18px;
}

.zone-controls { flex-wrap: wrap; justify-content: flex-end; }

.zone-control-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.zone-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 12px;
    padding: 0 12px 12px;
}

.zone-play {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zone-frame-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

#zoneFrame {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    border-radius: 12px;
    background: #000;
}

.zone-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(11, 11, 11, 0.88);
}
.zone-loading[hidden] { display: none !important; }

.zone-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

/* Percentage loader for game documents and their assets. */
.zone-loading {
    padding: 18px;
    background: rgba(8, 8, 10, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.zone-loading-card {
    width: min(360px, 86vw);
    padding: 20px 22px;
    border: 1px solid var(--border, #2a2a32);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card-bg, #121216) 94%, transparent);
    box-shadow: 0 0 40px var(--accent-glow), 0 12px 32px rgba(0, 0, 0, 0.5);
}

.zone-loading-kicker {
    display: block;
    margin-bottom: 9px;
    font-family: var(--font);
    font-size: 0.6rem;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--text-dim, #9a9aa8);
}

.zone-loading-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.zone-loading-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: bold;
    color: var(--text-primary, #f2f2f5);
}

.zone-loading-pct {
    flex-shrink: 0;
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px var(--accent-glow);
}

.zone-progress {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg, #0b0b0b) 72%, #fff 6%);
}

.zone-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 62%, #000), var(--accent));
    box-shadow: 0 0 12px var(--accent-glow);
    transition: width 0.2s ease-out;
}

.zone-loading-status {
    margin-top: 9px;
    font-family: var(--font);
    font-size: 0.66rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim, #9a9aa8);
}

/* Compact mirror of the same progress on the pre-game ad card. */
.game-preroll-progress {
    height: 5px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg, #0b0b0b) 72%, #fff 6%);
}

.game-preroll-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 62%, #000), var(--accent));
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.2s ease-out;
}

.game-preroll-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    font-family: var(--font);
    font-size: 0.62rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim, #9a9aa8);
}

.game-preroll-progress-meta #gamePrerollPct {
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
    .zone-loading-card { width: 100%; padding: 18px; }
    .zone-loading-pct { font-size: 1.15rem; }
    .zone-progress { height: 8px; }
    .zone-loading-status { font-size: 0.62rem; }
}

@media (prefers-reduced-motion: reduce) {
    .zone-progress-fill,
    .game-preroll-progress-fill { transition: none; }
}

.zone-rail {
    display: none;
    flex: 0 0 160px;
    width: 160px;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
    overflow: hidden;
}

.zone-rail.has-ad { display: flex; }
.zone-rail .ad-slot { max-width: 160px; }
.zone-rail .ad-slot.has-ad { padding: 0; }

.zone-bottom-ad {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}
.zone-bottom-ad .ad-slot.has-ad { padding: 4px 0 0; }

/* Narrow iPad portrait shows one rail; phones show the banner under the game. */
@media (max-width: 999px) {
    .zone-rail--left { display: none !important; }
}
@media (max-width: 719px) {
    .zone-rail { display: none !important; }
}
@media (min-width: 720px) {
    #zoneViewer.zone-has-rail .zone-bottom-ad { display: none; }
}

.zone-exit-fullscreen {
    display: none;
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 60;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(13, 13, 13, 0.82);
    color: #fff;
    font-family: var(--font);
    font-size: 0.7rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#zoneViewer.zone-fullscreen,
#zoneViewer:fullscreen {
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 2147482000;
    background: #000;
    padding: 0;
}

#zoneViewer.zone-fullscreen .zone-header,
#zoneViewer.zone-fullscreen .zone-rail,
#zoneViewer.zone-fullscreen .zone-bottom-ad { display: none !important; }

#zoneViewer.zone-fullscreen .zone-stage { padding: 0; gap: 0; }
#zoneViewer.zone-fullscreen #zoneFrame { border-radius: 0; }
#zoneViewer.zone-fullscreen .zone-exit-fullscreen { display: inline-flex; }

/* --- Pre-game ad --- */
.game-preroll {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(9, 9, 9, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.2s ease;
}
.game-preroll[hidden] { display: none !important; }

.game-preroll-card {
    width: min(780px, 100%);
    max-height: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.game-preroll-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.game-preroll-kicker {
    font-size: 0.58rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0.7;
}

.game-preroll-count {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: bold;
}

.ad-slot--preroll { width: 100%; max-width: 728px; margin: 0 auto; }
.ad-slot--preroll.has-ad { padding: 0; }
.ad-slot--preroll iframe { margin: 0 auto; }

.game-preroll-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.game-preroll-name { font-size: 0.8rem; color: var(--text-primary); }

.game-preroll-skip {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: var(--accent);
    color: #0b0b0b;
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
}
.game-preroll-skip[disabled] {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border);
    cursor: default;
}

.game-preroll-note {
    margin: 0;
    font-size: 0.66rem;
    line-height: 1.5;
    color: var(--text-dim);
    opacity: 0.7;
}

/* --- Native banner --- */
.ad-slot--native { max-width: 970px; }
.ad-slot--native.has-ad { display: block; padding: 18px 0; }
.ad-native-holder { width: 100%; overflow: hidden; }
.ad-native-holder img { max-width: 100%; height: auto; }

/* --- Games grid: cheap scrolling on tablets --- */
.zone-item {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.05);
    content-visibility: auto;
    contain-intrinsic-size: auto 250px;
}

.zone-item img { background: rgba(255, 255, 255, 0.03); }

.games-load-sentinel {
    grid-column: 1 / -1;
    width: 100%;
    height: 1px;
}

@media (min-width: 900px) and (max-width: 1279px) {
    .games-featured-item { flex: 0 0 calc(25% - 30px); }
}
@media (min-width: 640px) and (max-width: 899px) {
    .games-featured-item { flex: 0 0 calc(33.333% - 30px); }
}

/* ══════════════════════════════════════════════════════════════════════
   12. iPad / touch tuning
   ══════════════════════════════════════════════════════════════════════ */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (pointer: coarse) {
    button, a, .nav-item, .zone-item, .games-featured-item, .zone-control-btn {
        touch-action: manipulation;
    }

    /* iOS zooms the page when a focused field is under 16px. */
    input, select, textarea { font-size: 16px; }

    .zone-control-btn,
    .games-fav-filter-btn,
    .games-search-container select { min-height: 44px; }

    .games-heart-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }

    /* A blurred sticky bar is expensive to composite while scrolling. */
    .games-search-container {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: color-mix(in srgb, var(--bg) 96%, transparent);
    }
}

@media (hover: none) {
    .zone-item:hover { transform: none; border-color: var(--border); box-shadow: none; }
    .zone-item:hover p { color: var(--text-dim); text-shadow: none; }
    .zone-item:active { transform: scale(0.97); border-color: var(--accent); }

    .games-featured-item:hover { transform: none; }
    .games-featured-item:hover img { border-color: transparent; box-shadow: none; }
    .games-featured-item:active img { border-color: var(--accent); }

    .games-nav-btn:hover { background: var(--card-bg); border-color: var(--border); }
    .zone-control-btn:hover { background: var(--input-bg); color: inherit; box-shadow: none; }
    .zone-control-btn:active { background: var(--accent); color: #0b0b0b; }
}

.view-section,
#games-content { overscroll-behavior: contain; }

@supports (height: 100dvh) {
    body { height: 100dvh; }

    .view-section,
    #games-content { min-height: calc(100dvh - 76px); }

    #proxy-content { height: calc(100dvh - 76px) !important; }
}

@media (max-width: 900px) {
    @supports (height: 100dvh) {
        .view-section,
        #games-content { min-height: calc(100dvh - 62px); }

        #proxy-content { height: calc(100dvh - 62px) !important; }
    }
}


/* Quick fullscreen entry button over the game itself */
.zone-enter-fullscreen {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(13, 13, 13, 0.78);
    color: #fff;
    font-family: var(--font);
    font-size: 0.68rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.zone-enter-fullscreen:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #0b0b0b;
}

.zone-enter-fullscreen svg { flex-shrink: 0; }

#zoneViewer.zone-fullscreen .zone-enter-fullscreen { display: none; }

/* AETHER DESKTOP SHELL */
/* ══════════════════════════════════════════════════════════════════════
   AETHER DESKTOP SHELL
   Bottom taskbar, app icons, compact windows and layout modes.
   ══════════════════════════════════════════════════════════════════════ */

html[data-layout="desktop"],
html[data-layout="compact"] {
    --taskbar-h: 74px;
    --taskbar-safe: env(safe-area-inset-bottom, 0px);
    --taskbar-total: calc(var(--taskbar-h) + var(--taskbar-safe));
}

html[data-layout="compact"] { --taskbar-h: 58px; }

/* ── Bottom taskbar ─────────────────────────────────────────────────── */
html[data-layout="desktop"] .sidebar,
html[data-layout="compact"] .sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--taskbar-total);
    padding: 0 12px env(safe-area-inset-bottom, 0px);
    flex-direction: row;
    align-items: center;
    gap: 3px;
    border-top: 1px solid var(--border);
    border-right: 0;
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.97), rgba(12, 12, 12, 0.99));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    z-index: 1200;
}

html[data-layout="desktop"] .sidebar:hover,
html[data-layout="compact"] .sidebar:hover { width: 100%; }

html[data-layout="desktop"] .logo-box,
html[data-layout="compact"] .logo-box {
    width: 38px;
    height: 38px;
    margin: 0 7px 0 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(200, 200, 200, 0.3);
    border-radius: 10px;
    background: rgba(200, 200, 200, 0.12);
    font-size: 22px;
    line-height: 1;
    text-shadow: 0 0 10px var(--accent-glow);
}

html[data-layout="desktop"] .nav-group,
html[data-layout="compact"] .nav-group {
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    height: 100%;
    gap: 1px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html[data-layout="desktop"] .nav-group::-webkit-scrollbar,
html[data-layout="compact"] .nav-group::-webkit-scrollbar { display: none; }

html[data-layout="desktop"] .nav-item,
html[data-layout="compact"] .nav-item {
    width: auto;
    min-width: 58px;
    height: 100%;
    min-height: 0;
    padding: 6px 9px 5px;
    gap: 3px;
    flex-direction: column;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-dim);
    position: relative;
}

html[data-layout="desktop"] .nav-item::before,
html[data-layout="compact"] .nav-item::before { display: none; }

html[data-layout="desktop"] .nav-item svg,
html[data-layout="compact"] .nav-item svg {
    width: 19px;
    height: 19px;
    min-width: 0;
}

html[data-layout="desktop"] .nav-item span,
html[data-layout="compact"] .nav-item span {
    position: static;
    left: auto;
    opacity: 1;
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.55px;
    text-transform: none;
    white-space: nowrap;
}

html[data-layout="desktop"] .nav-item:hover,
html[data-layout="compact"] .nav-item:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

html[data-layout="desktop"] .nav-item.active,
html[data-layout="compact"] .nav-item.active {
    color: var(--accent);
    background: rgba(200, 200, 200, 0.13);
}

html[data-layout="desktop"] .nav-item.active svg,
html[data-layout="compact"] .nav-item.active svg { stroke: var(--accent); }

html[data-layout="desktop"] .nav-item.active::after,
html[data-layout="compact"] .nav-item.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 14px;
    height: 2px;
    margin-left: -7px;
    border-radius: 99px;
    background: var(--accent);
}

html[data-layout="desktop"] .sidebar-bottom,
html[data-layout="compact"] .sidebar-bottom {
    flex-direction: row;
    align-items: center;
    width: auto;
    margin-left: 4px;
    padding: 0 4px 0 0;
    gap: 1px;
    border: 0;
}

html[data-layout="desktop"] .create-cta,
html[data-layout="compact"] .create-cta {
    width: 34px;
    height: 34px;
    margin-left: 4px;
    padding: 0;
    justify-content: center;
    border-radius: 9px;
}

html[data-layout="desktop"] .create-cta span,
html[data-layout="compact"] .create-cta span { display: none; }

html[data-layout="desktop"] .taskbar-tray,
html[data-layout="compact"] .taskbar-tray {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding-left: 8px;
    flex-shrink: 0;
}

html[data-layout="desktop"] .taskbar-info,
html[data-layout="compact"] .taskbar-info {
    width: 32px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
}

html[data-layout="desktop"] .taskbar-info svg,
html[data-layout="compact"] .taskbar-info svg { width: 15px; height: 15px; }

html[data-layout="desktop"] .taskbar-info:hover,
html[data-layout="compact"] .taskbar-info:hover { color: var(--accent); background: rgba(255, 255, 255, 0.06); }

html[data-layout="desktop"] .taskbar-clock,
html[data-layout="compact"] .taskbar-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    min-width: 56px;
    height: 100%;
    padding: 0 6px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font);
}

#taskbar-time { font-size: 12px; line-height: 1.1; font-weight: bold; }
#taskbar-date { font-size: 8.5px; line-height: 1.1; color: var(--text-dim); letter-spacing: 0.5px; text-transform: uppercase; }

html[data-layout="classic"] .taskbar-tray { display: none; }

html[data-layout="desktop"][data-taskbar-labels="false"] .nav-item span,
html[data-layout="compact"][data-taskbar-labels="false"] .nav-item span { display: none; }

html[data-layout="compact"] .nav-item,
html[data-layout="desktop"][data-taskbar-labels="false"] .nav-item {
    min-width: 44px;
    padding-right: 7px;
    padding-left: 7px;
}

/* ── Main content area above the taskbar ───────────────────────────── */
html[data-layout="desktop"] .main-view,
html[data-layout="compact"] .main-view {
    margin-left: 0;
    padding-top: 0;
    height: 100dvh;
    overflow: hidden;
}

html[data-layout="desktop"] .view-section,
html[data-layout="compact"] .view-section {
    height: calc(100dvh - var(--taskbar-total));
    min-height: 0;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 22px clamp(16px, 3vw, 42px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

html[data-layout="desktop"] #games-content,
html[data-layout="compact"] #games-content {
    max-width: 1480px;
    height: calc(100dvh - var(--taskbar-total)) !important;
    min-height: 0 !important;
    padding: 14px clamp(16px, 3vw, 42px) 22px !important;
}

html[data-layout="desktop"] #proxy-content,
html[data-layout="compact"] #proxy-content {
    max-width: none;
    height: calc(100dvh - var(--taskbar-total)) !important;
    min-height: 0 !important;
    padding: 0 !important;
}

html[data-layout="desktop"] #app-frame,
html[data-layout="compact"] #app-frame {
    top: 0;
    height: calc(100dvh - var(--taskbar-total));
}

html[data-layout="desktop"] .games-search-container,
html[data-layout="compact"] .games-search-container {
    top: 0;
    margin-bottom: 16px;
    padding: 8px 0;
}

html[data-layout="desktop"] #legal-footer,
html[data-layout="compact"] #legal-footer {
    bottom: calc(var(--taskbar-total) + 3px);
    left: 0;
    right: 0;
    font-size: 8px;
    opacity: 0.55;
}

html[data-layout="desktop"] .status-hud,
html[data-layout="desktop"] .social-hud,
html[data-layout="compact"] .status-hud,
html[data-layout="compact"] .social-hud { display: none !important; }

body.zone-open .sidebar { display: none; }

/* ── Desktop home ──────────────────────────────────────────────────── */
html[data-layout] #home-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    max-width: 1520px;
    padding: 16px clamp(16px, 3vw, 42px);
}

.desktop-stage {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: clamp(14px, 2vw, 24px);
    background-color: rgba(10, 10, 10, 0.58);
    background-image:
        radial-gradient(720px 400px at 82% 6%, rgba(200, 200, 200, 0.28), transparent 65%),
        radial-gradient(520px 380px at 8% 100%, rgba(170, 170, 170, 0.12), transparent 60%),
        linear-gradient(135deg, rgba(28, 28, 28, 0.72), rgba(11, 11, 11, 0.84));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 28px 70px rgba(0, 0, 0, 0.32);
}

.desktop-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 80%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 80%);
}

.desktop-stage > * { position: relative; z-index: 1; }

html[data-wallpaper="grid"] .desktop-stage {
    background-image:
        radial-gradient(700px 380px at 75% 4%, rgba(229, 229, 229, 0.14), transparent 65%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 28px),
        linear-gradient(145deg, rgba(18, 18, 18, 0.9), rgba(9, 9, 9, 0.94));
}

html[data-wallpaper="grid"] .desktop-stage::before { opacity: 0; }

html[data-wallpaper="graphite"] .desktop-stage {
    background-image:
        radial-gradient(600px 400px at 78% 8%, rgba(255, 255, 255, 0.08), transparent 70%),
        linear-gradient(145deg, rgba(38, 38, 38, 0.88), rgba(9, 9, 9, 0.95));
}

html[data-wallpaper="graphite"] .desktop-stage::before { opacity: 0; }

.desktop-workarea {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: clamp(12px, 2vw, 24px);
    align-items: start;
}

.desktop-app-column { min-width: 0; }

.desktop-label {
    margin: 0 0 7px;
    color: var(--text-dim);
    font-size: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.65;
}

.desktop-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.desktop-shortcut {
    width: 82px;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.desktop-shortcut:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.desktop-shortcut.active { color: var(--accent); }

.desktop-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(200, 200, 200, 0.22), rgba(255, 255, 255, 0.04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.24);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.desktop-icon svg { width: 21px; height: 21px; }

.desktop-shortcut:hover .desktop-icon,
.desktop-shortcut.active .desktop-icon {
    transform: translateY(-1px);
    border-color: rgba(200, 200, 200, 0.7);
    box-shadow: 0 0 16px rgba(200, 200, 200, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.desktop-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1.2;
    letter-spacing: 0.35px;
    text-align: center;
}

.desktop-tip { margin: 8px 0 0; color: var(--text-dim); font-size: 8px; line-height: 1.4; text-align: center; opacity: 0.5; }

html[data-icon-size="sm"] .desktop-icon { width: 38px; height: 38px; border-radius: 10px; }
html[data-icon-size="sm"] .desktop-icon svg { width: 18px; height: 18px; }
html[data-icon-size="sm"] .desktop-shortcut { width: 74px; }
html[data-icon-size="lg"] .desktop-icon { width: 50px; height: 50px; border-radius: 14px; }
html[data-icon-size="lg"] .desktop-icon svg { width: 24px; height: 24px; }
html[data-icon-size="lg"] .desktop-shortcut { width: 88px; }

.desktop-panels {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.85fr);
    gap: clamp(10px, 1.6vw, 16px);
    align-items: start;
}

.desktop-window {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(25, 25, 25, 0.9), rgba(14, 14, 14, 0.94));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.desktop-window-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.028);
    color: var(--text-dim);
    font-size: 8px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.desktop-dots { display: inline-flex; gap: 4px; flex-shrink: 0; }
.desktop-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.desktop-dots i:first-child { background: rgba(200, 200, 200, 0.7); }
.desktop-dots i:nth-child(2) { background: rgba(170, 170, 170, 0.55); }
.desktop-window-title { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desktop-window-mini { margin-left: auto; font-size: 7.5px; opacity: 0.6; }
.desktop-online { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 7.5px; letter-spacing: 0.7px; white-space: nowrap; }
.desktop-online i { width: 5px; height: 5px; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 6px rgba(110, 231, 183, 0.8); }

.desktop-window-body { padding: clamp(14px, 2vw, 24px); }

.desktop-kicker {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 8px;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

.desktop-welcome h1 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    line-height: 1.15;
    letter-spacing: 0.2px;
}

.desktop-welcome h1 span#typewriter {
    color: var(--accent);
    border-right: 2px solid var(--accent);
    padding-right: 4px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.desktop-subtitle {
    max-width: 56ch;
    margin: 0;
    color: var(--text-dim);
    font-size: 0.73rem;
    line-height: 1.55;
}

.desktop-subtitle .total-visits-display,
.desktop-subtitle .game-count-display { margin-left: 6px; font-size: 0.68rem; opacity: 0.55; }
.desktop-welcome .hero-actions { margin-top: 14px; gap: 8px; }
.desktop-welcome .btn-start { margin-top: 0; padding: 10px 16px; border-radius: 8px; font-size: 0.68rem; letter-spacing: 1.1px; }
.desktop-welcome .btn-ghost { padding: 9px 14px; border-radius: 8px; font-size: 0.66rem; letter-spacing: 1.1px; }

.desktop-widget { min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.desktop-clock-body { padding: 13px 15px 15px; }
html[data-layout] #home-content #home-clock {
    margin: 0;
    color: var(--accent);
    font-size: clamp(1.75rem, 3.2vw, 2.55rem);
    line-height: 1.05;
    letter-spacing: -0.5px;
    text-shadow: 0 0 16px var(--accent-glow);
}
html[data-layout] #home-content #home-date {
    margin-top: 6px;
    color: var(--text-dim);
    font-size: 8.5px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.desktop-promo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    max-width: none;
    margin: 0;
    padding: 12px 13px;
    border-radius: 12px;
}
.desktop-promo .promo-body { flex: none; gap: 3px; }
.desktop-promo .promo-badge { font-size: 7px; padding: 1px 5px; }
.desktop-promo .promo-title { font-size: 0.82rem; }
.desktop-promo .promo-desc { font-size: 0.65rem; line-height: 1.4; }
.desktop-promo .promo-cta { width: auto; font-size: 0.56rem; letter-spacing: 1px; }

.desktop-ad-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 2px;
}

.desktop-ad-row .ad-slot.has-ad { padding: 2px 0; }

.desktop-shortcut:focus-visible,
.taskbar-info:focus-visible,
.taskbar-clock:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Compact app pages ─────────────────────────────────────────────── */
html[data-layout="desktop"] .settings-grid,
html[data-layout="compact"] .settings-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 14px;
}

html[data-layout="desktop"] .settings-card,
html[data-layout="compact"] .settings-card {
    padding: 18px;
    margin-bottom: 0;
    border-radius: 14px;
}

html[data-layout="desktop"] .settings-header,
html[data-layout="compact"] .settings-header { margin-bottom: 18px !important; }
html[data-layout="desktop"] .settings-header h2,
html[data-layout="compact"] .settings-header h2 { margin-bottom: 6px !important; font-size: 1.35rem; }

html[data-layout="desktop"] .app-grid,
html[data-layout="compact"] .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 14px;
    margin-top: 18px;
}

html[data-layout="desktop"] .app-card,
html[data-layout="compact"] .app-card { padding: 14px; gap: 10px; border-radius: 13px; }

html[data-layout="desktop"] .zone-item,
html[data-layout="compact"] .zone-item { padding: 0; border-radius: 14px; }
html[data-layout="desktop"] .zone-item p,
html[data-layout="compact"] .zone-item p { margin: 0; padding: 1.1rem 0.5rem 0.45rem; font-size: 0.68rem; line-height: 1.25; }

html[data-layout="desktop"] #gamesContainer,
html[data-layout="compact"] #gamesContainer {
    grid-template-columns: repeat(auto-fill, minmax(clamp(108px, 10vw, 148px), 1fr));
    gap: 10px;
}

html[data-layout="desktop"] .games-featured-wrapper,
html[data-layout="compact"] .games-featured-wrapper { margin-bottom: 18px; padding: 0; }

html[data-layout="desktop"] .games-search-container,
html[data-layout="compact"] .games-search-container { padding: 8px 0; }

/* ── Smaller screens ────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .desktop-workarea { grid-template-columns: 1fr; gap: 10px; }
    .desktop-app-column { min-width: 0; }
    .desktop-label { margin-bottom: 5px; text-align: left; }
    .desktop-shortcuts { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
    .desktop-shortcut { width: auto; padding: 5px 3px; }
    .desktop-tip { display: none; }
}

@media (max-width: 900px) {
    .desktop-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .desktop-panels { grid-template-columns: 1fr; }
    .desktop-widget { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (max-width: 700px) {
    html[data-layout="desktop"] .sidebar .nav-item span,
    html[data-layout="compact"] .sidebar .nav-item span { display: none; }
    html[data-layout="desktop"] .sidebar .nav-item,
    html[data-layout="compact"] .sidebar .nav-item { min-width: 42px; padding-right: 6px; padding-left: 6px; }
    html[data-layout="desktop"] .sidebar-bottom,
    html[data-layout="compact"] .sidebar-bottom,
    html[data-layout="desktop"] .create-cta,
    html[data-layout="compact"] .create-cta,
    html[data-layout="desktop"] .taskbar-info,
    html[data-layout="compact"] .taskbar-info { display: none; }
    html[data-layout="desktop"] .logo-box,
    html[data-layout="compact"] .logo-box { width: 34px; height: 34px; margin-right: 5px; font-size: 20px; border-radius: 9px; }
    #taskbar-date { display: none !important; }
    html[data-layout="desktop"] .taskbar-clock,
    html[data-layout="compact"] .taskbar-clock { min-width: 46px; }
    html[data-layout="desktop"] .view-section,
    html[data-layout="compact"] .view-section,
    html[data-layout="desktop"] #games-content,
    html[data-layout="compact"] #games-content { padding-right: 10px !important; padding-left: 10px !important; }
}

@media (max-width: 620px) {
    html[data-layout] #home-content { padding: 10px; gap: 8px; }
    .desktop-stage { padding: 10px; border-radius: 14px; }
    .desktop-window-body { padding: 13px; }
    .desktop-welcome h1 { font-size: 1.3rem; }
    .desktop-widget { grid-template-columns: 1fr; }
    .desktop-icon { width: 40px; height: 40px; border-radius: 11px; }
    .desktop-icon svg { width: 19px; height: 19px; }
    .desktop-name { font-size: 8.5px; }
    html[data-layout] #home-content #home-clock { font-size: 1.7rem; }
    .desktop-promo { padding: 11px 12px; }
}

@media (max-width: 390px) {
    .desktop-shortcuts { gap: 1px; }
    .desktop-shortcut { padding-right: 1px; padding-left: 1px; }
    .desktop-name { font-size: 8px; letter-spacing: 0; }
}

/* The home section is a fixed-height flex scroll area. Keep the desktop and
   the ad row at natural height; otherwise a tall ad unit shrinks the desktop. */
html[data-layout] #home-content { align-items: stretch; }
html[data-layout] #home-content > .desktop-stage,
html[data-layout] #home-content > .desktop-ad-row { flex: 0 0 auto; }

/* Keep the desktop shell clean in every mode. The old floating telemetry and
   social rails overlap compact content, especially in Classic on phones. */
html[data-layout] .status-hud,
html[data-layout] .social-hud { display: none !important; }

/* .main-view is a flex child; without min-width:0 the games carousel's
   min-content width can stretch Classic beyond the viewport. */
html[data-layout="classic"] .main-view {
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
}
html[data-layout="classic"] .view-section,
html[data-layout="classic"] #games-content {
    min-width: 0;
}

/* Game covers are square. Without an explicit height rule the HTML
   width="300" height="300" attributes force every card image to 300px tall,
   making each game card look like a portrait poster. */
html[data-layout] .zone-item img {
    height: auto !important;
    aspect-ratio: 1 / 1;
}

/* Compact featured carousel: still portrait-ish, but no longer 375px tall. */
html[data-layout] .games-featured-item img {
    height: clamp(140px, 20vh, 210px);
    aspect-ratio: auto;
    object-fit: cover;
}

/* Phone games toolbar: keep search + sort + favourites to two rows so the
   first row of games is visible above the taskbar. */
@media (max-width: 620px) {
    html[data-layout] .games-search-container {
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 8px;
        padding: 4px 0;
        margin-bottom: 10px;
    }
    html[data-layout] .games-search-input-wrapper { flex: 1 1 100%; }
    html[data-layout] #gamesSearchInput {
        padding: 10px 12px 10px 40px;
        font-size: 0.85rem;
        border-width: 1px;
    }
    html[data-layout] #gamesSortSelect,
    html[data-layout] .games-fav-filter-btn {
        flex: 1 1 calc(50% - 4px);
        width: auto;
        min-width: 0;
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 0.72rem;
    }
    html[data-layout] .games-featured-wrapper { margin-bottom: 8px; }
}



/* ── Alternative links (home) ───────────────────────────────────────── */
html[data-layout] #home-content > .link-hub {
    flex: 0 0 auto;
    width: 100%;
}

.link-hub-body { padding: clamp(12px, 1.5vw, 18px) clamp(12px, 1.8vw, 20px) clamp(13px, 1.6vw, 19px); }

.link-hub-desc {
    margin: 0 0 10px;
    color: var(--text-dim);
    font-size: 0.68rem;
    line-height: 1.5;
}

.link-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.link-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.link-card:hover,
.link-card:focus-visible {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 18px var(--accent-glow);
    transform: translateY(-1px);
}

.link-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.link-card-top { display: flex; align-items: center; gap: 6px; min-width: 0; }

.link-card-name {
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.4px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card-tag {
    flex-shrink: 0;
    margin-left: auto;
    padding: 1px 5px;
    border: 1px solid rgba(200, 200, 200, 0.35);
    border-radius: 4px;
    color: var(--accent);
    font-size: 6.5px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.link-card-url {
    padding-right: 16px;
    overflow: hidden;
    color: var(--text-dim);
    font-size: 0.6rem;
    letter-spacing: 0.2px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card-go {
    position: absolute;
    right: 10px;
    bottom: 9px;
    color: var(--accent);
    font-size: 0.72rem;
    opacity: 0.55;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.link-card:hover .link-card-go,
.link-card:focus-visible .link-card-go { opacity: 1; transform: translateX(2px); }

@media (max-width: 620px) {
    .link-hub-grid { grid-template-columns: 1fr; }
}
