:root {
    --bg: #050505;
    --bg-elevated: #171717;
    --bg-elevated-2: #111111;
    --accent: #ff8a00;
    --accent-2: #ffb547;
    --green: #35c759;
    --text: #ffffff;
    --muted: #a0a0a0;
    --border: #2b2b2b;
    --danger: #ff4c4c;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --shadow-soft: 0 14px 40px rgba(0,0,0,0.6);
    --transition-fast: 0.2s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
}

body {
    display: flex;
    justify-content: center;
}

/* App container sized like phone */
.app-root {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    background: linear-gradient(180deg,#050505,#050505 70%,#090909);
    position: relative;
    overflow: hidden;
    padding-bottom: 110px; /* space for nav + slip */
}

/* Top bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 4px;
    background: #050505;
    position: sticky;
    top: 0;
    z-index: 30;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: radial-gradient(circle at 20% 20%,#ffe08a,#ff8a00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #111;
    font-size: 16px;
}

.app-title-block {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.app-subtitle {
    font-size: 10px;
    color: var(--muted);
}

.top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: #202020;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.top-icon.user::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid var(--muted);
    box-shadow: 0 0 0 2px transparent;
}

.btn {
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn-green {
    background: var(--green);
    color: #021005;
    box-shadow: 0 0 0;
}

.btn-green:active {
    transform: scale(0.97);
}

.btn-outline {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.btn-light {
    background: #f6f6f6;
    color: #111;
}

.btn-full {
    width: 100%;
}

/* Segment bar */
.segment-bar {
    padding: 4px 12px 10px;
    display: flex;
    gap: 8px;
}

.segment-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: 999px;
    border: none;
    background: #121212;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.segment-active {
    background: #262626;
    color: var(--text);
}

/* Screens */
.screen-container {
    position: relative;
    padding: 0 10px 10px;
}

.screen {
    display: none;
}

.screen-active {
    display: block;
}

.screen-title {
    padding: 4px 4px 12px;
    font-size: 18px;
    font-weight: 700;
}

/* Promos */
.home-promos {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scroll-snap-type: x mandatory;
}

.home-promos::-webkit-scrollbar {
    display: none;
}

.promo-card {
    background: linear-gradient(135deg,#232323,#151515);
    border-radius: var(--radius-lg);
    padding: 14px 14px 14px;
    min-width: 85%;
    scroll-snap-align: center;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.promo-large {
    background: radial-gradient(circle at 0 0,#ffcf81,#ff8a00);
}

.promo-card.gravy {
    background: radial-gradient(circle at 0 0,#ffdba2,#ffb547);
}

.promo-tag {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    color: #111;
    text-transform: uppercase;
}

.promo-large .promo-tag,
.promo-card.gravy .promo-tag {
    color: #111;
}

.promo-heading {
    font-size: 18px;
    font-weight: 800;
    margin-top: 4px;
}

.promo-text {
    font-size: 12px;
    color: #222;
    max-width: 260px;
}

.promo-large .promo-text,
.promo-card.gravy .promo-text {
    color: #3f2200;
}

.promo-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* sports strip */
.sports-strip {
    margin-top: 8px;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 0 2px 6px;
}

.sports-strip::-webkit-scrollbar {
    display: none;
}

.sport-pill {
    border-radius: 999px;
    border: none;
    padding: 6px 12px;
    background: #151515;
    color: var(--muted);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sport-pill::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #333;
}

.sport-active {
    background: #262626;
    color: #fff;
}

.sport-active::before {
    background: #ff8a00;
}

/* ticker */
.ticker-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 2px;
    scrollbar-width: none;
}

.ticker-row::-webkit-scrollbar { display:none; }

.ticker-pill {
    border-radius: var(--radius-pill);
    border: 1px solid #282828;
    background: #101010;
    padding: 4px 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.ticker-live {
    padding: 2px 6px;
    border-radius: 999px;
    background: #ff3b30;
    font-size: 9px;
    text-transform: uppercase;
}

/* stat filter */
.stat-filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px;
}

.stat-filter-row::-webkit-scrollbar {
    display: none;
}

.chip {
    border-radius: var(--radius-pill);
    border: 1px solid #262626;
    background: #111;
    color: var(--muted);
    padding: 6px 12px;
    font-size: 11px;
}

.chip-active {
    border-color: var(--accent);
    background: rgba(255,138,0,0.16);
    color: #ffdba2;
}

/* card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
    padding-bottom: 10px;
}

.player-card {
    background: #141414;
    border-radius: var(--radius-md);
    padding: 9px 9px 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7);
    position: relative;
    overflow: hidden;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.player-name {
    font-size: 13px;
    font-weight: 600;
}

.player-team {
    font-size: 11px;
    color: var(--muted);
}

.player-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 4px;
}

.player-line {
    font-size: 18px;
    font-weight: 700;
}

.player-footer {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

.player-btn {
    flex: 1;
    border-radius: 8px;
    border: none;
    padding: 6px 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.player-btn.more {
    background: rgba(49, 199, 71, 0.16);
    color: #b9ffcf;
    border: 1px solid #34c759;
}

.player-btn.under {
    background: rgba(255, 59, 48, 0.16);
    color: #ffb3af;
    border: 1px solid #ff3b30;
}

.player-btn span.small {
    font-size: 9px;
    text-transform: uppercase;
}

.lock-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0,0,0,0.65);
    border: 1px solid #353535;
    color: var(--muted);
}

/* bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 430px;
    width: 100%;
    height: 60px;
    background: rgba(0,0,0,0.98);
    display: flex;
    border-top: 1px solid #1b1b1b;
    z-index: 50;
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
}

.nav-icon {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid #404040;
}

.nav-active {
    color: var(--green);
}

.nav-active .nav-icon {
    border-color: var(--green);
}

/* slip drawer */
.slip-drawer {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translate(-50%, 0);
    width: 100%;
    max-width: 430px;
    background: #1a130d;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 35px rgba(0,0,0,0.9);
    z-index: 40;
}

.slip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #25140b;
    border-radius: 18px 18px 0 0;
}

.slip-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    font-weight: 600;
}

.slip-count {
    font-size: 10px;
    color: #f8d19f;
}

.slip-toggle {
    border: none;
    background: transparent;
    color: #f4c278;
    font-size: 14px;
}

.slip-body {
    max-height: 0;
    overflow: hidden;
    padding: 0 12px 0;
    transition: max-height 0.25s ease-out, padding 0.25s ease-out;
}

.slip-body.open {
    max-height: 360px;
    padding: 8px 12px 12px;
}

.small {
    font-size: 11px;
}

.tiny {
    font-size: 10px;
}

.muted {
    color: #d9b48c;
}

/* slip items */
.slip-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
}

