:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #3b82f6;
    --hover-color: #60a5fa;
    --accent-color: #ec4899;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    color: var(--text-color);
    font-family: var(--font-family);
    height: 100vh;
    width: 100vw;
    display: flex;
    overflow: hidden;
}

.container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Canvas Area */
.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    touch-action: none;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s ease;
}

.container.panel-active .canvas-container {
    margin-left: 400px;
}

/* Hide other controls when panel is active for maximum visibility */
.container.panel-active #top-nav,
.container.panel-active #canvas-actions,
.container.panel-active #speed-ctrl-floating {
    display: none !important;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* Info Panel (Overlay on canvas) */
.info-panel {
    position: absolute;
    top: 80px; 
    left: 350px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 10;
    transition: left 0.4s ease;
}

.container.panel-active .info-panel {
    left: calc(350px + 400px);
}

.info-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.info-math {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.info-value {
    font-size: 0.95rem;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.info-value span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Control Panel (Glass Layer) */
/* Control Panel (Glass Layer) */
.control-panel {
    position: fixed; /* Case 3: Fixed to viewport for reliable scroll math */
    top: 20px;
    left: 20px;
    width: 320px;
    height: calc(100vh - 40px);
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    /* Layout & Scroll */
    display: block;
    overflow-y: scroll !important; /* Force scroll for diagnostics */
    overflow-x: hidden;
    pointer-events: auto;
    touch-action: pan-y;
}

/* Scrollbar Visibility - Bright and Wide */
.control-panel::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.control-panel::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Accordion Styling (v5.26) */
.accordion-group {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden; /* Kept for transition */
    transition: border-color 0.3s ease, background 0.3s ease;
    margin-bottom: 1rem;
}

.accordion-group.active {
    overflow: visible; /* Release for scrolling when active */
}

/* v5.28: Slope Parameter Grouping */
.slope-section {
    border-left: 2px solid var(--primary-color);
    padding-left: 0.5rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.01);
}

.slope-section-title {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* v5.30: Point List Action Buttons */
.list-btn-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.reorder-btn, .delete-btn-list {
    background: none;
    border: none;
    padding: 2px 6px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.reorder-btn {
    color: var(--text-secondary);
}

.reorder-btn:hover:not(:disabled) {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.reorder-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.delete-btn-list {
    color: #ff4d4d;
    font-size: 1.1rem;
}

.delete-btn-list:hover {
    background: rgba(255, 77, 77, 0.1);
}

/* v5.31: Visual Feedback for List Interaction */
.point-list-item.flash {
    animation: point-flash 0.8s ease-out;
}

@keyframes point-flash {
    0% { background-color: rgba(59, 130, 246, 0.4); box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.5); }
    100% { background-color: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0px rgba(59, 130, 246, 0); }
}

.accordion-group:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.accordion-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.3s ease;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.accordion-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.accordion-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.accordion-group.active .accordion-icon {
    color: var(--accent-color);
}

.accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-group.active .accordion-content {
    grid-template-rows: 1fr;
}

.accordion-inner {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0 0.25rem; /* Further reduced from 0.5rem to maximize space */
    opacity: 0;
    transition: padding 0.3s ease, opacity 0.3s ease;
    min-height: 0; /* Important for grid containment */
}

.accordion-group.active .accordion-inner {
    padding: 1rem 0.25rem;
    opacity: 1;
    overflow: visible; /* Release for scrolling when active */
}

.accordion-group .separator {
    margin: 0.5rem 0;
}

.control-panel h1 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.control-panel p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;  /* Slightly tighter gap */
    background: none !important; /* Ensure no panelization */
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.control-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label-value {
    color: var(--accent-color);
    font-weight: 600;
    font-family: monospace;
    font-size: 0.85rem;
}

select, .number-input, .text-input {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    font-family: var(--font-family);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

select:focus, .number-input:focus, .text-input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

select option {
    background: #1e293b;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-top: -6px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s;
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.5);
    background: #fff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
}

/* Checkbox Toggle */
.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-group label:not(.switch) {
    font-size: 0.8rem;
    color: var(--text-color);
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: #94a3b8;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); background-color: #fff; }

.multi-input { display: flex; gap: 0.5rem; }
.multi-input .number-input { flex: 1; min-width: 0; padding: 0.6rem 0.4rem; }

/* v3.3: Shape Specific Horizontal Layout */
.side-by-side-layout {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.side-by-side-layout .control-group {
    flex: 1;
    min-width: 0;
}

#shapeSpecificRow #polygonCornersControl {
    flex: 0 0 70px;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.slider-row input[type=range] {
    flex: 1;
}

/* Segmented Control (Horizontal Tabs) */
.segmented-control {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 2px;
    width: fit-content;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    padding: 5px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: calc(0.5rem - 2px);
    transition: all 0.2s;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

.segmented-control input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}


/* Enhanced Slider Controls */
.modern-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    position: relative;
    padding: 10px 0;
}

.slider-adj-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 500;
    transition: all 0.2s;
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.slider-adj-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.slider-adj-btn:active {
    transform: scale(0.9);
    background: var(--primary-color);
}

.slider-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

/* Visual Indicator (Bubble) */
.slider-visual-indicator {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    top: -45px;
    left: 0;
    transform: translateX(-50%) scale(0);
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
    opacity: 0;
}

.slider-visual-indicator::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid white;
}

.slider-wrapper.active .slider-visual-indicator {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.terrain-ui-group {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.separator {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
}

/* Mobile Toggle */
.mobile-toggle-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(30, 41, 59, 0.7); /* Change from primary to semi-transparent */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 1000;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    touch-action: none;
    transition: all 0.3s ease;
}

.mobile-toggle-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

#bottom-controls-wrapper {
    position: fixed;
    bottom: 30px;
    left: calc(50% + 160px); 
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas: "speed settings";
    align-items: flex-end;
    gap: 20px;
    z-index: 100;
    transition: left 0.4s ease;
    max-width: 95vw;
}

#speed-ctrl-floating {
    grid-area: speed;
    justify-self: center;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 15px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 420px; /* Increased to fit both buttons */
}

#speed-ctrl-floating #playPauseBtn {
    margin-left: auto;
    padding: 8px;
    font-size: 0;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #3b82f6; /* Vibrant Blue */
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

#speed-ctrl-floating #resetBtn {
    padding: 8px;
    font-size: 0;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 55, 75, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

#speed-ctrl-floating #playPauseBtn:hover, 
#speed-ctrl-floating #resetBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

#speed-ctrl-floating span {
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
}

#speedSlider {
    flex: 1;
}



