* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'MundoSansBlack';
    src: url('../fonts/MundoSansBlack.woff2') format('woff2');
    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, #212121 0%, #202120 50%, #212121 100%);
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex; /* Remove if needed*/
    flex-direction: column; /* Remove if needed*/
}

header {
    background: linear-gradient(135deg, #282828 0%, #242424 100%);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-bottom: 3px solid #303030;
}

.logo {
    margin-bottom: 1rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.logo img {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(2px 2px 10px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

@keyframes glow {
    from { filter: drop-shadow(2px 2px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 20px rgba(183, 148, 246, 0.5)); }
    to { filter: drop-shadow(2px 2px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 30px rgba(183, 148, 246, 0.8)); }
}

.subtitle {
    font-family: 'MundoSansBlack', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.8rem;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

nav {
    background: rgba(32, 33, 32, 0.95);
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #303030;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

nav a {
    font-family: 'MundoSansBlack', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    margin: 0 0.5rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-block;
}

nav a:hover {
    background: rgba(48, 48, 48, 0.8);
    color: #fff;
    transform: translateY(-2px);
}

nav a.active {
    background: rgba(55, 55, 55, 0.9);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.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, #212121 0%, #202120 50%, #212121 100%);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    background: rgba(33, 33, 33, 0.8);
    border-radius: 15px;
    padding: 2rem 4rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #303030;
    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: #ffffff;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #ffffff;
    padding-bottom: 0.5rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.search-container {
    margin-bottom: 2rem;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.toggle-filters-btn {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    color: #ffffff;
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid #404040;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.toggle-filters-btn:hover {
    border-color: #ffffff;
    background: rgba(40, 40, 40, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.toggle-filters-btn.active {
    background: rgba(48, 48, 48, 0.8);
    border-color: #ffffff;
}

.search-box {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    color: #ffffff;
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid #404040;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box:focus {
    border-color: #ffffff;
    background: rgba(40, 40, 40, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.search-box::placeholder {
    color: #808080;
}

.rarity-filters {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.rarity-filters.show {
    max-height: 200px;
    opacity: 1;
    margin-top: 1rem;
}

.rarity-filter {
    padding: 0.5rem 1.5rem;
    border: none !important;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    opacity: 0.6;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.8px;
    -webkit-font-smoothing: antialiased;
}

.rarity-filter[data-value="Crusader"] {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 50%, #1a1a1a 100%);
}

.rarity-filter[data-value="Secret"] {
    background: linear-gradient(135deg, #FF0000 0%, #FF5555 100%);
}

.rarity-filter[data-value="Mythic"] {
    background: linear-gradient(
        135deg,
        rgba(255, 0, 0, 1) 0%,
        rgba(255, 154, 0, 1) 1%,
        rgba(208, 222, 33, 1) 2%,
        rgba(79, 220, 74, 1) 3%,
        rgba(63, 218, 216, 1) 4%,
        rgba(47, 201, 226, 1) 5%,
        rgba(28, 127, 238, 1) 6%,
        rgba(95, 21, 242, 1) 7%,
        rgba(186, 12, 248, 1) 8%,
        rgba(251, 7, 217, 1) 9%,
        rgba(255, 0, 0, 1) 10%,
        rgba(255, 154, 0, 1) 11%,
        rgba(208, 222, 33, 1) 12%,
        rgba(79, 220, 74, 1) 13%,
        rgba(63, 218, 216, 1) 14%,
        rgba(47, 201, 226, 1) 15%,
        rgba(28, 127, 238, 1) 16%,
        rgba(95, 21, 242, 1) 17%,
        rgba(186, 12, 248, 1) 18%,
        rgba(251, 7, 217, 1) 19%,
        rgba(255, 0, 0, 1) 20%,
        rgba(255, 154, 0, 1) 21%,
        rgba(208, 222, 33, 1) 22%,
        rgba(79, 220, 74, 1) 23%,
        rgba(63, 218, 216, 1) 24%,
        rgba(47, 201, 226, 1) 25%,
        rgba(28, 127, 238, 1) 26%,
        rgba(95, 21, 242, 1) 27%,
        rgba(186, 12, 248, 1) 28%,
        rgba(251, 7, 217, 1) 29%,
        rgba(255, 0, 0, 1) 30%,
        rgba(255, 154, 0, 1) 31%,
        rgba(208, 222, 33, 1) 32%,
        rgba(79, 220, 74, 1) 33%,
        rgba(63, 218, 216, 1) 34%,
        rgba(47, 201, 226, 1) 35%,
        rgba(28, 127, 238, 1) 36%,
        rgba(95, 21, 242, 1) 37%,
        rgba(186, 12, 248, 1) 38%,
        rgba(251, 7, 217, 1) 39%,
        rgba(255, 0, 0, 1) 40%,
        rgba(255, 154, 0, 1) 41%,
        rgba(208, 222, 33, 1) 42%,
        rgba(79, 220, 74, 1) 43%,
        rgba(63, 218, 216, 1) 44%,
        rgba(47, 201, 226, 1) 45%,
        rgba(28, 127, 238, 1) 46%,
        rgba(95, 21, 242, 1) 47%,
        rgba(186, 12, 248, 1) 48%,
        rgba(251, 7, 217, 1) 49%,
        rgba(255, 0, 0, 1) 50%,
        rgba(255, 154, 0, 1) 51%,
        rgba(208, 222, 33, 1) 52%,
        rgba(79, 220, 74, 1) 53%,
        rgba(63, 218, 216, 1) 54%,
        rgba(47, 201, 226, 1) 55%,
        rgba(28, 127, 238, 1) 56%,
        rgba(95, 21, 242, 1) 57%,
        rgba(186, 12, 248, 1) 58%,
        rgba(251, 7, 217, 1) 59%,
        rgba(255, 0, 0, 1) 60%,
        rgba(255, 154, 0, 1) 61%,
        rgba(208, 222, 33, 1) 62%,
        rgba(79, 220, 74, 1) 63%,
        rgba(63, 218, 216, 1) 64%,
        rgba(47, 201, 226, 1) 65%,
        rgba(28, 127, 238, 1) 66%,
        rgba(95, 21, 242, 1) 67%,
        rgba(186, 12, 248, 1) 68%,
        rgba(251, 7, 217, 1) 69%,
        rgba(255, 0, 0, 1) 70%,
        rgba(255, 154, 0, 1) 71%,
        rgba(208, 222, 33, 1) 72%,
        rgba(79, 220, 74, 1) 73%,
        rgba(63, 218, 216, 1) 74%,
        rgba(47, 201, 226, 1) 75%,
        rgba(28, 127, 238, 1) 76%,
        rgba(95, 21, 242, 1) 77%,
        rgba(186, 12, 248, 1) 78%,
        rgba(251, 7, 217, 1) 79%,
        rgba(255, 0, 0, 1) 80%,
        rgba(255, 154, 0, 1) 81%,
        rgba(208, 222, 33, 1) 82%,
        rgba(79, 220, 74, 1) 83%,
        rgba(63, 218, 216, 1) 84%,
        rgba(47, 201, 226, 1) 85%,
        rgba(28, 127, 238, 1) 86%,
        rgba(95, 21, 242, 1) 87%,
        rgba(186, 12, 248, 1) 88%,
        rgba(251, 7, 217, 1) 89%,
        rgba(255, 0, 0, 1) 90%,
        rgba(255, 154, 0, 1) 91%,
        rgba(208, 222, 33, 1) 92%,
        rgba(79, 220, 74, 1) 93%,
        rgba(63, 218, 216, 1) 94%,
        rgba(47, 201, 226, 1) 95%,
        rgba(28, 127, 238, 1) 96%,
        rgba(95, 21, 242, 1) 97%,
        rgba(186, 12, 248, 1) 98%,
        rgba(251, 7, 217, 1) 99%,
        rgba(255, 0, 0, 1) 100%
    );
    background-size: 1500% 1500%;
    animation: mythic-gradient 150s linear infinite;
}

@keyframes mythic-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.rarity-filter[data-value="Legendary"] {
    background: linear-gradient(135deg, #FFD700 0%, #FFF455 100%);
}

.rarity-filter[data-value="Epic"] {
    background: linear-gradient(135deg, #9400D3 0%, #BA55D3 100%);
}

.rarity-filter[data-value="Rare"] {
    background: linear-gradient(135deg, #4169E1 0%, #87CEEB 100%);
}

.rarity-filter[data-value="Common"] {
    background: linear-gradient(135deg, #808080 0%, #C0C0C0 100%);
}

.rarity-filter.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

h3 {
    color: #c9adff;
    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(40, 40, 40, 0.6) 0%, rgba(30, 30, 30, 0.6) 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #404040;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card:hover {
    border-color: #ffffff;
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.8) 0%, rgba(40, 40, 40, 0.8) 100%);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card h4 {
    color: #ffffff;
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card p {
    color: #e0e0e0;
    margin: 0;
    font-size: 1rem;
    opacity: 0.8;
}

.tip {
    background: rgba(183, 148, 246, 0.2);
    border-left: 4px solid #b794f6;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
}

.tip strong {
    color: #dfc8ff;
}

ul {
    margin-left: 1.5rem;
    margin-top: 1rem;
}

li {
    margin: 0.5rem 0;
    color: #e8d5ff;
}

footer {
    text-align: center;
    padding: 2rem;
    background: rgba(24, 24, 24, 0.95);
    color: #ffffff;
    border-top: 2px solid #303030;
    margin-top: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.highlight {
    color: #dfc8ff;
    font-weight: bold;
}

/* Item Type Colors */
.type-filter {
    padding: 0.5rem 1.5rem;
    border: none !important;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    opacity: 0.6;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.8px;
    -webkit-font-smoothing: antialiased;
}

.type-filter:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.type-filter.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.type-filter[data-value="evolution_item"] {
    background: linear-gradient(135deg, #FF4500 0%, #FF8C00 100%);
}

.type-filter[data-value="skin"] {
    background: linear-gradient(135deg, #FF1493 0%, #FF69B4 100%);
}

.type-filter[data-value="portal"] {
    background: linear-gradient(135deg, #4B0082 0%, #8A2BE2 100%);
}

.type-filter[data-value="relic"] {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.type-filter[data-value="capsule"] {
    background: linear-gradient(135deg, #1E90FF 0%, #00BFFF 100%);
}

.type-filter[data-value="buff_item"] {
    background: linear-gradient(135deg, #32CD32 0%, #98FB98 100%);
}

.type-filter[data-value="rolling_item"] {
    background: linear-gradient(135deg, #9400D3 0%, #BA55D3 100%);
}

.type-filter[data-value="material"] {
    background: linear-gradient(135deg, #A0522D 0%, #DEB887 100%);
}

.type-filter[data-value="quest_item"] {
    background: linear-gradient(135deg, #FF4500 0%, #FFA07A 100%);
}

.type-filter[data-value="potion"] {
    background: linear-gradient(135deg, #00CED1 0%, #40E0D0 100%);
}

.type-filter[data-value="food"] {
    background: linear-gradient(135deg, #FF6347 0%, #FFA07A 100%);
}

/* Mobile Menu Styles */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
    background: linear-gradient(135deg, #282828 0%, #242424 100%);
    border: 2px solid #404040;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    padding: 13px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.menu-toggle:hover {
    background: linear-gradient(135deg, #303030 0%, #282828 100%);
    border-color: #505050;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.hamburger {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 20px;
    width: 20px;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.active {
    background: linear-gradient(135deg, #323232 0%, #282828 100%);
    border-color: #606060;
}

.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0.5rem;
        margin: 1rem auto;
    }

    .section {
        padding: 1rem;
    }
    
    /* Mobile update logs improvements */
    .update-entry {
        margin-left: 1.5rem;
        padding: 1rem;
    }

    .update-category ul {
        padding-left: 1rem;
    }

    .update-category li {
        padding-right: 0.5rem;
        font-size: 0.9rem;
        display: flex;
        gap: 0.5rem;
        justify-content: space-between;
    }

    .aligned-units li {
        display: flex;
        justify-content: space-between;
        white-space: normal;
    }

    .update-content h3 {
        font-size: 1.3rem;
    }

    .update-content h4 {
        font-size: 1rem;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    html, body {
        min-height: 100vh;
        background: linear-gradient(135deg, #212121 0%, #202120 50%, #212121 100%);
    }

    body.nav-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    body.nav-open .container,
    body.nav-open .section {
        background: linear-gradient(135deg, #212121 0%, #202120 50%, #212121 100%);
    }

    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, rgba(24, 24, 24, 0.98) 0%, rgba(28, 28, 28, 0.98) 100%);
        backdrop-filter: blur(10px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        transition: all 0.4s ease;
        z-index: 1000;
        opacity: 0;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    nav.nav-open {
        left: 0;
        opacity: 1;
    }

    body.modal-open .menu-toggle {
        display: none !important;
    }

    nav a {
        display: block;
        margin: 0.4rem 0;
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
        text-align: center;
        border-radius: 8px;
        width: 70%;
        max-width: 250px;
        transition: all 0.3s ease;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    nav a:hover {
        transform: translateY(-2px);
        background: rgba(48, 48, 48, 0.8);
    }

    nav a.active {
        transform: none;
    }

    .search-container {
        margin-bottom: 1rem;
    }

    .search-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }

    .filters-container.show {
        margin-top: 0.5rem;
    }

    /* Prevent horizontal overflow on small screens */
    html, body {
        overflow-x: hidden;
    }

    /* Ensure trait cards don't force horizontal scroll and wrap long text */
    #traits-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        box-sizing: border-box;
    }

    .trait-card {
        min-width: 0; /* allow grid items to shrink below intrinsic content */
        word-break: break-word;
    }

    .trait-description,
    .tier-effect,
    .trait-effect {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* Tier List Styles */
.tier-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.tier-row {
    display: flex;
    gap: 0.8rem;
    padding: 0.8rem;
    border-radius: 10px;
    background: rgba(24, 24, 24, 0.95);
    width: 100%;
    min-height: 100px;
    border: 1px solid #2a2a2a;
}

.tier-label {
    font-family: 'MundoSansBlack', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 140px;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border-radius: 8px;
    flex-shrink: 0;
    text-align: center;
}

.meta-hybrid .tier-label {
    background: linear-gradient(135deg, #FF4F2D 0%, #FF8D55 100%);
    color: #000;
}

.meta-ground .tier-label {
    background: linear-gradient(135deg, #FFB347 0%, #FFE484 100%);
    color: #000;
}

.meta-hill .tier-label {
    background: linear-gradient(135deg, #47FFA7 0%, #A4FFD5 100%);
    color: #000;
}

.meta-support .tier-label {
    background: linear-gradient(135deg, #C655FF 0%, #E8AAFF 100%);
    color: #000;
}

/* New tier styles for Infinite tierlist additions */
.meta-dps .tier-label {
    background: linear-gradient(135deg, #FF6B6B 0%, #FFB347 100%);
    color: #000;
}

.carries .tier-label {
    background: linear-gradient(135deg, #FFD700 0%, #FFF455 100%);
    color: #000;
}

/* Sub-meta tier styles */
.sub-meta-dps .tier-label {
    background: linear-gradient(135deg, #FF8D55 0%, #FFD27A 100%);
    color: #000;
}

.sub-meta-support .tier-label {
    background: linear-gradient(135deg, #DDA0FF 0%, #F0D9FF 100%);
    color: #000;
}

/* NEW badge for codes */
.new-badge {
    display: inline-block;
    color: #1abc9c; /* green text */
    background: rgba(26, 188, 156, 0.08);
    border: 1px solid rgba(26, 188, 156, 0.18);
    padding: 2px 6px;
    margin-left: 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    vertical-align: middle;
}

.hybrid .tier-label {
    background: linear-gradient(135deg, #FF4F2D 0%, #FF8D55 100%);
    color: #000;
}

.ground .tier-label {
    background: linear-gradient(135deg, #FFB347 0%, #FFE484 100%);
    color: #000;
}

.hill .tier-label {
    background: linear-gradient(135deg, #47FFA7 0%, #A4FFD5 100%);
    color: #000;
}

.support .tier-label {
    background: linear-gradient(135deg, #C655FF 0%, #E8AAFF 100%);
    color: #000;
}

.tier-units {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.4rem;
    width: 100%;
    padding: 0.4rem;
    justify-content: center;
}

.unit-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unit-card:hover {
    transform: translateY(-5px);
    filter: brightness(1.2);
}

.unit-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .tier-row {
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem;
    }

    .tier-label {
        width: 100%;
        min-width: 0;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        font-size: 1rem;
    }

    .tier-units {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.25rem;
        padding: 0.25rem;
        width: 100%;
    }

    .unit-card {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .unit-card img {
        width: 100%;
        height: auto;
        border-radius: 4px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .modal-body {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
        padding: 12px;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .traits-container {
        flex-direction: column;
        gap: 15px;
    }

    .modal-header img {
        margin: 0 auto;
    }
}

.filters-container {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.filters-container.show {
    display: block;
    opacity: 1;
    margin-top: 1rem;
}

.filter-section {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(40, 40, 40, 0.4);
    border-radius: 10px;
}

.filter-section h4 {
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    padding-left: 0.5rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: none !important;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    opacity: 0.6;
    color: #fff;
}

.filter-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.filter-btn.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.toggle-match-btn {
    background: rgba(40, 40, 40, 0.6);
    border: none;
    color: inherit;
    font-size: 0.9em;
    cursor: pointer;
    font-weight: inherit;
    padding: 2px 8px;
    margin-left: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
    border-radius: 4px;
}

.toggle-match-btn:hover {
    background: rgba(48, 48, 48, 0.8);
}

.toggle-match-btn.match-all {
    background: rgba(26, 188, 156, 0.3);
    color: #1abc9c;
    border: 1px solid rgba(26, 188, 156, 0.6);
}

.toggle-match-btn.match-all:hover {
    background: rgba(26, 188, 156, 0.5);
}

/* Tier List Button Styles */
.tierlist-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.tierlist-btn {
    padding: 0.7rem 1.8rem;
    font-size: 1.1rem;
    color: #ffffff;
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid #404040;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 140px;
}

.tierlist-btn:hover {
    background: rgba(48, 48, 48, 0.8);
    border-color: #ffffff;
    transform: translateY(-2px);
}

.tierlist-btn.active {
    background: rgba(183, 148, 246, 0.2);
    border-color: #b794f6;
    box-shadow: 0 0 15px rgba(183, 148, 246, 0.3);
}

/* Tierlist Filters Container Centering */
.tierlist-buttons + .search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

.tierlist-buttons + .search-container .search-row {
    width: auto;
    justify-content: center;
}

/* Element Colors */
.element-filter {
    padding: 0.5rem 1.5rem;
    border: none !important;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    opacity: 0.6;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.8px;
    -webkit-font-smoothing: antialiased;
}

.element-filter:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.element-filter.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.element-filter[data-value="Fire"] {
    background: linear-gradient(135deg, #FF4500 0%, #FF6347 100%);
}

.element-filter[data-value="Water"] {
    background: linear-gradient(135deg, #00BFFF 0%, #87CEEB 100%);
}

.element-filter[data-value="Air"] {
    background: linear-gradient(135deg, #228B22 0%, #32CD32 50%, #98FB98 100%);
}

.element-filter[data-value="Dark"] {
    background: linear-gradient(135deg, #483D8B 0%, #6A5ACD 100%);
}

.element-filter[data-value="Light"] {
    background: linear-gradient(135deg, #FFD700 0%, #FAFAD2 100%);
}

.element-filter[data-value="Lightning"] {
    background: linear-gradient(135deg, #00008B 0%, #4169E1 50%, #87CEEB 100%);
}

.element-filter[data-value="Rose"] {
    background: linear-gradient(135deg, #FF69B4 0%, #FFC0CB 100%);
}

/* Damage Type Colors */
.damage-filter {
    padding: 0.5rem 1.5rem;
    border: none !important;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    opacity: 0.6;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.8px;
    -webkit-font-smoothing: antialiased;
}

.damage-filter:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.damage-filter.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.damage-filter[data-value="Physical"] {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #FF0000 100%);
    position: relative;
    overflow: hidden;
}

.damage-filter[data-value="Magic"] {
    background: linear-gradient(135deg, #000080 0%, #0000FF 50%, #1E90FF 100%);
    position: relative;
    overflow: hidden;
}

.damage-filter[data-value="True"] {
    background: linear-gradient(135deg, #E8E8E8 0%, #FFFFFF 50%, #F8F8F8 100%);
    color: #000 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
    position: relative;
    overflow: hidden;
}

.damage-filter::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.3;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
}

/* Attribute Colors */
.attribute-filter {
    padding: 0.5rem 1.5rem;
    border: none !important;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    opacity: 0.6;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.8px;
    -webkit-font-smoothing: antialiased;
}

.attribute-filter:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.attribute-filter.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.attribute-filter[data-value="Hybrid"] {
    background: linear-gradient(135deg, #FF1E1E 0%, #FF6B6B 100%);
}

.attribute-filter[data-value="Ground"] {
    background: linear-gradient(135deg, #1E90FF 0%, #87CEFA 100%);
}

.attribute-filter[data-value="Hill"] {
    background: linear-gradient(135deg, #2ECC71 0%, #98FB98 100%);
}

.attribute-filter[data-value="Summon"] {
    background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 100%);
}

.attribute-filter[data-value="Farm"] {
    background: linear-gradient(135deg, #FFD700 0%, #FFF68F 100%);
}

.attribute-filter[data-value="Buff"] {
    background: linear-gradient(135deg, #9932CC 0%, #DA70D6 100%);
}

.unit-name {
    font-size: 0.8rem;
    color: #fff;
    display: block;
}

.blue-border {
    border: 2px solid #4287f5;
}

.red-border {
    border: 2px solid #ff4444;
}

.yellow-border {
    border: 2px solid #ffd700;
}

.purple-border {
    border: 2px solid #9b59b6;
}

.green-border {
    border: 2px solid #2ecc71;
}

/* Modal Styles */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

@keyframes modalContentSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
    to {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes modalContentSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 20px 0;
    opacity: 0;
    animation: modalFadeIn 0.3s ease-out forwards;
}

.modal.closing {
    animation: modalFadeOut 0.3s ease-out forwards;
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #282828 0%, #242424 100%);
    padding: 20px;
    width: 90%;
    max-width: 1000px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 2px solid #303030;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    animation: modalContentSlideIn 0.4s ease-out 0.1s forwards;
}

.modal.closing .modal-content {
    animation: modalContentSlideOut 0.3s ease-out forwards;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.close-modal:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Unit Info Specific Styles */
.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.modal-header img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

.modal-details h2 {
    color: #ffffff;
    margin: 0 0 10px 0;
    padding: 0;
    border: none;
    font-size: 1.8rem;
}

.modal-details {
    margin-top: -4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-details h2 {
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.modal-details p {
    color: #e0e0e0;
    margin: 0;
}

.modal-body {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    min-height: min-content;
}

.modal-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Prevents flex items from overflowing */
}

.modal-section {
    background: rgba(40, 40, 40, 0.5);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #404040;
    display: flex;
    flex-direction: column;
}

.modal-section h3 {
    font-size: 1.8rem;
    color: #ffffff;
    margin: 0 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #404040;
    text-align: center;
}

#passiveSection h3 {
    color: #ffa500;
}

#abilitySection h3 {
    color: #ff4444;
}

.traits-section h4 {
    text-align: center;
}

.stat-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(48, 48, 48, 0.5);
    border-radius: 5px;
}

.ability-item {
    background: rgba(48, 48, 48, 0.5);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.ability-item h4 {
    color: #c9adff;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    font-size: 1.35rem;
}

.cooldown {
    color: #ffd700;
    font-size: 0.9em;
}

.traits-container {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.traits-section {
    background: rgba(48, 48, 48, 0.5);
    padding: 12px;
    border-radius: 8px;
    flex: 1;
}

.curse-container {
    text-align: center;
    padding: 12px;
    margin-top: 15px;
    background: rgba(48, 48, 48, 0.5);
    border-radius: 8px;
    width: 100%;
}

.traits-section h4 {
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 1.5rem;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.traits-and-curse {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 5px;
    justify-content: center;
    align-items: center;
}

.trait-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(40, 40, 40, 0.6);
    padding: 4px;
    transition: all 0.2s ease;
    border: 1px solid rgba(183, 148, 246, 0.2);
}

.trait-wrapper:hover {
    transform: scale(1.1);
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(183, 148, 246, 0.6);
}

.trait-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.curse-container {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    display: flex;
    justify-content: center;
}

.curse-container span {
    font-size: 1.1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.curse-container .good-curse {
    color: #2ecc71;
}

.curse-container .separator {
    color: #ffffff;
}

.curse-container .bad-curse {
    color: #e74c3c;
}

/* Traits Table Styles */
.table-container {
    overflow-x: auto;
    margin: 2rem 1rem;
    padding: 0 1rem;
}

.traits-grid {
    padding: 0.75rem;
}

#traits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.trait-card {
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.6) 0%, rgba(30, 30, 30, 0.6) 100%);
    border-radius: 12px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    border: 2px solid #404040;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.trait-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trait-card:hover {
    border-color: #ffffff;
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.8) 0%, rgba(40, 40, 40, 0.8) 100%);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.trait-card:hover::before {
    opacity: 1;
}

.trait-card:hover .trait-name {
    transform: translateY(-2px);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.trait-card:hover .trait-odds {
    opacity: 1;
}

.trait-icon {
    width: 96px;
    height: 96px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

.trait-card:hover .trait-icon {
    transform: scale(1.05);
}

.trait-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.trait-name {
    font-family: 'MundoSansBlack', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.35rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0;
    font-weight: normal;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.trait-odds {
    font-family: 'MundoSansBlack', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.35rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.75rem;
    font-weight: normal;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.trait-description {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
}

.tier-effect {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: normal;
    padding: 0.5rem;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.tier-effect:hover {
    opacity: 1;
}

.tier-number {
    color: #ffffff;
    font-weight: normal;
    margin-right: 0.5rem;
    opacity: 0.9;
}

.trait-effect {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: normal;
    padding: 0.5rem;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.trait-effect:hover {
    opacity: 1;
}

.error-message {
    color: #ff4444;
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    #traits-container {
        grid-template-columns: 1fr;  /* Force single column on mobile */
        gap: 1rem;
        padding: 0.5rem;
        width: 100%;
        max-width: 100%;
    }

    .trait-card {
        padding: 1rem;
        width: 100%;
        margin: 0 auto;
    }

    .trait-icon {
        width: 48px;
        height: 48px;
    }

    .trait-name {
        font-size: 1.2rem;
    }

    .trait-odds {
        font-size: 1rem;
    }
}

/* Codes Table Specific Styles */
.traits-table {
    width: 100%;
    max-width: 1000px;
    margin: 1rem auto;
    border-collapse: collapse;
    background: rgba(32, 32, 32, 0.6);
    border-radius: 10px;
    overflow: hidden;
}

.traits-table thead {
    background: rgba(40, 40, 40, 0.8);
}

.traits-table th {
    padding: 1rem;
    text-align: left;
    color: #ffffff;
    font-weight: bold;
    border-bottom: 2px solid #404040;
    white-space: nowrap;
}

.traits-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(64, 64, 64, 0.5);
    white-space: pre-line;
    vertical-align: middle;
}

.traits-table tbody tr:hover {
    background: rgba(40, 40, 40, 0.4);
}

.traits-table code {
    background: rgba(30, 30, 30, 0.6);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    border: 1px solid #404040;
    word-break: break-word;
}

.traits-table .active {
    color: #2ecc71;
    font-weight: bold;
}

.traits-table .expired {
    color: #e74c3c;
    font-weight: bold;
}

/* Mobile Optimizations for Codes Table */
@media (max-width: 768px) {
    .section {
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .section h2 {
        text-align: center;
        width: 100%;
    }

    .table-container {
        margin: 1rem 0;
        padding: 0;
        overflow-x: hidden;
        width: 100%;
    }
    
    .traits-table code {
        display: inline-block;
        margin: 0.2rem auto;
        font-size: 0.95rem;
        padding: 0.4rem 0.8rem;
        text-align: center;
        white-space: pre-wrap;
    }

    .traits-table td::before {
        content: attr(data-label);
        display: block;
        color: #b794f6;
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        font-weight: bold;
        text-align: center;
    }
    
    .tip {
        text-align: center;
        width: 100%;
        max-width: 500px;
        margin: 1rem auto;
    }
    
    .traits-table {
        display: block;
        background: none;
        border-radius: 0;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .traits-table thead {
        display: none;
    }
    
    .traits-table tbody {
        display: block;
        width: 100%;
    }
    
    .traits-table tr {
        display: block;
        background: rgba(32, 32, 32, 0.6);
        margin-bottom: 1rem;
        padding: 1rem;
        border-radius: 10px;
        border: 1px solid #404040;
        text-align: center;
    }
    
    .traits-table td {
        display: block;
        padding: 0.5rem 0;
        border: none;
        position: relative;
        padding-left: 0;
        text-align: center;
        white-space: pre-wrap;
        word-break: break-word;
        line-height: 1.4;
    }

    .traits-table td:not(:last-child) {
        border-bottom: 1px solid rgba(64, 64, 64, 0.3);
        margin-bottom: 0.5rem;
    }
    
    .traits-table td::before {
        content: attr(data-label);
        display: block;
        color: #b794f6;
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        font-weight: bold;
        text-align: center;
    }
    
    .traits-table code {
        display: inline-block;
        margin: 0.2rem auto;
        font-size: 0.95rem;
        padding: 0.4rem 0.8rem;
        text-align: center;
        white-space: pre-wrap;
    }
    
    .traits-table code {
        display: inline-block;
        margin: 0.2rem auto;
        font-size: 0.95rem;
        padding: 0.4rem 0.8rem;
        text-align: center;
    }

    /* On mobile, place the NEW badge above the code label */
    .traits-table td[data-label="Code"] {
        display: flex;
        flex-direction: column;
        align-items: center; /* center badge and code horizontally */
        gap: 0.25rem;
        text-align: center;
    }

    .traits-table td[data-label="Code"] .new-badge {
        order: -1; /* move badge before the code element */
        display: inline-block;
        margin: 0 auto;
    }

    .traits-table .active,
    .traits-table .expired {
        display: inline-block;
        min-width: 80px;
        padding: 0.3rem 0.8rem;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.2);
    }

    .traits-table td:not(:last-child) {
        border-bottom: 1px solid rgba(64, 64, 64, 0.3);
        margin-bottom: 0.8rem;
        padding-bottom: 0.8rem;
    }
}

/* Update Logs Styles */
.update-timeline {
    position: relative;
    padding: 2rem 0;
}

.update-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom, 
        rgba(183, 148, 246, 0.8) 0%,
        rgba(183, 148, 246, 0.4) 100%);
    border-radius: 3px;
}

.update-entry {
    position: relative;
    margin-left: 2rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(40, 40, 40, 0.6);
    border-radius: 12px;
    border: 1px solid #404040;
    transition: all 0.3s ease;
}

.update-entry::before {
    content: '';
    position: absolute;
    left: -2.65rem;
    top: 2rem;
    width: 1rem;
    height: 1rem;
    background: #b794f6;
    border-radius: 50%;
    border: 3px solid #282828;
    box-shadow: 0 0 10px rgba(183, 148, 246, 0.5);
}

.update-entry.latest {
    background: linear-gradient(135deg, 
        rgba(183, 148, 246, 0.2) 0%,
        rgba(40, 40, 40, 0.6) 100%);
    border: 1px solid #b794f6;
}

.update-entry.latest::before {
    background: #ffffff;
    box-shadow: 0 0 15px rgba(183, 148, 246, 0.8);
}

.update-date {
    font-family: 'Consolas', monospace;
    color: #b794f6;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.update-content h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(183, 148, 246, 0.3);
}

.update-category {
    margin-bottom: 1.5rem;
}

.update-category h4 {
    color: #dfc8ff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.update-category ul {
    margin: 0;
    padding-left: 1.5rem;
}

.update-content {
    font-family: 'Consolas', monospace;
}

.update-content h3, 
.update-content h4 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.update-category li {
    color: #e0e0e0;
    margin: 0.3rem 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Desktop pre-formatting */
@media (min-width: 769px) {
    .update-category li {
        white-space: pre;
    }
}

.update-date {
    font-family: 'Consolas', monospace;
    color: #b794f6;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.update-entry:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background: rgba(48, 48, 48, 0.6);
}

.update-entry.latest:hover {
    background: linear-gradient(135deg, 
        rgba(183, 148, 246, 0.3) 0%,
        rgba(48, 48, 48, 0.6) 100%);
}

/* Interactive Card Styles */
.interactive-card {
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.interactive-card:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.modal-icons-container {
    display: flex;
    gap: 8px;
    margin: 0;
    align-items: center;
}

.attributes-container,
.damage-types-container,
.elements-container {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 32px;
}

.attribute-badge {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    width: 85px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
}

.attribute-badge[data-value="Hybrid"] {
    background: linear-gradient(135deg, #FF1E1E 0%, #FF6B6B 100%);
}

.attribute-badge[data-value="Ground"] {
    background: linear-gradient(135deg, #1E90FF 0%, #87CEFA 100%);
}

.attribute-badge[data-value="Hill"] {
    background: linear-gradient(135deg, #2ECC71 0%, #98FB98 100%);
}

.attribute-badge[data-value="Summon"] {
    background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 100%);
}

.attribute-badge[data-value="Farm"] {
    background: linear-gradient(135deg, #FFD700 0%, #FFF68F 100%);
    color: #000;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.attribute-badge[data-value="Buff"] {
    background: linear-gradient(135deg, #9932CC 0%, #DA70D6 100%);
}

.damage-type-icon,
.element-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    padding: 4px;
    margin: 0;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    background: rgba(40, 40, 40, 0.4);
    border-radius: 6px;
}

/* Non-selectable Content */
.card,
.card *:not(code),
.unit-card,
.unit-card *,
.trait-card,
.trait-card *,
.tier-row,
.tier-row *,
.tip,
.tip *:not(code),
.traits-table th,
.traits-table td:not(code),
.update-entry,
.update-entry *,
.feedback-form label,
.submit-status,
#charCount,
.char-counter,
.form-actions,
.modal *:not(input):not(textarea),
.stat-item,
.ability-item,
.trait-effect,
.tier-effect {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Make code elements explicitly selectable */
code {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}