@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    background-color: #070b14;
    touch-action: none;
}

code, pre, .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.builder-card {
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(11, 17, 30, 0.98));
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

canvas#pcBoard {
    cursor: default;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    display: block;
    width: 100%;
    height: 100%;
}

.tool-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Плаваючі круглі кнопки дій (FAB) */
.fab-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-btn:hover {
    transform: scale(1.08);
}

.fab-btn:active {
    transform: scale(0.94);
}

/* VIEWCUBE 3D */
.viewcube-wrapper {
    width: 56px;
    height: 56px;
    perspective: 250px;
    cursor: pointer;
}
.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-25deg) rotateY(40deg);
    transition: transform 0.1s ease-out;
}
.face {
    position: absolute;
    width: 56px;
    height: 56px;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid #0284c7;
    color: #f8fafc;
    font-size: 8px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: visible;
    transition: all 0.15s;
}
.face:hover { background: #0284c7; }
.face.front  { transform: rotateY(0deg) translateZ(28px); }
.face.back   { transform: rotateY(180deg) translateZ(28px); }
.face.right  { transform: rotateY(90deg) translateZ(28px); }
.face.left   { transform: rotateY(-90deg) translateZ(28px); }
.face.top    { transform: rotateX(90deg) translateZ(28px); }
.face.bottom { transform: rotateX(-90deg) translateZ(28px); }

.cube-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #94a3b8;
    transition: all 0.15s;
}
.cube-btn:hover { background: #1e293b; color: #38bdf8; }

/* ГІЗМО КНОПКИ */
.gizmo-mode-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.15s;
}
.gizmo-mode-btn:hover {
    color: #38bdf8;
    background: #1e293b;
}
.gizmo-mode-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
}

/* ВИСУВНА ПАНЕЛЬ НАЛАШТУВАНЬ 3D СЦЕНИ */
.cad-drawer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    transform: translateX(0);
    opacity: 1;
}
.cad-drawer.drawer-closed {
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
}

.cad-slider {
    accent-color: #0284c7;
    height: 5px;
    border-radius: 4px;
    background: #334155;
    outline: none;
}

.cad-preset-btn {
    padding: 6px 8px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    background: #090e1a;
    border: 1px solid #1e293b;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.cad-preset-btn:hover {
    border-color: #38bdf8;
    color: #ffffff;
}
.cad-preset-btn.active {
    background: #0c4a6e;
    border-color: #0284c7;
    color: #38bdf8;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.35);
}

.cad-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 9px;
    background: #090e1a;
    border: 1px solid #1e293b;
    font-size: 11px;
    color: #cbd5e1;
    cursor: pointer;
    transition: border-color 0.15s;
}
.cad-toggle-row:hover {
    border-color: #334155;
}
.cad-checkbox {
    accent-color: #06b6d4;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Кастомний темний скролбар */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0b111e;
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

@keyframes bounceShort {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-bounce-short {
    animation: bounceShort 0.6s ease-in-out;
}