:root {
    --sidebar-w: 72px;
    --sidebar-h: 72px;
    --brand-teal: #00f2ea;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --icon-black: #000000;
    --hold-time: 0.3s;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Space Mono', monospace;
}

body {
    margin: 0;
    background: #e2e8f0;
    height: 100dvh;
    overflow: hidden;
}

.tooltip {
    position: fixed;
    background: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2000;
    white-space: nowrap;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar {
    position: fixed;
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: var(--sidebar-w);
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    z-index: 100;
    transition: all 0.3s ease;
    user-select: none; /* Prevent text selection */
}

@media (max-width: 600px) {
    .sidebar {
        right: 12px;
        bottom: auto;
        width: auto;
        height: var(--sidebar-h);
        flex-direction: row;
        padding: 0 10px;
    }

    .spacer {
        display: none;
    }

    .category[data-tip="Settings"] {
        margin-left: auto;
    }

    .category.active .submenu {
        left: 0;
        top: 70px;
        flex-direction: column;
        animation: slideDown 0.2s ease-out;
    }
}

.category {
    position: relative;
    width: 100%;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

@media (max-width: 600px) {
    .category {
        width: 64px;
        height: 100%;
    }
}

.main-icon {
    font-size: 28px;
    color: var(--icon-black);
}

.hold-ring {
    position: absolute;
    width: 44px;
    height: 44px;
    border: 3px solid transparent;
    border-radius: 50%;
    transition: border-color 0.1s, transform var(--hold-time) linear;
    pointer-events: none;
}

.submenu {
    display: none;
    position: absolute;
    left: 80px;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 8px;
    gap: 8px;
    align-items: center;
    z-index: 101;
}

.category.active .submenu {
    display: flex;
    z-index: 200;
    animation: slideIn 0.2s ease-out;
}

.sub-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--icon-black);
    transition: all 0.2s;
    cursor: pointer;
}
/* Asshole import from google */
.material-symbols-outlined, 
.sub-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sub-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--brand-teal);
}

.window {
    position: absolute;
    top: 100px;
    left: 100px;
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 500;
    border: 1px solid var(--glass-border);
}

@media (max-width: 600px) {
    .window {
        width: calc(100% - 40px);
        left: 20px !important;
        top: 100px !important;
    }
}

.window-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    font-weight: 700;
    font-size: 11px;
    color: var(--icon-black);
    letter-spacing: 1px;
}

.window-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 13px;
}

.close-btn {
    cursor: pointer;
    font-size: 18px;
    color: var(--icon-black);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--brand-teal);
    cursor: pointer;
}

.input-group.checkbox-group {
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    font-size: 10px;
    letter-spacing: 1px;
}

.main-icon.counter-display {
    font-family: 'Space Mono', monospace;
    font-size: 14px; 
    font-weight: 700;
    color: var(--icon-black);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -1px;
}

#count-current, #count-total {
    min-width: 2px;
    text-align: center;
}

.coming-soon-popup {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: none; /* User can click through it */
    z-index: 10000;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.coming-soon-popup.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.joint-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.joint-row label {
    font-size: 11px;
    font-weight: 700;
    min-width: 70px;
    letter-spacing: 0.5px;
}

.joint-row input[type="range"] {
    flex: 1;
    accent-color: var(--brand-teal);
}

.joint-val {
    font-size: 11px;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
    font-family: 'Space Mono', monospace;
}

.joint-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

.sub-btn-small {
    flex: 1;
    padding: 8px 12px;
    background: white;
    color: var(--icon-black);
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.sub-btn-small:hover {
    background: rgba(0, 242, 234, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 242, 234, 0.3);
}

.sub-btn-small:active {
    transform: translateY(0);
}

.xyz-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.xyz-row label {
    font-size: 11px;
    font-weight: 700;
    min-width: 50px;
    letter-spacing: 0.5px;
}

.xyz-row input[type="range"] {
    flex: 1;
    accent-color: var(--brand-teal);
}

.xyz-val {
    font-size: 11px;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    font-family: 'Space Mono', monospace;
}

.xyz-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

/* Container for the robot selection grid */
.robot-selection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns as requested */
    gap: 12px;
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Individual robot item styling */
.robot-item {
    position: relative; /* CRITICAL: This anchors the absolute label */
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure the label shows up when the PARENT is hovered */
.robot-item:hover .robot-label {
    opacity: 1;
}

.robot-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(59, 242, 255, 0.9); /* Using a teal-ish brand color looks cleaner */
    color: #000; /* Dark text on bright background for readability */
    font-size: 11px;
    font-weight: bold;
    padding: 6px 2px;
    text-align: center;
    opacity: 0;
    transform: translateY(10px); /* Small slide-up effect */
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10; /* Ensure it stays above the image */
}

.robot-item:hover .robot-label {
    opacity: 1;
    transform: translateY(0);
}

.robot-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Prevents stretching */
    pointer-events: none; /* Allows click to pass to parent */
}