@font-face {
    font-family: 'CustomFont';
    src: url('../../fonts/font.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'CustomFont';
    src: url('../../fonts/bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}



:root {
    --bg: #0d0d0d;
    --card: #141414;
    --card-hover: #1c1c1c;
    --muted: #bfc9df;
    --text: #e9eef8;
    --accent: #5561ff;
    --accent-hover: #6d79ff;
    --border: #222;
    --code-bg: #0f0f10;
    --success: #7fffa1;
    --warning: #ffea73;
    --danger: #ff6b6b;
    --danger-hover: #ff5252;
    --glow: rgba(115, 135, 255, 0.12);
    --pastel-blue: #a8d5ff;
}

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

body {
    font-family: 'CustomFont', Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Wiki Style */
header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

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

.logo {
    font-family: 'CustomFont', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
    font-size: 14px;
    margin-left: 24px;
}

nav a:hover {
    color: var(--text);
}

/* Layout Setup */
.wiki-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    padding: 32px;
    min-height: calc(100vh - 64px);
}

/* Main Content Area */
.wiki-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
}

/* Back Link / Menu */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    width: fit-content;
    margin-bottom: 24px;
}

.back-link:hover {
    color: var(--text);
}

.wiki-content h1 {
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.wiki-content h2.subtitle {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 32px;
    font-weight: 500;
}

.wiki-content h3 {
    font-size: 18px;
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.info-text {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row.full {
    grid-column: 1 / -1;
}

.form-row.inline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: var(--code-bg);
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.form-row label {
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 16px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all .2s;
}

/* Ocultar as setas (spinners) dos campos de número */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-row textarea {
    min-height: 80px;
    resize: vertical;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.5;
}

.form-row input[type="color"] {
    padding: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Rarity Select */
.rarity-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rarity-option {
    flex: 1;
    min-width: 80px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--border);
    background: var(--code-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    font-weight: 600;
    font-size: 13px;
    color: var(--muted);
}

.rarity-option:hover {
    border-color: var(--accent);
    color: var(--text);
}

.rarity-option.common.selected {
    border-color: #ffffff;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.rarity-option.uncommon.selected {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.rarity-option.rare.selected {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.rarity-option.epic.selected {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.rarity-option.legendary.selected {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.rarity-option.mythic.selected {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

/* Dynamic Items (Commands) */
.dynamic-item {
    background: var(--code-bg);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
}

.dynamic-item .remove-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all .2s;
}

.dynamic-item .remove-btn:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}

.add-btn {
    width: 100%;
    padding: 14px;
    background: none;
    color: var(--accent);
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-size: 14px;
}

.add-btn:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.generate-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    font-size: 16px;
    margin-top: 32px;
}

.generate-btn:hover {
    background: var(--accent-hover);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 96px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.sidebar-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 16px;
    font-weight: 600;
}

.sidebar-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 16px;
}

/* Creator Box with Yellow Glow */
.creator-box {
    display: flex;
    align-items: center;
    gap: 16px;
}

.creator-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 215, 0, 0.6);
    animation: glowPulse 2.5s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.1); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3); }
}

.creator-info {
    flex: 1;
}

.creator-title {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 4px;
}

.creator-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color .2s;
}

.github-link:hover {
    color: var(--text);
}

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

/* Preview Box Styles */
.preview-container {
    background: var(--code-bg);
    border: 1px dashed var(--border);
    border-radius: 8px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

#glowCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    image-rendering: pixelated;
    z-index: 0;
    pointer-events: none;
}

.preview-container img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    z-index: 1;
    position: relative;
}

.upload-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background: var(--code-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

/* =========================================
   FLOATING CTA BUTTON (Relic Sets)
   ========================================= */
.floating-cta {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--card);
    border: 1px solid rgba(218, 187, 13, 0.637);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(252, 255, 85, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-width: 340px;
}

.floating-cta:hover {
    transform: translateY(-6px);
    background: var(--card-hover);
    box-shadow: 0 15px 40px rgba(0,0,0,0.7), 0 0 30px rgba(255, 244, 85, 0.3);
    border-color: rgba(218, 187, 13, 0.637);
}

.cta-icon {
    background: rgba(255, 244, 85, 0.15);
    color: var(--accent);
    padding: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cta-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cta-text strong {
    font-size: 14px;
    font-weight: 700;
}

.cta-text span {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

/* Responsive */
@media(max-width:1024px) {
    .wiki-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        order: -1;
    }
    .wiki-content {
        padding: 24px;
    }
}

@media(max-width:768px) {
    .floating-cta {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

@media(max-width:640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .rarity-select {
        flex-direction: column;
    }
}