   :root {
            --royal-purple: #1a0f4e;
            --royal-gold: #ffd700;
            --royal-gold-light: #fff9d6;
            --royal-blue: #0a0529;
            --royal-light: #4a3a8a;
            --royal-accent: #8a6de9;
            --royal-text: #f8f1ff;
            --royal-shadow: rgba(45, 27, 105, 0.7);
            --royal-dark: #0f0529;
            --royal-velvet: #2d1b69;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background: linear-gradient(135deg, var(--royal-blue), var(--royal-purple), #0c0635);
            color: var(--royal-text);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            overflow-x: hidden;
            position: relative;
        }

        /* Animated background */
        .bg-decoration {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            opacity: 0.1;
            background: 
                radial-gradient(circle at 20% 80%, var(--royal-gold) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, var(--royal-accent) 0%, transparent 50%);
        }

        /* Header */
        .royal-header {
            text-align: center;
            padding: 30px 20px;
            width: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
            border-bottom: 2px solid var(--royal-gold);
            position: relative;
            margin-bottom: 30px;
        }

        .royal-header::before, .royal-header::after {
            content: '';
            position: absolute;
            top: 10px;
            width: 60px;
            height: 60px;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50,5 L60,40 L95,40 L65,60 L75,95 L50,75 L25,95 L35,60 L5,40 L40,40 Z" fill="%23ffd700" /></svg>');
            background-repeat: no-repeat;
            background-position: center;
            background-size: contain;
            opacity: 0.7;
        }

        .royal-header::before {
            left: 20px;
        }

        .royal-header::after {
            right: 20px;
            transform: scaleX(-1);
        }

        .crown-icon {
            font-size: 3rem;
            color: var(--royal-gold);
            margin-bottom: 15px;
            text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
            animation: crownGlow 3s infinite alternate;
        }

        @keyframes crownGlow {
            0% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); }
            100% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1)); }
        }

        .title {
            font-size: 3.5rem;
            color: var(--royal-gold);
            text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
            margin-bottom: 10px;
            letter-spacing: 2px;
            position: relative;
            display: inline-block;
        }

        .title::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 10%;
            width: 80%;
            height: 3px;
            background: linear-gradient(90deg, transparent, var(--royal-gold), transparent);
        }

        .subtitle {
            font-size: 1.2rem;
            color: var(--royal-accent-light);
            max-width: 800px;
            margin: 0 auto;
            line-height: 1.6;
        }

        /* Main container */
        #container {
            width: 95%;
            max-width: 1400px;
            background: radial-gradient(circle at center, rgba(26, 10, 82, 0.9), rgba(15, 5, 41, 0.95));
            border: 3px solid var(--royal-gold);
            border-radius: 25px;
            box-shadow: 
                0 0 40px rgba(138, 109, 233, 0.5),
                inset 0 0 40px rgba(255, 215, 0, 0.1);
            padding: 40px;
            position: relative;
            overflow: hidden;
            margin-bottom: 40px;
        }

        /* Corner decorations */
        .corner-decor {
            position: absolute;
            width: 70px;
            height: 70px;
            z-index: 2;
        }

        .corner-decor.tl {
            top: 0;
            left: 0;
            border-top: 3px solid var(--royal-gold);
            border-left: 3px solid var(--royal-gold);
            border-top-left-radius: 20px;
        }

        .corner-decor.tr {
            top: 0;
            right: 0;
            border-top: 3px solid var(--royal-gold);
            border-right: 3px solid var(--royal-gold);
            border-top-right-radius: 20px;
        }

        .corner-decor.bl {
            bottom: 0;
            left: 0;
            border-bottom: 3px solid var(--royal-gold);
            border-left: 3px solid var(--royal-gold);
            border-bottom-left-radius: 20px;
        }

        .corner-decor.br {
            bottom: 0;
            right: 0;
            border-bottom: 3px solid var(--royal-gold);
            border-right: 3px solid var(--royal-gold);
            border-bottom-right-radius: 20px;
        }

        /* Array container */
        #array-container {
            min-height: 350px;
            background: rgba(15, 5, 41, 0.7);
            border-radius: 20px;
            border: 2px solid var(--royal-accent);
            padding: 30px;
            margin-bottom: 30px;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center;
            gap: 25px;
            position: relative;
            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
        }

        .array-empty-message {
            color: var(--royal-accent-light);
            font-size: 1.5rem;
            text-align: center;
            width: 100%;
            padding: 50px;
            font-style: italic;
        }

        /* Array element styling */
        .array-element {
            width: 120px;
            height: 120px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: linear-gradient(145deg, var(--royal-gold), #d4af37);
            border-radius: 15px;
            color: var(--royal-blue);
            font-weight: bold;
            font-size: 1.8rem;
            box-shadow: 
                0 8px 20px rgba(0, 0, 0, 0.3),
                inset 0 2px 5px rgba(255, 255, 255, 0.4);
            transition: all 0.3s ease;
            position: relative;
            border: 3px solid transparent;
        }

        .array-element::before {
            content: '';
            position: absolute;
            top: -5px;
            left: -5px;
            right: -5px;
            bottom: -5px;
            border-radius: 18px;
            background: linear-gradient(145deg, var(--royal-gold), var(--royal-accent));
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .array-element:hover::before {
            opacity: 1;
        }

        .array-element.active {
            transform: scale(1.1);
            border-color: var(--royal-accent);
            box-shadow: 
                0 0 30px rgba(138, 109, 233, 0.7),
                inset 0 2px 5px rgba(255, 255, 255, 0.4);
        }

        .array-element.inserting {
            animation: insertPulse 0.8s ease-out;
        }

        .array-element.updating {
            animation: updatePulse 0.8s ease-out;
        }

        .array-element.deleting {
            animation: deletePulse 0.8s ease-out forwards;
        }

        @keyframes insertPulse {
            0% { transform: scale(0.5); opacity: 0; }
            70% { transform: scale(1.1); }
            100% { transform: scale(1); opacity: 1; }
        }

        @keyframes updatePulse {
            0% { background: linear-gradient(145deg, #ff6b6b, #ee5a24); }
            100% { background: linear-gradient(145deg, var(--royal-gold), #d4af37); }
        }

        @keyframes deletePulse {
            0% { transform: scale(1); opacity: 1; }
            100% { transform: scale(0); opacity: 0; }
        }

        .element-index {
            position: absolute;
            top: -25px;
            font-size: 1.1rem;
            color: var(--royal-gold-light);
            font-weight: bold;
            background: rgba(26, 10, 82, 0.9);
            padding: 3px 10px;
            border-radius: 10px;
            border: 1px solid var(--royal-accent);
        }

        .element-value {
            font-size: 2.2rem;
            font-weight: bold;
        }

        /* Controls container */
        .container-footer {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            justify-content: center;
            align-items: center;
            background: rgba(74, 58, 138, 0.3);
            border-radius: 20px;
            padding: 30px;
            border: 2px solid var(--royal-accent);
        }

        /* Input styling */
        .royal-input {
            padding: 15px 20px;
            border-radius: 12px;
            border: 2px solid var(--royal-gold);
            background: rgba(255, 255, 255, 0.1);
            color: var(--royal-text);
            font-size: 1.1rem;
            min-width: 180px;
            transition: all 0.3s;
            box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
        }

        .royal-input:focus {
            outline: none;
            border-color: var(--royal-accent);
            box-shadow: 0 0 15px rgba(138, 109, 233, 0.5);
            background: rgba(255, 255, 255, 0.15);
        }

        .royal-input::placeholder {
            color: #b5a8ff;
        }

        /* Button styling */
        .royal-button {
            padding: 16px 30px;
            border-radius: 12px;
            border: none;
            background: linear-gradient(145deg, var(--royal-gold), #d4af37);
            color: var(--royal-blue);
            font-weight: bold;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            min-width: 180px;
        }

        .royal-button:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
            background: linear-gradient(145deg, #fff, var(--royal-gold));
        }

        .royal-button:active {
            transform: translateY(-2px);
        }

        .royal-button i {
            font-size: 1.2rem;
        }

        /* Specific button colors */
        #insert-button {
            background: linear-gradient(145deg, #4CAF50, #2E7D32);
            color: white;
        }

        #insert-button:hover {
            background: linear-gradient(145deg, #66BB6A, #388E3C);
        }

        #update-button {
            background: linear-gradient(145deg, #2196F3, #0D47A1);
            color: white;
        }

        #update-button:hover {
            background: linear-gradient(145deg, #42A5F5, #1565C0);
        }

        #delete-button {
            background: linear-gradient(145deg, #f44336, #b71c1c);
            color: white;
        }

        #delete-button:hover {
            background: linear-gradient(145deg, #EF5350, #C62828);
        }

        #random-generate-button {
            background: linear-gradient(145deg, #9C27B0, #6A1B9A);
            color: white;
        }

        #random-generate-button:hover {
            background: linear-gradient(145deg, #AB47BC, #7B1FA2);
        }

        /* Stats panel */
        .stats-panel {
            display: flex;
            justify-content: space-around;
            background: rgba(26, 10, 82, 0.7);
            border-radius: 20px;
            padding: 20px;
            margin-top: 30px;
            border: 2px solid var(--royal-accent);
            flex-wrap: wrap;
            gap: 20px;
        }

        .stat-box {
            text-align: center;
            padding: 15px 25px;
            background: rgba(74, 58, 138, 0.5);
            border-radius: 15px;
            min-width: 180px;
        }

        .stat-value {
            font-size: 2.5rem;
            font-weight: bold;
            color: var(--royal-gold);
            margin-bottom: 5px;
        }

        .stat-label {
            color: #d0c5ff;
            font-size: 1rem;
        }

        /* Instructions */
        .instructions {
            background: rgba(26, 10, 82, 0.7);
            border-radius: 20px;
            padding: 25px;
            margin-top: 30px;
            border: 2px solid var(--royal-accent);
            max-width: 800px;
            width: 95%;
        }

        .instructions h3 {
            color: var(--royal-gold);
            margin-bottom: 15px;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .instructions h3 i {
            color: var(--royal-gold);
        }

        .instructions p {
            color: #d0c5ff;
            margin-bottom: 15px;
            line-height: 1.6;
        }

        .instructions ul {
            color: #d0c5ff;
            padding-left: 20px;
            line-height: 1.6;
        }

        .instructions li {
            margin-bottom: 10px;
        }

        .instructions strong {
            color: var(--royal-gold-light);
        }

        /* Footer */
        .royal-footer {
            margin-top: 40px;
            text-align: center;
            color: #b5a8ff;
            font-size: 1rem;
            padding: 25px;
            width: 100%;
            border-top: 1px solid rgba(255, 215, 0, 0.3);
            background: rgba(15, 5, 41, 0.5);
        }

        .royal-footer a {
            color: var(--royal-gold);
            text-decoration: none;
            transition: color 0.3s;
        }

        .royal-footer a:hover {
            color: white;
            text-decoration: underline;
        }

        /* Back button */
        .back-button {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 100;
        }

        .back-btn {
            display: flex;
            align-items: center;
            color: var(--royal-gold);
            text-decoration: none;
            font-weight: bold;
            padding: 12px 20px;
            background: rgba(26, 10, 82, 0.8);
            border-radius: 10px;
            border: 2px solid var(--royal-gold);
            transition: all 0.3s;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(5px);
        }

        .back-btn:hover {
            background: rgba(255, 215, 0, 0.2);
            transform: translateX(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
        }

        .back-btn i {
            margin-right: 10px;
            font-size: 1.2rem;
        }

        /* Responsive design */
        @media (max-width: 1200px) {
            #container {
                padding: 30px;
            }
            
            .title {
                font-size: 3rem;
            }
            
            .array-element {
                width: 100px;
                height: 100px;
            }
            
            .element-value {
                font-size: 2rem;
            }
        }

        @media (max-width: 992px) {
            .container-footer {
                flex-direction: column;
                align-items: stretch;
            }
            
            .royal-input, .royal-button {
                width: 100%;
            }
            
            .title {
                font-size: 2.5rem;
            }
            
            .subtitle {
                font-size: 1.1rem;
            }
        }

        @media (max-width: 768px) {
            #container {
                padding: 20px;
            }
            
            .title {
                font-size: 2rem;
            }
            
            .crown-icon {
                font-size: 2.5rem;
            }
            
            .royal-header::before, .royal-header::after {
                width: 40px;
                height: 40px;
            }
            
            .array-element {
                width: 80px;
                height: 80px;
            }
            
            .element-value {
                font-size: 1.8rem;
            }
            
            .stat-box {
                min-width: 140px;
            }
            
            .stat-value {
                font-size: 2rem;
            }
        }

        @media (max-width: 480px) {
            .title {
                font-size: 1.8rem;
            }
            
            .crown-icon {
                font-size: 2rem;
            }
            
            .royal-header {
                padding: 20px 10px;
            }
            
            .array-element {
                width: 70px;
                height: 70px;
            }
            
            .element-value {
                font-size: 1.5rem;
            }
            
            .back-btn {
                padding: 10px 15px;
                font-size: 0.9rem;
            }
        }

        /* Scrollbar styling */
        ::-webkit-scrollbar {
            width: 12px;
        }

        ::-webkit-scrollbar-track {
            background: var(--royal-blue);
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(var(--royal-gold), var(--royal-accent));
            border-radius: 6px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(var(--royal-gold-light), var(--royal-accent-light));
        }