* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background: #0b0b0c;
    color: #d8d8d8;
    font-size: 12px;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

.app {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100vw;
    height: 100vh;
    padding: 10px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #131316;
    border: 1px solid #1f1f24;
    border-radius: 8px;
    padding: 10px 14px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.brand-logo {
    display: block;
    max-height: 44px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.topbar-stats {
    display: flex;
    gap: 8px;
    margin-left: 4px;
    align-items: center;
}

.chip {
    display: flex;
    flex-direction: column;
    background: #0e0e10;
    border: 1px solid #1f1f24;
    border-radius: 6px;
    padding: 5px 10px;
    min-width: 100px;
    justify-content: center;
}

.chip-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6f6f75;
}

.chip-value {
    font-size: 14px;
    color: #e6e6e6;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.input {
    background: #0e0e10;
    border: 1px solid #1f1f24;
    border-radius: 6px;
    color: #e6e6e6;
    padding: 8px 10px;
    font-size: 12px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
    width: 100%;
}

.input:focus {
    border-color: #ff9900;
    background: #111114;
}

.input-nick {
    width: 130px;
}

.input-balance-hidden {
    display: none;
}

.target-hidden {
    display: none;
}

.balance-chip {
    display: flex;
    align-items: baseline;
    gap: 6px;
    background: #0e0e10;
    border: 1px solid #2a2113;
    border-radius: 6px;
    padding: 7px 12px;
}

.balance-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6f6f75;
}

.balance-value {
    font-size: 18px;
    color: #ff9900;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

.balance-currency {
    font-size: 10px;
    color: #b37613;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn {
    border: 1px solid #1f1f24;
    background: #17171a;
    color: #cfcfd4;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, color 0.15s ease;
}

.btn:hover {
    background: #1d1d21;
    border-color: #2a2a30;
}

.btn:active {
    opacity: 0.85;
}

.btn-primary {
    background: linear-gradient(180deg, #ff9900 0%, #d47c00 100%);
    border: 1px solid #ffb340;
    color: #121212;
    box-shadow: 0 1px 0 #7a4a00;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #ffa51c 0%, #d47c00 100%);
    border-color: #ffc766;
}

.btn-danger {
    background: #1a1113;
    border-color: #3a1f22;
    color: #c98a8a;
}

.btn-danger:hover {
    background: #22161a;
    border-color: #4a2a2e;
    color: #e0a0a0;
}

.btn-block {
    width: 100%;
}

.btn-mini {
    background: #0e0e10;
    border: 1px solid #1f1f24;
    color: #8a8a92;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-mini:hover {
    background: #16161a;
    color: #cfcfd4;
    border-color: #2a2a30;
}

.grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.row {
    display: grid;
    gap: 10px;
    min-height: 0;
}

.row-top {
    grid-template-columns: 1.05fr 1.25fr 1.05fr 1.4fr;
    flex: 1.15;
}

.row-bottom {
    grid-template-columns: 1fr 1.6fr;
    flex: 1;
}

.block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #131316;
    border: 1px solid #1f1f24;
    border-radius: 8px;
    padding: 16px;
    overflow: hidden;
    min-height: 0;
}

.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.block-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #8a8a92;
    font-weight: 700;
}

.block-title-small {
    color: #8a8a92;
}

.label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #6f6f75;
    font-weight: 600;
}

.slot {
    background: #0e0e10;
    border: 1px solid #1f1f24;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: border-color 0.15s ease;
}

.slot-main {
    flex: 1;
    min-height: 130px;
}

.slot.filled {
    border-color: #ff9900;
}

.slot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.slot-placeholder {
    color: #55555c;
    font-size: 11px;
    letter-spacing: 0.4px;
    line-height: 1.5;
    max-width: 180px;
}

.slot-img {
    width: 100%;
    max-width: 160px;
    height: 80px;
    object-fit: contain;
    background: #08080a;
    border-radius: 4px;
    padding: 4px;
}

.slot-name {
    font-size: 13px;
    color: #e6e6e6;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.slot-price {
    font-size: 15px;
    color: #ff9900;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.bet-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.spin-result {
    text-align: center;
    min-height: 18px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #8a8a92;
    flex-shrink: 0;
    font-weight: 600;
}

.spin-result.success {
    color: #ff9900;
}

.spin-result.fail {
    color: #d05a5a;
}

.block-wheel {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.block-wheel .wheel-wrap {
    margin: 0 auto;
}

.mult-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    width: 100%;
    flex-shrink: 0;
}

.btn-mult {
    background: #0e0e10;
    border: 1px solid #1f1f24;
    color: #a0a0a8;
    padding: 6px 0;
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-mult:hover {
    background: #16161a;
    color: #ff9900;
    border-color: #2a2113;
}

.stats-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex-shrink: 0;
}

