/* ═══════════════════════════════════════════════════
   llama.box - Curve Ecosystem Multitool
   system.css overrides & custom theme
   ═══════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-family: "VT323", "Chicago", "Geneva", monospace;
    background:
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%) 0 0 / 2px 2px scroll,
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%) 1px 1px / 2px 2px scroll,
        #fff !important;
    color: #000;
    user-select: none;
    cursor: default;
}

/* ── Top Menu Bar ─────────────────────────────── */
.desktop-menubar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: #fff;
    border-bottom: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    z-index: 10000;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.logo-icon {
    font-size: 18px;
    margin-right: 2px;
    cursor: pointer;
    filter: grayscale(1);
    transition: filter 0.2s;
}

.logo-icon:hover {
    filter: none;
}

/* Let system.css handle menu-bar base styles (font, bg, flex) */
.desktop-menubar ul[role="menu-bar"] {
    background: transparent;
}

/* Menu bar items — system.css padding + font */
.desktop-menubar ul[role="menu-bar"] > [role="menu-item"] {
    padding: 4px 10px;
    font-family: Chicago_12, Chicago, "VT323", monospace;
    font-size: 14px;
}

/* Dropdown menus — system.css style with shadow & vertical line */
.desktop-menubar ul[role="menu"] {
    top: 100%;
    min-width: 200px;
    background: #fff;
    border: 1px solid #000;
    box-shadow: 2px 2px #000;
}


/* Dropdown items — system.css sizing */
.desktop-menubar ul[role="menu"] > [role="menu-item"] > a,
.desktop-menubar ul[role="menu"] > [role="menu-item"] > button {
    display: block;
    padding: 4px 20px;
    font-family: Chicago_12, Chicago, "VT323", monospace;
    font-size: 14px;
    text-decoration: none;
    color: #000;
    width: 100%;
    box-sizing: border-box;
}

.desktop-menubar ul[role="menu"] > [role="menu-item"] > a:hover,
.desktop-menubar ul[role="menu"] > [role="menu-item"] > a:focus,
.desktop-menubar ul[role="menu"] > [role="menu-item"] > button:hover,
.desktop-menubar ul[role="menu"] > [role="menu-item"] > button:focus {
    background: #000;
    color: #fff;
    outline: none;
}

/* Dotted divider between menu groups */
.desktop-menubar [role="menu-item"].divider::after {
    content: "";
    display: block;
    border-top: 1.5px dotted #000;
    pointer-events: none;
}

.menu-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-family: Chicago_12, Chicago, "VT323", monospace;
}

.menu-right > span {
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    font-variant-numeric: tabular-nums;
}

.menu-right > .clickable {
    cursor: pointer;
}


.network-label {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #999;
    flex-shrink: 0;
}

.status-dot.connected {
    background: #0a0;
}

.gas-price {
    opacity: 0.7;
}

.clock {
    font-weight: bold;
    min-width: 48px;
    text-align: right;
}

/* ── Desktop Icons & Folders ─────────────────── */
.desktop-icons {
    position: fixed;
    display: flex;
    gap: 8px;
    z-index: 1;
}

/* ── Alignment variants (shared by both) ─────── */
.align-left {
    top: 44px;
    left: 16px;
    flex-direction: row;
    align-items: flex-start;
    gap: 4px;
}

.align-left .desktop-column,
.align-right .desktop-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.align-right {
    top: 44px;
    right: 16px;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 4px;
}

.align-top {
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    align-items: flex-start;
}

.align-bottom {
    bottom: 42px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    align-items: flex-end;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    width: 72px;
    height: 72px;
    transition: background 0.15s;
}

.desktop-icon:hover {
    background: rgba(0, 0, 0, 0.06);
}

.desktop-icon:active {
    background: rgba(0, 0, 0, 0.12);
}

.icon-img {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 1px 1px 0 #000;
    overflow: hidden;
}

