:root {
    --bg: #040b16;
    --bg-deep: #061121;
    --surface: rgba(10, 25, 48, 0.78);
    --surface-solid: #09172c;
    --surface-elevated: #0e2240;
    --blue-divider: rgba(56, 182, 255, 0.18);
    --btn-blue: #2ea8ff;
    --btn-red: #ff4757;
    --text: #ffffff;
    --text-muted: #8eb4d9;
    --text-dim: #567699;
    --danger: #ff4757;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    width: 100%;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ========================================================================= */
/* FULLSCREEN WRAPPERS & SMOOTH VIEW TRANSITIONS                             */
/* ========================================================================= */
.screen-wrapper {
    display: none;
    min-height: 100vh;
    width: 100%;
    flex-direction: column;
}

.screen-wrapper.active {
    display: flex;
    animation: screenFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ========================================================================= */
/* SCREEN 1: MOBILE WELCOME / AUTH VIEW                                      */
/* ========================================================================= */
.welcome-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 25%, #0d2547 0%, #050d1a 65%, #030710 100%);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.welcome-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
    color: #ffffff;
    text-shadow: 0 0 24px rgba(46, 168, 255, 0.35);
}

.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-field label {
    font-size: 14px;
    font-weight: 600;
    padding-left: 4px;
    color: #d6ecff;
}

.auth-field input {
    width: 100%;
    background: rgba(11, 29, 56, 0.85);
    border: none;
    box-shadow: inset 0 0 0 1.5px rgba(46, 168, 255, 0.25), 0 6px 18px rgba(0, 0, 0, 0.35);
    border-radius: 14px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 15px;
    padding: 13px 16px;
    outline: none;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.auth-field input::placeholder {
    color: var(--text-dim);
    font-size: 14px;
}

.auth-field input:focus {
    background: rgba(14, 36, 68, 0.95);
    box-shadow: inset 0 0 0 1.5px var(--btn-blue), 0 0 16px rgba(46, 168, 255, 0.28);
}

.auth-actions {
    margin-top: 10px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-equal-btn {
    width: 100%;
    padding: 12px 16px !important;
    font-size: 15px !important;
    border-radius: 14px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ========================================================================= */
/* UNIVERSAL BUTTON SYSTEM (MOBILE SIZED & INVERTED HOVER)                   */
/* ========================================================================= */
.pill-btn-primary,
.profile-action-btn,
.filter-btn,
.plus-balance-btn {
    cursor: pointer;
    background: var(--btn-blue);
    color: #ffffff;
    border: none;
    border-radius: 13px;
    padding: 11px 20px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(46, 168, 255, 0.25);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.pill-btn-primary {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 14px;
}

.pill-btn-primary:hover,
.profile-action-btn:hover,
.filter-btn:hover,
.plus-balance-btn:hover {
    background: #ffffff;
    color: var(--btn-blue);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.pill-btn-primary:active,
.profile-action-btn:active,
.filter-btn:active,
.plus-balance-btn:active {
    transform: scale(0.97);
}

.profile-action-btn.danger,
.pill-btn-outline {
    cursor: pointer;
    background: var(--btn-red);
    color: #ffffff;
    border: none;
    border-radius: 13px;
    padding: 11px 20px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.25);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.pill-btn-outline {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 14px;
}

.profile-action-btn.danger:hover,
.pill-btn-outline:hover {
    background: #ffffff;
    color: var(--btn-red);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.profile-action-btn.danger:active,
.pill-btn-outline:active {
    transform: scale(0.97);
}

.text-btn-secondary {
    cursor: pointer;
    background: rgba(46, 168, 255, 0.16);
    color: #ffffff;
    border: none;
    border-radius: 13px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    padding: 11px 20px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.text-btn-secondary:hover {
    background: #ffffff;
    color: var(--btn-blue);
}

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

/* ========================================================================= */
/* LOGGED-IN PLAYER FRAME (MOBILE TARGETED)                                  */
/* ========================================================================= */
.player-frame {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg) url('/imgs/main-background.png') center center / cover no-repeat fixed;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
}

/* TOP BAR: username | balance | "+" button(for balance) */
.player-topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--blue-divider);
    background: rgba(5, 14, 28, 0.88);
    backdrop-filter: blur(12px);
    font-family: var(--font-mono);
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 200;
}

.topbar-user-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.top-username {
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}

.top-divider {
    color: var(--text-muted);
    opacity: 0.6;
}

.top-balance {
    font-weight: 600;
    color: #63c2ff;
    white-space: nowrap;
}

.plus-balance-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 9px;
    font-family: var(--font-mono);
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}

/* ========================================================================= */
/* MAIN TAB STAGE                                                            */
/* ========================================================================= */
.tab-stage {
    flex: 1;
    width: 100%;
    padding: 16px 14px 85px;
    display: flex;
    flex-direction: column;
}

.tab-view {
    display: none;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.tab-view.active {
    display: flex;
    animation: tabSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.section-heading {
    text-align: center;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
    text-shadow: 0 0 16px rgba(46, 168, 255, 0.3);
}

/* ========================================================================= */
/* TAB 1: GAMES VIEW                                                         */
/* ========================================================================= */
.featured-game-banner {
    width: 100%;
    aspect-ratio: 2007 / 783;
    border: none;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    background: var(--surface-solid);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 20px rgba(46, 168, 255, 0.14);
}

.banner-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.live-leaderboard-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.live-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--btn-blue);
    box-shadow: 0 0 10px var(--btn-blue);
    animation: blinkDot 1.8s infinite ease-in-out;
}

@keyframes blinkDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.live-header h3 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.live-sub {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
}

.live-rich-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 2.5px solid var(--btn-blue);
    padding-left: 14px;
}

.rich-user-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rich-user-name {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.rich-user-balance {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #63c2ff;
}

.games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.game-mock-card {
    cursor: pointer;
    width: 100%;
    aspect-ratio: 2141 / 734;
    background: var(--surface-solid);
    border: none;
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(46, 168, 255, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    touch-action: manipulation;
}

.game-mock-card:active {
    transform: scale(0.98);
}

.game-card-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.game-mock-card.disabled-game {
    cursor: not-allowed;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.game-mock-card.disabled-game .game-card-image {
    filter: brightness(0.38) saturate(0.75);
}

.unavailable-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 9, 20, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.unavailable-overlay span {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(6, 16, 34, 0.85);
    padding: 8px 16px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* ========================================================================= */
/* TAB 1B: CASES MARKETPLACE & TAB 2: INVENTORY                              */
/* ========================================================================= */
.subpage-top-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.inventory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.search-input {
    flex: 1;
    min-width: 0;
    background: rgba(10, 26, 50, 0.85);
    border: none;
    box-shadow: inset 0 0 0 1.5px rgba(46, 168, 255, 0.25);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: box-shadow 0.2s ease;
}

.search-input::placeholder {
    color: var(--text-dim);
    font-size: 13px;
}

.search-input:focus {
    box-shadow: inset 0 0 0 1.5px var(--btn-blue), 0 0 14px rgba(46, 168, 255, 0.25);
}

.inventory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.inventory-case-card {
    border: none;
    border-radius: 18px;
    padding: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    background: linear-gradient(145deg, rgba(14, 35, 68, 0.88) 0%, rgba(7, 19, 38, 0.92) 100%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(56, 182, 255, 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.case-image-slot {
    flex: 1;
    width: 100%;
    min-height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.case-art-img {
    max-width: 130px;
    max-height: 125px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.65));
}

.case-bottom-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.case-title {
    font-size: 17px;
    font-weight: 700;
    text-align: left;
    line-height: 1.2;
    color: #ffffff;
}

.case-count {
    position: absolute;
    bottom: 18px;
    right: 18px;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: #63c2ff;
}

.case-buy-row {
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--blue-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.case-price {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: #63c2ff;
}

.case-buy-btn {
    cursor: pointer;
    outline: none;
    background: var(--btn-blue);
    color: #ffffff;
    border: none;
    border-radius: 11px;
    padding: 9px 18px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 14px rgba(46, 168, 255, 0.28);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
    touch-action: manipulation;
}

.case-buy-btn:hover {
    background: #ffffff;
    color: var(--btn-blue);
}

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

.case-count-inline {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: #63c2ff;
}

/* ========================================================================= */
/* CASE OUTCOME MODAL & OPENING OVERLAY                                      */
/* ========================================================================= */
.case-outcome-card {
    max-width: 340px;
    text-align: center;
    padding: 24px 20px !important;
}

.case-outcome-title {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.02em;
    text-shadow: 0 0 16px rgba(46, 168, 255, 0.35);
}

.case-outcome-title.jackpot {
    color: #ffd700;
    text-shadow: 0 0 24px rgba(255, 215, 0, 0.72), 0 0 10px rgba(255, 180, 0, 0.55);
}

.case-outcome-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: rgba(6, 16, 32, 0.78);
    border-radius: 14px;
    box-shadow: inset 0 0 0 1.5px rgba(46, 168, 255, 0.28);
}

.case-outcome-amount {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 800;
    color: #2ed573;
    text-shadow: 0 0 18px rgba(46, 213, 115, 0.45);
}

.case-outcome-amount.jackpot {
    color: #ffd700;
    text-shadow: 0 0 24px rgba(255, 215, 0, 0.75), 0 0 12px rgba(255, 180, 0, 0.55);
}

.case-opening-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 14, 0.94);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1200;
    user-select: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.case-opening-overlay.open {
    display: flex;
    opacity: 1;
    animation: overlayFadeIn 0.2s ease;
}

.case-opening-overlay.fading-out {
    opacity: 0;
    pointer-events: none;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.case-tap-stage {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    cursor: pointer;
    padding: 20px;
    z-index: 2;
    touch-action: manipulation;
}

.case-tap-stage.active {
    display: flex;
}

.case-tap-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 24px rgba(46, 168, 255, 0.35));
    pointer-events: none;
}

.case-tap-img.shake {
    animation: caseTapShake 0.25s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes caseTapShake {
    0% { transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.08) rotate(-7deg) translate(-5px, -3px); }
    40% { transform: scale(1.1) rotate(7deg) translate(5px, -2px); }
    60% { transform: scale(1.06) rotate(-5deg) translate(-3px, 2px); }
    80% { transform: scale(1.03) rotate(4deg) translate(2px, 0); }
    100% { transform: scale(1) rotate(0deg); }
}

.case-tap-text {
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.04em;
    text-shadow: 0 0 20px rgba(46, 168, 255, 0.7);
    pointer-events: none;
}

/* ========================================================================= */
/* TAB 3: PROFILE VIEW & PROMO SECTION                                       */
/* ========================================================================= */
.avatar-wrapper {
    display: flex;
    justify-content: center;
    margin: 8px 0 14px;
}

.mock-avatar-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 24px rgba(46, 168, 255, 0.25);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    transform: scale(1.22);
}

.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}

.password-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.password-toggle-btn {
    cursor: pointer;
    background: var(--btn-blue);
    color: #ffffff;
    border: none;
    outline: none;
    border-radius: 9px;
    padding: 5px 12px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(46, 168, 255, 0.25);
    transition: background-color 0.18s ease, color 0.18s ease;
    touch-action: manipulation;
}

.password-toggle-btn:hover {
    background: #ffffff;
    color: var(--btn-blue);
}

.mono-bold {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #63c2ff;
}

.profile-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    width: 100%;
}

.profile-actions-stack .profile-action-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.promo-section {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1.5px solid var(--blue-divider);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.promo-label {
    font-size: 14px;
    font-weight: 600;
    color: #d6ecff;
}

.promo-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-input {
    flex: 1;
    min-width: 0;
    background: rgba(10, 26, 50, 0.85);
    border: none;
    box-shadow: inset 0 0 0 1.5px rgba(46, 168, 255, 0.25);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: box-shadow 0.2s ease;
}

.promo-input::placeholder {
    color: var(--text-dim);
    font-size: 13px;
}

.promo-input:focus {
    box-shadow: inset 0 0 0 1.5px var(--btn-blue), 0 0 14px rgba(46, 168, 255, 0.25);
}

#promoSubmitBtn {
    width: auto;
    padding: 10px 16px;
    flex-shrink: 0;
}

.promo-feedback {
    font-family: var(--font-mono);
    font-size: 12px;
}

.promo-feedback.error {
    color: #ff8a93;
}

.promo-feedback.success {
    color: #2ed573;
}

/* ========================================================================= */
/* PERSISTENT BOTTOM NAVIGATION (MOBILE DOCK)                                */
/* ========================================================================= */
.player-bottom-nav {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--blue-divider);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(5, 14, 28, 0.94);
    backdrop-filter: blur(14px);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    gap: 8px;
}

.nav-tab {
    cursor: pointer;
    background: rgba(46, 168, 255, 0.14);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 8px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
    text-align: center;
    touch-action: manipulation;
}

.nav-tab:hover {
    background: #ffffff;
    color: var(--btn-blue);
}

.nav-tab:active {
    transform: scale(0.96);
}

.nav-tab.active {
    background: var(--btn-blue);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(46, 168, 255, 0.35);
}

/* ========================================================================= */
/* MODALS (MOBILE-SAFE, NO HORIZONTAL OVERFLOW)                              */
/* ========================================================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 9, 20, 0.85);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
    z-index: 900;
    overflow-y: auto;
}

.modal-backdrop.open {
    display: flex;
    animation: screenFadeIn 0.2s ease;
}

.modal-card {
    width: 100%;
    max-width: 390px;
    background: linear-gradient(160deg, #0c213f 0%, #061224 100%);
    border: none;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(46, 168, 255, 0.3);
    border-radius: 18px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 19px;
    font-weight: 700;
}

.modal-close {
    cursor: pointer;
    background: rgba(46, 168, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.modal-close:hover {
    background: #ffffff;
    color: var(--btn-blue);
}

.modal-subtitle {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -6px;
}

.modal-confirm-text {
    font-size: 15px;
    line-height: 1.45;
    color: #d6ecff;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.modal-field label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.modal-field input {
    width: 100%;
    background: rgba(6, 16, 32, 0.9);
    border: none;
    box-shadow: inset 0 0 0 1.5px rgba(46, 168, 255, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 16px;
    padding: 11px 14px;
    outline: none;
}

.modal-field input:focus {
    box-shadow: inset 0 0 0 1.5px var(--btn-blue);
}

/* 5 Quick Deposit Chips in a Single Mobile Row */
.modal-chips {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 100%;
}

.modal-chip {
    cursor: pointer;
    background: var(--btn-blue);
    color: #ffffff;
    border: none;
    outline: none;
    border-radius: 9px;
    padding: 7px 0;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    transition: background-color 0.18s ease, color 0.18s ease;
    touch-action: manipulation;
}

.modal-chip:hover {
    background: #ffffff;
    color: var(--btn-blue);
}

/* Modal Actions: Side-by-side with zero overflow */
.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.modal-actions.single {
    grid-template-columns: 1fr;
}

.modal-actions .pill-btn-primary,
.modal-actions .pill-btn-outline,
.modal-actions .text-btn-secondary {
    padding: 11px 8px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap;
}

/* ========================================================================= */
/* 3-STEP WALLET DEPOSIT / WITHDRAWAL FLOW                                   */
/* ========================================================================= */
.wallet-step {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.wallet-step.active {
    display: flex;
    animation: screenFadeIn 0.2s ease;
}

.wallet-mode-panel {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.wallet-mode-panel.active {
    display: flex;
}

.crypto-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crypto-meta-pill {
    background: rgba(46, 168, 255, 0.14);
    border-radius: 9px;
    padding: 7px 11px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #cbe7ff;
}

.crypto-meta-pill strong {
    color: #ffffff;
    font-weight: 700;
}

.crypto-meta-pill.highlight-pill {
    background: linear-gradient(135deg, #2ea8ff 0%, #1676d2 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(46, 168, 255, 0.35);
}

.copiable-address-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(6, 16, 32, 0.92);
    box-shadow: inset 0 0 0 1.5px rgba(46, 168, 255, 0.35);
    border-radius: 11px;
    padding: 9px 11px;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.address-code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: #ffffff;
    word-break: break-all;
    user-select: all;
    line-height: 1.35;
}

.copy-chip-btn {
    cursor: pointer;
    flex-shrink: 0;
    background: var(--btn-blue);
    color: #ffffff;
    border: none;
    outline: none;
    border-radius: 8px;
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.copy-chip-btn:hover {
    background: #ffffff;
    color: var(--btn-blue);
}

.deposit-timer-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(14, 35, 68, 0.7);
    border-radius: 11px;
    padding: 9px 12px;
}

.timer-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.timer-countdown {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: #ff4757;
    letter-spacing: 0.05em;
}

.admin-payment-note {
    background: rgba(6, 16, 32, 0.65);
    border-radius: 11px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 3px solid var(--btn-blue);
}

.admin-contact-line {
    font-size: 12px;
    color: #d6ecff;
}

.payment-instruction-text {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}

.payment-attention-box {
    background: rgba(255, 71, 87, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11.5px;
    line-height: 1.35;
    color: #ff9aa2;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.attention-title {
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #ff4757;
}

.wallet-done-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 10px;
    gap: 10px;
}

.done-check-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #2ed573;
    color: #030a14;
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px rgba(46, 213, 115, 0.45);
}

.wallet-done-title {
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
}

.wallet-progress-wrapper {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--blue-divider);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wallet-progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}

.progress-step-label.active {
    color: #63c2ff;
    font-weight: 700;
}

.wallet-progress-track {
    width: 100%;
    height: 3px;
    background: rgba(56, 182, 255, 0.18);
    border-radius: 999px;
    overflow: hidden;
}

.wallet-progress-fill {
    height: 100%;
    background: var(--btn-blue);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.wallet-progress-fill.step-1 { width: 33.3%; }
.wallet-progress-fill.step-2 { width: 66.6%; }
.wallet-progress-fill.step-3 { width: 100%; }

.delete-phrase-highlight {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 77, 94, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 77, 94, 0.45);
    border-radius: 9px;
    padding: 8px 11px;
    user-select: all;
}

/* ========================================================================= */
/* TOAST NOTIFICATIONS & EMPTY STATES                                        */
/* ========================================================================= */
.toast-container {
    position: fixed;
    top: 14px;
    right: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    max-width: 380px;
    width: 100%;
    background: #091a33;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), inset 0 0 0 1.5px var(--btn-blue);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: #ffffff;
    animation: toastIn 0.22s ease;
    text-align: center;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.error {
    background: #2b0b12;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), inset 0 0 0 1.5px var(--danger);
    color: #ff8a93;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-muted);
    padding: 32px 16px;
    background: rgba(9, 23, 44, 0.55);
    border-radius: 16px;
}
