* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #D4A843;
    --gold-light: #E8C970;
    --gold-dark: #B8922E;
    --gold-dim: rgba(212, 168, 67, 0.1);
    --gold-glow: rgba(212, 168, 67, 0.3);
    --bg: #08080c;
    --bg-card: rgba(255, 255, 255, 0.02);
    --border: rgba(212, 168, 67, 0.15);
    --text: #e0e0e0;
    --text-dim: #888;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 40px 20px;
    background-image: radial-gradient(circle at 20% 20%, rgba(212, 168, 67, 0.06), transparent 40%),
                      radial-gradient(circle at 80% 80%, rgba(212, 168, 67, 0.04), transparent 40%);
}

.back-home {
    display: inline-block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: color 0.2s;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding-left: 4px;
}

.back-home:hover {
    color: var(--gold);
}

.container {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 80px rgba(212, 168, 67, 0.05);
}

h1 {
    color: var(--text);
    font-weight: 800;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.gold {
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lead {
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.info {
    background: var(--gold-dim);
    border-left: 3px solid var(--gold);
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 28px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--gold);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
}

.plugin-link {
    display: inline-block;
    margin-top: 12px;
    margin-right: 8px;
    padding: 8px 16px;
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.5);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.plugin-link:hover {
    background: #4ade80;
    color: #0a0a0f;
}

.plugin-link.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    border-color: var(--border);
}

.plugin-link.secondary:hover {
    background: var(--gold);
    color: #0a0a0f;
    border-color: var(--gold);
}

.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-weight: 500;
    font-size: 0.95rem;
}

.alert.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.alert.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

label {
    display: block;
    margin: 18px 0 8px;
    font-weight: 600;
    color: var(--gold);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="number"],
input[type="file"],
select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 6px 14px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--gold);
    color: #0a0a0f;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23D4A843' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

select option {
    background: #1a1a22;
    color: var(--text);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .row {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 24px;
    }

    h1 {
        font-size: 1.5rem;
    }
}

button[type="submit"] {
    width: 100%;
    margin-top: 28px;
    padding: 16px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
    color: #0a0a0f;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(212, 168, 67, 0.25);
    font-family: inherit;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 168, 67, 0.45);
}

button[type="submit"]:active {
    transform: translateY(0);
}

.footer {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.7;
}

.footer code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gold);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
}

.footer ul {
    padding-left: 22px;
    margin-top: 8px;
}

.footer li {
    margin: 6px 0;
}

.footer p strong {
    color: var(--gold);
}

/* ===== Prévisualisation 3D ===== */
.preview-section {
    margin-top: 28px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.preview-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 14px;
}

.preview-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.preview-skin-label {
    margin: 0;
    font-size: 0.75rem;
    flex: 0 0 auto;
}

.preview-toolbar input[type="file"] {
    flex: 1 1 220px;
    width: auto;
}

.preview-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.preview-buttons button {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.preview-buttons button:hover {
    background: var(--gold);
    color: #0a0a0f;
}

.preview-wrapper {
    position: relative;
    width: 100%;
    height: 480px;
    background:
        radial-gradient(circle at 50% 30%, rgba(212, 168, 67, 0.08), transparent 60%),
        #050508;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

#preview-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

#preview-canvas:active {
    cursor: grabbing;
}

.preview-status {
    position: absolute;
    left: 12px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    pointer-events: none;
}

.preview-controls-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .preview-wrapper { height: 380px; }
    .preview-buttons { margin-left: 0; width: 100%; }
    .preview-buttons button { flex: 1; }
}
