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

body {
    background: #0a0a0f;
    color: #c8c8d0;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    min-height: 100vh;
}

header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #1a1a2e;
}

header h1 {
    font-size: 2rem;
    color: #e0e0e8;
    letter-spacing: 0.1em;
    font-weight: normal;
}

.subtitle {
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

nav {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

nav button {
    background: none;
    border: 1px solid #2a2a3e;
    color: #888;
    padding: 0.4rem 1.2rem;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

nav button:hover, nav button.active {
    border-color: #4a4a6e;
    color: #e0e0e8;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Gallery */
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid #1a1a2e;
    transition: border-color 0.2s;
}

.gallery-item:hover {
    border-color: #3a3a5e;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.gallery-item .item-info {
    padding: 0.6rem;
    font-size: 0.75rem;
    background: #0f0f18;
}

.gallery-item .item-algo {
    color: #7a7a9a;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

.gallery-item .item-seed {
    color: #a0a0b8;
    margin-top: 0.2rem;
}

.gallery-item .item-time {
    color: #555;
    font-size: 0.65rem;
    margin-top: 0.2rem;
}

.loading, .empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #444;
}

/* Generate Form */
#generate-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    background: #0f0f18;
    border: 1px solid #2a2a3e;
    color: #c8c8d0;
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group input:focus {
    border-color: #4a4a6e;
}

.hint {
    color: #555;
    font-size: 0.75rem;
    margin-top: 0.3rem;
}

.dim-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dim-row input {
    width: 120px !important;
}

.dim-row span {
    color: #555;
}

#params-container .form-group {
    margin-bottom: 1rem;
}

#params-container label {
    font-size: 0.75rem;
}

#params-container input {
    width: 100%;
    background: #0f0f18;
    border: 1px solid #2a2a3e;
    color: #c8c8d0;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.85rem;
}

#submit-btn {
    width: 100%;
    background: #1a1a2e;
    border: 1px solid #3a3a5e;
    color: #c8c8d0;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

#submit-btn:hover {
    background: #2a2a3e;
    border-color: #5a5a7e;
}

#submit-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Submit result */
#submit-result {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.result-msg {
    color: #7a7a9a;
    margin-bottom: 1rem;
}

.result-id {
    font-size: 0.85rem;
    color: #555;
}

.result-id a {
    color: #6a6a9a;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #2a2a3e;
    border-top-color: #6a6a9a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#result-thumb {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid #2a2a3e;
    margin-top: 1rem;
}

/* Queue view */
#queue-status {
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

#queue-status h3 {
    color: #6a6a8a;
    font-weight: normal;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-top: 1.5rem;
}

#queue-status p {
    color: #555;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    max-width: 900px;
    width: 100%;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: -2rem;
    right: 0;
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: #aaa;
}

.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    border: 1px solid #2a2a3e;
}

#modal-details {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #666;
    text-align: left;
    background: #0f0f18;
    padding: 1rem;
    border: 1px solid #1a1a2e;
}

#modal-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    border-bottom: 1px solid #151520;
}

#modal-details .detail-label {
    color: #555;
}

#modal-details .detail-value {
    color: #888;
}

.remix-btn {
    margin-top: 1rem;
    background: #1a1a2e;
    border: 1px solid #3a3a5e;
    color: #a0a0b8;
    padding: 0.5rem 1.5rem;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.remix-btn:hover {
    background: #2a2a3e;
    border-color: #5a5a7e;
    color: #e0e0e8;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #333;
    font-size: 0.75rem;
    border-top: 1px solid #1a1a2e;
    margin-top: 4rem;
}
