/* ==========================================================================
   MAZE STUDIO - TAP AWAY 2D: MASTER MIND EDITION
   Ultra-Premium Cyber & Glassmorphic Design System
   ========================================================================== */

:root {
    --bg-color: #0b0f19;
    --canvas-bg: radial-gradient(circle at 50% 50%, #111827 0%, #030712 100%);
    --grid-color: rgba(255, 255, 255, 0.06);
    --accent-cyan: #00f0ff;
    --accent-magenta: #ff0077;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.82);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 18px 45px -10px rgba(0, 0, 0, 0.65), 0 0 25px rgba(0, 240, 255, 0.08);
    --border-radius: 20px;
    --card-radius: 22px;
}

/* Theme Variances */
body.theme-cyber {
    --bg-color: #0b0f19;
    --canvas-bg: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
    --grid-color: rgba(0, 240, 255, 0.08);
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(0, 240, 255, 0.2);
    --glass-shadow: 0 18px 45px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 240, 255, 0.12);
}

body.theme-studio {
    --bg-color: #f1f5f9;
    --canvas-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --grid-color: rgba(0, 0, 0, 0.05);
    --text-color: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 14px 35px -10px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
}

body.theme-midnight {
    --bg-color: #09090b;
    --canvas-bg: radial-gradient(circle at 50% 50%, #18181b 0%, #09090b 100%);
    --grid-color: rgba(245, 158, 11, 0.08);
    --text-color: #fafafa;
    --text-muted: #a1a1aa;
    --glass-bg: rgba(24, 24, 27, 0.85);
    --glass-border: rgba(245, 158, 11, 0.22);
    --glass-shadow: 0 18px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.14);
}

