@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #000000;
    --primary-hover: #1a1a1a;
    --accent: #d4af37;
    --accent-hover: #c19b2b;
    --bg-dark: #0a0a0a;
    --bg-gradient: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2d2d2d 100%);
    --surface: rgba(255, 255, 255, 0.98);
    --text-main: #0a0a0a;
    --text-muted: #6b7280;
    --text-light: #ffffff;
    --radius: 24px;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 35px 60px -15px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('img/logo.png') no-repeat center center;
    background-size: 50%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Animated particles background */
body::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.container {
    width: 100%;
    max-width: 900px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(212, 175, 55, 0.1);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Elegant header */
header {
    padding: 50px 30px;
    text-align: center;
    background: linear-gradient(180deg, #000000 0%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

header img {
    max-width: 220px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.3));
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {

    0%,
    100% {
        filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.3));
    }

    50% {
        filter: drop-shadow(0 4px 20px rgba(212, 175, 55, 0.5));
    }
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-light);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
}

header p {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.content {
    padding: 50px 40px;
}

/* Steps Transition */
.step {
    display: none;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.step.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Titles */
.step h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 35px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.step h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 2px;
}

/* Character Selection */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.char-card {
    background: white;
    border: 2px solid #f1f5f9;
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.char-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.char-card:hover::before {
    transform: scaleX(1);
}

.char-card:hover {
    border-color: var(--accent);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(212, 175, 55, 0.2);
}

.char-img-container {
    width: 100%;
    height: 220px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin-bottom: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.char-img-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 40%, rgba(212, 175, 55, 0.05) 100%);
    pointer-events: none;
}

.char-img-container img {
    height: 120%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.char-card:hover .char-img-container img {
    transform: scale(1.15) rotate(2deg);
}

.char-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.char-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Forms */
.form-group {
    margin-bottom: 28px;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.05rem;
}

input[type="text"] {
    width: 100%;
    padding: 18px 20px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    outline: none;
    font-size: 1.05rem;
    transition: all 0.3s;
    background: white;
}

input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.upload-box {
    border: 2px dashed #d1d5db;
    border-radius: 18px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.upload-box:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.upload-box.has-image {
    border-style: solid;
    border-color: var(--accent);
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e1 100%);
}

.preview-img {
    max-height: 250px;
    border-radius: 14px;
    margin-top: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 20px;
    border-radius: 16px;
    border: none;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #2d2d2d 100%);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    position: relative;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent) 0%, #c19b2b 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.4);
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled::after,
.btn-primary:disabled::before {
    display: none;
}

.btn-secondary {
    background: white;
    border: 2px solid #e5e7eb;
    color: var(--text-main);
    margin-top: 15px;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: var(--text-main);
}

/* Loading */
.loader-container {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 6px solid #f1f5f9;
    border-top: 6px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    margin: 0 auto 35px;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-msg {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

/* Result */
.result-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
    margin-bottom: 35px;
    border: 3px solid var(--accent);
}

.actions {
    display: flex;
    gap: 15px;
}

.actions .btn {
    flex: 1;
}

/* Back Button */
.back-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(212, 175, 55, 0.2);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transition: all 0.3s;
}

.back-btn:hover {
    background: white;
    border-color: var(--accent);
    transform: translateX(-3px);
}

/* Error */
.error-msg {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    color: #be123c;
    padding: 18px 20px;
    border-radius: 14px;
    border: 2px solid #fda4af;
    margin-bottom: 28px;
    display: none;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

footer {
    padding: 25px;
    text-align: center;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    border-top: 1px solid #e5e7eb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--accent);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    padding: 40px 40px 30px;
    background: linear-gradient(180deg, #000000 0%, #1a1a1a 100%);
    border-bottom: 2px solid var(--accent);
}

.modal-header img {
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.4));
}

.modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.modal-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
}

.modal-body {
    padding: 35px 40px 40px;
}

.contest-instructions {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e1 100%);
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
}

.contest-instructions h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 15px;
}

.contest-instructions ol {
    margin-left: 20px;
    color: var(--text-main);
}

.contest-instructions li {
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.contest-instructions strong {
    color: var(--primary);
    font-weight: 700;
}

.contest-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    padding: 18px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.contest-checkbox:has(input:checked) {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e1 100%);
    border-color: var(--accent);
}

.contest-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--accent);
    margin-top: 2px;
}

.contest-checkbox label {
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
    cursor: pointer;
    line-height: 1.5;
}

.contest-disclaimer {
    margin-top: 25px;
    padding: 15px;
    background: #f1f5f9;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .content {
        padding: 35px 25px;
    }

    .character-grid {
        grid-template-columns: 1fr;
    }

    .step h2 {
        font-size: 1.6rem;
    }
}