.icon-img-src {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* when icon-img contains an image, remove white bg */
.icon-img.has-img {
    background: none;
    padding: 0;
}

/* ── Folder Icon — Mac OS System 6 (1988) ──────── */
.icon-img.folder-type {
    position: relative;
    background: #fff;
    border: 2px solid #000;
    border-radius: 0;
    margin-top: 10px;
    overflow: visible;
    box-shadow: 1px 1px 0 #000;
    width: 48px;
    height: 36px;
}

/* folder tab — separate outline, sits on top of body */
.icon-img.folder-type::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: -2px;
    width: 16px;
    height: 7px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 5px 5px 0 0;
}

/* image inside folder */
.icon-img.folder-type.has-img {
    background: #fff;
    padding: 4px;
}

.icon-img.folder-type.has-img .icon-img-src {
    object-fit: contain;
}

.desktop-icon span {
    color: #000;
    text-shadow: none;
    text-align: center;
    font-family: "VT323", monospace;
    font-size: 14px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* ── Window Overrides ─────────────────────────── */
.window {
    position: absolute;
    z-index: 100;
    min-width: 320px;
    max-height: calc(100vh - 70px);
    box-shadow:
        4px 4px 0 rgba(0, 0, 0, 0.5),
        8px 8px 24px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.window.active {
    z-index: 1000;
    box-shadow:
        4px 4px 0 rgba(0, 0, 0, 0.7),
        8px 8px 32px rgba(0, 0, 0, 0.6);
    outline: 1px solid rgba(255, 255, 255, 0.05);
}

.window .title-bar {
    cursor: move;
    flex-shrink: 0;
}

.window-body {
    padding: 12px;
    background: #fff;
    overflow-y: auto;
    flex: 1;
}

.window-body .window-pane {
    height: auto;
    overflow-y: auto;
    padding: 0.5rem 1rem;
}

.window.minimized .window-body,
.window.minimized .separator,
.window.minimized .details-bar {
    display: none;
}

/* ── Window Shade (double-click title bar) ────── */
.window.window-shaded {
    height: auto !important;
    max-height: none !important;
    overflow: hidden;
}
.window.window-shaded .separator,
.window.window-shaded .window-body,
.window.window-shaded .details-bar,
.window.window-shaded .resize-grip {
    display: none !important;
}

/* ── Details Bar ──────────────────────────────── */
.details-bar {
    display: flex;
    align-items: center;
    font-size: 13px;
    gap: 8px;
    padding: 4px 12px;
    background: #f4f4f4;
    border-bottom: 1px solid #ccc;
    font-family: "VT323", monospace;
    letter-spacing: 0.3px;
    flex-wrap: wrap;
}

/* ── Swap Components ──────────────────────────── */
.swap-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.swap-box {
    border: 1.5px solid #999;
    padding: 10px;
    background: #fafafa;
    margin-bottom: 4px;
}

.swap-label {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px;
    display: block;
    font-family: "VT323", monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.swap-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.token-select {
    width: 110px;
    font-size: 14px;
    font-family: "VT323", monospace;
}

.token-label {
    width: 110px;
    font-size: 14px;
    font-weight: bold;
    font-family: "VT323", monospace;
    padding: 4px 8px;
    background: #e8e8e8;
    border: 1.5px solid #999;
    text-align: center;
}

.swap-input {
    flex: 1;
    font-size: 18px;
    text-align: right;
    font-family: "VT323", monospace;
    letter-spacing: 1px;
}

.swap-input.full-width {
    width: 100%;
    text-align: right;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
}

.balance-label {
    font-family: "VT323", monospace;
    font-size: 14px;
    opacity: 0.7;
}

.swap-arrow-row {
    display: flex;
    justify-content: center;
    margin: -4px 0;
}

.swap-arrow-btn {
    font-size: 18px;
    width: 36px;
    height: 28px;
    padding: 0;
    line-height: 1;
}

/* ── Info rows ────────────────────────────────── */
.swap-info,
.crv-stats {
    border: 1.5px solid #ddd;
    padding: 8px 10px;
    background: #f8f8f8;
    margin: 4px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    font-family: "VT323", monospace;
    letter-spacing: 0.3px;
}

.info-row + .info-row {
    border-top: 1px dotted #ddd;
}

/* ── Buttons ──────────────────────────────────── */
.btn-full {
    width: 100%;
    margin-top: 8px;
    font-size: 15px;
    padding: 6px 12px;
    font-family: "VT323", monospace;
    letter-spacing: 0.5px;
}

.btn-tiny {
    font-size: 11px;
    padding: 1px 6px;
    font-family: "VT323", monospace;
}

.btn-tag {
    font-size: 12px;
    padding: 2px 10px;
    margin-right: 2px;
    font-family: "VT323", monospace;
}

.btn-tag.active {
    background: #000;
    color: #fff;
}

/* ── Tab Bar ──────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    padding: 4px 0;
}

/* ── Pool Table ───────────────────────────────── */
.pool-table-pane {
    max-height: 320px;
}

.pool-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "VT323", monospace;
    font-size: 14px;
}

.pool-table th {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 2px solid #000;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f0f0f0;
    position: sticky;
    top: 0;
}

.pool-table td {
    padding: 6px 8px;
    border-bottom: 1px dotted #ccc;
}

.pool-table tr:hover {
    background: #e8e8ff;
}

.pool-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
}

.pool-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #000;
    border-radius: 2px;
    flex-shrink: 0;
}

