html, body {
  overflow: hidden;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

#renderCanvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}

#renderCanvasEditorPreview {
  width: 100%;
  height: 100%;
  touch-action: none;
}

body {
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
    font-family: 'Comic Neue', cursive;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    color: #333;
    overflow-y: auto;
    overflow-x: hidden;
}

.page-header {
    background: linear-gradient(45deg, #2E7D32, #388E3C);
    color: white;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border: 4px solid #1B5E20;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    pointer-events: none;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.logo-section {
    flex: 0 0 80px;
}

.lego-logo {
    width: 60px;
    height: 60px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.title-section {
    flex: 1;
    text-align: center;
    margin: 0 20px;
}

.title-section h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 3.8em;
    font-weight: bold;
    text-shadow: 4px 4px 0px #1B5E20;
    margin-bottom: 10px;
    letter-spacing: 3px;
    color: #FFD700;
    -webkit-text-stroke: 2px #1B5E20;
}

.title-image {
    max-width: 100%;
    height: auto;
    max-height: 160px;
    margin-bottom: 10px;
    filter: drop-shadow(3px 3px 0px #1B5E20);
}

.title-section p {
    font-family: 'Comic Neue', cursive;
    font-size: 1.3em;
    margin: 8px 0;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    font-weight: 600;
}

.social-section {
    flex: 0 0 100px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.social-icon {
    display: inline-block;
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    text-align: center;
    line-height: 45px;
    color: white;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
}

.social-icon:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: #FFD700;
}

.panel {
    border-radius: 15px;
    border: 4px solid #2E7D32;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.panel-heading {
    background: linear-gradient(45deg, #2E7D32, #388E3C) !important;
    color: white !important;
    border-radius: 11px 11px 0 0;
    border-bottom: 4px solid #1B5E20;
    padding: 18px;
}

.panel-title {
    font-family: 'Fredoka One', cursive;
    font-weight: bold;
    font-size: 1.4em;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    color: #FFD700;
}

.panel-body {
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    font-family: 'Comic Neue', cursive;
}

.btn {
    border-radius: 12px;
    border: 3px solid #2E7D32;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin: 3px;
    font-family: 'Comic Neue', cursive;
    font-size: 0.95em;
    padding: 10px 20px;
}

.btn-default {
    background: linear-gradient(45deg, #2E7D32, #388E3C);
    color: white;
    border-color: #1B5E20;
}

.btn-default:hover {
    background: linear-gradient(45deg, #1B5E20, #2E7D32);
    color: #FFD700;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.btn-default:active {
    transform: translateY(-1px);
}

.btn-default.disabled {
    background: #ccc;
    border-color: #999;
    color: #666;
}

.btn-group-vertical .btn {
    margin: 2px 0;
    border-radius: 8px;
}

.colorpicker {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    margin: 3px;
    border: 3px solid #2E7D32;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

#renderCanvas, #renderCanvasEditorPreview {
    border: 4px solid #2E7D32;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    height: 600px;
}

.nav-pills > li > a {
    border-radius: 10px;
    border: 3px solid #2E7D32;
    margin: 3px;
    color: #2E7D32;
    font-weight: bold;
    font-family: 'Comic Neue', cursive;
}

.nav-pills > li.active > a {
    background: linear-gradient(45deg, #2E7D32, #388E3C);
    border-color: #1B5E20;
    color: white;
}

.nav-pills > li > a:hover {
    background: linear-gradient(45deg, #1B5E20, #2E7D32);
    color: #FFD700;
}

.shape-picker {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border-color: #2E7D32;
    font-family: 'Comic Neue', cursive;
}

.shape-picker:hover {
    background: linear-gradient(45deg, #45a049, #388E3C);
    color: #FFD700;
}

#load-input-content {
    border: 3px solid #2E7D32;
    border-radius: 10px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.9em;
}

#save-output {
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #2E7D32;
    border-radius: 10px;
    padding: 18px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    max-height: 350px;
    overflow-y: auto;
}

/* Penguin theme colors with better contrast */
#White { background: #FFFFFF; border: 2px solid #ccc; }
#Grey { background: #808080; border: 2px solid #666; }
#Yellow { background: #FFD700; border: 2px solid #FFA000; }
#Red { background: #FF0000; border: 2px solid #CC0000; }
#Lime { background: #32CD32; border: 2px solid #228B22; }
#Blue { background: #0000FF; border: 2px solid #0000CC; }
#OrangeRed { background: #FF4500; border: 2px solid #CC3700; }
#Violet { background: #8A2BE2; border: 2px solid #6A1B9A; }
#Purple { background: #800080; border: 2px solid #660066; }
#MediumTurquoise { background: #48D1CC; border: 2px solid #20B2AA; }
#RoyalBlue { background: #4169E1; border: 2px solid #3151B0; }
#Navy { background: #000080; border: 2px solid #000066; }
#GreenYellow { background: #ADFF2F; border: 2px solid #9ACD32; }
#Green { background: #008000; border: 2px solid #006000; }
#Chocolate { background: #D2691E; border: 2px solid #A0522D; }

/* About section improvements */
.panel-body h4 {
    font-family: 'Fredoka One', cursive;
    color: #2E7D32;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.panel-body h4:first-child {
    margin-top: 0;
}

.panel-body h4 i {
    margin-right: 8px;
    color: #FFD700;
}

.panel-body p {
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1.05em;
}

.share-section {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.1), rgba(56, 142, 60, 0.1));
    border-radius: 12px;
    border: 2px solid rgba(46, 125, 50, 0.3);
}

.share-btn {
    margin: 5px;
    padding: 12px 20px;
    font-size: 0.95em;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #1DA1F2, #0D8BD9);
    border-color: #0D8BD9;
    color: white;
}

.share-btn:hover {
    background: linear-gradient(45deg, #0D8BD9, #0A6BC7);
    color: #FFD700;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 161, 242, 0.4);
}

.share-btn i {
    margin-right: 8px;
}

.token-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    border: 3px solid #2E7D32;
}

.token-info {
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-top: 10px;
}

.token-info h5 {
    font-family: 'Fredoka One', cursive;
    color: #2E7D32;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.token-info p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .title-section h1 {
        font-size: 2.8em;
    }
    
    .title-section p {
        font-size: 1.1em;
    }
    
    .panel-body {
        padding: 20px;
    }
    
    .social-section {
        justify-content: center;
    }
    
    .share-section {
        padding: 15px;
    }
    
    .share-btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
    
    .panel-body h4 {
        font-size: 1.1em;
    }
    
    .panel-body p {
        font-size: 1em;
    }
}

/* Enhanced animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

.btn:hover {
    animation: bounce 0.8s ease;
}

.title-section h1 {
    animation: glow 3s ease-in-out infinite;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #2E7D32;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1B5E20;
}

/* Footer styles */
.footer {
    background: linear-gradient(45deg, #1B5E20, #2E7D32);
    color: white;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 4px solid #FFD700;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    flex: 0 0 180px;
}

.footer-lego-logo {
    width: 150px;
    height: 150px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.footer-text {
    flex: 1;
    text-align: center;
    margin: 0 20px;
}

.footer-text p {
    margin: 5px 0;
    font-family: 'Comic Neue', cursive;
    font-size: 0.95em;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
}

.footer-text p:first-child {
    font-weight: bold;
    font-size: 1.05em;
    color: #FFD700;
}

.footer-social {
    flex: 0 0 100px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.footer-social-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    color: white;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
}

.footer-social-icon:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    color: #FFD700;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-text {
        margin: 0;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer {
        padding: 25px 15px;
    }
}
