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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: #16213e;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #00d9ff;
    font-size: 2rem;
}

.section {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #aaa;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #2a3f5f;
    border-radius: 8px;
    background: #0f0f23;
    color: #eee;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #00d9ff;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row input {
    flex: 1;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: #2a3f5f;
    color: #eee;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:hover:not(:disabled) {
    background: #3a5080;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button.primary {
    width: 100%;
    background: #00d9ff;
    color: #1a1a2e;
    font-weight: 600;
    padding: 15px;
    font-size: 1.1rem;
}

button.primary:hover:not(:disabled) {
    background: #00b8d9;
}

button.primary.cancel {
    background: #dc2626;
}

button.primary.cancel:hover:not(:disabled) {
    background: #b91c1c;
}

button.secondary {
    background: #2a3f5f;
    color: #aaa;
}

button.secondary:hover:not(:disabled) {
    background: #3a5080;
    color: #eee;
}

.button-row {
    display: flex;
    gap: 10px;
}

.button-row .secondary {
    flex: 0 0 auto;
}

.button-row .primary {
    flex: 1;
}

.hidden {
    display: none !important;
}

/* Thumbnail */
#thumbnail-container {
    text-align: center;
    margin-bottom: 20px;
}

#thumbnail {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

/* Badge system */
.field-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 50px;
    padding: 10px;
    background: #0f0f23;
    border: 2px solid #2a3f5f;
    border-radius: 8px;
    margin-bottom: 8px;
}

.field-container input[type="text"] {
    flex: 1;
    min-width: 120px;
    border: none;
    background: transparent;
    padding: 5px;
}

.badge-field {
    display: contents;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background: #2a3f5f;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    user-select: none;
}

.badge:hover {
    transform: scale(1.05);
}

.badge.in-field {
    background: #00d9ff;
    color: #1a1a2e;
}

.available-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-left: 5px;
}

.available-label {
    font-size: 0.8rem;
    color: #666;
    margin-right: 5px;
}

.badge-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Status messages */
#status-message {
    padding: 15px;
    border-radius: 8px;
    background: #2a3f5f;
    text-align: center;
}

#status-message.success {
    background: #1a4d2e;
    color: #4ade80;
}

#status-message.error {
    background: #4d1a1a;
    color: #f87171;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

button .btn-text {
    vertical-align: middle;
}

/* Progress bar */
#progress-container {
    margin-bottom: 15px;
}

#progress-bar {
    width: 100%;
    height: 20px;
    background: #0f0f23;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #2a3f5f;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00d9ff, #00b8d9);
    border-radius: 8px;
    transition: width 0.3s ease;
}

#progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #aaa;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .input-row {
        flex-direction: column;
    }
}
