@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --background: #0a0e1a;
    --foreground: #ffffff;
    --card: #151b2b;
    --card-foreground: #ffffff;
    --primary: #ff6b35;
    --primary-foreground: #ffffff;
    --secondary: #1e2537;
    --secondary-foreground: #ffffff;
    --muted: #252d3f;
    --muted-foreground: #8b92a8;
    --accent: #ff4757;
    --accent-foreground: #ffffff;
    --destructive: #ff3742;
    --border:#252d3f;
    --ring: #ff6b35;
    --modal-bg: #1A2233;
    --payment-color: #252f44;
    --border-color: #2c3a58;
    --roulette-gradient: #2A344A;
    --autospin-button: #394257;
    --autospin-button-text: #aeb8d0;

    --theme-color: #252f44;
    --theme-circle-color: #ff6b35;
    
    --win-orange: #ff6b35;
    --win-red: #ff4757;
    --win-dark: #0a0e1a;
    --win-dark-light: #151b2b;
    --win-dark-medium: #1e2537;
    --win-success: #10B981;
    --win-blue: #3742fa;
    
    /* Рулетка фон - темная тема */
    --roulette-bg-image: url('/roulette-bg-black.png');
}

.light-theme {
    --background: #f5f5f5;
    --foreground: #000000;
    --card: #ffffff;
    --card-foreground: #000000; 
    --primary: #ff6b35;
    --primary-foreground: #ffffff;
    --secondary: #e0e0e0; 
    --secondary-foreground: #000000; 
    --muted: #d0d0d0; 
    --muted-foreground: #606060;
    --accent: #ff4757;
    --accent-foreground: #ffffff;
    --destructive: #ff3742;
    --border: #cccccc;
    --ring: #ff6b35;
    --modal-bg: #E4E9F5;
    --payment-color: #f0f4ff;
    --border-color: #a1b7ee;
    --roulette-gradient: #ffffff;
    --autospin-button: #d5d5d5;
    --autospin-button-text: black;

    --theme-color: #ff6b35;
    --theme-circle-color: white;

    --win-orange: #ff6b35;
    --win-red: #ff4757;
    --win-dark: #f5f5f5;
    --win-dark-light: #e0e0e0;
    --win-dark-medium: #d0d0d0;
    --win-success: #10B981; 
    --win-blue: #3742fa;
    
    /* Рулетка фон - светлая тема */
    --roulette-bg-image: url('/roulette-bg-white.png');
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
    border-color: var(--border);
}

body, html {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--foreground);
    overscroll-behavior: none;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

#app { 
    display: flex; 
    flex-direction: column; 
    height: 100dvh;
    visibility: hidden;
}

main { 
    flex-grow: 1; 
    overflow: hidden; 
    position: relative;
}

.page {
    position: absolute; 
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    display: flex; 
    flex-direction: column;
    opacity: 0; 
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    background: var(--background);
}

.page.active { 
    opacity: 1; 
    visibility: visible;
    pointer-events: auto;
    overflow: auto;
}

.content-wrapper { 
    padding: 1rem; 
    overflow-y: auto; 
    flex-grow: 1;
    padding-bottom: 90px;
}

#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--win-dark);
    transition: opacity 0.5s ease-out, visibility 0s 0.5s;
}
#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}
.splash-logo {
    width: 150px;
    height: auto;
}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--foreground);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--muted-foreground);
}

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.header {
    padding: 0.5rem 1rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.5rem; 
}
.balance-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
    margin-left: auto;
}
.balance-label {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    line-height: 1;
}

#balance-amount {
    font-size: 1.1rem; 
    font-weight: 500; 
    letter-spacing: -0.5px;
    color: var(--foreground);
    line-height: 1.2;
    white-space: nowrap;
}

#balance-amount .cents {
    color: var(--muted-foreground);
}

#deposit-btn {
    background: var(--win-success);
    color: white;
    border: none;
    border-radius: 0.6rem; 
    padding: 0.5rem 0.9rem; 
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 0 25px 0px rgba(16, 185, 129, 0.4);
}

#withdraw-btn {
    background: var(--win-blue);
    color: white;
    border: none;
    border-radius: 0.6rem; 
    padding: 0.5rem 0.9rem; 
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 0 15px 0px rgba(16, 185, 129, 0.4);
}

.icon-btn {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 0.6rem; 
    width: 38px; 
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s;
}
.icon-btn:active {
    background-color: #2a344a;
}
.icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--muted-foreground);
}

.bottom-nav {
    position: fixed;
    bottom: 0; 
    left: 0; 
    right: 0;
    background-color: var(--win-dark-light);
    border-top: 1px solid var(--border);
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
    z-index: 100;
}
.bottom-nav-content {
    display: flex;
    justify-content: space-around;
}
.nav-tab {
    position: relative;
    background: none; 
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    flex: 1;
    padding: 4px;
    transition: color 0.2s;
}
.nav-tab.active {
    color: var(--win-orange);
}
.nav-tab svg {
    width: 1.25rem; 
    height: 1.25rem;
}

.nav-counter {
    position: absolute;
    top: -2px;
    right: 8px;
    background-color: var(--win-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--win-dark-light);
}

#toast-container {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    background-color: var(--win-success);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.error { background-color: var(--win-red); }
.toast.warning { background-color: var(--win-orange); }
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.withdraw-error {
    font-size: 0.9rem;
    color: #d23d3d;
    text-align: center;
    margin-top: -1rem;
}

.express-history-cont {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.express-history-block {
    background-color: var(--win-dark-light);
    border-radius: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease-out;
}
.express-history-field-cont {
    display: flex;
    flex-direction: row;
    font-size: 1.1rem;
    gap: 20px;
    font-weight: 700;
}
.express-history-bets {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.express-history-bet {
    background-color: var(--payment-color);
    border-radius: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.2s  ease-out;
}
.profile-switch-cont {
    width: fit-content;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--foreground);
    margin-left: auto;
    margin-bottom: 10px;
}
.profile-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.profile-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--theme-color);
    border-radius: 24px;
    transition: 0.4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--theme-circle-color);
    border-radius: 50%;
    transition: 0.4s;
}
input:checked + .slider {
    background-color: var(--theme-color);
}
input:checked + .slider:before {
    transform: translateX(26px);
    background-color: var(--theme-circle-color);
}