/* CSS Variables for Color Palette */
:root {
    --bg-main: #FFFEF7;
    --bg-card: #FFF8E1;
    --bg-code: #2D3748;
    --accent-primary: #4ECDC4;
    --accent-secondary: #FFD700;
    --accent-tertiary: #FF6B6B;
    --accent-quaternary: #95E1D3;
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-headline: #2D5C5C;
    --text-light: #FFFFFF;
    --border-color: #000000;
    --shadow-color: #222222;
    --success-color: #4CAF50;
    --error-color: #F44336;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #F0F8FF 0%, #E8F5E8 50%, #FFF9E6 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

/* Hide bubbles on desktop */
body::before,
body::after {
    display: none;
}

@keyframes bubblesFloat {
    0% { 
        transform: translateY(20%);
        opacity: 0;
    }
    10% { 
        transform: translateY(15%);
        opacity: 1;
    }
    20% { 
        transform: translateY(10%);
        opacity: 1;
    }
    30% { 
        transform: translateY(5%);
        opacity: 1;
    }
    40% { 
        transform: translateY(0%);
        opacity: 1;
    }
    50% { 
        transform: translateY(-5%);
        opacity: 1;
    }
    60% { 
        transform: translateY(-10%);
        opacity: 1;
    }
    70% { 
        transform: translateY(-15%);
        opacity: 1;
    }
    80% { 
        transform: translateY(-20%);
        opacity: 1;
    }
    90% { 
        transform: translateY(-25%);
        opacity: 0.8;
    }
    100% { 
        transform: translateY(-30%);
        opacity: 0;
    }
}

/* Typography */
.title {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-headline);
    
    letter-spacing: -0.02em;
    line-height: 1.1;
    animation: titleBounce 2s ease-out;
    position: relative;
    z-index: 1;
}


.title-word-1 {
    color: #4169E1;
    position: relative;
    display: inline-block;
    animation: playfulFloat 8s ease-in-out infinite;
    animation-delay: 3s;
}

.title-word-2 {
    color: black;
    position: relative;
    display: inline-block;
    animation: gentleFloat2 5s ease-in-out infinite;
}

.title-word-3 {
    color: #DC143C;
    position: relative;
    display: inline-block;
    animation: gentleFloat3 6s ease-in-out infinite;
}

.subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    text-align: center;
    color: var(--text-secondary);
    max-width: 750px;
    margin: 0 auto;
    font-weight: 600;
    line-height: 1.4;
    animation: slideUp 1s ease-out 0.5s both;
    padding: 0 1rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
    text-shadow: 2px 2px 0 var(--shadow-color);
}

.section-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Header */
.header {
    padding: 4rem 1rem 3rem;
    text-align: center;
    position: relative;
}

/* Header CTA */
.header-cta {
    text-align: center;
    margin-top: 2rem;
    animation: bounceDown 1.2s ease-out 1s both;
}

.install-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--accent-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 4px 4px 0 var(--shadow-color);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.install-btn:hover {
    background: #FFEB3B;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--shadow-color);
}

.install-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20px 15px, var(--accent-primary) 2px, transparent 2px),
        radial-gradient(circle at 60px 10px, var(--accent-tertiary) 1.5px, transparent 1.5px),
        radial-gradient(circle at 100px 35px, var(--accent-quaternary) 2px, transparent 2px),
        radial-gradient(circle at 140px 20px, var(--accent-primary) 1.5px, transparent 1.5px),
        radial-gradient(circle at 180px 30px, var(--accent-tertiary) 2px, transparent 2px),
        radial-gradient(circle at 40px 40px, var(--accent-quaternary) 1.5px, transparent 1.5px),
        radial-gradient(circle at 120px 45px, var(--accent-primary) 2px, transparent 2px),
        radial-gradient(circle at 80px 25px, var(--accent-tertiary) 1.5px, transparent 1.5px);
    background-size: 200px 60px;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: sparkleFlow 4s linear infinite;
    pointer-events: none;
    z-index: 0;
    border-radius: 9px;
}

.install-btn:hover::before {
    opacity: 0.6;
}

.install-btn img, .install-btn span {
    position: relative;
    z-index: 1;
}

/* GitHub Button (Top Right) */
.github-btn {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: var(--text-light);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 2px 2px 0 var(--shadow-color);
    transition: all 0.2s ease;
    z-index: 10;
}

