@font-face {
    font-family: 'Doto';
    src: url('/fonts/Doto-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: block;
}

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

body {
    background: #000000;
    color: #b0b0b0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    border-bottom: 1px solid #222;
    padding: 1.5rem 3rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.title-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: 0.2rem;
    font-family: 'Doto', 'Courier New', monospace;
    color: #a78bfa;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: #8b5cf6;
}

.twitter-icon {
    color: #a78bfa;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.twitter-icon:hover {
    color: #8b5cf6;
}

.main-container {
    flex: 1;
    display: flex;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem;
    gap: 3rem;
}

.editor-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.upload-area:hover {
    background: #111;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #888;
}

.upload-placeholder p {
    font-size: 1rem;
    text-transform: lowercase;
}

#editorCanvas {
    position: relative;
    cursor: crosshair;
    max-width: 100%;
    max-height: 100%;
}

.attributes-section {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #a78bfa;
    text-transform: lowercase;
    font-family: 'Doto', 'Courier New', monospace;
    letter-spacing: 0.1rem;
}

.attributes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.attribute-item {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 0;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.attribute-item:hover {
    border-color: #444;
    background: #111;
}

.attribute-item.selected {
    border-color: #a78bfa;
}

.attribute-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.overlay {
    position: absolute;
    cursor: move;
    user-select: none;
}

.overlay img {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.overlay.selected {
    outline: 2px dashed #a78bfa;
    outline-offset: 4px;
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #a78bfa;
    border: 1px solid #000;
    cursor: nwse-resize;
}

.resize-handle.bottom-right {
    bottom: -6px;
    right: -6px;
}

.rotate-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #8b5cf6;
    border: 1px solid #000;
    border-radius: 50%;
    cursor: grab;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.rotate-handle:active {
    cursor: grabbing;
}

.download-btn {
    background: #8b5cf6;
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: lowercase;
    font-family: 'Doto', 'Courier New', monospace;
    letter-spacing: 0.1rem;
}

.download-btn:hover {
    background: #a78bfa;
}

.download-btn:active {
    transform: scale(0.98);
}

@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }

    .attributes-section {
        width: 100%;
    }

    .attributes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1.5rem;
    }

    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .main-container {
        padding: 1.5rem;
    }

    .attributes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
