@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

code, pre, .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.library-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(9, 14, 28, 0.98));
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
}

.block-scheme-canvas {
    background: radial-gradient(circle at 10% 10%, #0c1427, #060a14);
    border: 1px solid #1e293b;
    border-radius: 1.25rem;
}

/* Кольори блоків Scratch */
.sc-cat-motion   { background-color: #4c97ff; border-color: #3373cc; }
.sc-cat-looks    { background-color: #9966ff; border-color: #774dc1; }
.sc-cat-sound    { background-color: #cf63cf; border-color: #bd42bd; }
.sc-cat-events   { background-color: #ffbf00; border-color: #cc9900; }
.sc-cat-control  { background-color: #ffab19; border-color: #cf8717; }
.sc-cat-pen      { background-color: #0fbd8c; border-color: #0b8e6b; }

/* Фірмові Scratch-блоки на схемі збирання */
.visual-scratch-block {
    position: relative;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    user-select: none;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border-radius: 7px;
    border-width: 1.5px;
    border-style: solid;
    padding: 3px 10px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    gap: 6px;
    margin-bottom: -1px;
    z-index: 10;
}

/* Верхній паз блоку */
.visual-scratch-block::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 14px;
    width: 18px;
    height: 5px;
    background: inherit;
    border-top: inherit;
    border-left: inherit;
    border-right: inherit;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    z-index: 2;
}

/* Нижній виступ блоку */
.visual-scratch-block::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 14px;
    width: 18px;
    height: 5px;
    background: inherit;
    border-bottom: inherit;
    border-left: inherit;
    border-right: inherit;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    z-index: 3;
}

/* Hat-блок «Коли прапорець натиснуто» */
.visual-scratch-block.is-hat {
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    padding-top: 5px;
    padding-bottom: 5px;
}
.visual-scratch-block.is-hat::before {
    display: none;
}

/* C-подібні блоки циклів та умов */
.visual-c-block {
    display: flex;
    flex-direction: column;
    width: fit-content;
    min-width: 220px;
    margin-bottom: -1px;
    z-index: 10;
}
.visual-c-header {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 7px 7px 0 0;
    border-width: 1.5px 1.5px 0 1.5px;
    border-style: solid;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    gap: 6px;
    position: relative;
}
.visual-c-header::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 14px;
    width: 18px;
    height: 5px;
    background: inherit;
    border-top: inherit;
    border-left: inherit;
    border-right: inherit;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}
.visual-c-body {
    border-left: 16px solid;
    border-left-color: inherit;
    padding: 4px 0 4px 10px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.45);
    min-height: 38px;
}
.visual-c-divider {
    min-height: 24px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background-color: inherit;
    border-left: 16px solid;
    border-left-color: inherit;
}
.visual-c-footer {
    border-radius: 0 0 7px 7px;
    height: 12px;
    border-width: 0 1.5px 1.5px 1.5px;
    border-style: solid;
    position: relative;
}
.visual-c-footer::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 14px;
    width: 18px;
    height: 5px;
    background: inherit;
    border-bottom: inherit;
    border-left: inherit;
    border-right: inherit;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}

/* Інпути всередині схем блоків */
.visual-block-badge {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    border-radius: 8px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}
.visual-block-select-badge {
    background: rgba(15, 23, 42, 0.9);
    color: #38bdf8;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
}

/* Стилізовані кроки інструкції */
.step-instruction-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.7);
    transition: all 0.2s ease;
}
.step-instruction-card:hover {
    border-color: rgba(45, 212, 191, 0.5);
    transform: translateY(-1px);
}

/* Анімація копіювання */
@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}
.copied-btn {
    animation: copyPulse 0.3s ease-in-out;
    background-color: #0d9488 !important;
    border-color: #2dd4bf !important;
    color: #ffffff !important;
}

/* Кастомний темний скролбар */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #070b14; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }