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

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Fredoka+One&display=swap');

@font-face {
    font-family: 'Fredoka One';
    src: url('https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    font-feature-settings: 'kern';
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgba(10, 10, 10, 1) 0%, rgba(0, 0, 0, 1) 50%, rgba(10, 10, 10, 1) 100%);
    color: rgba(224, 224, 224, 1);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, rgba(15, 15, 15, 1) 0%, rgba(0, 0, 0, 1) 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    border-bottom: 3px solid rgba(26, 26, 26, 1);
}

.subtitle {
    font-family: 'Fredoka One', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin: 0;
    flex-shrink: 0;
}

nav {
    background: transparent;
    padding: 0;
    text-align: right;
    backdrop-filter: none;
    border-bottom: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

nav a {
    font-family: 'Fredoka One', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: rgba(255, 255, 255, 1);
    text-decoration: none;
    padding: 0.4rem 1rem;
    margin: 0;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 0.95rem;
}

nav a:hover {
    background: rgba(183, 148, 246, 0.1);
    color: rgba(183, 148, 246, 1);
    transform: translateY(-1px);
}

nav a.active {
    background: rgba(183, 148, 246, 0.2);
    color: rgba(183, 148, 246, 1);
    border-bottom: 2px solid rgba(183, 148, 246, 1);
    padding-bottom: 0.2rem;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 1) 0%, rgba(0, 0, 0, 1) 50%, rgba(10, 10, 10, 1) 100%);
}

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