#speed-ctrl-floating #resetBtn:active {
    transform: scale(0.95);
}

#group-display {
    grid-area: settings;
}

@media (max-width: 768px) {
    .mobile-toggle-btn {
        display: flex;
        bottom: 20px; /* Default position when panel is closed */
        right: 20px;
        left: auto;
        transform: none;
        transition: bottom 0.3s ease; /* Smooth transition when panel opens */
    }
    .container.panel-active .mobile-toggle-btn {
        bottom: 57svh; /* Moves above the 55svh control panel */
    }
    .control-panel {
        top: auto; bottom: 0; left: 0; right: 0;
        width: 100%; height: 55svh;
        border-radius: 1rem 1rem 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        padding: 1.5rem;
    }
    .container.panel-active .control-panel { transform: translateY(0); }
    .container.panel-active .canvas-container {
        height: 40svh;
        margin-left: 0;
    }
    .container.panel-active #top-nav,
    .container.panel-active #canvas-actions,
    .container.panel-active #speed-ctrl-floating {
        display: none !important;
    }
    .info-panel {
        top: 80px; left: 10px; right: 10px;
        padding: 1rem; min-width: auto;
    }
    .container.panel-active .info-panel {
        left: 10px;
    }
    #canvas-actions {
        bottom: 100px;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
    }
    #canvas-actions button {
        padding: 0.6rem 1rem; /* Compact padding */
        font-size: 0.75rem; /* Shrunk font size */
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 100px;
    }
    #speed-ctrl-floating {
        position: relative;
        left: auto !important;
        transform: none;
        bottom: auto !important;
        min-width: 200px; /* Shrunk min-width */
        margin-bottom: 0.5rem;
        padding: 4px 12px; /* Thinner padding */
    }
    #speed-ctrl-floating span {
        font-size: 0.75rem; /* Shrunk label font */
    }
}


