/* Design tokens and hero treatment mirror upflydev.com (index.css / ai.css). */
:root {
    --primary-color: #FB5130;
    --text-color: #fff;
    --second-text-color: #c4c4c4;
    --background-color: #000508;
    --accent: 251, 81, 48;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 4rem 0; }

.gradient-text {
    background: linear-gradient(100deg, #9945FF, #1FCFF1 45%, #FB5130);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ---------- Background orbs ---------- */
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 900px;
    z-index: -1; overflow: hidden; pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: .45; will-change: transform; }
.orb-1 { width: 500px; height: 500px; background: #9945FF; top: -80px; left: 5%; animation: orbFloat 15s ease-in-out infinite; }
.orb-2 { width: 440px; height: 440px; background: #1FCFF1; top: 60px; right: 4%; animation: orbFloat 19s ease-in-out infinite reverse; }
.orb-3 { width: 400px; height: 400px; background: #FB5130; bottom: -120px; left: calc(50% - 200px); animation: orbFloat 17s ease-in-out infinite; }
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -40px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* ---------- Buttons ---------- */
.btn-primary, .btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    padding: 1rem 2.25rem; border-radius: 999px; border: 1px solid transparent;
    font-weight: 700; font-size: 1rem; line-height: 1.2;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--primary-color); color: #fff; box-shadow: 0 12px 40px -16px rgba(251, 81, 48, .9); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 44px -14px rgba(251, 81, 48, 1); }
.btn-ghost {
    color: var(--text-color); background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .18); backdrop-filter: blur(8px);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: rgba(31, 207, 241, .6); box-shadow: 0 12px 40px -16px rgba(31, 207, 241, .6); }
.cta-row { display: flex; flex-wrap: wrap; gap: .85rem; }

/* ---------- Header ---------- */
.header { padding: 1.25rem 0; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand .logo { width: 140px; height: 32px; }
.brand-suffix {
    font-weight: 800; font-size: 1.1rem; letter-spacing: .02em;
    padding: .15rem .6rem; border-radius: 999px;
    background: rgba(251, 81, 48, .16); color: var(--primary-color);
}
/* Account placeholder: user + plan state, static until auth ships */
.account {
    display: flex; align-items: center; gap: .75rem;
    padding: .35rem .5rem .35rem .85rem; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04);
    backdrop-filter: blur(8px); font-weight: 600;
}
.plan {
    padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .02em;
}
.plan-free { background: rgba(255, 255, 255, .08); color: var(--second-text-color); }
.plan-premium { background: rgba(255, 213, 18, .16); color: #FFD512; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%; font-size: .85rem; font-weight: 800;
    background: linear-gradient(135deg, #9945FF, #1FCFF1); color: #000;
}
.account-name { padding-right: .35rem; }

/* ---------- Game switcher (game pages) ---------- */
.switcher {
    position: sticky; top: 0; z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, .08); border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 5, 8, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.switcher-row { display: flex; align-items: center; gap: 1.25rem; min-height: 56px; }
.switcher-back { color: var(--second-text-color); font-weight: 600; white-space: nowrap; }
.switcher-back:hover { color: var(--text-color); }
.switcher-tabs {
    display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: .5rem 0;
    -webkit-overflow-scrolling: touch;
}
.switcher-tabs::-webkit-scrollbar { display: none; }
.switcher-tab {
    display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap;
    padding: .4rem .9rem .4rem .45rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
    color: var(--second-text-color); border: 1px solid transparent; transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.switcher-tab img { width: 28px; height: 28px; border-radius: 8px; }
.switcher-tab:hover { color: var(--text-color); background: rgba(255, 255, 255, .05); }
.switcher-tab[aria-current="page"] {
    color: var(--text-color); background: rgba(var(--accent), .14); border-color: rgba(var(--accent), .4);
}

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; padding: 5rem 0 3rem; }
.badge {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .55rem 1.2rem; margin-bottom: 2rem; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .04);
    backdrop-filter: blur(10px); font-size: .95rem; color: var(--second-text-color);
}
.badge .dot { width: 9px; height: 9px; border-radius: 50%; background: #19FB9B; box-shadow: 0 0 14px #19FB9B; animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
.hero h1 { font-size: clamp(2.6rem, 6vw, 5.25rem); line-height: 1.05; letter-spacing: -.02em; margin: 0 auto 1.5rem; max-width: 18ch; }
.hero .lead { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--second-text-color); max-width: 720px; margin: 0 auto; }

/* Game page hero: copy left, phone right */
.hero-game { text-align: left; padding: 3.5rem 0 1rem; }
.hero-game-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 3rem; align-items: center; }
.hero-game h1 { margin: 1.25rem 0 1.25rem; max-width: 14ch; }
.hero-game .lead { margin: 0 0 2rem; }
.hero-game-shot { display: flex; justify-content: center; }
.hero-game-shot img {
    width: min(100%, 340px); border-radius: 2.25rem;
    box-shadow: 0 40px 80px -30px rgba(var(--accent), .55), 0 0 0 1px rgba(255, 255, 255, .08);
}

/* ---------- App row (icon + name) ---------- */
.app-row { display: inline-flex; align-items: center; gap: 1rem; }
.app-row img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .8); transition: transform .25s ease; }
.app-row:hover img { transform: translateY(-2px) scale(1.04); }
.app-name { font-weight: 800; font-size: 1.15rem; }