.section {
    background: rgba(15, 15, 15, 0.8);
    border-radius: 15px;
    padding: 2rem 4rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(26, 26, 26, 1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.section:nth-child(1) { animation-delay: 0.2s; }
.section:nth-child(2) { animation-delay: 0.4s; }
.section:nth-child(3) { animation-delay: 0.6s; }
.section:nth-child(4) { animation-delay: 0.8s; }
.section:nth-child(5) { animation-delay: 1.0s; }
.section:nth-child(n+6) { animation-delay: 1.2s; }

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(32, 33, 32, 0.4);
}

h2 {
    color: rgba(255, 255, 255, 1);
    font-family: 'Fredoka', 'Fredoka One', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid rgba(255, 255, 255, 1);
    padding-bottom: 0.5rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

h3 {
    color: rgba(201, 173, 255, 1);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.6) 0%, rgba(10, 10, 10, 0.6) 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(42, 42, 42, 1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.card:hover {
    border-color: rgba(183, 148, 246, 1);
    background: linear-gradient(135deg, rgba(30, 20, 40, 0.8) 0%, rgba(20, 10, 30, 0.8) 100%);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(183, 148, 246, 0.2);
}

.card h4 {
    color: rgba(255, 255, 255, 1);
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card p {
    color: rgba(224, 224, 224, 1);
    margin: 0;
    font-size: 1rem;
    opacity: 0.8;
}

.tip {
    background: rgba(183, 148, 246, 0.2);
    border-left: 4px solid rgba(183, 148, 246, 1);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tip strong {
    color: rgba(223, 200, 255, 1);
}

.tip a {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

ul {
    margin-left: 1.5rem;
    margin-top: 1rem;
}

li {
    margin: 0.5rem 0;
    color: rgba(232, 213, 255, 1);
}

footer {
    text-align: center;
    padding: 2rem;
    background: rgba(10, 10, 10, 0.95);
    color: rgba(255, 255, 255, 1);
    border-top: 2px solid rgba(26, 26, 26, 1);
    margin-top: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Flexible Item List Styles */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
}

.item-card {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.6) 0%, rgba(10, 10, 10, 0.6) 100%);
    padding: 0;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    position: relative;
}

.item-card img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    aspect-ratio: 1;
}

.item-card .item-name {
    color: rgba(255, 255, 255, 1);
    font-size: 0.9rem;
    text-align: center;
    word-wrap: break-word;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem;
    margin: 0;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(183, 148, 246, 0.2);
}

/* Search and Filter Styles */
.search-container {
    margin: 1.5rem 0;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.search-box {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid rgba(42, 42, 42, 1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 1);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: rgba(183, 148, 246, 1);
    background: rgba(40, 30, 50, 0.8);
    box-shadow: 0 0 10px rgba(183, 148, 246, 0.2);
}

.search-box::placeholder {
    color: rgba(153, 153, 153, 1);
}

.toggle-filters-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid rgba(42, 42, 42, 1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 1);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    white-space: nowrap;
}

.toggle-filters-btn:hover {
    border-color: rgba(183, 148, 246, 1);
    background: rgba(40, 30, 50, 0.8);
    box-shadow: 0 0 10px rgba(183, 148, 246, 0.2);
}

.toggle-filters-btn.active {
    background: rgba(183, 148, 246, 0.2);
    border-color: rgba(183, 148, 246, 1);
}

.filters-container {
    display: none;
    background: rgba(20, 20, 20, 0.8);
    border: 2px solid rgba(42, 42, 42, 1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.filters-container.show {
    display: flex;
}

.filter-section {
    flex: 1;
    min-width: 200px;
}

.filter-section h4 {
    color: rgba(183, 148, 246, 1);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.filter-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.25rem 0.75rem;
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid rgba(42, 42, 42, 1);
    border-radius: 4px;
    color: rgba(224, 224, 224, 1);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
}

.filter-btn:hover {
    background: rgba(40, 30, 50, 0.8);
    border-color: rgba(183, 148, 246, 1);
}

.filter-btn.active {
    background: rgba(183, 148, 246, 0.2);
    border-color: rgba(183, 148, 246, 1);
    color: rgba(255, 255, 255, 1);
}

/* Rarity-specific filter button colors */
.filter-btn[data-value="Rare"] {
    border-color: rgba(100, 149, 237, 1);
    color: rgba(100, 149, 237, 1);
    background: rgba(100, 149, 237, 0.3);
}

.filter-btn[data-value="Rare"]:hover {
    background: rgba(100, 149, 237, 0.5);
    border-color: rgba(100, 149, 237, 1);
}

.filter-btn[data-value="Rare"].active {
    background: rgba(100, 149, 237, 0.6);
    border-color: rgba(100, 149, 237, 1);
    box-shadow: 0 0 8px rgba(100, 149, 237, 0.4);
}

.filter-btn[data-value="Epic"] {
    border-color: rgba(186, 85, 211, 1);
    color: rgba(186, 85, 211, 1);
    background: rgba(186, 85, 211, 0.3);
}

.filter-btn[data-value="Epic"]:hover {
    background: rgba(186, 85, 211, 0.5);
    border-color: rgba(186, 85, 211, 1);
}

.filter-btn[data-value="Epic"].active {
    background: rgba(186, 85, 211, 0.6);
    border-color: rgba(186, 85, 211, 1);
    box-shadow: 0 0 8px rgba(186, 85, 211, 0.4);
}

.filter-btn[data-value="Legendary"] {
    border-color: rgba(255, 165, 0, 1);
    color: rgba(255, 165, 0, 1);
    background: rgba(255, 165, 0, 0.3);
}

.filter-btn[data-value="Legendary"]:hover {
    background: rgba(255, 165, 0, 0.5);
    border-color: rgba(255, 165, 0, 1);
}

.filter-btn[data-value="Legendary"].active {
    background: rgba(255, 165, 0, 0.6);
    border-color: rgba(255, 165, 0, 1);
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.4);
}

.filter-btn[data-value="Mythic"] {
    background: linear-gradient(rgba(20, 20, 20, 0.7), rgba(20, 20, 20, 0.7)) padding-box,
                linear-gradient(135deg, rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 0, 255, 1), rgba(75, 0, 130, 1), rgba(148, 0, 211, 1)) border-box;
    border: 2px solid transparent;
    color: transparent;
}

.filter-btn[data-value="Mythic"]:hover {
    background: linear-gradient(rgba(20, 20, 20, 0.5), rgba(20, 20, 20, 0.5)) padding-box,
                linear-gradient(135deg, rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 0, 255, 1), rgba(75, 0, 130, 1), rgba(148, 0, 211, 1)) border-box;
}

.filter-btn[data-value="Mythic"].active {
    background: linear-gradient(rgba(20, 20, 20, 0.4), rgba(20, 20, 20, 0.4)) padding-box,
                linear-gradient(135deg, rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 0, 255, 1), rgba(75, 0, 130, 1), rgba(148, 0, 211, 1)) border-box;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.filter-btn[data-value="Mythic"]::before,
.filter-btn[data-value="Mythic"].active::before {
    content: attr(data-text);
    background: linear-gradient(135deg, rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 0, 255, 1), rgba(75, 0, 130, 1), rgba(148, 0, 211, 1));
    -webkit-background-clip: text;
    background-clip: text;
    color: rgba(255, 255, 255, 1);
}

.filter-btn[data-value="Secret"] {
    border-color: rgba(220, 20, 60, 1);
    color: rgba(220, 20, 60, 1);
    background: rgba(220, 20, 60, 0.3);
}

.filter-btn[data-value="Secret"]:hover {
    background: rgba(220, 20, 60, 0.5);
    border-color: rgba(220, 20, 60, 1);
}

.filter-btn[data-value="Secret"].active {
    background: rgba(220, 20, 60, 0.6);
    border-color: rgba(220, 20, 60, 1);
    box-shadow: 0 0 8px rgba(220, 20, 60, 0.4);
}

/* Rarity Badges */
.rarity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
}

.rarity-rare {
    background: rgba(100, 149, 237, 0.3);
    color: rgba(100, 149, 237, 1);
    border: 2px solid rgba(100, 149, 237, 1);
}

.rarity-epic {
    background: rgba(186, 85, 211, 0.3);
    color: rgba(186, 85, 211, 1);
    border: 2px solid rgba(186, 85, 211, 1);
}

