/* Import original Ember app CSS (full layout + components) */
@import url('original.css');

/* === Dark theme overrides === */
:root {
    --tg-color-scheme: dark;
    --tg-theme-bg-color: #212121;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #aaaaaa;
    --tg-theme-link-color: #8774e1;
    --tg-theme-button-color: #8774e1;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #0f0f0f;
    --tg-theme-header-bg-color: #212121;
    --tg-theme-accent-text-color: #8774e1;
    --tg-theme-section-bg-color: #212121;
    --tg-theme-section-header-text-color: #aaaaaa;
    --tg-theme-subtitle-text-color: #aaaaaa;
    --tg-theme-destructive-text-color: #e53935;
    --tg-viewport-height: 100vh;
    --tg-viewport-stable-height: 100vh;
    --bs-body-bg: #131E29;
    --bs-body-color: #F6F6F6;
    --bs-body-font-family: "Inter", system-ui, -apple-system, sans-serif;
    --bs-border-color: #283747;
    --bs-secondary-color: #A8C5EA;
}

/* Fix crypto logo positioning globally */
.crypto-logo {
    display: inline-block !important;
    position: relative !important;
    float: none !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    top: auto !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    transform: none !important;
    vertical-align: middle !important;
    margin-left: 4px !important;
}
.crypto-logo.small-icon {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
}
/* Bet input icon */
.input-logo-container .crypto-logo {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-left: 0 !important;
}
/* Wallet page icons */
.wallet-page-item .crypto-logo {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    margin-left: 0 !important;
}
/* Deposit modal coin selector */
#depositCoinIcon {
    margin-left: 8px !important;
}

body {
    background-color: #131E29 !important;
    color: #F6F6F6 !important;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.application.dark {
    background-color: #131E29;
    color: #F6F6F6;
    min-height: 100vh;
}

/* Header */
#header {
    background-color: #1C2938 !important;
}

/* Form controls */
.form-control,
.form-control:focus {
    color: #F6F6F6 !important;
    background-color: transparent !important;
    border-color: #283747 !important;
}
.form-control::placeholder {
    color: #8EA2BB !important;
}
.form-select {
    color: #F6F6F6 !important;
    background-color: #1C2938 !important;
    border-color: #283747 !important;
}
.form-select option {
    background-color: #1C2938;
}
.form-label {
    color: #A8C5EA !important;
}

/* Buttons */
.btn.btn-primary,
.bet-start .btn.btn-primary {
    background-color: #0cf !important;
    color: #002F00 !important;
    border-color: #0cf !important;
    font-weight: 600;
}

/* Cashout state */
.bet-start .btn.btn-primary.cashout-active {
    background-color: #34C759 !important;
    border-color: #34C759 !important;
    color: #fff !important;
}

/* Auto stop button */
.bet-start .btn.btn-primary.auto-stop {
    background-color: #FF3B30 !important;
    border-color: #FF3B30 !important;
    color: #fff !important;
}

/* White sections */
section.white {
    background-color: transparent !important;
    color: #F6F6F6;
}

/* Dropdown dark */
.dropdown-menu {
    background-color: #141B24 !important;
    color: #F6F6F6 !important;
    border-color: #283747 !important;
}
.dropdown-item {
    color: #F6F6F6 !important;
}
.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(255,255,255,0.05) !important;
}

/* Menu option currency */
.menu-option-currency {
    background-color: #141B24 !important;
    color: #F6F6F6 !important;
}
.menu-option-currency::before {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='10' viewBox='0 0 20 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 9.89844L9.89949 -0.00105727L19.799 9.89844H9.89949H0Z' fill='%23141B24'/%3E%3C/svg%3E") !important;
}
.menu-option-currency .row {
    cursor: pointer;
}
.menu-option-currency .row:active {
    opacity: 0.7;
}

/* History */
.bet-history-header,
.bet-history-container:nth-child(2n),
.bet-history-container:nth-child(2n) .block-col {
    background-color: #1F2C3C !important;
}
.bet-history-header .block-col {
    color: #8EA2BB !important;
}
.bet-history-container .block-col {
    color: #F6F6F6;
}

/* Container switch */
.container-switch {
    background-color: #141F2B !important;
}
.container-switch .level.active-level {
    background-color: #1F2C3C !important;
    color: #F6F6F6;
}
.container-switch .level {
    color: #A8C5EA;
    cursor: pointer;
}

/* Footer game */
.footer-game .icons-container {
    border-right-color: #2F3F53 !important;
}

