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

:root {
    --primary: #ffb800;
    --primary-dark: #d98b00;
    --secondary: #d986ff;
    --bg: #121013;
    --surface: #1f1821;
    --border: #5a415e;
    --text: #f4e7fd;
    --text-light: #b49ecf;
    --accent: #ff6f2d;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background: radial-gradient(circle at top left, rgba(255, 184, 0, 0.08), transparent 25%),
                radial-gradient(circle at bottom right, rgba(217, 134, 255, 0.08), transparent 20%),
                #0f0b11;
    color: var(--text);
    line-height: 1.6;
}

.header {
    background: #181018;
    border-bottom: 3px solid var(--accent);
    padding: 2rem 0;
    margin-bottom: 2.5rem;
    box-shadow: inset 0 -2px 0 rgba(255, 120, 0, 0.25);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.tagline {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
    max-width: 720px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

.macro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.macro-card {
    background: linear-gradient(180deg, rgba(30, 22, 35, 0.95), rgba(20, 14, 24, 0.98));
    border: 2px dashed rgba(255, 184, 0, 0.45);
    border-radius: 0 18px 0 18px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    box-shadow: var(--shadow);
}

.macro-card:hover {
    transform: translateY(-4px) rotate(-0.2deg);
    border-color: rgba(255, 111, 45, 0.75);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}

.macro-card-header {
    background: #261a2f;
    color: var(--primary);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    font-size: 2rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 184, 0, 0.2);
}

.macro-card-body {
    padding: 1.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.macro-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
    text-transform: uppercase;
}

.macro-card-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: auto;
    line-clamp: 3;
}

.macro-card-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.macro-card-footer button {
    flex: 1;
}

.btn {
    padding: 0.7rem 1rem;
    border: 2px solid rgba(255, 184, 0, 0.9);
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    color: var(--text);
    background: rgba(255, 184, 0, 0.08);
}

.btn-primary {
    background: rgba(255, 184, 0, 0.18);
    color: var(--text);
}

.btn-primary:hover {
    background: rgba(255, 184, 0, 0.32);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal.open {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #160f17;
    border: 2px solid rgba(255, 111, 45, 0.75);
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 2rem;
    border-top: 1px dashed rgba(255, 184, 0, 0.25);
}

#modalTitle {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
}

.modal-video {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.modal-video video {
    width: 100%;
    height: auto;
}

.modal-video.no-video {
    background: var(--bg);
    color: var(--text-light);
    font-size: 0.9rem;
}

.modal-description {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text);
}

.modal-downloads {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-downloads button {
    flex: 1;
    min-width: 120px;
}

.footer {
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
}

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

    .logo {
        font-size: 1.5rem;
    }

    .macro-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .modal-body {
        padding: 1.5rem;
    }

    #modalTitle {
        font-size: 1.4rem;
    }

    .modal-video {
        min-height: 200px;
    }

    .modal-downloads {
        flex-direction: column;
    }

    .modal-downloads button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem 2rem;
    }

    .macro-grid {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 1.25rem;
    }

    .tagline {
        font-size: 0.85rem;
    }
}