.rarity-legendary {
    background: rgba(255, 165, 0, 0.3);
    color: rgba(255, 165, 0, 1);
    border: 2px solid rgba(255, 165, 0, 1);
}

.rarity-mythic {
    background: linear-gradient(rgba(20, 20, 20, 0.7), rgba(20, 20, 20, 0.7)) padding-box,
                linear-gradient(135deg, rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 0, 255, 1), rgba(75, 0, 130, 1), rgba(148, 0, 211, 1)) border-box;
    color: transparent;
    border: 2px solid transparent;
}

.rarity-mythic::before {
    content: attr(data-text);
    background: linear-gradient(135deg, rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 0, 255, 1), rgba(75, 0, 130, 1), rgba(148, 0, 211, 1));
    -webkit-background-clip: text;
    background-clip: text;
    color: rgba(255, 255, 255, 1);
}

.rarity-secret {
    background: rgba(220, 20, 60, 0.3);
    color: rgba(220, 20, 60, 1);
    border: 2px solid rgba(220, 20, 60, 1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(10, 10, 10, 0.95) 100%);
    border: 2px solid rgba(26, 26, 26, 1);
    border-radius: 15px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 1);
    font-size: 1.8rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.close-modal:hover {
    background: rgba(183, 148, 246, 0.2);
    color: rgba(183, 148, 246, 1);
}

.modal-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(42, 42, 42, 1);
}

.modal-header img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
}

.modal-details {
    flex: 1;
}

.modal-details h2 {
    margin: 0 0 -0.5rem 0;
    border: none;
}

.modal-rarity {
    margin-bottom: 1rem;
}

.modal-attributes {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.attribute-badge {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background: rgba(183, 148, 246, 0.2);
    border: 1px solid rgba(183, 148, 246, 1);
    border-radius: 6px;
    color: rgba(183, 148, 246, 1);
    font-size: 0.85rem;
}

.modal-body {
    margin-top: 1rem;
}

.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 6px;
    border-left: 3px solid rgba(183, 148, 246, 1);
}

.stat-item span:first-child {
    color: rgba(183, 148, 246, 1);
    font-weight: bold;
}

.stat-item span:last-child {
    color: rgba(224, 224, 224, 1);
    text-align: right;
}



/* Codes Table Styles */
.codes-table {
    margin-top: 2rem;
}

.codes-table-container {
    width: 100%;
    border-collapse: collapse;
    background: rgba(15, 15, 15, 0.8);
    border: 2px solid rgba(26, 26, 26, 1);
    border-radius: 10px;
    overflow: hidden;
    table-layout: fixed;
}

.codes-table-container thead {
    background: rgba(20, 20, 20, 0.9);
    border-bottom: 2px solid rgba(42, 42, 42, 1);
}

.codes-table-container th {
    color: rgba(183, 148, 246, 1);
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    font-size: 0.95rem;
}

.codes-table-container th:nth-child(1) {
    width: 40%;
}

.codes-table-container th:nth-child(2) {
    width: 30%;
}

.codes-table-container th:nth-child(3) {
    width: 30%;
}

.codes-table-container tbody tr {
    border-bottom: 1px solid rgba(42, 42, 42, 1);
    transition: all 0.3s ease;
}

.codes-table-container tbody tr:last-child {
    border-bottom: none;
}

.codes-table-container tbody tr:hover {
    background: rgba(30, 20, 40, 0.5);
}

.codes-table-container td {
    padding: 1rem;
    color: rgba(224, 224, 224, 1);
    text-align: center;
}

.code-cell {
    font-family: 'Fredoka One', 'Courier New', monospace;
    text-align: center;
    position: relative;
}

.code-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.code-text {
    color: rgba(255, 255, 255, 1);
    font-size: 1rem;
    cursor: pointer;
    user-select: all;
}

.code-text:hover {
    text-decoration: underline;
}

.badge-new {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    background: rgba(76, 175, 80, 0.3);
    border: 1px solid rgba(76, 175, 80, 1);
    color: rgba(76, 175, 80, 1);
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    min-width: 80px;
}

.status-active {
    background: rgba(76, 175, 80, 0.3);
    color: rgba(76, 175, 80, 1);
    border: 1px solid rgba(76, 175, 80, 1);
}

.status-expired {
    background: rgba(220, 20, 60, 0.3);
    color: rgba(220, 20, 60, 1);
    border: 1px solid rgba(220, 20, 60, 1);
}
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        align-items: flex-start;
    }

    .subtitle {
        font-size: 1.5rem;
    }

    nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    nav a {
        padding: 0.35rem 0.8rem;
        font-size: 0.85rem;
    }

    .container {
        padding: 0.5rem;
        margin: 1rem auto;
    }

    .section {
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

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

    .aligned-units li {
        display: flex;
        justify-content: space-between;
        white-space: normal;
    }
}
