@import url('../../shared/tokens.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body.hexa-app-host {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--hexa-white);
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.hexa-app {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: var(--safe-top);
    background:
        radial-gradient(ellipse 80% 50% at 10% 0%, rgba(0, 212, 255, 0.07), transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(168, 85, 247, 0.08), transparent 50%),
        var(--bg-base);
}

.app-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 8px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(3, 3, 15, 0.85);
    backdrop-filter: blur(10px);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    color: inherit;
}

.app-logo img { width: 28px; height: 28px; object-fit: contain; }
.app-logo .dot { color: var(--hexa-purple); }

.app-topbar .btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--hexa-white);
    cursor: pointer;
    flex-shrink: 0;
}

.desktop-nav {
    display: none;
    gap: 4px;
    flex-wrap: wrap;
    margin-left: auto;
}

@media (min-width: 900px) {
    .desktop-nav { display: flex; }
    .tab-bar { display: none !important; }
    .app-scroll { padding: 20px 24px; }
    .hx-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.desktop-nav button {
    font-size: 0.8rem;
    padding: 8px 12px;
    min-height: 44px;
    border: none;
    background: transparent;
    color: var(--hexa-dim);
    cursor: pointer;
    border-radius: 8px;
}

.desktop-nav button.is-on {
    color: var(--hexa-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.tab-bar {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 8px 8px calc(10px + var(--safe-bottom));
    border-top: 1px solid var(--glass-border);
    background: rgba(8, 8, 24, 0.96);
    backdrop-filter: blur(14px);
}

.tab-bar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border: none;
    background: none;
    color: var(--hexa-muted);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 52px;
}

.tab-bar button i { font-size: 1.15rem; }
.tab-bar button.is-on { color: var(--hexa-cyan); }

.hx-screen { display: none; animation: hxFadeIn 0.25s ease; }
.hx-screen.is-active { display: block; }

@keyframes hxFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    color: var(--hexa-dim);
    margin-bottom: 12px;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 8vw, 3.2rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.hero-title .accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    font-size: 0.88rem;
    color: var(--hexa-dim);
    margin-bottom: 16px;
    max-width: 42ch;
}

.hx-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

.hx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.hx-btn-primary { background: var(--gradient); color: #03030f; }
.hx-btn-ghost {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--hexa-white);
}

.hx-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }

.hx-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px;
}

.hx-card h3 { font-size: 0.92rem; margin-bottom: 6px; }
.hx-card p { font-size: 0.78rem; color: var(--hexa-dim); line-height: 1.45; }
.hx-card a { color: var(--hexa-cyan); }

.hx-chip {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.hx-chip.live { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.hx-chip.pass { background: rgba(0, 212, 255, 0.15); color: var(--hexa-cyan); }
.hx-chip.muted { background: rgba(255, 255, 255, 0.08); color: var(--hexa-dim); }

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.stat-box {
    text-align: center;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.stat-box b {
    display: block;
    font-size: 1.1rem;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
}

.stat-box span {
    font-size: 0.62rem;
    color: var(--hexa-muted);
    text-transform: uppercase;
}

.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
}

.player-row:last-child { border-bottom: none; }

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--gradient);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: #03030f;
    overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.news-list { display: flex; flex-direction: column; gap: 10px; }

.news-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.news-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(168, 85, 247, 0.25));
    flex-shrink: 0;
    object-fit: cover;
}

.profile-card { text-align: center; padding: 24px 16px; }

.profile-card .avatar-lg {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    border-radius: 24px;
    background: var(--glass);
    border: 2px solid var(--glass-border);
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: var(--hexa-muted);
    overflow: hidden;
}

.profile-card .avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.install-banner {
    display: none;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(0, 212, 255, 0.08);
    font-size: 0.78rem;
}

.install-banner.is-visible { display: block; }

.install-banner button {
    margin-top: 8px;
    width: 100%;
}

.app-offline {
    font-size: 0.72rem;
    color: #fbbf24;
    text-align: center;
    padding: 6px;
    display: none;
}

.app-offline.is-on { display: block; }