body.theme-emerald {
    --bg-color: #022c22;
    --canvas-bg: radial-gradient(circle at 50% 50%, #064e3b 0%, #022c22 100%);
    --grid-color: rgba(16, 185, 129, 0.08);
    --text-color: #ecfdf5;
    --text-muted: #6ee7b7;
    --glass-bg: rgba(6, 78, 59, 0.85);
    --glass-border: rgba(16, 185, 129, 0.25);
    --glass-shadow: 0 18px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   FIRST-CLASS DEDICATED LIGHT MODE
   High-contrast, crisp studio acrylic styling with tactile depth
   ========================================================================== */
body.light-mode {
    --bg-color: #f1f5f9;
    --canvas-bg: radial-gradient(circle at 50% 50%, #ffffff 0%, #e2e8f0 100%);
    --grid-color: rgba(15, 23, 42, 0.07);
    --text-color: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(15, 23, 42, 0.12);
    --glass-shadow: 0 16px 35px -10px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-mode .glass-panel {
    background: rgba(255, 255, 255, 0.93);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 16px 35px -8px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.1);
}

body.light-mode .btn-secondary {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

body.light-mode .btn-secondary:hover {
    background: rgba(15, 23, 42, 0.11);
    border-color: rgba(15, 23, 42, 0.22);
}

body.light-mode .diff-badge {
    background: rgba(14, 165, 233, 0.15);
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.35);
}

body.light-mode .stat-label {
    color: #475569;
}

body.light-mode .stat-value {
    color: #0f172a;
}

body.light-mode .shape-badge {
    background: rgba(225, 29, 72, 0.12);
    color: #e11d48;
    border-color: rgba(225, 29, 72, 0.3);
    text-shadow: none;
}

body.light-mode .text-glow-cyan {
    color: #0284c7;
    text-shadow: none;
}

body.light-mode .text-glow-red {
    color: #dc2626;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}

body.light-mode .modal-card {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25);
}

body.light-mode .settings-label {
    color: #64748b;
}

body.light-mode .palette-item {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

body.light-mode .palette-item:hover,
body.light-mode .palette-item.active {
    background: rgba(14, 165, 233, 0.1);
    border-color: #0284c7;
}

body.light-mode .diff-option {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

body.light-mode .diff-option:hover,
body.light-mode .diff-option.active {
    background: rgba(14, 165, 233, 0.1);
    border-color: #0284c7;
}

body.light-mode .hud-tip {
    color: #475569;
}

/* 1GB & 2GB RAM Mode Styling (Eliminate GPU composite layers, blur passes, and text-shadow thrashing) */
body.low-ram-mode .glass-panel,
body.low-ram-mode .overlay-card,
body.low-ram-mode .hud,
body.low-ram-mode .hint-panel {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.low-ram-mode .text-glow-cyan,
body.low-ram-mode .text-glow-red,
body.low-ram-mode .combo-glow,
body.low-ram-mode .shape-badge,
body.low-ram-mode .endless-badge {
    text-shadow: none !important;
}

body.low-ram-mode .btn {
    box-shadow: none !important;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Canvas Wrapper */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--canvas-bg);
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.4s ease;
}

canvas {
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Glassmorphic Elements */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* HUD Top Header */
.hud {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 960px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    animation: slide-down 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-center {
    display: flex;
    align-items: center;
    gap: 22px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 65px;
}

.stat-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: var(--text-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

/* Highlight Badges */
.diff-badge {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 240, 255, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.3);
    letter-spacing: 0.5px;
}

.shape-badge {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(255, 0, 119, 0.15);
    color: #ff0077;
    border: 1px solid rgba(255, 0, 119, 0.35);
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 0, 119, 0.4);
}

.endless-badge {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(5, 255, 161, 0.15);
    color: #05ffa1;
    border: 1px solid rgba(5, 255, 161, 0.35);
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(5, 255, 161, 0.4);
}

.combo-stat {
    animation: combo-bounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.combo-glow {
    color: #ffe500;
    text-shadow: 0 0 12px rgba(255, 229, 0, 0.7);
    font-size: 1.4rem;
}

.text-glow-red {
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    white-space: nowrap;
    letter-spacing: 2px;
}

.text-glow-cyan {
    color: var(--accent-cyan);
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.hud-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Interactive Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    outline: none;
}

.icon-btn {
    padding: 9px 10px;
}

.btn.active {
    background: var(--accent-cyan) !important;
    color: #020617 !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.4) !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

.btn-primary {
    background: linear-gradient(135deg, #00f0ff 0%, #006eff 100%);
    color: #020617;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 22px rgba(0, 240, 255, 0.55);
    transform: translateY(-2px);
}

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

.btn-lg {
    padding: 13px 28px;
    font-size: 1.05rem;
    border-radius: 14px;
}

/* Floating Viewport Navigation Widgets */
.view-controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-icon-round {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    font-size: 1.2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-round:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--accent-cyan);
}

/* Bottom Hint Panel */
.hint-panel {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    pointer-events: none;
    text-align: center;
    max-width: 80%;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}

/* Overlays & Modals Universal Framework */
.overlay,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 120;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.hidden,
.modal-overlay.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.overlay-card,
.modal-card {
    width: 90%;
    max-width: 440px;
    padding: 34px 28px;
    display: flex;
    flex-direction: column;
    border-radius: var(--card-radius);
    transform: scale(1);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 240, 255, 0.12);
}

.overlay.hidden .overlay-card,
.modal-overlay.hidden .modal-card {
    transform: scale(0.85);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--accent-cyan);
    transform: scale(1.15);
}

.trophy-container {
    color: var(--accent-cyan);
    margin-bottom: 20px;
}

.trophy-icon {
    width: 68px;
    height: 68px;
    filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.5));
}

.overlay-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.overlay-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.4;
}

.stats-summary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-lbl {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.summary-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-cyan);
}

/* Settings Modal Specifics */
.settings-group {
    margin-bottom: 18px;
    text-align: left;
    width: 100%;
}

.settings-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 700;
}

/* Difficulty Selector Grid */
.diff-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.diff-option {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.diff-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.diff-option.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
}

.diff-title {
    font-size: 0.85rem;
    font-weight: 700;
}

.diff-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Palette Grid */
.palette-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.palette-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.palette-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.palette-item.active {
    background: rgba(0, 240, 255, 0.14);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.palette-name {
    font-size: 0.82rem;
    font-weight: 600;
}

.palette-dots {
    display: flex;
    gap: 4px;
}

.palette-dots div {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.color-picker-wrapper {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    gap: 8px;
}

.color-picker-wrapper input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

/* Keyframe Animations */
@keyframes slide-down {
    from { transform: translate(-50%, -40px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes combo-bounce {
    0% { transform: scale(0.7); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive Breakpoints */
@media (max-width: 680px) {
    .hud {
        flex-direction: column;
        padding: 10px 14px;
        gap: 8px;
        top: 6px;
        width: 96%;
    }

    .hud-center {
        width: 100%;
        justify-content: space-around;
        gap: 6px;
    }

    .stat-box {
        min-width: 50px;
    }

    .stat-label {
        font-size: 0.55rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .hud-right {
        width: 100%;
        justify-content: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .hud-right .btn {
        padding: 7px 10px;
        font-size: 0.76rem;
    }

    .btn-text {
        display: none;
    }

    .view-controls {
        bottom: 60px;
        right: 12px;
    }

    .hint-panel {
        bottom: 12px;
        font-size: 0.75rem;
        padding: 4px 10px;
    }
}

/* --- HUD Mode Pill & Mode Selection Styles --- */
.hud-mode-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 243, 255, 0.12);
    border: 1px solid rgba(0, 243, 255, 0.35);
    color: var(--accent-cyan);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.timer-glow {
    color: #ff9d00 !important;
    text-shadow: 0 0 10px rgba(255, 157, 0, 0.5);
}

.modes-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
    max-height: 52vh;
    overflow-y: auto;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.mode-card:hover {
    background: rgba(0, 243, 255, 0.08);
    border-color: rgba(0, 243, 255, 0.3);
    transform: translateY(-2px);
}

.mode-card.active {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0, 243, 255, 0.25);
}

.mode-card .mode-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.mode-card .mode-info h3 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.mode-card .mode-info p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Interactive HUD Shape Badge */
.btn-shape-badge {
    cursor: pointer;
    background: rgba(255, 0, 119, 0.18);
    border: 1px solid rgba(255, 0, 119, 0.4);
    color: #ff0077;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    font-family: inherit;
}

.btn-shape-badge:hover {
    transform: translateY(-1px) scale(1.04);
    background: rgba(255, 0, 119, 0.28);
    border-color: #ff0077;
    box-shadow: 0 0 15px rgba(255, 0, 119, 0.5);
}

/* Shapes & Living Creatures Gallery */
.shapes-modal-card {
    max-width: 580px;
    width: 94%;
    max-height: 85vh;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
}

.shapes-tab-bar {
    display: flex;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    padding: 4px 2px 8px 2px;
    scrollbar-width: thin;
}

.shape-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: inherit;
}

.shape-tab-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    color: var(--text-main);
    border-color: rgba(0, 240, 255, 0.3);
}

.shape-tab-btn.active {
    background: rgba(0, 240, 255, 0.2);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.shapes-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 10px;
    max-height: 52vh;
    overflow-y: auto;
    padding: 6px 4px;
    scrollbar-width: thin;
}

.shape-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    position: relative;
    user-select: none;
}

.shape-card:hover {
    background: rgba(0, 240, 255, 0.12);
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.shape-card.active {
    background: rgba(0, 240, 255, 0.22);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.shape-card .shape-card-icon {
    font-size: 2.1rem;
    margin-bottom: 5px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.shape-card:hover .shape-card-icon {
    transform: scale(1.15);
}

.shape-card .shape-card-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.shape-card .shape-card-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.shape-card.cleared .shape-card-sub {
    color: #ffd700;
    font-weight: 700;
}
