:root {
    --iq-bg: #0e1018;        /* Main Background */
    --iq-panel: #1c1f2b;     /* Panels/Sidebars */
    --iq-border: #2a2e39;    /* Borders */
    --iq-green: #00b555;     /* Call/Buy */
    --iq-green-hover: #00e66c;
    --iq-red: #ff3b30;       /* Put/Sell */
    --iq-red-hover: #ff5c5c;
    --iq-text: #ffffff;
    --iq-muted: #ffffff !important;     /* UPDATED: Much Lighter Grey for visibility */
    --iq-accent: #ff9900;
    --iq-input: #242834;
    --iq-blue: #005cff;      /* Assets Blue */
    --iq-overlay: rgba(14, 16, 24, 0.95);
}

* { box-sizing: border-box; user-select: none; }

/* --- CUSTOM SCROLLBARS (PROFESSIONAL) --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--iq-bg); 
}
::-webkit-scrollbar-thumb {
    background: var(--iq-border); 
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--iq-muted); 
}

html, body {
    height: 100%;
    background-color: var(--iq-bg);
    color: var(--iq-text);
    font-family: 'Roboto', sans-serif;
    margin: 0; padding: 0;
    overflow: hidden; /* App-like feel */
}

/* --- FORCE LIGHTER TEXT FOR LABELS --- */
.text-muted, .form-label, .small, small {
    color: #d1d5db !important; /* Force readable grey/white */
}

/* --- LAYOUT GRID (Responsive) --- */
#app-interface {
    display: grid;
    grid-template-columns: 60px 1fr 260px; /* Sidebar | Chart | Controls */
    grid-template-rows: 50px 1fr;          /* Header | Content */
    height: 100dvh; 
    width: 100vw;
    transition: all 0.3s ease;
}

