/* Import Glancyr font - fallback to system fonts */
@import url('https://fonts.cdnfonts.com/css/glancyr');

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

:root {
    --primary: #54EFEA;
    --dark-teal: #022C31;
    --background: #000000;
    --white: #FFFFFF;
    --neutral-300: #D4D4D4;
    --neutral-400: #A3A3A3;
    --neutral-600: #525252;
}

body {
    font-family: 'Glancyr', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 20px 100px 20px;
    position: relative;
    overflow-x: hidden;
}

/* Background pattern effect similar to Checkmate website */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(84, 239, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(84, 239, 234, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    background: rgba(2, 44, 49, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(84, 239, 234, 0.2);
    border-radius: 24px;
    padding: 48px;
    max-width: 700px;
    width: 100%;
    position: relative;
    z-index: 1;
    box-shadow: 
        0 0 40px rgba(84, 239, 234, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

.header {
    text-align: center;
    margin-bottom: 48px;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.logo {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 20px rgba(84, 239, 234, 0.5));
}

.logo.checkmark {
    width: 100px;
    height: 100px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.title {
    font-family: 'Tektur', monospace;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--white);
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--white) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-family: 'Glancyr', sans-serif;
    font-size: 20px;
    font-weight: 300;
    color: var(--neutral-300);
    line-height: 1.8;
}

/* Lore Section */
.lore-section {
    text-align: center;
    margin: 48px 0;
    padding: 32px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(84, 239, 234, 0.15);
    border-radius: 16px;
    position: relative;
}

.lore-title {
    margin-bottom: 32px;
}

.lore-title h2 {
    font-family: 'Tektur', monospace;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    min-height: 38px;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: var(--primary);
    margin-left: 4px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

.lore-text {
    font-family: 'Glancyr', serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.8;
    color: var(--neutral-300);
    margin-bottom: 32px;
    font-style: italic;
}

.lore-text p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.highlight {
    color: var(--primary);
    font-weight: 600;
    font-family: 'Tektur', monospace;
    text-shadow: 0 0 10px rgba(84, 239, 234, 0.5);
}

.upload-section {
    text-align: center;
    margin: 40px 0 32px;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-cta-btn {
    font-family: 'Tektur', monospace;
    display: inline-block;
    padding: 24px 48px;
    background: rgba(84, 239, 234, 0.05);
    border: 2px solid rgba(84, 239, 234, 0.3);
    border-radius: 12px;
    cursor: pointer;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--white);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    min-height: 70px;
    min-width: 500px;
}

.upload-cta-btn span {
    display: inline-block;
}

.upload-cta-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 0 40px rgba(84, 239, 234, 0.5);
    background: rgba(84, 239, 234, 0.15);
}

.upload-cta-btn:active {
    transform: scale(1.02);
}

/* Loading Bar */
.loading-bar-container {
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #089499 100%);
    animation: loadingSweepFast 3.5s ease-in-out forwards;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(84, 239, 234, 0.6);
}

@keyframes loadingSweep {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

@keyframes loadingSweepFast {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Tektur', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    z-index: 10;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(84, 239, 234, 0.5);
    letter-spacing: 1px;
}

.preview-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.canvas-wrapper {
    display: none;
    justify-content: center;
    margin-bottom: 32px;
}

canvas {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    border: 2px solid rgba(84, 239, 234, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(84, 239, 234, 0.2);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.controls {
    display: none;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(84, 239, 234, 0.15);
    border-radius: 16px;
    padding: 32px;
}

.edit-panel {
    background: rgba(84, 239, 234, 0.05);
    border: 2px solid rgba(84, 239, 234, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edit-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    height: 40px;
}

.edit-control label {
    font-family: 'Tektur', monospace;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 1px;
    width: 160px;
    flex-shrink: 0;
}

.slider {
    width: 240px;
    height: 6px;
    border-radius: 3px;
    background: rgba(84, 239, 234, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(84, 239, 234, 0.6);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(84, 239, 234, 0.8);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(84, 239, 234, 0.6);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(84, 239, 234, 0.8);
}

.edit-control span {
    font-family: 'Tektur', monospace;
    font-size: 12px;
    color: var(--neutral-400);
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.reset-btn {
    font-family: 'Tektur', monospace;
    width: 100%;
    padding: 12px;
    background: rgba(84, 239, 234, 0.1);
    border: 1px solid rgba(84, 239, 234, 0.3);
    border-radius: 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: rgba(84, 239, 234, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(84, 239, 234, 0.4);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.edit-btn,
.download-btn,
.share-btn {
    font-family: 'Tektur', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
}

.edit-btn {
    background: linear-gradient(135deg, rgba(84, 239, 234, 0.4) 0%, rgba(84, 239, 234, 0.2) 100%);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 20px rgba(84, 239, 234, 0.2);
}

.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(84, 239, 234, 0.4);
    background: linear-gradient(135deg, rgba(84, 239, 234, 0.5) 0%, rgba(84, 239, 234, 0.3) 100%);
}

.edit-btn:active {
    transform: translateY(0px);
}

.download-btn,
.share-btn {
    font-family: 'Tektur', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
}

.download-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #089499 100%);
    color: var(--background);
    box-shadow: 0 4px 20px rgba(84, 239, 234, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(84, 239, 234, 0.5);
}

.download-btn:active {
    transform: translateY(0px);
}

.share-btn {
    background: linear-gradient(135deg, #1DA1F2 0%, #0C7ABF 100%);
    color: var(--white);
    box-shadow: 0 4px 20px rgba(29, 161, 242, 0.3);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(29, 161, 242, 0.5);
}

.share-btn:active {
    transform: translateY(0px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 32px 24px;
    }

    .title {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    .lore-section {
        padding: 24px 16px;
        margin: 32px 0;
    }

    .lore-title h2 {
        font-size: 24px;
    }

    .lore-text {
        font-size: 16px;
    }

    .upload-cta-btn {
        padding: 18px 32px;
        font-size: 18px;
        letter-spacing: 2px;
        min-width: 350px;
        min-height: 60px;
    }

    .edit-panel {
        padding: 16px;
    }

    .edit-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        height: auto;
        margin-bottom: 12px;
    }

    .edit-control label {
        width: 100%;
    }

    .slider {
        width: 100%;
    }

    .edit-control span {
        width: 100%;
        text-align: left;
    }

    .controls {
        padding: 24px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .edit-btn,
    .download-btn,
    .share-btn {
        padding: 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 24px;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    .upload-cta-btn {
        min-width: 280px;
        min-height: 55px;
        padding: 16px 24px;
        font-size: 16px;
        letter-spacing: 1.5px;
    }

}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 60px;
    background: transparent;
    z-index: 100;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

.footer-copyright {
    font-family: 'Glancyr', sans-serif;
    font-size: 11px;
    font-weight: 300;
    line-height: 18px;
    color: rgba(255, 255, 255, 0.4);
}

.footer-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    border-radius: 4px;
}

.social-link:hover {
    color: var(--primary);
    background: rgba(84, 239, 234, 0.1);
    transform: translateY(-2px);
}

.social-link svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .footer {
        padding: 16px 24px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-copyright {
        font-size: 10px;
    }
    
    .footer-links {
        gap: 12px;
    }
}