.github-btn:hover {
    background: var(--bg-card);
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--shadow-color);
}

.github-btn svg {
    flex-shrink: 0;
}

/* Header Stars */
.header-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -10;
}

/* Main Content */
.main {
    flex: 1;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

/* Floating Decorations */
.floating-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -10;
}

.decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.8;
    animation-duration: 8s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

/* Card Components */
.card {
    background: var(--bg-card);
    border: 4px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 8px 8px 0 var(--shadow-color);
    position: relative;
    overflow: visible;
    z-index: 1;
}

.main-card {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 1.5rem 2.5rem 2.5rem;
}

.card-content {
    position: relative;
    z-index: 2;
}


/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.rule-input {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    background: var(--text-light);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-shadow: 4px 4px 0 var(--shadow-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.rule-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 4px 4px 0 var(--accent-primary);
}

.rule-input::placeholder {
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 4px 4px 0 var(--shadow-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-primary);
    position: relative;
}

.btn-primary:hover {
    background: #45B7B8;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--shadow-color);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: 
        radial-gradient(circle at 10% 20%, var(--accent-secondary) 3px, transparent 3px),
        radial-gradient(circle at 90% 25%, var(--accent-tertiary) 2px, transparent 2px),
        radial-gradient(circle at 20% 80%, var(--accent-primary) 2px, transparent 2px),
        radial-gradient(circle at 80% 90%, var(--accent-quaternary) 3px, transparent 3px),
        radial-gradient(circle at 15% 50%, var(--accent-secondary) 2px, transparent 2px),
        radial-gradient(circle at 85% 60%, var(--accent-tertiary) 2px, transparent 2px);
    background-size: 60px 60px;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: sparkleOrbit 3s linear infinite;
    pointer-events: none;
    z-index: -1;
}

.btn-primary:hover::before {
    opacity: 1;
}


.btn-primary:disabled {
    background: #A0A0A0;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: 4px 4px 0 var(--shadow-color);
}

.btn-primary:disabled:hover {
    background: #A0A0A0;
    transform: none;
    box-shadow: 4px 4px 0 var(--shadow-color);
}

.btn-primary:disabled::before {
    display: none;
}


.btn-secondary {
    background: var(--accent-secondary);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: #E6C200;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--shadow-color);
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}


.success-alert {
    background: #E8F5E8;
    border: 3px solid var(--success-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 4px 4px 0 var(--shadow-color);
}

.success-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.success-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--success-color);
}

.success-instructions {
    color: var(--text-secondary);
    line-height: 1.5;
}

.success-instructions p {
    margin: 0;
}

.file-path {
    background: var(--bg-code);
    color: var(--text-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.check-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.error-alert {
    background: #FFEBEE;
    border: 3px solid var(--error-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 4px 4px 0 var(--shadow-color);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.error-alert.hidden {
    display: none;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.error-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--error-color);
}

.error-content {
    color: var(--text-secondary);
    line-height: 1.5;
}

.error-content p {
    margin: 0;
}

.error-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Code Block */
.code-block {
    background: var(--bg-code);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 4px 4px 0 var(--shadow-color);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.code-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1A202C;
    border-bottom: 2px solid var(--border-color);
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.window-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.window-dot.red {
    background: #FF5F57;
}

.window-dot.yellow {
    background: #FFBD2E;
}

.window-dot.green {
    background: #28CA42;
}

.code-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #1A202C;
    border-top: 2px solid var(--border-color);
    justify-content: center;
    align-items: center;
}

.code-action-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 44px;
    line-height: 1;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.copy-btn {
    background: var(--accent-secondary);
    color: var(--text-primary);
}

.copy-btn:hover {
    background: #E6C200;
    transform: translateY(-1px);
}

.install-btn {
    background: var(--accent-secondary);
    color: var(--text-primary);
}

.install-btn:hover {
    background: #FFEB3B;
    transform: translateY(-1px);
}

.download-btn {
    background: var(--accent-secondary);
    color: var(--text-primary);
}

.download-btn:hover {
    background: #E6C200;
    transform: translateY(-1px);
}

.code-container {
    position: relative;
}

.code-content {
    padding: 1.5rem;
    color: var(--text-light);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
}

.copy-icon-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    box-shadow: 2px 2px 0 var(--shadow-color);
    z-index: 10;
}

.copy-icon-btn:hover {
    background: var(--accent-secondary);
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--shadow-color);
}

.copy-icon-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* Loading Indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}


.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
}

.robot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: robotBobble 2s ease-in-out infinite;
}

.robot-head {
    width: 60px;
    height: 50px;
    background: var(--accent-quaternary);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    box-shadow: 4px 4px 0 var(--shadow-color);
    margin-bottom: 5px;
}

.robot-antenna {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: var(--border-color);
}

.antenna-ball {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-tertiary);
    border-radius: 50%;
    animation: antennaBlink 2s ease-in-out infinite;
}

.robot-eyes {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.robot-eye {
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    border-radius: 50%;
    animation: robotBlink 3s ease-in-out infinite;
}

.robot-mouth {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 8px;
    border: 2px solid var(--text-primary);
    border-top: none;
    border-radius: 0 0 10px 10px;
}

.robot-body {
    width: 50px;
    height: 40px;
    background: var(--accent-quaternary);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    box-shadow: 4px 4px 0 var(--shadow-color);
}

.robot-panel {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.robot-light {
    width: 8px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent-primary);
    animation: robotLights 1.5s ease-in-out infinite;
}

.robot-light-1 {
    animation-delay: 0s;
}

.robot-light-2 {
    animation-delay: 0.3s;
}

.robot-light-3 {
    animation-delay: 0.6s;
}


.loading-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    animation: pulse 2s ease-in-out infinite;
}

