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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e8e8e8;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    border-bottom: 2px solid #d4af37;
}

.title {
    font-size: 2.5rem;
    color: #d4af37;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    font-weight: bold;
}

.subtitle {
    font-size: 1.1rem;
    color: #a8a8a8;
    margin-bottom: 20px;
}

.current-index {
    font-size: 1.3rem;
    color: #d4af37;
    font-weight: bold;
    background: rgba(212, 175, 55, 0.1);
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.canvas-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#pixel-canvas {
    border: 3px solid #d4af37;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.canvas-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    width: 100%;
    max-width: 300px;
}

.pattern-analysis {
    display: grid;
    gap: 10px;
}

.pattern-analysis div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Controls */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.nav-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sequential-nav {
    display: flex;
    gap: 10px;
}

.jump-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input-section label {
    color: #d4af37;
    font-weight: bold;
}

#index-input {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 1px solid #d4af37;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
    font-family: 'Courier New', monospace;
}

#index-input:focus {
    outline: none;
    border-color: #f4d03f;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.presets {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.presets h3 {
    color: #d4af37;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.rgb-values {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.rgb-values h3 {
    color: #d4af37;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.rgb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.rgb-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.rgb-text {
    color: #a8a8a8;
    text-align: center;
    font-size: 0.7rem;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: 2px solid #d4af37;
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #d4af37;
    color: #1a1a2e;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.btn-primary:hover {
    background: #f4d03f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-preset {
    margin: 5px;
    flex: 1;
    min-width: 120px;
}

/* Bookmarks */
.bookmarks-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 40px;
}

.bookmarks-section h3 {
    color: #d4af37;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bookmark-name {
    flex: 1;
    color: #e8e8e8;
    font-weight: bold;
}

.bookmark-index {
    color: #a8a8a8;
    font-size: 0.9rem;
}

.bookmark-load,
.bookmark-delete {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.bookmark-delete {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff4444;
    color: #ff4444;
}

.bookmark-delete:hover {
    background: rgba(255, 0, 0, 0.2);
}

/* Quote Toast */
.quote-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(212, 175, 55, 0.95);
    color: #1a1a2e;
    padding: 15px 20px;
    border-radius: 8px;
    font-style: italic;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    color: #a8a8a8;
}

.footer a {
    color: #d4af37;
    text-decoration: none;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .sequential-nav,
    .jump-controls,
    .actions {
        flex-direction: column;
    }
    
    .input-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    #index-input {
        min-width: unset;
    }
    
    .bookmark-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .bookmark-name,
    .bookmark-index {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    #pixel-canvas {
        width: 250px;
        height: 250px;
    }
    
    .quote-toast {
        left: 20px;
        right: 20px;
        max-width: unset;
    }
}