/* Scratch Jr Specific Styles */

:root {
  --jr-yellow: #FFCF33;
  --jr-blue: #5CB1FF;
  --jr-green: #97CD3D;
  --jr-orange: #FF9B42;
  --jr-red: #FF6680;
  --jr-purple: #C881FF;
  --jr-bg: #F0F4F8;
  --jr-stage: #FFFFFF;
}

.jr-font {
    font-family: 'Outfit', 'Varela Round', sans-serif;
}

/* Stage Area */
.jr-stage {
    background-color: var(--jr-stage);
    border-radius: 12px;
    border: 4px solid #DFE7EF;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.jr-sprite {
    position: absolute;
    width: 100px;
    height: 100px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><g fill="%23FFCF33"><circle cx="50" cy="50" r="40"/><circle cx="35" cy="45" r="5" fill="black"/><circle cx="65" cy="45" r="5" fill="black"/><path d="M40 65 Q50 75 60 65" stroke="black" stroke-width="3" fill="none"/></g><path d="M25 25 L15 10 L35 20 Z" fill="%23FFCF33"/><path d="M75 25 L85 10 L65 20 Z" fill="%23FFCF33"/></svg>'); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Block Palette */
.jr-palette {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.jr-block {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.1s;
    user-select: none;
    position: relative;
    flex-shrink: 0;
}

.jr-block:active {
    transform: scale(0.9);
}

.jr-block::after {
    content: '';
    position: absolute;
    right: -6px;
    width: 12px;
    height: 20px;
    background: inherit;
    border-radius: 4px;
    clip-path: polygon(0 0, 100% 20%, 100% 80%, 0% 100%);
}

.jr-block::before {
    content: '';
    position: absolute;
    left: -6px;
    width: 12px;
    height: 20px;
    background: inherit;
    border-radius: 4px;
    clip-path: polygon(0 20%, 100% 0, 100% 100%, 0% 80%);
    filter: brightness(0.9);
}

/* Block Types */
.block-trigger { background-color: var(--jr-yellow); color: #8F721A; }
.block-motion { background-color: var(--jr-blue); color: #1E5C99; }
.block-looks { background-color: var(--jr-purple); color: #5E2C85; }
.block-sound { background-color: var(--jr-green); color: #4B6E1A; }
.block-control { background-color: var(--jr-orange); color: #994D0A; }
.block-end { background-color: var(--jr-red); color: #8F2636; }

/* Coding Area */
.jr-script-area {
    background: #F8FAFC;
    border: 3px dashed #CBD5E1;
    border-radius: 16px;
    min-height: 120px;
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 0;
}

.script-ghost {
    opacity: 0.5;
}

/* Animations */
@keyframes jump {
    0% { transform: translateY(0); }
    50% { transform: translateY(-50px); }
    100% { transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Helper Bubbles */
.speech-bubble {
    position: absolute;
    background: white;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid #333;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 14px;
    color: #333;
    font-weight: bold;
    pointer-events: none;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