.pool-badge.stable {
    background: #c8e6c9;
}
.pool-badge.crypto {
    background: #bbdefb;
}
.pool-badge.factory {
    background: #fff9c4;
}
.pool-badge.tri {
    background: #f8bbd0;
}

.pool-filters {
    display: flex;
    gap: 2px;
    padding: 8px 0 4px;
    flex-wrap: wrap;
}

.search-input {
    font-size: 13px;
    padding: 1px 6px;
    width: 140px;
    font-family: "VT323", monospace;
}

/* ── veCRV Dashboard ──────────────────────────── */
.vecrv-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.stat-card {
    border: 1.5px solid #000;
    padding: 10px;
    text-align: center;
    background: #f8f8f8;
}

.stat-card.wide {
    border: 1.5px solid #999;
}

.stat-value {
    font-size: 22px;
    font-weight: bold;
    font-family: "VT323", monospace;
    letter-spacing: 1px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
    font-family: "VT323", monospace;
    text-transform: uppercase;
}

.stat-change {
    font-size: 13px;
    font-family: "VT323", monospace;
    margin-top: 2px;
}

.lock-duration-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ── Gauge Voting ─────────────────────────────── */
.gauge-header {
    padding: 6px 0;
}

.gauge-note {
    font-size: 13px;
    font-family: "VT323", monospace;
    opacity: 0.7;
}

.gauge-table td {
    vertical-align: middle;
}

.gauge-slider {
    width: 80px;
    cursor: pointer;
    vertical-align: middle;
}

.gauge-val {
    font-family: "VT323", monospace;
    font-size: 14px;
    margin-left: 6px;
    min-width: 32px;
    display: inline-block;
}

.gauge-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-family: "VT323", monospace;
    font-size: 15px;
}

/* ── Analytics ────────────────────────────────── */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.chart-container {
    border: 1.5px solid #999;
    padding: 10px;
    margin-bottom: 8px;
    background: #fafafa;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chart-title {
    font-family: "VT323", monospace;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
}

.chart-tabs {
    display: flex;
    gap: 2px;
}

canvas {
    width: 100%;
    image-rendering: pixelated;
    background: #fff;
    border: 1px solid #ddd;
}

/* ── About Window ─────────────────────────────── */
.about-body {
    text-align: center;
    padding: 20px;
}

.about-logo {
    font-size: 64px;
    line-height: 1;
    filter: grayscale(0.5);
}

.about-title {
    font-family: "Press Start 2P", monospace;
    font-size: 18px;
    margin: 8px 0 4px;
    letter-spacing: 1px;
}

.about-version {
    font-family: "VT323", monospace;
    font-size: 16px;
    opacity: 0.7;
    margin: 0;
}

.about-text {
    font-family: "VT323", monospace;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    margin: 0;
}

.about-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 12px 0;
}

.about-footer {
    font-size: 13px;
    opacity: 0.5;
    font-family: "VT323", monospace;
    margin: 12px 0 0;
}

/* ── Folder Window ────────────────────────────── */
.folder-body {
    padding: 16px;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 12px;
    justify-content: start;
}

.folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    width: 80px;
    transition: background 0.12s;
}

.folder-item:hover {
    background: #d8d8ff;
}

.folder-item:active {
    background: #b8b8ff;
}

.folder-item span {
    font-size: 13px;
    font-family: "VT323", monospace;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
}

/* ── Telegram Bot Window ─────────────────────── */
.tg-bot-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    text-align: center;
}

.tg-bot-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid #000;
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.tg-bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tg-bot-avatar-emoji {
    font-size: 48px;
    line-height: 1;
}

.tg-bot-name {
    font-family: "VT323", monospace;
    font-size: 22px;
    margin: 0 0 4px;
}

.tg-bot-members {
    font-family: "VT323", monospace;
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.tg-bot-desc {
    font-family: "VT323", monospace;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-line;
    text-align: center;
    padding: 12px;
    background: #f5f5f5;
    border: 1.5px solid #ccc;
    width: 100%;
    box-sizing: border-box;
}

/* ── YieldBasis ───────────────────────────────── */
.yb-explainer {
    font-family: "VT323", monospace;
    font-size: 14px;
    padding: 8px 10px;
    background: #f0f8f0;
    border: 1.5px solid #a5d6a7;
    margin-bottom: 8px;
    line-height: 1.4;
}

.yb-table-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    border-radius: 2px;
}

/* ── Manage Actions ───────────────────────────── */
.manage-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Control Strip (Taskbar) ──────────────────── */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    max-width: 100vw;
    height: 26px;
    background: #fff;
    border: 1px solid #000;
    display: inline-flex;
    align-items: stretch;
    padding: 0;
    z-index: 10000;
}

.taskbar-items {
    display: flex;
    min-width: 0;
    overflow: hidden;
}

/* Individual tile — flat, separated by thin lines */
.taskbar-tile {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    background: #fff;
    border: none;
    border-right: 1px solid #808080;
    box-sizing: border-box;
    flex-shrink: 0;
}

.taskbar-tile img {
    display: block;
    image-rendering: pixelated;
}

.taskbar-tile:hover {
    background: #b0b0b0;
}

.taskbar-tile.active {
    background: #a0a0a0;
}

/* Expanded tile — icon + label */
.taskbar-tile.expanded {
    width: auto;
    min-width: 0;
    padding: 0 8px;
    gap: 4px;
    flex-shrink: 1;
}

.taskbar-tile .tile-label {
    display: none;
    font-family: Chicago_12, Chicago, "VT323", monospace;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.taskbar-tile.expanded .tile-label {
    display: block;
}

/* Toggle arrow button — flat, same bg */
.taskbar-toggle {
    width: 18px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0;
    background: #fff;
    border: none;
    border-left: 1px solid #808080;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* CSS triangle arrow */
.taskbar-toggle::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid #000;
}

.taskbar-toggle.expanded::after {
    border-left: none;
    border-right: 5px solid #000;
}

.taskbar-toggle:hover {
    background: #b0b0b0;
}


/* ── Colors ───────────────────────────────────── */
.green-text {
    color: #2e7d32;
}
.red-text {
    color: #c62828;
}

/* ── Utility ──────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── Scrollbar styling ── (system.css handles it) */

/* ── Animations ───────────────────────────────── */
@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.window {
    animation: windowOpen 0.15s ease-out;
}

/* ── Selection ────────────────────────────────── */
::selection {
    background: #000;
    color: #fff;
}

/* ── Responsive tweaks ────────────────────────── */
@media (max-width: 768px) {
    .desktop-icons {
        position: static !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
        align-items: center !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        padding-top: 36px;
    }

    .desktop-column {
        display: contents !important;
    }

    .window {
        left: 4px !important;
        right: 4px;
        width: calc(100vw - 8px) !important;
        max-width: none;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .vecrv-dashboard {
        grid-template-columns: 1fr;
    }

    .network-label {
        display: none;
    }

    .window-body iframe {
        transform: scale(0.75);
        transform-origin: 0 0;
        width: 133.334% !important;
        height: 133.334% !important;
    }
}

/* ── Boot Screen ──────────────────────────────── */
.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #0a0a14;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease-out;
}

.boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-inner {
    text-align: center;
    color: #c0c0c0;
    font-family: "VT323", monospace;
}

.boot-logo {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 12px;
    animation: bootPulse 1.5s ease-in-out infinite;
    filter: grayscale(0.3);
}

@keyframes bootPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.boot-title {
    font-family: "Press Start 2P", monospace;
    font-size: 28px;
    color: #fff;
    letter-spacing: 3px;
    margin-bottom: 6px;
}

.boot-sub {
    font-size: 18px;
    color: #888;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.boot-progress-wrap {
    width: 320px;
    height: 12px;
    border: 2px solid #555;
    background: #1a1a2e;
    margin: 0 auto 16px;
    overflow: hidden;
}

.boot-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2e7d32, #66bb6a);
    transition: width 0.3s ease-out;
}