/* ---------- Showcase (one per game on the home page) ---------- */
.showcase {
    position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    gap: 2.5rem; align-items: center; padding: 3rem;
    border-radius: 2rem; border: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(135deg, rgba(var(--accent), .12), rgba(255, 255, 255, .02) 60%);
    overflow: hidden; transition: border-color .25s ease, transform .25s ease;
}
.showcase + .showcase { margin-top: 2rem; }
.showcase:hover { border-color: rgba(var(--accent), .5); transform: translateY(-3px); }
.showcase-cover { position: absolute; inset: 0; z-index: 0; }
.showcase-copy, .showcase-shot { position: relative; z-index: 1; }
.showcase-copy h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); line-height: 1.1; letter-spacing: -.01em; margin: 1.25rem 0 1rem; }
.showcase-copy > p { color: var(--second-text-color); font-size: 1.05rem; max-width: 56ch; margin-bottom: 1.5rem; }
.showcase .cta-row { margin-top: 1.75rem; }
.showcase-shot { display: flex; justify-content: center; }
.showcase-shot img {
    width: min(100%, 300px); border-radius: 2rem;
    box-shadow: 0 40px 80px -30px rgba(var(--accent), .6), 0 0 0 1px rgba(255, 255, 255, .08);
    transition: transform .35s ease;
}
.showcase:hover .showcase-shot img { transform: translateY(-6px) rotate(-1.5deg); }

.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    padding: .35rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
    background: rgba(var(--accent), .14); color: rgb(var(--accent)); border: 1px solid rgba(var(--accent), .3);
}

