html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
}

body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    animation: fade 0.5s ease-in-out;
}

.cards-main {
    padding: 0;
    position: relative;
    z-index: 2;
    width: 800px;
}

.cards-frame {
    width: 100%;
    height: 770px;
    background: linear-gradient(to bottom, #010101, #0f0f0f, #060606);
    border: 2px double #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -4px;
    box-shadow: 3px 3px 0 #010101;
    position: relative;
}

.cards-frame::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, var(--violet-glow), transparent);
    opacity: 0.31;
    pointer-events: none;
    z-index: 0;
}

.cards-banner {
    width: 100%;
    height: 100px;
    background: #000;
    border: 2px solid #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -4px;
    box-shadow: 3px 2px 0 rgba(3, 3, 3, 0.89);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.banner-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 11px;
    letter-spacing: 2px;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #222;
    position: relative;
    z-index: 1;
}

.home-btn {
    display: inline-block;
    padding: 10px;
    background: linear-gradient(to bottom, #0b0b0b, #010101);
    border: 2px double #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -3px;
    box-shadow: 1px 1px 0 #010101;
    color: #bfbfbf;
    text-align: center;
    font-size: 12px;
    font-family: "MS UI Gothic", monospace;
    text-decoration: none;
    transition: all 0.2s;
    text-shadow: 1px 1px 2px #010101;
    min-width: 100px;
}

.home-btn:hover {
    color: #fffffe;
    font-style: italic;
    text-shadow: 0 0 6px var(--tpurple), 1px 1px 2px #010101;
    background: linear-gradient(to bottom, #010101, #0b0b0b);
}

.home-btn:active {
    transform: translateY(1px);
}

.filter-controls {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    background: linear-gradient(to bottom, #0b0b0b, #010101);
    border: 2px double #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -3px;
    box-shadow: 1px 1px 0 #010101;
    color: #bfbfbf;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 1px 1px 2px #010101;
    font-family: inherit;
    letter-spacing: 1px;
}

.filter-btn:hover, .filter-btn.active {
    color: #fffffe;
    font-style: italic;
    text-shadow: 0 0 6px var(--tpurple), 1px 1px 2px #010101;
    background: linear-gradient(to bottom, #010101, #0b0b0b);
}

.filter-btn:active {
    transform: translateY(1px);
}

.cards-display {
    padding: 20px;
    min-height: 500px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;

    /* Firefox Scrollbar Styling */
    scrollbar-width: thin; 
    scrollbar-color: #222 #000; 
}

.cards-display::-webkit-scrollbar {
    width: 6px;
}

.cards-display::-webkit-scrollbar-track {
    background: #000;
}

.cards-display::-webkit-scrollbar-thumb {
    background: #222;
}

.cards-display::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.character-card {
    width: 100%;
}

.character-card.hidden {
    display: none;
}

.card-frame {
    background:
    radial-gradient(circle at bottom right, var(--tpurple) 0%, transparent 40%),
    linear-gradient(180deg, #0b0b0b, #010101);
    border: 2px double #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -4px;
    box-shadow: 2px 2px 0 rgba(3, 3, 3, 0.89);
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-frame:hover {
    box-shadow: 3px 3px 0 rgba(3, 3, 3, 0.89);
}

.card-portrait {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-bottom: 1px solid #333;
    cursor: pointer;
    display: block;
}

.card-data {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-data h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #fff;
    text-align: center;
    font-weight: bold;
    letter-spacing: 2px;
    padding-bottom: 8px;
    border-bottom: 1px dotted #454545;
    text-shadow:
    -1px -1px 0 #010101,
    0px -1px 0 #010101,
    1px -1px 0 #010101,
    -1px 0px 0 #010101,
    1px 0px 0 #010101,
    -1px 1px 0 #010101,
    0px 1px 0 #010101,
    1px 1px 0 #010101;
}

.card-data p {
    font-size: 11px;
    line-height: 1.5;
    color: #aaa;
    text-align: center;
    text-shadow:
    -1px -1px 0 #010101,
    0px -1px 0 #010101,
    1px -1px 0 #010101,
    -1px 0px 0 #010101,
    1px 0px 0 #010101,
    -1px 1px 0 #010101,
    0px 1px 0 #010101,
    1px 1px 0 #010101;
    margin: 0 0 15px 0;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.card-actions a {
    flex: 1;
    padding: 8px 12px;
    background: linear-gradient(to bottom, #0b0b0b, #010101);
    border: 2px double #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -3px;
    box-shadow: 1px 1px 0 #010101;
    color: #bfbfbf;
    text-decoration: none;
    font-size: 11px;
    text-align: center;
    transition: all 0.2s;
    text-shadow:
    -1px -1px 0 #010101,
    0px -1px 0 #010101,
    1px -1px 0 #010101,
    -1px 0px 0 #010101,
    1px 0px 0 #010101,
    -1px 1px 0 #010101,
    0px 1px 0 #010101,
    1px 1px 0 #010101;
}

.card-actions a:hover {
    color: #fffffe;
    font-style: italic;
    text-shadow: 0 0 6px var(--tpurple), 1px 1px 2px #010101;
    background: linear-gradient(to bottom, #010101, #0b0b0b);
}

.detail-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(to bottom, #010101, #0f0f0f, #060606);
    border: 2px double #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -4px;
    box-shadow: 3px 3px 0 #010101;
    width: 800px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
}

.modal-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, var(--violet-glow), transparent);
    opacity: 0.31;
    pointer-events: none;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #fff;
}

.modal-layout {
    display: flex;
    height: 100%;
    position: relative;
    z-index: 1;
}

.modal-image {
    width: 300px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-right: 1px solid #222;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#modalImg {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border: 1px solid #333;
}

.dl-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(to bottom, #0b0b0b, #010101);
    border: 2px double #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -3px;
    box-shadow: 1px 1px 0 #010101;
    color: #bfbfbf;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s;
    text-shadow:
    -1px -1px 0 #010101,
    0px -1px 0 #010101,
    1px -1px 0 #010101,
    -1px 0px 0 #010101,
    1px 0px 0 #010101,
    -1px 1px 0 #010101,
    0px 1px 0 #010101,
    1px 1px 0 #010101;
    font-family: inherit;
}

.dl-btn:hover {
    color: #fffffe;
    font-style: italic;
    text-shadow: 0 0 6px var(--tpurple), 1px 1px 2px #010101;
    background: linear-gradient(to bottom, #010101, #0b0b0b);
}

.modal-info {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    max-height: 85vh;

    /* Firefox Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: #222 #000;
}

.modal-info h2 {
    margin: 0 0 25px 0;
    font-size: 20px;
    color: #fff;
    font-weight: bold;
    letter-spacing: 3px;
    padding-bottom: 10px;
    border-bottom: 1px dotted #454545;
    text-shadow:
    -1px -1px 0 #010101,
    0px -1px 0 #010101,
    1px -1px 0 #010101,
    -1px 0px 0 #010101,
    1px 0px 0 #010101,
    -1px 1px 0 #010101,
    0px 1px 0 #010101,
    1px 1px 0 #010101;
}

.info-section {
    margin-bottom: 25px;
}

.info-section h4 {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #ccc;
    font-weight: normal;
    letter-spacing: 1px;
    font-style: italic;
}

#greetNum {
    color: #888;
    font-size: 10px;
}

.info-text {
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed #333;
    padding: 15px;
    font-size: 12px;
    line-height: 1.6;
    color: #aaa;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    text-shadow:
    -1px -1px 0 #010101,
    0px -1px 0 #010101,
    1px -1px 0 #010101,
    -1px 0px 0 #010101,
    1px 0px 0 #010101,
    -1px 1px 0 #010101,
    0px 1px 0 #010101,
    1px 1px 0 #010101;

    /* Firefox Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: #222 #000;
}

.info-text::-webkit-scrollbar {
    width: 6px;
}

.info-text::-webkit-scrollbar-track {
    background: #000;
}

.info-text::-webkit-scrollbar-thumb {
    background: #222;
}

.info-text::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.greet-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.greet-nav button {
    width: 35px;
    height: 25px;
    background: linear-gradient(to bottom, #0b0b0b, #010101);
    border: 2px double #010101;
    outline: 1px solid var(--tpurple);
    outline-offset: -3px;
    box-shadow: 1px 1px 0 #010101;
    color: #bfbfbf;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
    font-family: inherit;
}

.greet-nav button:hover:not(:disabled) {
    color: #fffffe;
    background: linear-gradient(to bottom, #010101, #0b0b0b);
}

.greet-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .modal-box {
        width: 95%;
    }

    .modal-layout {
        flex-direction: column;
    }

    .modal-image {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #1a1a1a;
        padding: 20px;
    }
}