:root {
    --bg: #05020b;
    --surface: #0f0a1c;
    --surface-2: #161029;
    --text: #f5f2ff;
    --text-muted: #b3acc8;
    --accent: #8b3dff;
    --accent-2: #4f19a7;
    --border: rgba(255, 255, 255, 0.08);
    --danger: #ff4f82;
    --shadow: 0 10px 35px rgba(86, 24, 194, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(139, 61, 255, 0.32), transparent 45%),
        radial-gradient(circle at 90% 15%, rgba(79, 25, 167, 0.45), transparent 40%),
        var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 16px 110px;
}

.hero {
    background: linear-gradient(140deg, rgba(139, 61, 255, 0.24), rgba(15, 10, 28, 0.92));
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.06;
    letter-spacing: 0.01em;
}

.hero p {
    margin: 0;
    color: var(--text-muted);
    max-width: 600px;
}

.view {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    pointer-events: none;
    position: absolute;
    inset: 0;
    transition: opacity .34s ease, transform .34s ease;
}

.view.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    position: relative;
}

.section {
    margin: 0 0 26px;
}

.section h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.cards {
    display: grid;
    gap: 12px;
}

.news-card,
.video-card,
.placeholder-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(160deg, rgba(34, 24, 58, 0.8), rgba(13, 9, 24, 0.95));
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.news-card:hover,
.video-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 61, 255, 0.55);
    box-shadow: 0 12px 30px rgba(72, 26, 153, 0.3);
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #201436;
}

.card-content {
    padding: 12px 14px 14px;
}

.card-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
}

.card-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.45;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.watch-btn {
    flex-shrink: 0;
    border: 1px solid rgba(139, 61, 255, 0.8);
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 10px;
    text-decoration: none;
    transition: transform .2s ease, filter .2s ease;
}

.watch-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 24px 12px;
}

.error-box {
    background: rgba(255, 79, 130, 0.08);
    border: 1px solid rgba(255, 79, 130, 0.35);
    color: #ffc5d6;
    border-radius: 14px;
    padding: 12px;
    font-size: 0.88rem;
    margin-bottom: 12px;
}

.simple-view {
    padding: 24px 0;
}

.simple-view h2 {
    margin: 0 0 8px;
}

.simple-view p {
    margin: 0;
    color: var(--text-muted);
}

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 14px;
    width: min(94vw, 700px);
    background: rgba(8, 6, 14, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    padding: 8px;
    z-index: 100;
}

.bottom-nav-inner {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.nav-indicator {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(25% - 3px);
    border-radius: 12px;
    background: linear-gradient(125deg, rgba(139, 61, 255, 0.95), rgba(79, 25, 167, 0.95));
    box-shadow: 0 8px 20px rgba(80, 27, 170, 0.4);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.nav-btn {
    position: relative;
    z-index: 1;
    appearance: none;
    border: 0;
    background: transparent;
    color: #d9cfef;
    padding: 12px 8px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .25s ease;
}

.nav-btn.active {
    color: #fff;
}

@media (min-width: 720px) {
    .cards.news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cards.video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hidden {
    display: none !important;
}

.profile-card {
    background: linear-gradient(160deg, rgba(34, 24, 58, 0.8), rgba(13, 9, 24, 0.95));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

.profile-warning {
    background: rgba(255, 79, 130, 0.1);
    border: 1px solid rgba(255, 79, 130, 0.35);
    color: #ffc5d6;
    border-radius: 14px;
    padding: 14px;
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(139, 61, 255, 0.6);
}

.profile-name {
    margin: 0 0 4px;
}

.profile-meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-status {
    margin-top: 12px;
    color: var(--text-muted);
    min-height: 1.2em;
}

.primary-btn,
.secondary-btn {
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}

.primary-btn {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-color: rgba(139, 61, 255, 0.8);
    color: #fff;
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--border);
}

#finishAccountBtn,
#bindBrawlBtn {
    margin-top: 8px;
    width: 100%;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 2, 11, 0.72);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    padding: 14px;
}

.modal-content {
    width: min(100%, 520px);
    background: #120a22;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content p {
    color: var(--text-muted);
}

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 14px 0;
    color: var(--text);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.brawl-info {
    margin-top: 10px;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

#refreshBrawlBtn {
    margin-top: 8px;
    width: 100%;
}

.text-input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    outline: none;
}

.text-input:focus {
    border-color: rgba(139, 61, 255, 0.7);
}

.modal-helper {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.profile-loader {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
    margin-top: 10px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.shop-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.shop-filter {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

.shop-filter.active {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-color: rgba(139, 61, 255, 0.9);
}

.shop-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-card {
    background: linear-gradient(160deg, rgba(34, 24, 58, 0.8), rgba(13, 9, 24, 0.95));
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shop-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.shop-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-price {
    margin: 0;
    font-weight: 700;
    color: #f2ddff;
}

.buy-btn {
    width: 100%;
    margin-top: auto;
}

@media (max-width: 560px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
}

.payment-loader {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #ffffff;
    animation: spin 0.7s linear infinite;
    margin: 6px 0 12px;
}