/* HEADER */
.top-bar {
    grid-column: 1 / 4;
    background: var(--iq-panel);
    border-bottom: 1px solid var(--iq-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 15px; z-index: 100;
}
.logo-group { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-text { font-weight: 900; font-size: 18px; letter-spacing: 0.5px; }
.mobile-menu-btn { font-size: 24px; color: var(--iq-muted); display: none; }

.asset-btn {
    background: var(--iq-input);
    border: 1px solid var(--iq-border);
    border-radius: 4px; padding: 5px 12px;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; transition: 0.2s;
}
.asset-btn:hover { background: #2f3442; }

.balance-group { display: flex; align-items: center; gap: 12px; }
.balance-display { text-align: right; line-height: 1.1; }
.balance-label { font-size: 10px; color: var(--iq-muted); text-transform: uppercase; }
.balance-val { font-size: 16px; font-weight: 700; color: var(--iq-green); }

.btn-deposit-header {
    background: var(--iq-green); color: white;
    border: none; border-radius: 4px;
    padding: 8px 20px; font-weight: 700; font-size: 12px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
/* Responsive Deposit Button */
.dep-text { display: block; }
.dep-icon { display: none; font-size: 18px; }

/* HEADER ICONS */
.hdr-ico {
    position: relative;
    cursor: pointer;
    color: var(--iq-muted);
    padding: 6px;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hdr-ico:hover { background: rgba(255,255,255,0.05); color: white; }

/* NOTIFICATION + MESSAGE BADGES */
.notif-badge, .msg-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--iq-red); color: white;
    font-size: 9px; font-weight: bold;
    width: 14px; height: 14px; border-radius: 50%;
    display: none;
    align-items: center; justify-content: center;
}

/* NOTIFICATION OVERLAY */
#notifOverlay {
    position: absolute; top: 60px; right: 20px;
    width: 340px; max-height: 80vh; overflow-y: auto;
    background: var(--iq-panel); border: 1px solid var(--iq-border);
    border-radius: 10px; z-index: 5000; display: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* MESSAGE OVERLAY */
#msgOverlay {
    position: absolute; top: 60px; right: 20px;
    width: 380px; max-height: 80vh; overflow-y: auto;
    background: var(--iq-panel); border: 1px solid var(--iq-border);
    border-radius: 10px; z-index: 5200; display: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.overlay-header {
    padding: 10px 15px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,0.2);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.overlay-title {
    font-weight: 900;
    color: white;
    letter-spacing: 0.4px;
    font-size: 13px;
    text-transform: uppercase;
}
.overlay-actions {
    font-size: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.overlay-actions span {
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.notif-list, .msg-list { padding: 0; }
.notif-item, .msg-item {
    padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: 0.2s; position: relative;
}
.notif-item:hover, .msg-item:hover { background: rgba(255,255,255,0.03); }
.notif-title, .msg-title { font-weight: 800; font-size: 13px; color: white; margin-bottom: 2px; }
.notif-body, .msg-body { font-size: 11px; color: var(--iq-muted); line-height: 1.45; }
.notif-time, .msg-time { font-size: 9px; color: #a0a6b4; text-align: right; margin-top: 6px; }

/* message collapse */
.msg-item.unread::before{
    content:"";
    position:absolute;
    left:0; top:0; bottom:0;
    width:3px;
    background: var(--iq-accent);
    opacity: 0.9;
}
.msg-body-wrap { margin-top: 6px; display:none; }
.msg-body-wrap.show { display:block; }
.msg-snippet { font-size: 11px; color: var(--iq-muted); line-height: 1.35; }
.msg-pill {
    display:inline-flex;
    align-items:center;
    gap:6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.18);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    color: var(--iq-muted);
    margin-right: 8px;
}

/* LEFT SIDEBAR (DESKTOP) */
.left-sidebar {
    grid-row: 2 / 3;
    background: var(--iq-panel);
    border-right: 1px solid var(--iq-border);
    display: flex; flex-direction: column;
    align-items: center; padding-top: 15px;
    gap: 10px;
}
.menu-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: var(--iq-muted); font-size: 18px;
    border-radius: 10px; cursor: pointer; transition: 0.2s;
}
.menu-icon:hover { color: white; background: rgba(255,255,255,0.05); }
.menu-icon.active { color: var(--iq-accent); background: rgba(255,153,0,0.12); }

/* MOBILE SIDEBAR (OFFCANVAS) */
#mobileSidebar {
    position: fixed; top: 0; left: -280px; width: 280px; height: 100%;
    background: var(--iq-panel); z-index: 15000;
    border-right: 1px solid var(--iq-border);
    transition: left 0.3s ease; padding: 20px;
    display: flex; flex-direction: column;
}
#mobileSidebar.open { left: 0; }
.mobile-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 14000; display: none;
}
.mobile-overlay.open { display: block; }
.mobile-nav-item {
    padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
    color: white; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 15px;
    border-radius: 10px;
}
.mobile-nav-item:hover { background: rgba(255,255,255,0.04); }
.mobile-nav-item i { font-size: 20px; color: var(--iq-muted); }

/* CENTER AREA */
.main-stage {
    grid-row: 2 / 3;
    background: var(--iq-bg);
    position: relative;
    overflow: hidden;
}
#tv_chart_container { width: 100%; height: 100%; }

/* CONTENT OVERLAYS */
.content-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--iq-bg); z-index: 50;
    padding: 20px; overflow-y: auto;
    display: none; 
}
.content-overlay.active { display: block; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ASSETS & PAYMENTS THEME */
.wallet-card-dark {
    background: var(--iq-panel); border: 1px solid var(--iq-border);
    border-radius: 12px; padding: 30px; text-align: center;
    margin-bottom: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.asset-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.asset-tab-btn {
    flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--iq-border);
    background: var(--iq-input); color: var(--iq-muted); font-weight: 900;
    transition: 0.2s; cursor: pointer;
}
.asset-tab-btn.active { background: var(--iq-green); color: white; border-color: var(--iq-green); }

/* DEPOSIT GRID */
.amt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.amt-btn {
    background: var(--iq-input); border: 1px solid var(--iq-border);
    color: white; padding: 12px; text-align: center; border-radius: 10px;
    font-weight: 900; cursor: pointer; transition: 0.2s; font-size:13px;
}
.amt-btn:hover, .amt-btn.active { border-color: var(--iq-green); background: rgba(0,181,85,0.1); color: var(--iq-green); }

/* COIN LIST (NO FLASHING) */
.coin-flash-item {
    background: var(--iq-panel); padding: 12px; border-radius: 10px;
    cursor: pointer; border: 1px solid var(--iq-border);
    display: flex; justify-content: space-between; align-items: center;
    transition: 0.2s; margin-bottom: 5px;
}
.coin-flash-item:hover { background: rgba(255,255,255,0.03); }

/* RIGHT SIDEBAR (TRADING) */
.right-sidebar {
    grid-row: 2 / 3;
    background: var(--iq-panel);
    border-left: 1px solid var(--iq-border);
    padding: 15px;
    display: flex; flex-direction: column;
    overflow-y: auto;
}

.control-group { margin-bottom: 15px; }
.control-label { font-size: 11px; color: var(--iq-muted); text-transform: uppercase; font-weight: 900; margin-bottom: 6px; display: block; letter-spacing: 0.5px; }

.iq-input {
    background: var(--iq-input); border: 1px solid var(--iq-border);
    border-radius: 10px; height: 40px; display: flex; align-items: center;
    justify-content: space-between; padding: 0 10px;
}
.iq-input input {
    background: transparent; border: none;
    color: white; font-weight: 900; font-size: 16px;
    width: 100%; text-align: right; outline: none;
}

/* MARKET ACTIVITY (ORDER BOOK) */
.order-book { margin-bottom: 15px; background: rgba(0,0,0,0.2); padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.06); }
.ob-row { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 2px; }
.ob-price { font-family: monospace; font-weight: 900; }
.ob-ask { color: var(--iq-red); }
.ob-bid { color: var(--iq-green); }
.ob-amt { color: #9aa2b4; font-family: monospace; }

/* TIME DROPDOWN */
.iq-dropdown { position: relative; cursor: pointer; }
.iq-dropdown-head {
    background: var(--iq-input); border: 1px solid var(--iq-border);
    border-radius: 10px; height: 40px; padding: 0 10px;
    display: flex; align-items: center; justify-content: space-between;
    color: white; font-weight: 900;
}
.iq-dropdown-list {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: #242834; border: 1px solid var(--iq-border);
    border-radius: 10px; margin-top: 8px; z-index: 200;
    display: none;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}
.iq-dropdown-list.show { display: block; }
.iq-dropdown-item {
    padding: 10px; font-size: 14px; color: var(--iq-muted);
    transition: 0.2s; border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; justify-content: space-between;
}
.iq-dropdown-item:hover { background: rgba(255,255,255,0.05); color: white; }
.iq-dropdown-item.selected { color: var(--iq-accent); }

.profit-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.profit-percent { font-size: 28px; font-weight: 900; color: var(--iq-green); text-shadow: 0 0 10px rgba(0,181,85,0.3); }

.trade-buttons { margin-top: auto; }
.btn-trade-iq {
    width: 100%; border: none; border-radius: 12px; padding: 15px; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center;
    color: white; font-weight: 900; font-size: 16px;
    cursor: pointer; transition: transform 0.1s; position: relative; overflow: hidden;
}
.btn-trade-iq:active { transform: scale(0.97); }
.btn-call { background: var(--iq-green); box-shadow: 0 4px 15px rgba(0,181,85,0.3); }
.btn-put { background: var(--iq-red); box-shadow: 0 4px 15px rgba(255,59,48,0.3); }
.btn-sub { font-size: 10px; opacity: 0.8; font-weight: 700; display: block; letter-spacing: 0.6px; }

/* CUSTOM ALERT BOX */
#alertOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--iq-overlay); z-index: 12000;
    display: none; align-items: center; justify-content: center;
}
.alert-box {
    background: var(--iq-panel); border: 1px solid var(--iq-border);
    width: 360px; padding: 25px; border-radius: 12px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.alert-title { font-weight: 900; font-size:16px; margin-bottom: 10px; color: white; text-transform: uppercase; letter-spacing: 0.8px; }
.alert-msg { font-size: 13px; color: var(--iq-muted); margin-bottom: 20px; line-height: 1.45; }
.btn-alert {
    background: var(--iq-blue); border: none; padding: 12px 0; width: 100%;
    color: white; font-weight: 900; border-radius: 10px; cursor: pointer;
    text-transform: uppercase; letter-spacing: 1px;
}

/* TRADE STATUS OVERLAY (Z-INDEX 10000) */
#activeTradeOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(14, 16, 24, 0.85); backdrop-filter: blur(4px);
    z-index: 10000; display: none; 
    flex-direction: column; align-items: center; justify-content: center;
}
.blind-card {
    background: var(--iq-panel); border: 1px solid var(--iq-border);
    padding: 30px; border-radius: 16px; width: 320px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.blind-timer { font-size: 56px; font-weight: 900; color: white; font-family: monospace; margin: 15px 0; }
.blind-label { font-size: 11px; color: var(--iq-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; font-weight: 900; }
.blind-val { font-size: 16px; font-weight: 900; color: white; margin-bottom: 15px; }
.blink-msg { animation: blink 2s infinite; color: var(--iq-accent); font-size: 12px; margin-top: 15px; font-weight: 700; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.55; } 100% { opacity: 1; } }

/* RESULT MODAL (Z-INDEX 11000) */
#resultOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--iq-overlay); z-index: 11000; display: none;
    justify-content: center; align-items: center;
}
.result-card {
    background: var(--iq-panel); border: 1px solid var(--iq-border);
    border-radius: 14px; width: 340px; padding: 40px 30px;
    text-align: center; color: #333; box-shadow: 0 20px 60px rgba(0,0,0,0.9);
}

