:root { 
    --ocean: #051622; 
    --gold: #deb887; 
    --aqua: #1ba098; 
    --white: #ced7d8; 
}

body { 
    font-family: 'Segoe UI', Tahoma, sans-serif; 
    background: var(--ocean); 
    color: var(--white); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 20px; 
    margin: 0; 
}

.container { 
    max-width: 1400px; 
    width: 100%; 
}

/* Desktop layout: side-by-side */
@media (min-width: 1024px) {
    .main-content {
        display: grid;
        grid-template-columns: 1fr 550px;
        gap: 30px;
        align-items: start;
    }
    
    .left-panel {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .right-panel {
        position: sticky;
        top: 20px;
    }
    
    .result-area {
        margin-top: 0 !important;
    }
}

/* Mobile layout: stacked */
@media (max-width: 1023px) {
    .main-content {
        display: block;
    }
}

h2 { 
    color: var(--aqua); 
    text-align: center; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    margin-bottom: 10px; 
}

.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--aqua);
}

.tab-btn {
    background: transparent;
    color: var(--white);
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: 0.2s;
}

.tab-btn:hover {
    color: var(--aqua);
}

.tab-btn.active {
    color: var(--aqua);
    border-bottom-color: var(--aqua);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section { 
    background: #0b2c3d; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 15px;
    border: 1px solid var(--aqua); 
}

.frame-controls .section {
    margin-bottom: 15px;
}

.frame-controls .section:last-child {
    margin-bottom: 0;
}

.style-controls { 
    display: flex; 
    gap: 20px; 
    margin-top: 10px; 
    font-size: 14px; 
    flex-wrap: wrap; 
}

.style-group { 
    flex: 1; 
    min-width: 150px; 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
}

input, textarea, select { 
    width: 100%; 
    padding: 10px; 
    margin-top: 5px; 
    background: #123c52; 
    color: white; 
    border: 1px solid #1ba098; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 14px; 
}

textarea {
    min-height: 150px;
}

input[type="range"] { 
    cursor: pointer; 
    height: 8px; 
    background: #123c52; 
    border: none; 
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--aqua);
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--aqua);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.scroll-box { 
    height: 380px;
    overflow-y: auto; 
    border: 1px solid #1ba09833; 
    border-radius: 8px; 
    margin-bottom: 15px;
    background: rgba(0,0,0,0.2); 
    resize: vertical; 
    min-height: 150px; 
}

table { 
    width: 100%; 
    border-collapse: collapse; 
}

th { 
    position: sticky; 
    top: 0; 
    background: #123c52; 
    color: var(--gold); 
    padding: 12px; 
    text-align: left; 
    z-index: 10; 
}

td { 
    padding: 10px; 
    border-bottom: 1px solid #1ba09833; 
    cursor: pointer; 
    font-size: 13px; 
}

tr:hover { 
    background: rgba(27, 160, 152, 0.2); 
}

tr.active { 
    background: rgba(27, 160, 152, 0.4); 
    border-left: 5px solid var(--gold); 
}

.btn-main { 
    background: var(--gold); 
    color: #051622; 
    border: none; 
    padding: 16px 24px;
    width: 100%; 
    font-weight: bold; 
    cursor: pointer; 
    margin-top: 15px; 
    border-radius: 4px; 
    font-size: 16px; 
    transition: 0.2s;
    box-sizing: border-box;
}

.btn-secondary {
    background: #123c52;
    color: var(--aqua);
    border: 1px solid var(--aqua);
    padding: 16px 24px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 16px;
    transition: 0.2s;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-secondary:hover {
    background: #1a4e68;
}

.btn-download { 
    background: var(--aqua); 
    color: white; 
    border: none; 
    padding: 16px 24px;
    width: 100%; 
    font-weight: bold; 
    cursor: pointer; 
    margin-top: 15px; 
    border-radius: 4px; 
    font-size: 16px;
    display: none;
    box-sizing: border-box;
}

.btn-randomize {
    background: var(--aqua);
    color: white;
    border: none;
    padding: 10px 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    transition: 0.2s;
}

.btn-randomize:hover {
    background: #158d85;
}

.result-area { 
    margin-top: 30px;
    text-align: center; 
    padding-bottom: 50px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.frame-controls {
    margin-bottom: 0;
    padding-bottom: 20px;
}

#preview-canvas {
    display: none;
    background: repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 50% / 20px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.loader { 
    display: none; 
    color: var(--gold); 
    margin: 20px 0; 
    font-weight: bold; 
    animation: pulse 1.5s infinite; 
}

@keyframes pulse { 
    0% { opacity: 0.5; } 
    50% { opacity: 1; } 
    100% { opacity: 0.5; } 
}
