body {
    background-color: #0e0e0e;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    font-size: 14px;
    overscroll-behavior-y: none;
    /* Prevent pull-to-refresh / close */
    height: 100vh;
    overflow: hidden;
    /* Main scroll handled by table-wrapper only */
}

.container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header Section --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    /* Prevent header shrinking */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.title-group {
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 1.4rem;
    margin: 0;
    color: #fff;
    background: linear-gradient(45deg, #ff8c00, #ff0080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    margin-top: -2px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.user-badge {
    font-size: 10px;
    color: #555;
    font-family: monospace;
}

.status-badge {
    background: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #aaa;
}

.status-badge.live {
    background: #2ecc71;
    color: #000;
    font-weight: bold;
}

/* --- Stats Bar --- */
.stats-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.stat {
    background: #1c1c1c;
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}

#stat-whales,
#stat-positions {
    font-size: 16px;
    font-weight: bold;
}

/* --- Table Wrapper (Scrollable) --- */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    /* Smooth iOS scroll */
    padding-bottom: 20px;
    flex: 1;
    /* Take remaining height if needed */
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Force scroll on mobile */
}

th {
    text-align: left;
    color: #888;
    font-weight: normal;
    padding: 12px;
    border-bottom: 1px solid #333;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    vertical-align: middle;
    white-space: nowrap;
}

/* --- Column Specifics --- */
.coin-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coin-badge {
    font-weight: 700;
    color: #fff;
    font-size: 15px;
}

/* Position Dots */
.side-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.side-long {
    background-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

.side-short {
    background-color: #ff3b3b;
    box-shadow: 0 0 10px rgba(255, 59, 59, 0.6);
}

/* --- Values --- */
.val-long {
    color: #2ecc71;
}

.val-short {
    color: #e74c3c;
}

.roe {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 4px;
}

/* --- Action Buttons (Whale Cell) --- */
.whale-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.address {
    font-family: monospace;
    background: transparent;
    color: #aaa;
    font-size: 13px;
    margin-right: 4px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0;
    /* For SVG */
    color: #fff;
    /* White icons */
    transition: all 0.2s ease;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0.7;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue tap box on Android */
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Mouse Hover Only (Prevents sticky hover on mobile) */
@media (hover: hover) {
    .icon-btn:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.1);
        transform: scale(1.1);
    }

    .btn-del:hover {
        color: #ff4d4d;
        background: rgba(255, 77, 77, 0.1);
    }
}

/* Touch Feedback */
.icon-btn:active {
    transform: scale(0.95);
    opacity: 1;
}

.btn-del {
    color: #fff;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(40, 40, 40, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    opacity: 1;
}