.boot-log {
    font-size: 14px;
    color: #4a4a6a;
    height: 80px;
    width: 360px;
    margin: 0 auto;
    text-align: left;
    overflow: hidden;
    line-height: 1.6;
}

.boot-log .log-line {
    animation: logFadeIn 0.2s ease-out;
}

@keyframes logFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Input focus enhancement ──────────────────── */
.swap-input:focus {
    outline: 2px solid #000;
    outline-offset: -2px;
}

/* ── Button press feedback ────────────────────── */
.btn-default:hover {
    filter: brightness(0.95);
}

/* ── Stat card hover ──────────────────────────── */
.stat-card:hover {
    background: #f0f0f0;
    transition: background 0.15s;
}

/* ── Pool table row selection ─────────────────── */
.pool-table tr {
    transition: background 0.1s;
    cursor: default;
}

/* ── Range slider custom ──────────────────────── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #ccc;
    border: 1px solid #999;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #000;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #000;
    cursor: pointer;
    border-radius: 0;
}

/* ── Desktop icon hover ──────────────────────── */
.desktop-icon:hover .icon-img {
    background: #fff;
    box-shadow:
        1px 1px 0 #000,
        0 0 8px rgba(255, 255, 255, 0.15);
}

.desktop-icon:hover .icon-img.has-img {
    background: none;
    box-shadow:
        1px 1px 0 #000,
        0 0 12px rgba(255, 255, 255, 0.25);
}

/* folder hover — System 6 invert */
.desktop-icon:hover .icon-img.folder-type,
.desktop-icon:hover .icon-img.folder-type.has-img {
    background: #000;
    box-shadow: 1px 1px 0 #000;
}

.desktop-icon:hover .icon-img.folder-type::before {
    background: #000;
}

.desktop-icon:hover .icon-img.folder-type.has-img .icon-img-src {
    filter: invert(1);
}

/* folder inside folder windows */
.folder-item:hover .icon-img.folder-type,
.folder-item:hover .icon-img.folder-type.has-img {
    background: #e8e8e8;
}

.folder-item:hover .icon-img.folder-type::before {
    background: #e8e8e8;
}

/* ── Open-External (pop-out) Button ──────────── */
.open-external {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #000;
    background: #fff;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 2px;
    flex-shrink: 0;
}

/* box part of pop-out icon */
.open-external::before {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border: 1.5px solid #000;
    background: transparent;
}

/* arrow part of pop-out icon */
.open-external::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid #000;
    border-right: 1.5px solid #000;
}

.open-external:hover {
    background: #e0e0e0;
}

.open-external:active {
    background: #ccc;
}

/* ── Wrapper Cards (CRV/YB Wrappers) ─────────── */
.wrapper-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.chart-loading {
    text-align: center;
    padding: 12px 8px;
    font-family: "VT323", monospace;
    font-size: 14px;
    color: #666;
    background: #f8f8f8;
    border: 1px dashed #ccc;
    margin-bottom: 4px;
}

/* ── Standalone Mode ─────────────────────────── */
body.standalone .desktop-menubar,
body.standalone .desktop-icons,
body.standalone .taskbar,
body.standalone .beta-watermark {
    display: none !important;
}