#instruction-overlay {
    position: fixed;
    top: 30px;
    left: calc(50% + 160px); 
    transform: translateX(-50%);
    z-index: 1000;
    text-align: center;
    color: #a2c2e6;
    font-size: 11px;
    font-weight: 500;
    text-shadow: 0 4px 6px rgba(0,0,0,0.8);
    pointer-events: none;
    transition: opacity 0.3s ease;
    touch-action: none;
    white-space: nowrap;
}

/* v5.40: Floating Panel (Display Settings) Styles */
.floating-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: auto;
    min-width: 180px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    margin-bottom: 0; /* Align to the same baseline as buttons */
}

.floating-panel .accordion-header {
    padding: 8px 12px;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.floating-panel .accordion-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.floating-panel .accordion-icon {
    font-size: 1rem;
    color: var(--accent-blue);
}

.floating-panel .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.floating-panel.active .accordion-content {
    max-height: 300px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.floating-panel .accordion-inner {
    padding: 10px;
}

.floating-panel.active .accordion-content {
    max-height: 500px; 
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.display-settings-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    padding: 10px 5px;
}

.display-settings-col {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
}

.display-col-left {
    min-width: 150px;
}

.display-col-right {
    min-width: 140px;
}

.floating-panel .checkbox-group {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    min-height: 24px;
}

.floating-panel .checkbox-group label {
    font-size: 0.75rem;
    color: #cbd5e1;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .display-settings-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 20px;
    }

    .display-col-left, .display-col-right {
        min-width: 0;
    }

    #bottom-controls-wrapper {
        grid-template-columns: auto;
        grid-template-areas: 
            "speed"
            "settings";
        justify-items: center; /* Center items horizontally in the grid column */
        gap: 12px;
        bottom: 20px;
        left: 50% !important;
        width: 98vw;
    }

    #speed-ctrl-floating {
        width: 90%; /* Expand to most of screen width */
        max-width: 400px;
        min-width: 250px;
        padding: 8px 15px;
        gap: 10px;
    }

    #speed-ctrl-floating span {
        font-size: 0.75rem;
    }
    
    #speed-ctrl-floating #playPauseBtn,
    #speed-ctrl-floating #resetBtn {
        min-width: 36px;
        height: 36px;
        padding: 8px;
    }

    #speed-ctrl-floating #playPauseBtn svg,
    #speed-ctrl-floating #resetBtn svg {
        width: 18px;
        height: 18px;
    }

    #speedSlider {
        width: 100px; /* Expanded slider for better control */
        flex: 1; /* Allow to grow if there's space */
    }
    
    .floating-panel {
        min-width: 180px; /* Slightly wider to be more legible */
        max-width: 90vw;
    }

    #resetBtn, #playPauseBtn {
        min-width: 75px;
        padding: 6px 12px;
        font-size: 0.7rem;
    }

    .floating-panel .accordion-header {
        padding: 6px 10px;
    }

    .floating-panel .accordion-title {
        font-size: 0.7rem;
    }

    #instruction-overlay { top: 25px; left: 50% !important; font-size: 10px; }
}

#top-nav {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-link-btn-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

#viewLockBtn.locked {
    background: #f59e0b;
    border-color: #d97706;
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.portal-link-btn-mini:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

#viewLockBtn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

#viewLockBtn.locked:hover {
    background: #d97706;
    border-color: #b45309;
}

.reset-shape-btn {
    margin-top: 8px;
    background: rgba(162, 194, 230, 0.15);
    border: 1px solid rgba(162, 194, 230, 0.4);
    color: #a2c2e6;
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}
/* Premium Add Point Button */
.add-btn-premium {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 2px;
}

.add-btn-premium:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #26d366 0%, #19b352 100%);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
    filter: brightness(1.1);
}

.add-btn-premium:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    filter: brightness(0.9);
}