/* TRADE CONFIRM MODAL (PORTRAIT ONLY FLOW) */
#tradeConfirmOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(14, 16, 24, 0.88); backdrop-filter: blur(6px);
    z-index: 11500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.trade-confirm-card {
    width: 360px;
    max-width: 100%;
    background: var(--iq-panel);
    border: 1px solid var(--iq-border);
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.75);
    overflow: hidden;
}
.trade-confirm-head {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.18);
}
.trade-confirm-title {
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-size: 13px;
    color: white;
}
.trade-confirm-close {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.trade-confirm-body {
    padding: 16px;
}
.trade-confirm-pair {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.trade-confirm-pair .pair-name {
    font-weight: 900;
    font-size: 16px;
    color: white;
}
.trade-confirm-pair .dir-pill {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.08);
}
.dir-pill.up { background: rgba(0,181,85,0.12); color: var(--iq-green); border-color: rgba(0,181,85,0.25); }
.dir-pill.down { background: rgba(255,59,48,0.12); color: var(--iq-red); border-color: rgba(255,59,48,0.25); }

.trade-confirm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.trade-confirm-box {
    background: var(--iq-input);
    border: 1px solid var(--iq-border);
    border-radius: 12px;
    padding: 10px 12px;
}
.trade-confirm-box .lbl {
    font-size: 10px;
    color: var(--iq-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 900;
    margin-bottom: 6px;
}
.trade-confirm-box .val {
    font-size: 16px;
    font-weight: 900;
    color: white;
}
.trade-confirm-note {
    font-size: 11px;
    color: var(--iq-muted);
    line-height: 1.4;
    margin-bottom: 14px;
}
.trade-confirm-actions {
    display: flex;
    gap: 10px;
}
.btn-confirm {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px 12px;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
}
.btn-confirm.cancel {
    background: rgba(255,255,255,0.06);
    color: white;
    border: 1px solid rgba(255,255,255,0.12);
}
.btn-confirm.go.up { background: var(--iq-green); color: white; }
.btn-confirm.go.down { background: var(--iq-red); color: white; }

/* ASSET DROPDOWN (MARKET TAB) */
.asset-select-head {
    background: var(--iq-input);
    border: 1px solid var(--iq-border);
    border-radius: 10px;
    height: 40px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-weight: 900;
}
.asset-select-name { display:flex; align-items:center; gap:8px; min-width:0; }
.asset-select-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-select-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #242834;
    border: 1px solid var(--iq-border);
    border-radius: 12px;
    margin-top: 8px;
    z-index: 250;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}
.asset-select-list.show { display:block; }
.asset-select-item {
    padding: 10px;
    font-size: 13px;
    color: var(--iq-muted);
    transition: 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}
.asset-select-item:hover { background: rgba(255,255,255,0.05); color: white; }
.asset-select-item.active { color: var(--iq-accent); }
.asset-mini-right {
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    line-height:1.1;
    min-width: 110px;
}
.asset-mini-price {
    font-family: monospace;
    font-weight: 900;
    font-size: 12px;
}
.asset-mini-chg {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2px;
}

/* TRADE CONFIRM (AMOUNT + DURATION OPTIONS) */
.tc-amount-input {
    background: var(--iq-input);
    border: 1px solid var(--iq-border);
    color: white;
    font-weight: 900;
    padding: 12px 12px;
    border-radius: 12px;
    outline: none;
    width: 100%;
}
.tc-opt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.tc-opt {
    background: var(--iq-input);
    border: 1px solid var(--iq-border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: 0.15s;
}
.tc-opt:hover { background: rgba(255,255,255,0.04); }
.tc-opt.active {
    border-color: var(--iq-accent);
    box-shadow: 0 0 0 2px rgba(255,153,0,0.15) inset;
}
.tc-opt .t1 { font-weight: 900; color: white; font-size: 14px; }
.tc-opt .t2 { font-size: 11px; color: var(--iq-muted); margin-top: 4px; font-weight: 700; }
.tc-est {
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tc-est .lbl { font-size: 10px; color: var(--iq-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 900; }
.tc-est .val { font-size: 16px; font-weight: 900; color: var(--iq-green); }

/* PROFILE CARD */
.profile-hero {
    background: var(--iq-panel); border: 1px solid var(--iq-border);
    border-radius: 12px; padding: 20px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 20px;
}
.prof-avatar {
    width: 70px; height: 70px; border-radius: 50%;
    background: var(--iq-input); border: 2px solid var(--iq-green);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: white;
}
.prof-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.prof-stat-box { background: var(--iq-input); padding: 10px; border-radius: 10px; border: 1px solid var(--iq-border); }
.prof-stat-label { font-size: 10px; color: var(--iq-muted); text-transform: uppercase; font-weight: 900; letter-spacing: 0.6px; }
.prof-stat-val { font-size: 13px; font-weight: 900; color: white; margin-top: 2px; }

/* HISTORY TABLE */
.iq-table { width: 100%; color: #ccc; font-size: 13px; border-collapse: collapse; }
.iq-table th { text-align: left; color: white !important; padding: 10px; border-bottom: 1px solid var(--iq-border); font-weight: 900; text-transform: uppercase; font-size: 11px; letter-spacing: 0.6px; }
.iq-table td { padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.badge { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.4px; }
.badge-success { background: rgba(0,181,85,0.2); color: var(--iq-green); }
.badge-pending { background: rgba(255,153,0,0.2); color: var(--iq-accent); }
.badge-danger { background: rgba(255,59,48,0.2); color: var(--iq-red); }

/* LEADERBOARD */
.lb-wrap { max-width: 760px; margin: 0 auto; }
.lb-head {
    display:flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.lb-title {
    font-weight: 900;
    font-size: 20px;
    color: white;
    margin: 0;
}
.lb-sub {
    font-size: 12px;
    color: var(--iq-muted);
    margin-top: 4px;
    line-height: 1.35;
    font-weight: 700;
}
.lb-note {
    border: 1px solid rgba(255,153,0,0.25);
    background: rgba(255,153,0,0.08);
    padding: 10px 12px;
    border-radius: 12px;
    color: #f6d4a6;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}
.lb-cards {
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.lb-card {
    background: var(--iq-panel);
    border: 1px solid var(--iq-border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
.lb-rank {
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--iq-muted);
}
.lb-name {
    font-weight: 900;
    font-size: 14px;
    color: white;
    margin-top: 6px;
}
.lb-meta {
    display:flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    color: var(--iq-muted);
    font-weight: 800;
}
.lb-val {
    font-family: monospace;
    font-weight: 900;
}
.lb-table {
    width:100%;
    border-collapse: collapse;
    background: var(--iq-panel);
    border: 1px solid var(--iq-border);
    border-radius: 14px;
    overflow:hidden;
}
.lb-table th, .lb-table td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
}
.lb-table th {
    color: var(--iq-muted);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 10px;
    background: rgba(0,0,0,0.18);
}
.lb-table td { color: #d7dbe6; font-weight: 800; }
.lb-green { color: var(--iq-green) !important; }
.lb-red { color: var(--iq-red) !important; }
.lb-muted { color: var(--iq-muted) !important; font-weight: 800 !important; }

/* REPORT VIEW STYLES */
.report-paper {
    background: white; color: #333; padding: 40px; border-radius: 4px; min-height: 600px; position: relative;
    font-family: 'Times New Roman', serif;
}
.report-header { text-align: center; border-bottom: 2px solid #000; padding-bottom: 20px; margin-bottom: 30px; }
.report-logo { font-size: 32px; font-weight: 900; color: #0e1018; letter-spacing: 2px; }
.report-meta { display: flex; justify-content: space-between; margin-bottom: 30px; font-family: sans-serif; }
.report-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
.report-table th, .report-table td { border: 1px solid #ddd; padding: 12px; text-align: left; }
.report-table th { background: #f8f9fa; font-weight: bold; }
.report-watermark {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 80px; opacity: 0.05; font-weight: 900; pointer-events: none; white-space: nowrap;
}
.report-footer { text-align: center; font-size: 12px; color: #666; margin-top: 50px; border-top: 1px solid #ddd; padding-top: 10px; }

/* PRINT STYLES FOR REPORT */
@media print {
    body * { visibility: hidden; }
    #reportContent, #reportContent * { visibility: visible; }
    #reportContent { position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 20px; }
    .modal-footer { display: none; }
}

/* PORTRAIT MODE ADAPTATION */
@media (max-width: 768px) and (orientation: portrait) {
    #app-interface {
        grid-template-columns: 1fr;
        grid-template-rows: 50px 1fr auto; 
    }
    .left-sidebar { display: none !important; }
    .right-sidebar {
        grid-row: 3 / 4; grid-column: 1 / 2;
        border-left: none; border-top: 1px solid var(--iq-border);
        height: auto; padding: 12px;
        display: flex; flex-direction: column;
        overflow-y: visible; padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
    .main-stage { grid-row: 2 / 3; grid-column: 1 / 2; }

    /* Hide all trade controls except BUY/SELL buttons in portrait */
    .control-group { display: none !important; }
    .profit-info, .order-book { display: none !important; }

    /* Buttons only */
    .trade-buttons {
        width: 100%;
        display: flex;
        gap: 10px;
        margin-top: 0;
    }
    .btn-trade-iq {
        width: 50%;
        padding: 14px 12px;
        margin-bottom: 0;
        font-size: 15px;
    }

    .mobile-menu-btn { display: block !important; }
    .asset-btn-desk { display: flex !important; max-width: 150px; }
    .asset-btn-desk img { width: 14px; }
    #headerAsset { font-size: 12px !important; }
    .dep-text { display: none; }
    .dep-icon { display: block; }
    .btn-deposit-header { padding: 8px 12px; }

    /* overlays */
    .blind-card { width: 90% !important; max-width: 320px; padding: 15px !important; }
    .blind-timer { font-size: 42px !important; margin: 10px 0 !important; }
    .blind-label { font-size: 10px !important; margin-bottom: 2px !important; }
    .blind-val { font-size: 14px !important; margin-bottom: 10px !important; }
    .blink-msg { font-size: 11px !important; margin-top: 10px !important; }
    h5 { font-size: 16px !important; margin-bottom: 15px !important; }
    .result-card { width: 90% !important; max-width: 320px; padding: 25px 15px !important; }
    #resAmount { font-size: 32px !important; }

    #notifOverlay { right: 10px; width: calc(100vw - 20px); }
    #msgOverlay { right: 10px; width: calc(100vw - 20px); }

    .lb-cards { grid-template-columns: 1fr; }
}

/* --- HIDE NUMBER INPUT SPINNERS/ARROWS --- */
/* Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}