/* ── Resize Grip ─────────────────────────────── */
.resize-grip {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 10;
    background:
        linear-gradient(135deg,
            transparent 30%,
            #888 30%, #888 35%,
            transparent 35%, transparent 45%,
            #888 45%, #888 50%,
            transparent 50%, transparent 60%,
            #888 60%, #888 65%,
            transparent 65%);
}

.window-fullscreen .resize-grip,
.standalone-window .resize-grip {
    display: none;
}

/* ── Iframe Loader ───────────────────────────── */
.iframe-loader {
    position: absolute;
    inset: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.iframe-loader::before {
    content: 'Loading...';
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: #000;
}

.iframe-loader::after {
    content: '';
    position: absolute;
    bottom: 40%;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 12px;
    border: 2px solid #000;
    background: #fff;
    box-shadow: 1px 1px 0 #000;
    background-image: linear-gradient(90deg, #000 0%, #000 0%);
    background-repeat: no-repeat;
    background-size: 0% 100%;
    animation: iframeProgress 3s ease-out forwards;
}

@keyframes iframeProgress {
    0% { background-size: 0% 100%; }
    60% { background-size: 70% 100%; }
    100% { background-size: 90% 100%; }
}

/* ── Beta Watermark ──────────────────────────── */
.beta-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'VT323', monospace;
    font-size: 84px;
    color: rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: -1;
    user-select: none;
    letter-spacing: 2px;
}

body.standalone .boot-screen {
    display: none !important;
}

.window-fullscreen {
    position: fixed !important;
    top: 28px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 29px !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    z-index: 2000 !important;
    border-radius: 0;
    display: flex !important;
    flex-direction: column !important;
}

.window-fullscreen .title-bar {
    cursor: default !important;
}

.window-fullscreen .window-body {
    max-height: none !important;
    flex: 1;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
}

.window-fullscreen iframe {
    flex: 1 !important;
    height: 0 !important;
}

.standalone-window {
    margin: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    z-index: 100 !important;
    animation: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.standalone-window .title-bar {
    cursor: default !important;
}

.standalone-window .window-body {
    max-height: none !important;
    flex: 1;
}

/* hide close/resize/open-external in standalone, show back-to-desktop */
.standalone-window .close,
.standalone-window .resize,
.standalone-window .open-external {
    display: none !important;
}

.back-to-desktop {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #000;
    background: #fff;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
}

.back-to-desktop:hover {
    background: #e0e0e0;
}

.back-to-desktop:active {
    background: #ccc;
}

/* ── Desktop Pattern Chooser ────────────────── */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 4px;
}

.pattern-tile-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.pattern-tile {
    width: 48px;
    height: 48px;
    border: 2px solid #000;
    cursor: pointer;
}

.pattern-tile:hover {
    box-shadow: 0 0 0 2px #666;
}

.pattern-tile.active {
    border: 3px solid #000;
    box-shadow: 0 0 0 1px #fff inset;
}

.pattern-label {
    font-size: 11px;
    font-family: "VT323", monospace;
    text-align: center;
    margin-top: 2px;
}

.pattern-divider {
    grid-column: 1 / -1;
    border-top: 1.5px dotted #000;
    margin: 4px 0;
}

/* ── Dark Desktop Theme ─────────────────────── */
body.desktop-dark .desktop-icon span {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ── Nebula Desktop Overlays ────────────────── */
body.desktop-nebula::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

body.desktop-nebula::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(1px 1px at 30% 70%, rgba(200, 180, 255, 0.12), transparent),
        radial-gradient(1.5px 1.5px at 50% 40%, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 70% 80%, rgba(180, 200, 255, 0.12), transparent),
        radial-gradient(1px 1px at 90% 30%, rgba(255, 220, 255, 0.1), transparent),
        radial-gradient(1.5px 1.5px at 20% 90%, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 80% 60%, rgba(200, 200, 255, 0.1), transparent);
    pointer-events: none;
    z-index: 0;
    animation: drift 60s linear infinite;
}

@keyframes drift {
    from { transform: translateY(0); }
    to { transform: translateY(-40px); }
}

