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

:root {
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --bg-panel: #1a1a1a;
    --primary: #00d9ff;
    --primary-dim: #00aacc;
    --secondary: #ff00ff;
    --accent: #00ffff;
    --danger: #ff0040;
    --warning: #ffff00;
    --text: #00d9ff;
    --text-dim: #66ddff;
    --text-muted: #33ccff;
    --border: #00d9ff;
    --border-dim: #003344;
    --footer-glow: #fa8ff6;
}

@font-face {
    font-family: 'Courier';
    src: local('Courier New'), local('Courier');
}

body {
    font-family: 'Courier New', Courier, monospace;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 2;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    opacity: 0.03;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" /></filter><rect width="100%" height="100%" filter="url(%23noise)" /></svg>');
}

.header-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

.header {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.header-banner {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

.header-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-dark) 100%);
    pointer-events: none;
}

.control-panel {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin: 40px 20px 30px 20px;
}

.search-container,
.filter-container,
.sort-container {
    background: var(--bg-panel);
    border: 2px solid var(--border-dim);
    padding: 15px;
}

.search-container:hover,
.filter-container:hover,
.sort-container:hover {
    border-color: var(--border);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.search-label,
.filter-label,
.sort-label {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.search-input,
.filter-select,
.sort-select {
    width: 100%;
    background: var(--bg-darker);
    border: 1px solid var(--border-dim);
    color: var(--text);
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus,
.filter-select:focus,
.sort-select:focus {
    border-color: var(--border);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.search-stats {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.monster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 0 20px 30px 20px;
}

.monster-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-dim);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.monster-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    transition: left 0.5s;
}

.monster-card:hover::before {
    left: 100%;
}

.monster-card:hover {
    border-color: var(--border);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
    transform: translateY(-5px);
}

.monster-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.monster-image-container {
    width: 80px;
    height: 80px;
    background: var(--bg-darker);
    border: 2px solid var(--border-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.monster-image {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.monster-title-section {
    flex: 1;
    margin-left: 15px;
}

.monster-name {
    font-size: 18px;
    color: var(--primary);
    letter-spacing: 2px;
    margin-bottom: 5px;
    text-shadow: 0 0 5px var(--primary);
}

.monster-category {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.monster-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 5px 8px;
    background: var(--bg-darker);
    border-left: 2px solid var(--border-dim);
}

.stat-label {
    color: var(--text-dim);
}

.stat-value {
    color: var(--primary);
    font-weight: bold;
}

.monster-backstory {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 0 20px 30px 20px;
    padding: 20px;
    background: none;
    /* border: 2px solid var(--border-dim); */
    position: relative;
    z-index: 10;
}

.pagination-btn {
    background: var(--bg-darker);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--border);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.page-current {
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
}

.page-separator {
    color: var(--text-dim);
}

.page-total {
    color: var(--text-dim);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-panel);
    border: 2px solid var(--border);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1000000;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--border-dim);
}

.modal-title {
    font-size: 24px;
    color: var(--primary);
    letter-spacing: 3px;
    text-shadow: 0 0 10px var(--primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--danger);
}

.modal-body {
    padding: 30px;
}

.modal-monster-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-dim);
}

.modal-image-container {
    width: 150px;
    height: 150px;
    background: var(--bg-darker);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.modal-info {
    flex: 1;
}

.modal-monster-name {
    font-size: 28px;
    color: var(--primary);
    letter-spacing: 3px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px var(--primary);
}

.modal-monster-category {
    font-size: 14px;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.modal-stat-item {
    background: var(--bg-darker);
    border-left: 3px solid var(--border);
    padding: 10px;
}

.modal-stat-label {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.modal-stat-value {
    font-size: 20px;
    color: var(--primary);
    font-weight: bold;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section-title {
    font-size: 16px;
    color: var(--accent);
    letter-spacing: 2px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-dim);
}

.modal-section-content {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-dim);
}

.footer-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: visible;
    height: 225px;
    display: flex;
    align-items: flex-end;
    z-index: 1;
}

.footer-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 225px;
    background-image: url('branding-images/footer-bg.png');
    background-size: cover;
    background-position: bottom center;
    background-repeat: no-repeat;
    z-index: 0;
}

.footer-fade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, var(--bg-dark) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.footer {
    position: relative;
    text-align: center;
    padding: 30px 20px 30px 20px;
    background: transparent;
    border: none;
    margin: 0;
    width: 100%;
    z-index: 2;
}

.footer-text {
 font-size: 12px;
 color: #9ad6ff;
 letter-spacing: 2px;
 margin-bottom: 25px;
 font-weight: bold;
 animation: pulse-glow 2s ease-in-out infinite alternate;
 position: relative;
 z-index: 1;
 will-change: text-shadow;
}

@keyframes pulse-glow {
 0% {
 text-shadow: 
 0 0 10px var(--footer-glow),
 0 0 20px var(--footer-glow), 
 0 0 40px var(--footer-glow),
 0 0 60px var(--footer-glow);
 }
 100% {
 text-shadow: 
 0 0 20px var(--footer-glow),
 0 0 40px var(--footer-glow),
 0 0 80px var(--footer-glow), 
 0 0 120px var(--footer-glow);
 }
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.footer-link:hover {
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary);
}

@media (max-width: 768px) {
    .control-panel {
        grid-template-columns: 1fr;
    }

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

    .glitch {
        font-size: 24px;
    }

    .header-top {
        flex-direction: column;
        gap: 15px;
    }

    .modal-monster-header {
        flex-direction: column;
    }

    .modal-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