/* ---------- Build grid (game page) ---------- */
.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); letter-spacing: -.01em; margin-bottom: .5rem; }
.section-head .lead { color: var(--second-text-color); }
.build-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.5rem; }
.build-grid-single { grid-template-columns: minmax(0, 420px); justify-content: center; }
.build {
    display: flex; flex-direction: column; border-radius: 1.5rem; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.build:hover { transform: translateY(-5px); border-color: rgba(var(--accent), .55); box-shadow: 0 30px 60px -30px rgba(var(--accent), .6); }
.build img { aspect-ratio: 640 / 700; object-fit: cover; object-position: top; }
.build-body { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.25rem 1.35rem; }
.build-name { font-weight: 800; font-size: 1.1rem; }
.build-blurb { color: var(--second-text-color); font-size: .9rem; flex: 1; }
.build-play {
    margin-top: .85rem; align-self: flex-start; padding: .55rem 1.35rem; border-radius: 999px;
    background: var(--primary-color); color: #fff; font-weight: 700; font-size: .9rem;
}
.build-play::after { content: " \2197"; }

/* ---------- Library (home) ---------- */
.hub { padding: 1.5rem 0 4rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shelf + .shelf { margin-top: 3rem; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.shelf-head .app-row img { width: 44px; height: 44px; border-radius: 11px; }
.shelf-head .app-name { font-size: 1.35rem; }
.shelf-count { color: var(--second-text-color); font-size: .9rem; font-weight: 600; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
.tile {
    position: relative; display: flex; flex-direction: column; border-radius: 1.25rem; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tile:hover { transform: translateY(-5px); border-color: rgba(var(--accent), .55); box-shadow: 0 30px 60px -30px rgba(var(--accent), .6); }
.tile img { aspect-ratio: 4 / 3; object-fit: cover; object-position: center 38%; }
.tile-body { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem 1.1rem; }
.tile-name { font-weight: 800; }
.tile-blurb { color: var(--second-text-color); font-size: .85rem; }
.tile-play {
    position: absolute; top: .75rem; right: .75rem; padding: .35rem .9rem; border-radius: 999px;
    background: var(--primary-color); color: #fff; font-weight: 700; font-size: .8rem;
    opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease;
}
.tile:hover .tile-play, .tile:focus-visible .tile-play { opacity: 1; transform: none; }
@media (hover: none) { .tile-play { opacity: 1; transform: none; } }

/* ---------- Studio CTA ---------- */
.studio { text-align: center; }
.studio h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); margin-bottom: .75rem; }
.studio .lead { color: var(--second-text-color); max-width: 620px; margin: 0 auto 1.75rem; }

/* ---------- Player (game in an iframe under a thin switch bar) ---------- */
.player-body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.playbar {
    display: flex; align-items: center; gap: .75rem; flex: none; height: 48px; padding: 0 .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08); background: #000508;
}
.playbar-back { display: inline-flex; align-items: center; gap: .5rem; flex: none; padding-right: .5rem; }
.playbar-back img { width: 110px; height: 25px; }
.playbar-back .brand-suffix { font-size: .9rem; padding: .1rem .5rem; }
.playbar-back:hover { opacity: .85; }
.playbar-tabs { display: flex; gap: .35rem; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.playbar-tabs::-webkit-scrollbar { display: none; }
.playbar-tab {
    display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
    padding: .3rem .75rem .3rem .35rem; border-radius: 999px; font-weight: 600; font-size: .85rem;
    color: var(--second-text-color); border: 1px solid transparent; transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.playbar-tab img { width: 22px; height: 22px; border-radius: 6px; }
.playbar-tab:hover { color: var(--text-color); background: rgba(255, 255, 255, .05); }
.playbar-tab[aria-current="page"] { color: var(--text-color); background: rgba(var(--accent), .16); border-color: rgba(var(--accent), .45); }
.playbar-account { display: inline-flex; align-items: center; gap: .5rem; flex: none; }
.playbar-account .avatar { width: 28px; height: 28px; font-size: .75rem; }
.player-frame { flex: 1; width: 100%; border: 0; background: #000; }
@media (max-width: 590px) {
    .playbar-back .brand-suffix { display: none; }
    .playbar-back img { width: 96px; height: 22px; }
    .playbar-tab span { display: none; }
    .playbar-tab[aria-current="page"] span { display: inline; }
    .playbar-account .plan { display: none; }
}

/* ---------- Footer ---------- */
.footer { padding: 1.25rem 0; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--second-text-color); font-size: .8rem; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-nav a:hover { color: var(--text-color); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-game-row, .showcase { grid-template-columns: 1fr; }
    .hero-game-shot, .showcase-shot { order: -1; }
    .showcase { padding: 2rem 1.5rem; }
}
@media (max-width: 590px) {
    .switcher-row { gap: .75rem; }
    .switcher-back { font-size: .9rem; }
    .switcher-tab span { font-size: .85rem; }
    .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .tile-body { padding: .7rem .8rem .9rem; }
    .account-name { display: none; }
    .container { padding: 0 1rem; }
    .section { padding: 3rem 0; }
    .hero { padding-top: 3rem; }
    .brand .logo { width: 110px; height: 25px; }
    .cta-row .btn-primary, .cta-row .btn-ghost { width: 100%; }
    .showcase { padding: 1.5rem 1.15rem; border-radius: 1.5rem; }
    .showcase-shot img, .hero-game-shot img { width: min(100%, 240px); }
    .build-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
    .build-body { padding: .9rem; }
}