.loading-subtext {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Examples Section */
.examples-section {
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.examples-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.examples-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.example-card {
    background: var(--text-light);
    border: 3px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 6px 6px 0 var(--shadow-color);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.example-card:hover {
    transform: translate(2px, 2px);
    box-shadow: 4px 4px 0 var(--shadow-color);
}

.example-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.example-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-headline);
}

.example-tag {
    background: var(--accent-quaternary);
    color: var(--text-primary);
    padding: 0.3rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 2px 2px 0 var(--shadow-color);
}

.example-description {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer */
.footer {
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.heart-icon {
    width: 20px;
    height: 20px;
}

.warestack-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.warestack-link:hover {
    color: var(--text-headline);
    text-decoration: underline;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--text-primary);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1000;
    pointer-events: none;
    transform: translate(-50%, -100%);
    margin-top: -0.5rem;
    border: 2px solid var(--border-color);
    box-shadow: 2px 2px 0 var(--shadow-color);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-out {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.code-block-visible {
    opacity: 1;
    transform: translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Utilities */
.text-center {
    text-align: center;
}

.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        background: var(--accent-primary);
        transform: none;
        box-shadow: 4px 4px 0 var(--shadow-color);
    }
    
    .btn-primary:active {
        background: #45B7B8;
        transform: translate(2px, 2px);
        box-shadow: 2px 2px 0 var(--shadow-color);
    }
    
    .example-card:hover {
        transform: none;
        box-shadow: 6px 6px 0 var(--shadow-color);
    }
    
    .example-card:active {
        transform: translate(2px, 2px);
        box-shadow: 4px 4px 0 var(--shadow-color);
    }
    
    .github-btn:hover {
        background: var(--text-light);
        transform: none;
        box-shadow: 4px 4px 0 var(--shadow-color);
    }
    
    .github-btn:active {
        background: var(--bg-card);
        transform: translate(2px, 2px);
        box-shadow: 2px 2px 0 var(--shadow-color);
    }
    
    .code-action-btn:hover {
        transform: none;
    }
    
    .copy-btn:active {
        background: #E6C200;
        transform: translateY(1px);
    }
    
    .install-btn:active {
        background: #45B7B8;
        transform: translateY(1px);
    }
}

/* Responsive Design */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .main {
        padding: 0 1.5rem;
    }
    
    .examples-grid {
        max-width: 900px;
        gap: 1.25rem;
    }
    
    .title {
        font-size: clamp(2.5rem, 7vw, 4rem);
    }
    
    .subtitle {
        font-size: clamp(1.1rem, 3vw, 1.3rem);
    }
}

/* Tablets */
@media (max-width: 768px) {
    .input-wrapper {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .rule-input {
        margin-bottom: 0;
        min-height: 100px;
        font-size: 1rem;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Disable sparkle animation on wide buttons */
    .btn-primary::before {
        display: none;
    }
    
    .btn-primary:hover::before {
        display: none;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-card {
        padding: 1.25rem 1.75rem 1.25rem;
        margin: 0 1rem 2rem;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .section-description {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }
    
    .example-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .example-title {
        font-size: 1.1rem;
    }
    
    .example-tag {
        align-self: flex-start;
        font-size: 0.8rem;
        padding: 0.25rem 0.7rem;
        flex-shrink: 0;
    }
    
    .example-description {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Header responsive */
    .github-btn {
        top: 1rem;
        right: 1rem;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        gap: 0.4rem;
    }
    
    .header-cta {
        margin-top: 1.5rem;
    }
    
    .install-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        gap: 0.4rem;
    }
    
    /* Header adjustments */
    .header {
        padding: 3rem 1rem 2.5rem;
    }
    
    /* Success and error alerts */
    .success-alert, .error-alert {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .success-instructions {
        font-size: 0.9rem;
    }
    
    /* Code block responsive */
    .code-content {
        font-size: 0.85rem;
        padding: 1.25rem;
    }
    
    .code-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.25rem;
    }
    
    .code-action-btn {
        width: 100%;
        padding: 0.875rem;
        font-size: 0.9rem;
    }
    
    /* Robot responsive on tablet */
    .robot-head {
        width: 55px;
        height: 46px;
    }
    
    .robot-body {
        width: 46px;
        height: 38px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-subtext {
        font-size: 0.85rem;
    }
    
    /* Examples header */
    .examples-text {
        font-size: 1rem;
    }
    
    /* Reduce decorations on tablet */
    .decoration {
        width: 35px;
        height: 35px;
    }
    
    /* Hide some decorations on tablet */
    .generated-star:nth-child(n+13) {
        display: none;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    /* Cartoony mobile bubbles - star colors */
    body::before {
        display: block;
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 120%;
        background: 
            radial-gradient(circle 40px at 20% 30%, rgba(78, 205, 196, 0.4) 0%, rgba(78, 205, 196, 0.2) 50%, rgba(0, 0, 0, 0.08) 55%, transparent 60%),
            radial-gradient(circle 50px at 80% 20%, rgba(255, 215, 0, 0.35) 0%, rgba(255, 215, 0, 0.18) 50%, rgba(0, 0, 0, 0.08) 55%, transparent 60%),
            radial-gradient(circle 30px at 60% 70%, rgba(255, 107, 107, 0.4) 0%, rgba(255, 107, 107, 0.2) 50%, rgba(0, 0, 0, 0.08) 55%, transparent 60%),
            radial-gradient(circle 35px at 25% 80%, rgba(149, 225, 211, 0.35) 0%, rgba(149, 225, 211, 0.18) 50%, rgba(0, 0, 0, 0.08) 55%, transparent 60%),
            radial-gradient(circle 25px at 10% 15%, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.15) 50%, rgba(0, 0, 0, 0.06) 55%, transparent 60%),
            radial-gradient(circle 45px at 90% 40%, rgba(78, 205, 196, 0.35) 0%, rgba(78, 205, 196, 0.18) 50%, rgba(0, 0, 0, 0.08) 55%, transparent 60%),
            radial-gradient(circle 32px at 45% 10%, rgba(255, 107, 107, 0.3) 0%, rgba(255, 107, 107, 0.15) 50%, rgba(0, 0, 0, 0.06) 55%, transparent 60%),
            radial-gradient(circle 38px at 75% 85%, rgba(149, 225, 211, 0.32) 0%, rgba(149, 225, 211, 0.16) 50%, rgba(0, 0, 0, 0.07) 55%, transparent 60%);
        animation: bubblesFloat 25s linear infinite;
        z-index: -1;
        pointer-events: none;
    }
    
    body::after {
        display: block;
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 120%;
        background: 
            radial-gradient(circle 45px at 70% 50%, rgba(255, 107, 107, 0.3) 0%, rgba(255, 107, 107, 0.15) 50%, rgba(0, 0, 0, 0.06) 55%, transparent 60%),
            radial-gradient(circle 30px at 15% 60%, rgba(149, 225, 211, 0.25) 0%, rgba(149, 225, 211, 0.12) 50%, rgba(0, 0, 0, 0.06) 55%, transparent 60%),
            radial-gradient(circle 42px at 95% 75%, rgba(255, 215, 0, 0.28) 0%, rgba(255, 215, 0, 0.14) 50%, rgba(0, 0, 0, 0.06) 55%, transparent 60%),
            radial-gradient(circle 28px at 35% 35%, rgba(78, 205, 196, 0.25) 0%, rgba(78, 205, 196, 0.12) 50%, rgba(0, 0, 0, 0.06) 55%, transparent 60%),
            radial-gradient(circle 36px at 55% 90%, rgba(255, 215, 0, 0.27) 0%, rgba(255, 215, 0, 0.13) 50%, rgba(0, 0, 0, 0.06) 55%, transparent 60%),
            radial-gradient(circle 33px at 5% 45%, rgba(78, 205, 196, 0.26) 0%, rgba(78, 205, 196, 0.13) 50%, rgba(0, 0, 0, 0.06) 55%, transparent 60%);
        animation: bubblesFloat 30s linear infinite;
        animation-delay: -15s;
        z-index: -2;
        pointer-events: none;
    }

    .header {
        padding: 2rem 0.75rem 1.5rem;
    }
    
    .main {
        padding: 0 0.75rem;
    }
    
    .main-card {
        padding: 1rem 1.25rem 0.5rem;
        margin: 0 0.5rem 2rem;
        border-radius: 16px;
        border-width: 3px;
    }
    
    .title {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: clamp(1rem, 4vw, 1.2rem);
        padding: 0 0.5rem;
    }
    
    .section-title {
        font-size: 1.4rem;
        text-align: center;
    }
    
    .section-description {
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .rule-input {
        padding: 0.875rem;
        font-size: 1rem;
        min-height: 90px;
        border-radius: 10px;
        width: 100%;
    }
    
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        border-radius: 10px;
        text-transform: none;
        letter-spacing: 0.02em;
    }
    
    /* GitHub button mobile - banner layout */
    .github-btn {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 0.6rem;
        font-size: 0.8rem;
        font-weight: 700;
        border-radius: 0;
        border: none;
        border-bottom: 3px solid var(--border-color);
        box-shadow: 0 3px 0 var(--shadow-color);
        z-index: 20;
        justify-content: center;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        background: var(--accent-quaternary);
    }
    
    .github-btn:hover {
        transform: none;
        background: var(--accent-primary);
        box-shadow: 0 3px 0 var(--shadow-color);
    }
    
    .github-btn:active {
        background: var(--accent-primary);
        transform: translateY(1px);
        box-shadow: 0 2px 0 var(--shadow-color);
    }
    
    /* Add padding to body to account for fixed banner */
    body {
        padding-top: 3.2rem;
    }
    
    /* Install button mobile */
    .header-cta {
        margin-top: 1rem;
    }
    
    .install-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        border-radius: 10px;
        text-transform: none;
        letter-spacing: 0.02em;
    }
    
    /* Disable sparkle animation on mobile */
    .install-btn::before {
        display: none;
    }
    
    .install-btn:hover::before {
        display: none;
    }
    
    /* Examples mobile */
    .examples-section {
        margin-bottom: 2rem;
    }
    
    .examples-header {
        margin-bottom: 1.5rem;
    }
    
    .examples-text {
        font-size: 0.95rem;
    }
    
    .example-card {
        padding: 1.25rem;
        border-radius: 12px;
        border-width: 3px;
    }
    
    .example-title {
        font-size: 1rem;
    }
    
    .example-tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
        border-radius: 16px;
    }
    
    .example-description {
        font-size: 0.85rem;
    }
    
    /* Alerts mobile */
    .success-alert, .error-alert {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }
    
    .success-title {
        font-size: 1rem;
    }
    
    .success-instructions {
        font-size: 0.85rem;
    }
    
    .file-path {
        font-size: 0.8rem;
        padding: 0.15rem 0.3rem;
    }
    
    /* Code block mobile */
    .code-block {
        border-radius: 10px;
    }
    
    .code-content {
        font-size: 0.8rem;
        padding: 1rem;
        line-height: 1.4;
    }
    
    .code-actions {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .code-action-btn {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Loading mobile */
    .loading {
        padding: 1.5rem;
        gap: 0.75rem;
    }
    
    .robot-head {
        width: 45px;
        height: 38px;
    }
    
    .robot-body {
        width: 38px;
        height: 32px;
    }
    
    .robot-antenna {
        height: 8px;
        top: -12px;
    }
    
    .antenna-ball {
        width: 5px;
        height: 5px;
        top: -4px;
    }
    
    .robot-eyes {
        gap: 8px;
        top: 10px;
    }
    
    .robot-eye {
        width: 8px;
        height: 8px;
    }
    
    .robot-mouth {
        width: 16px;
        height: 6px;
        bottom: 8px;
    }
    
    .robot-panel {
        top: 6px;
        gap: 3px;
    }
    
    .robot-light {
        width: 6px;
        height: 2px;
    }
    
    .loading-text {
        font-size: 0.95rem;
    }
    
    .loading-subtext {
        font-size: 0.8rem;
    }
    
    /* Footer mobile */
    .footer {
        padding: 1.5rem 0.75rem;
    }
    
    .footer-text {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 0.25rem;
        line-height: 1.4;
    }
    
    /* Decorations mobile */
    .decoration {
        width: 25px;
        height: 25px;
    }
    
    /* Hide more decorations on mobile */
    .generated-star:nth-child(n+9) {
        display: none;
    }
    
    /* Tooltip mobile */
    .tooltip {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
    .main-card {
        padding: 0.875rem 1rem 0.5rem;
        margin: 0 0.25rem 1.5rem;
    }
    
    .title {
        font-size: clamp(1.75rem, 9vw, 2.5rem);
    }
    
    .subtitle {
        font-size: clamp(0.9rem, 4.5vw, 1.1rem);
        padding: 0 0.25rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .section-description {
        font-size: 0.85rem;
    }
    
    .rule-input {
        padding: 0.75rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .github-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .install-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .example-card {
        padding: 1rem;
    }
    
    .robot-head {
        width: 40px;
        height: 34px;
    }
    
    .robot-body {
        width: 34px;
        height: 28px;
    }
    
    /* Hide even more decorations on very small screens */
    .generated-star:nth-child(n+7) {
        display: none;
    }
}

/* Header Animations */
@keyframes titleBounce {
    0% { 
        transform: translateY(-30px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(10px) scale(1.05);
        opacity: 0.8;
    }
    100% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}


@keyframes slideUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceDown {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    70% {
        transform: translateY(-8px);
        opacity: 1;
    }
    85% {
        transform: translateY(3px);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}


/* Decoration Animations */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px);
    }
    50% { 
        transform: translateY(-8px);
    }
}

@keyframes gentleFloat2 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes gentleFloat3 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes playfulFloat {
    0%, 90% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(0deg); }
    50% { transform: translateY(0px) rotate(0deg); }
    75% { transform: translateY(-8px) rotate(0deg); }
    92% { transform: translateY(-4px) rotate(5deg); }
    94% { transform: translateY(-4px) rotate(-5deg); }
    96% { transform: translateY(-4px) rotate(3deg); }
    98% { transform: translateY(-4px) rotate(-2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}


@keyframes sparkleOrbit {
    0% { 
        transform: rotate(0deg);
        background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px;
    }
    25% {
        background-position: 15px 15px, -15px 15px, 15px -15px, -15px -15px, 20px 10px, -20px -10px;
    }
    50% {
        background-position: 30px 0px, -30px 0px, 0px -30px, 0px 30px, 25px -25px, -25px 25px;
    }
    75% {
        background-position: 15px -15px, -15px -15px, -15px 15px, 15px 15px, 10px -20px, -10px 20px;
    }
    100% { 
        transform: rotate(360deg);
        background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px;
    }
}

@keyframes sparkleFlow {
    0% { 
        background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px;
    }
    100% { 
        background-position: 200px 0px, 200px 0px, 200px 0px, 200px 0px, 200px 0px, 200px 0px, 200px 0px, 200px 0px;
    }
}

/* Robot Loading Animations */
@keyframes robotBobble {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
    }
    25% { 
        transform: translateY(-5px) rotate(1deg);
    }
    50% { 
        transform: translateY(-3px) rotate(0deg);
    }
    75% { 
        transform: translateY(-5px) rotate(-1deg);
    }
}

@keyframes robotBlink {
    0%, 90%, 100% { 
        transform: scaleY(1);
    }
    95% { 
        transform: scaleY(0.1);
    }
}

@keyframes antennaBlink {
    0%, 80%, 100% { 
        background: var(--accent-tertiary);
        transform: translateX(-50%) scale(1);
    }
    90% { 
        background: var(--accent-primary);
        transform: translateX(-50%) scale(1.3);
    }
}

@keyframes robotLights {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
    }
}


@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.02);
    }
}