.stat {
    background: #0e0e10;
    border: 1px solid #1f1f24;
    border-radius: 5px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-wide {
    grid-column: 1 / -1;
}

.stat-label {
    font-size: 9px;
    color: #6f6f75;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 14px;
    color: #e6e6e6;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-win {
    color: #6fbf6f;
}

.stat-loss {
    color: #d05a5a;
}

.stat-gold {
    color: #ff9900;
}

.history-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
}

.history-list::-webkit-scrollbar,
.garage-grid::-webkit-scrollbar,
.catalog-grid::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-thumb,
.garage-grid::-webkit-scrollbar-thumb,
.catalog-grid::-webkit-scrollbar-thumb {
    background: #26262b;
    border-radius: 3px;
}

.history-empty {
    text-align: center;
    color: #4c4c52;
    font-size: 11px;
    padding: 20px 0;
    letter-spacing: 1px;
}

.history-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 8px;
    align-items: center;
    background: #0e0e10;
    border: 1px solid #1f1f24;
    border-radius: 5px;
    padding: 5px 6px;
}

.history-item-img {
    width: 40px;
    height: 26px;
    object-fit: cover;
    border-radius: 3px;
    background: #08080a;
}

.history-item-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.history-item-name {
    font-size: 10px;
    color: #cfcfd4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-chance {
    font-size: 9px;
    color: #6f6f75;
    font-variant-numeric: tabular-nums;
}

.history-item-delta {
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.history-item-delta.plus {
    color: #6fbf6f;
}

.history-item-delta.minus {
    color: #d05a5a;
}

.camera-slot {
    flex-shrink: 0;
    height: 110px;
    border: 1px dashed #1f1f24;
    border-radius: 6px;
    background: #0a0a0c;
}

.block-garage,
.block-catalog {
    min-height: 0;
}

.tabs-mini {
    display: flex;
    gap: 3px;
    background: #0e0e10;
    border: 1px solid #1f1f24;
    border-radius: 5px;
    padding: 3px;
}

.tab-mini {
    background: transparent;
    border: none;
    color: #6f6f75;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 10px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.tab-mini:hover {
    color: #cfcfd4;
}

.tab-mini.active {
    background: #1a1611;
    color: #ff9900;
}

.garage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
    align-content: start;
}

.garage-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #4c4c52;
    font-size: 11px;
    padding: 40px 0;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.garage-card {
    background-color: #0e0e10;
    background-image: url('../images/UI/card_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #1f1f24;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.garage-card:hover {
    border-color: #2a2113;
    background-color: #111114;
}

.garage-card-img {
    width: 100%;
    height: 55px;
    object-fit: contain;
    background: transparent;
    border-radius: 4px;
    padding: 3px;
}

.garage-card-name {
    font-size: 10px;
    color: #e6e6e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    text-align: center;
}

.garage-card-price {
    font-size: 11px;
    color: #ff9900;
    font-variant-numeric: tabular-nums;
    text-align: center;
    font-weight: 700;
}

.garage-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.btn-bet {
    font-size: 9px;
    padding: 4px 2px;
    background: #1a1611;
    border: 1px solid #2a2113;
    color: #ff9900;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-bet:hover {
    background: #221c14;
    border-color: #4a3520;
}

.btn-sell {
    font-size: 9px;
    padding: 4px 2px;
    background: #1a1113;
    border: 1px solid #2a181c;
    color: #c98a8a;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-sell:hover {
    background: #22161a;
    border-color: #3a2028;
}

.catalog-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.input-search {
    width: 160px;
    padding: 6px 10px;
    font-size: 11px;
}

.input-sort {
    width: 155px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
    align-content: start;
}

.shop-item {
    background-color: #0e0e10;
    background-image: url('../images/UI/card_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #1f1f24;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.shop-item:hover {
    border-color: #2a2113;
    background-color: #111114;
}

.shop-item.selected {
    border-color: #ff9900;
    background-color: #16130d;
}

.shop-item-img {
    width: 100%;
    height: 55px;
    object-fit: contain;
    background: transparent;
    border-radius: 4px;
    padding: 3px;
}

.shop-item-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    text-align: center;
}

.shop-item-name {
    font-size: 10px;
    color: #d8d8d8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.shop-item-price {
    font-size: 11px;
    color: #ff9900;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.btn-buy {
    font-size: 9px;
    padding: 4px 2px;
    background: #1a1611;
    border: 1px solid #2a2113;
    color: #ff9900;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-buy:hover {
    background: #221c14;
    border-color: #4a3520;
}