.slip-item:last-child {
    border-bottom: none;
}

.slip-meta {
    font-size: 11px;
}

.slip-meta .player {
    font-weight: 600;
}

.slip-meta .market {
    color: #f8d19f;
}

.slip-choice {
    font-size: 11px;
    font-weight: 600;
    color: #fef4e8;
}

.remove-slip {
    border: none;
    background: transparent;
    color: #f1a08b;
    font-size: 14px;
}

/* multipliers */
.slip-multipliers {
    margin-top: 6px;
}

.multiplier-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.mult-btn {
    flex: 1;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid #5c4333;
    background: #1e120b;
    color: #f1c89a;
    padding: 5px 0;
}

.mult-active {
    background: #f2a950;
    color: #231309;
}

/* stake row */
.stake-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 10px 0 6px;
}

#stakeInput {
    border-radius: 10px;
    border: 1px solid #5c4333;
    background: #1e120b;
    color: #f8d19f;
    padding: 6px 10px;
    width: 120px;
}

.stake-payout {
    text-align: right;
}

#payoutDisplay {
    font-size: 17px;
    font-weight: 700;
}

/* center block logged out */
.center-block {
    margin-top: 60px;
    text-align: center;
}

.circle-outline {
    margin: 0 auto 12px;
    width: 80px;
    height: 80px;
    border-radius: 999px;
    border: 2px solid #ff8a00;
    box-shadow: 0 0 45px rgba(255,138,0,0.5);
}

/* refer */
.refer-hero {
    margin: 6px 4px 16px;
    padding: 16px 16px 18px;
    background: radial-gradient(circle at 0 0,#ffcf81,#ff8a00);
    border-radius: 18px;
    color: #2a1603;
}

.refer-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.refer-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.how-it-works {
    padding: 0 6px;
}

.how-it-works ol {
    font-size: 13px;
    color: var(--muted);
}

/* rewards screen */
.tab-row {
    display: flex;
    gap: 8px;
    padding: 4px 4px 10px;
}

.tab-btn {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 8px 0;
    background: #121212;
    color: var(--muted);
    font-size: 12px;
}

.tab-active {
    background: #262626;
    color: #fff;
}

.promo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 4px 20px;
}

/* modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    width: 90%;
    max-width: 380px;
    background: #101010;
    border-radius: 18px;
    padding: 16px 16px 18px;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.modal-close {
    position: absolute;
    right: 12px;
    top: 10px;
    border: none;
    background: transparent;
    color: var(--muted);
}

.modal-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.modal-tab {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 7px 0;
    font-size: 13px;
    background: #181818;
    color: var(--muted);
}

.modal-tab-active {
    background: #262626;
    color: #fff;
}

.form-group {
    margin-bottom: 10px;
}

label {
    display: block;
    font-size: 11px;
    margin-bottom: 4px;
    color: var(--muted);
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #262626;
    background: #151515;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
}

.auth-message {
    margin-top: 6px;
    min-height: 14px;
}

/* util */
.hidden {
    display: none !important;
}

.spacer-bottom {
    height: 260px;
}