/* Result overlay (win & lose) */
.game-section .result-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: overlayFadeIn 0.3s ease-out;
    cursor: pointer;
}
.result-overlay.win {
    background: radial-gradient(ellipse at center, rgba(29, 214, 255, 0.15) 0%, rgba(0,0,0,0.65) 100%);
}
.result-overlay.lose {
    background: radial-gradient(ellipse at center, rgba(255, 59, 48, 0.15) 0%, rgba(0,0,0,0.65) 100%);
}
.result-overlay .result-card {
    text-align: center;
    padding: 24px 40px;
    border-radius: 16px;
    animation: cardPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 180px;
}
.result-overlay.win .result-card {
    background: linear-gradient(145deg, rgba(20, 29, 39, 0.95), rgba(15, 35, 55, 0.95));
    border: 2px solid #1DD6FF;
    box-shadow: 0 0 30px rgba(29, 214, 255, 0.3), 0 0 60px rgba(29, 214, 255, 0.1), inset 0 1px 0 rgba(255,255,255,0.1);
}
.result-overlay.lose .result-card {
    background: linear-gradient(145deg, rgba(39, 20, 20, 0.95), rgba(50, 15, 15, 0.95));
    border: 2px solid #FF3B30;
    box-shadow: 0 0 30px rgba(255, 59, 48, 0.3), 0 0 60px rgba(255, 59, 48, 0.1), inset 0 1px 0 rgba(255,255,255,0.05);
}
.result-overlay .result-emoji {
    font-size: 36px;
    margin-bottom: 8px;
    animation: emojiPulse 1.5s ease-in-out infinite;
}
.result-overlay .result-title {
    font-size: 2em;
    font-weight: 800;
    letter-spacing: 1px;
}
.result-overlay.win .result-title {
    background: linear-gradient(135deg, #1DD6FF, #00FF88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.result-overlay.lose .result-title {
    background: linear-gradient(135deg, #FF3B30, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.result-overlay .result-divider {
    width: 50%;
    height: 1px;
    margin: 12px auto;
    border-radius: 1px;
}
.result-overlay.win .result-divider {
    background: linear-gradient(90deg, transparent, #1DD6FF, transparent);
}
.result-overlay.lose .result-divider {
    background: linear-gradient(90deg, transparent, #FF3B30, transparent);
}
.result-overlay .result-amount {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 4px;
}
.result-overlay.win .result-amount {
    color: #1DD6FF;
}
.result-overlay.lose .result-amount {
    color: #FF6B6B;
}
.result-overlay .result-hint {
    font-size: 11px;
    color: #7A91AF;
    margin-top: 8px;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes cardPopIn {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes emojiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Hide old winner block */
.game-section .winner-block {
    display: none !important;
}

/* Honesty */
.honesty-btn {
    color: #A8C5EA !important;
}

/* Dollars */
.dollars {
    color: #A8C5EA !important;
}

/* Cell styles */
.game .cell .cell-object,
.game .cell-preview .cell-object {
    background-color: #2F3F53;
    border: 1px solid #394C63;
    box-shadow: 0 4px 0 0 #1D2734;
}
.game .cell .cell-object:hover {
    background-color: #45515f;
}
.game .cell .cell-object:active,
.game .cell .cell-object.active {
    background-color: #1F2B38;
}
.game .cell .cell-object.pick {
    background-color: #08C;
    border-color: #08C;
}

/* Wallets btn */
.wallets-btn {
    background-color: #283747 !important;
}
.wallets-btn:active {
    background-color: #141B24 !important;
}

/* Menu options dropdown */
.menu-options {
    background-color: #141B24 !important;
}
.menu-options li {
    color: #A8C5EA;
    cursor: pointer;
}
.menu-options li.actived {
    color: #1C2938;
    background-color: #0cf;
}
.menu-options li.actived svg path {
    fill: #1C2938;
}
.menu-options li:not(.actived) svg path {
    fill: #A8C5EA;
}

/* Stats dropdown */
.dropdown-diagram {
    background-color: #141B24 !important;
    color: #A8C5EA !important;
}
.dropdown-diagram .header-dropdown {
    color: #F6F6F6;
}
.dropdown-diagram .profit {
    color: #34C759;
}
.dropdown-diagram .lose {
    color: #FF3B30;
}

/* ==== Deposit Modal (reple-modal) dark overrides ==== */
.reple-modal {
    position: fixed;
    z-index: 1001;
    left: 0; top: 0;
    width: 100%; height: 100dvh;
    max-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 24px;
    background: rgba(0,0,0,0.5);
}
.reple-modal .wallet-close-deposit {
    z-index: 3;
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100dvh;
    max-height: 100vh;
}
.reple-modal .container-max {
    background: #141D27 !important;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid rgba(0,136,204,0.2);
    border-radius: 8px;
    position: relative;
    padding: 28px;
    width: 92%;
    z-index: 4;
    min-height: 200px;
}
.reple-modal .container-max .close {
    position: absolute;
    right: 22px; top: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 5;
    padding: 4px;
}
.reple-modal .wallet-information {
    margin-bottom: 0;
    padding: 0.5rem 0;
}
.reple-modal .wallet-information h2 {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    color: #FFF;
    margin: 0 0 8px 0;
}
.reple-modal .balance-all {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 24px;
    line-height: 24px;
    color: #FFF;
    margin-bottom: 16px;
}

/* Coin selector display-input */
button.display-input {
    height: 36px;
    line-height: 18px;
    text-align: left;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    background-color: #131E29 !important;
    color: rgba(235,235,245,0.6) !important;
    border: 1px solid #283747 !important;
    border-radius: 6px;
    width: 100%;
    display: block;
    padding: 8px 12px;
    cursor: pointer;
}
button.display-input:focus,
button.display-input:hover {
    background-color: #131E29 !important;
}
button.display-input .input-text {
    display: inline-block;
    line-height: 18px;
    color: #FFF;
}
button.display-input .crypto-logo {
    position: relative;
    float: right;
    margin-left: 6px;
    width: 17px;
    height: 17px;
    transform: scale(1.5);
}
button.display-input.dropdown-input::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #A8C5EA;
}

/* Copy address container */
.btn-display-input-container {
    display: flex;
}
.btn-display-input-container .display-input {
    border-right: 0 !important;
    border-radius: 6px 0 0 6px;
    padding-top: 5px;
    scrollbar-width: none !important;
}
.btn-display-input-container .copy-btn {
    width: 48px;
    min-width: 48px;
    background-color: #131E29;
    border: 1px solid #283747 !important;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn-display-input-container .copy-btn:active {
    background-color: #1a2a3a;
}

/* QR Code */
.qr-code-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 64px;
    position: relative;
    overflow: hidden;
}
.qrcode {
    background: #FFF;
    border-radius: 4px;
    max-width: 120px;
    max-height: 120px;
    width: 120px;
    padding: 8px;
    overflow: hidden;
}
.qrcode canvas, .qrcode img {
    width: 100% !important;
    height: 100% !important;
}

/* Label description */
.label-description {
    font-family: Inter, sans-serif;
    font-size: 11px;
    color: #8EA2BB;
}

/* Deposit button */
.reple-modal .btn.btn-primary,
.reple-modal button.btn {
    width: 100%;
    color: #131E29 !important;
    background: #1DD6FF !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    border: none !important;
    padding: 12px;
    cursor: pointer;
}
.reple-modal button.btn:active {
    opacity: 0.85;
}

/* Payment container inputs in modal */
.reple-modal .form-control {
    background-color: #131E29 !important;
    color: rgba(235,235,245,0.6) !important;
    border: 1px solid #283747 !important;
}
.reple-modal .form-label {
    color: #A8C5EA !important;
    font-size: 0.85rem;
    margin-bottom: 0.2rem !important;
}

/* Dropdown in modal */
.reple-modal .dropdown-menu {
    background-color: #131E29 !important;
    border: 1px solid #283747 !important;
    min-width: 100%;
}
.reple-modal .dropdown-item {
    color: #F6F6F6 !important;
    font-size: 14px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.reple-modal .dropdown-item:active {
    background-color: rgba(255,255,255,0.05) !important;
}

/* Text utilities */
.text-green { color: #34C759 !important; }
.text-red { color: #FF3B30 !important; }

/* Section title */
.section-title {
    color: #F6F6F6 !important;
}

/* History header section */
.section-header {
    background-color: transparent !important;
}

/* Toast styling */
.toast-container {
    z-index: 9000;
}
.toast {
    background-color: #1C2938 !important;
    color: #F6F6F6 !important;
    border: 1px solid #283747;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}
.toast.show-toast {
    opacity: 1;
}
.toast-copy {
    border-left: 3px solid #34C759;
}
.toast-error {
    border-left: 3px solid #FF3B30;
}
.toast-success {
    border-left: 3px solid #0cf;
}

/* ==== CUSTOM: Bottom navigation ==== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1C2938;
    display: flex;
    border-top: 1px solid #2F3F53;
    z-index: 300;
    padding: 4px 0;
}
.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: #7A91AF;
    font-size: 10px;
    cursor: pointer;
    padding: 6px 0;
    font-family: 'Inter', sans-serif;
}
.nav-btn.active { color: #0cf; }
.nav-btn svg { stroke: currentColor; }

/* ==== CUSTOM: Pages system ==== */
.page { display: none; }
.page.active { display: block; }

/* Padding bottom for nav */
.container-sm { padding-bottom: 64px; }

/* ==== CUSTOM: Modal system ==== */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.6);
    z-index: 500;
}
.modal-custom {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}
.modal-custom-inner {
    width: 100%;
    max-height: 85vh;
    background-color: #1C2938;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    padding: 16px;
}
.modal-custom-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
}
.modal-custom-head h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #fff;
    margin: 0;
}
.modal-custom-close {
    background: none;
    border: none;
    color: #A8C5EA;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.modal-custom-body {
    padding-bottom: 24px;
}
@keyframes slideUp { from { transform: translateY(100%); } }

/* Wallet selector in modals */
.wallet-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.wallet-sel-btn {
    padding: 8px 16px;
    background: #283747;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #F6F6F6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.wallet-sel-btn.active { border-color: #0cf; }

/* Wallet page items */
.wallet-page-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #1C2938;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    margin-bottom: 8px;
}
.wallet-page-item.active { border-color: #0cf; }
.wallet-page-item-left { display: flex; align-items: center; gap: 10px; }
.wallet-page-balance { font-weight: 600; font-size: 15px; }

/* Withdrawal items */
.withdrawal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: #1C2938;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}
.withdrawal-status { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.withdrawal-status.pending, .withdrawal-status.Pending { background: #FF9500; color: #000; }
.withdrawal-status.approved, .withdrawal-status.Approved { background: #34C759; color: #fff; }
.withdrawal-status.cancelled, .withdrawal-status.Cancelled { background: #FF3B30; color: #fff; }
.withdrawal-cancel {
    background: none;
    border: 1px solid #FF3B30;
    color: #FF3B30;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

/* Fairness grid */
.fair-grid {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 12px;
}

/* Hash label in fairness modal */
.hash-label {
    font-style: italic;
    color: #8EA2BB;
}

/* Updated form control for fairness */
.form-control-updated {
    border: 1px solid #283747 !important;
    font-size: 14px;
    background-color: #131E29 !important;
    color: rgba(235,235,245,0.6) !important;
}
.form-control-updated:disabled {
    opacity: 0.7;
}
/* Honesty modal - original style */
.honesty-modal {
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,.5);
}
.honesty-modal .container-honesty {
    position: relative;
    padding: 16px 8px 8px;
    max-height: 96dvh;
    overflow: auto;
    width: 96%;
    max-width: 400px;
    background-color: #1C2938;
    border-radius: 16px;
}
.honesty-modal .container-honesty .close,
.container-honesty .close {
    right: 16px;
    top: 16px;
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 2;
}
.honesty-modal .game-section { padding: 0; }
.honesty-modal .game { pointer-events: none; }
.cell-object.cell-preview .emerald,
.cell-object.cell-preview .bomb {
    opacity: 0.85;
}

.fair-cell {
    flex: 1 0 20%;
    padding: 2px;
}
.fair-cell-inner {
    border-radius: 8px;
    padding-top: 100%;
    position: relative;
}
.fair-cell-inner.safe {
    background-color: rgba(52,199,89,0.2);
    border: 1px solid rgba(52,199,89,0.4);
}
.fair-cell-inner.bomb-cell {
    background-color: rgba(255,59,48,0.2);
    border: 1px solid rgba(255,59,48,0.4);
}
.fair-cell-inner .cell-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
}

/* Profile stats cards */
.stat-card {
    background-color: #1C2938;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.stat-value { font-size: 20px; font-weight: 700; color: #F6F6F6; }
.stat-label { font-size: 12px; color: #A8C5EA; margin-top: 4px; }
.stat-value.green { color: #34C759; }
.stat-value.red { color: #FF3B30; }

/* Profile bonus btn override */
.container-profile .container-bonus .btn-primary {
    background-color: #1DD6FF !important;
    color: #131E29 !important;
}

/* Bet button overrides for dark */
.bet-btn {
    color: #A8C5EA !important;
    background-color: #283747 !important;
    border-color: #283747 !important;
}
.bet-btn:hover {
    background-color: #1F2C3C !important;
}

/* Make all dropdown-menu visible when .show is added */
.dropdown-menu.show {
    display: block !important;
}

/* Toast animation override */
.toast.show-toast {
    display: block !important;
    opacity: 1 !important;
}
