* {
    box-sizing: border-box;
}

:root {
    --bg: #3a0a0a;
    --bg-deep: #2a0606;
    --bg-panel: #4a1010;
    --gold: #f5c518;
    --gold-dark: #d4a017;
    --orange: #ff7a18;
    --orange-hot: #ff5a00;
    --text: #fff;
    --text-muted: rgba(255, 255, 255, 0.75);
    --radius: 12px;
    --shell-max: 430px;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #1a0505;
    color: var(--text);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-shell {
    position: relative;
    width: 100%;
    max-width: var(--shell-max);
    min-height: 100vh;
    margin: 0 auto;
    background: linear-gradient(180deg, #4a0c0c 0%, #2a0606 40%, #1f0404 100%);
    padding-bottom: 72px;
    overflow-x: hidden;
}

/* Download bar */
.download-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #5c1212;
}

.download-bar__close {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.download-bar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.download-bar__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ffd54a, #ff8a00);
    color: #5a1a00;
    font-size: 12px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.download-bar__text {
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-bar__btn {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 6px;
    background: linear-gradient(180deg, #ff9a2e, #ff6a00);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* Top nav */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
}

.top-nav__logo {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffd34d;
    text-shadow: 0 1px 0 #8a4a00;
    white-space: nowrap;
}

.top-nav__actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.btn--register {
    background: linear-gradient(180deg, #ffe566, #f0b400);
    color: #5a2a00;
}

.btn--login {
    background: linear-gradient(180deg, #ff9a3a, #ff5a00);
    color: #fff;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.lang-switch__flag {
    width: 14px;
    height: 10px;
    border-radius: 1px;
    background:
        linear-gradient(180deg, #b22234 16%, #fff 16%, #fff 32%, #b22234 32%, #b22234 48%, #fff 48%, #fff 64%, #b22234 64%, #b22234 80%, #fff 80%),
        linear-gradient(90deg, #3c3b6e 35%, transparent 35%);
    background-size: 100% 100%, 40% 55%;
    background-repeat: no-repeat;
    background-position: 0 0, 0 0;
}

.lang-switch__arrow {
    font-size: 10px;
    opacity: 0.8;
}

/* Hero */
.hero {
    margin: 0 12px;
    padding: 18px 16px 14px;
    border-radius: 14px;
    background:
        radial-gradient(circle at 80% 40%, rgba(255, 200, 80, 0.35), transparent 45%),
        linear-gradient(135deg, #7a1a1a 0%, #4a0c0c 55%, #2f0808 100%);
    border: 1px solid rgba(255, 200, 80, 0.2);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero__eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    color: #ffe08a;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hero__title {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.hero__desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.hero__badge {
    display: inline-block;
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 210, 100, 0.45);
    font-size: 11px;
    color: #ffe9a8;
}

.hero__dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 12px;
}

.hero__dot {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.35);
}

.hero__dot.is-active {
    background: #7dff7a;
    width: 18px;
}

/* Ticker */
.ticker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #e8d5b5;
    color: #3a1a0a;
}

.ticker__icon {
    flex-shrink: 0;
    font-size: 14px;
}

.ticker__text {
    flex: 1;
    margin: 0;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker__detail {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 4px;
    background: #3a1a0a;
    color: #ffe08a;
    font-size: 11px;
    font-weight: 700;
}

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 14px 12px 0;
}

.quick-actions__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

.quick-actions__icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.quick-actions__icon--deposit {
    background: radial-gradient(circle at 30% 30%, #ff7a7a, #b01020);
}

.quick-actions__icon--deposit::after {
    content: "🎁";
    font-size: 24px;
}

.quick-actions__icon--agent {
    background: radial-gradient(circle at 30% 30%, #ff9a9a, #8a1020);
}

.quick-actions__icon--agent::after {
    content: "👤";
    font-size: 24px;
}

.quick-actions__icon--vip {
    background: radial-gradient(circle at 30% 30%, #ff8ad8, #8a1060);
}

.quick-actions__icon--vip::after {
    content: "💎";
    font-size: 24px;
}

.quick-actions__icon--rebate {
    background: radial-gradient(circle at 30% 30%, #ff6a6a, #7a1018);
}

.quick-actions__icon--rebate::after {
    content: "♠️";
    font-size: 22px;
}

/* Category tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tabs__item {
    flex: 0 0 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 68px;
    border-radius: 12px;
    background: #5a1414;
    font-size: 11px;
    font-weight: 600;
}

.category-tabs__item.is-active {
    background: linear-gradient(180deg, #ffe566, #f0a800);
    color: #5a2a00;
}

.category-tabs__icon {
    font-size: 20px;
    line-height: 1;
}

/* Game section */
.game-section {
    margin: 16px 12px 0;
}

.game-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.game-section__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.game-section__all {
    font-size: 13px;
    color: var(--text-muted);
}

.game-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.game-card__art {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: linear-gradient(160deg, #7a2020, #3a0a0a);
    border: 1px solid rgba(255, 200, 80, 0.2);
}

.game-card__art--wingo::after { content: "🎱"; }
.game-card__art--racing::after { content: "🏎️"; }
.game-card__art--k3::after { content: "🎲"; }

.game-card__name {
    font-size: 13px;
    font-weight: 600;
}

/* SEO copy (crawlable text, visually secondary) */
.seo-copy {
    margin: 20px 12px 8px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.seo-copy h2 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #ffe08a;
}

.seo-copy p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
}

/* Floating receive */
.fab-receive {
    position: fixed;
    right: max(12px, calc(50% - var(--shell-max) / 2 + 12px));
    bottom: 88px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 56px;
    font-size: 11px;
    font-weight: 700;
    color: #ffe08a;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.fab-receive__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: radial-gradient(circle at 30% 30%, #ff6a6a, #a01020);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    margin-bottom: 2px;
}

/* Bottom nav */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--shell-max);
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #4a1010, #2a0808);
    border-top: 1px solid rgba(255, 200, 80, 0.15);
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.bottom-nav__item.is-active {
    color: #ffe566;
}

.bottom-nav__icon {
    font-size: 18px;
    line-height: 1;
}

.bottom-nav__item--center {
    position: relative;
    top: -14px;
}

.bottom-nav__wheel {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fff7c8 0 18%, transparent 19%),
        conic-gradient(#ffd34d 0 25%, #ff8a00 0 50%, #ffd34d 0 75%, #ff8a00 0);
    border: 3px solid #fff2a8;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Language modal */
.lang-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
}

.lang-overlay.active {
    display: flex;
}

.lang-modal {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 24px;
    width: 280px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.lang-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.lang-modal__subtitle {
    font-size: 16px;
    font-weight: 500;
    color: #555;
    margin: 0 0 20px;
}

.lang-modal__buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.lang-modal__btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.lang-modal__btn:hover {
    opacity: 0.85;
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-panel {
    width: 280px;
    padding: 24px;
    text-align: center;
}

.loading-overlay__text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
}

.loading-overlay__subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 20px;
}

.loading-progress {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    overflow: hidden;
}

.loading-progress__bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.1s linear;
}

.loading-progress__text {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin: 12px 0 0;
}
