@font-face {
    font-family: 'Vampire Wars';
    src: url('fonts/Vampire Wars.ttf') format('truetype'),
         url('fonts/Vampire Wars.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Vampire Wars', sans-serif;
    background:
        radial-gradient(ellipse at 30% 0%, rgba(255,101,0,0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 100%, rgba(139,0,0,0.08) 0%, transparent 55%),
        radial-gradient(circle at center, #100c08 0%, #050304 100%);
    color: #e8dcc8;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background-color 0.5s;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: url('https://www.transparenttextures.com/patterns/brushed-alum-dark.png');
    opacity: 0.09;
    pointer-events: none;
    z-index: -1;
}

#head {
    background: linear-gradient(180deg, rgba(16,10,5,0.97) 0%, rgba(8,5,2,0.97) 100%);
    color: white;
    text-align: center;
    padding: 45px 20px 35px;
    text-transform: uppercase;
    letter-spacing: 6px;
    border-bottom: 2px solid #c9a227;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9), 0 0 60px rgba(255,101,0,0.06);
    position: relative;
    overflow: hidden;
}


#head::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0%, rgba(255,101,0,0.04) 50%, transparent 100%),
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(201,162,39,0.04) 40px);
    pointer-events: none;
}

#head::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff6500, #c9a227, #ff6500, transparent);
    animation: headerLine 4s ease-in-out infinite alternate;
}
@keyframes headerLine {
    0%   { opacity: 0.5; transform: scaleX(0.7); }
    100% { opacity: 1;   transform: scaleX(1); }
}

#head h1 {
    font-family: 'Vampire Wars', sans-serif;
    margin: 0;
    font-size: 3rem;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255,101,0,0.8),
        0 0 30px rgba(255,101,0,0.4),
        0 0 60px rgba(201,162,39,0.3);
    animation: slowPulse 4s infinite alternate;
}

@keyframes slowPulse {
    0%   { text-shadow: 0 0 10px rgba(255,101,0,0.6), 0 0 30px rgba(255,101,0,0.3), 0 0 60px rgba(201,162,39,0.2); }
    100% { text-shadow: 0 0 20px rgba(255,101,0,1.0), 0 0 50px rgba(255,101,0,0.6), 0 0 80px rgba(201,162,39,0.5); }
}

#head p {
    font-size: 1.1rem;
    color: #c9a227;
    letter-spacing: 4px;
    opacity: 0.85;
}

#main_box {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

#top_menu {
    display: flex;
    justify-content: space-between;
    background: rgba(16, 10, 5, 0.75);
    backdrop-filter: blur(12px);
    padding: 15px 25px;
    margin-top: 10px;
    border-radius: 6px;
    border: 1px solid rgba(201, 162, 39, 0.25);
    box-shadow: 0 8px 20px rgba(0,0,0,0.7), inset 0 1px 0 rgba(201,162,39,0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.search_div input, .filters select, .sort select {
    padding: 12px;
    font-size: 16px;
    font-family: 'Vampire Wars', sans-serif;
    font-weight: 700;
    background: rgba(10, 6, 2, 0.85);
    color: #d4b896;
    border: 1px solid rgba(201,162,39,0.2);
    border-radius: 4px;
    outline: none;
    transition: 0.3s;
    letter-spacing: 1px;
}

.search_div input { width: 250px; }

.search_div input:focus, .filters select:focus, .sort select:focus {
    box-shadow: 0 0 14px rgba(255, 101, 0, 0.5), 0 0 30px rgba(255, 101, 0, 0.2);
    border-color: #ff6500;
    color: #fff;
}

#bottom_part {
    display: flex;
    margin-top: 30px;
    gap: 30px;
    align-items: flex-start;
}

#left_col {
    width: 65%;
    background: rgba(12, 7, 3, 0.5);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(201, 162, 39, 0.25);
    box-shadow: inset 0 0 60px rgba(0,0,0,0.6), 0 0 20px rgba(255,101,0,0.03);
}

#right_col {
    width: 35%;
    position: sticky;
    top: 20px;
}

h2 {
    color: #c9a227;
    text-transform: uppercase;
    letter-spacing: 3px;
    border-bottom: 1px solid rgba(201,162,39,0.3);
    padding-bottom: 10px;
    font-family: 'Vampire Wars', sans-serif;
    text-shadow: 0 0 12px rgba(201,162,39,0.4), 0 2px 4px rgba(0,0,0,0.8);
}

#chars_grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    padding-top: 15px;
}


.card {
    position: relative;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 12px;
    width: 190px;
    text-align: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(20,25,30,0.9) 0%, rgba(10,12,16,0.95) 100%);
    box-shadow: 0 8px 15px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.02);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--card-color, rgba(255,255,255,0.1)) 0%, transparent 60%);
    opacity: 0;
    mix-blend-mode: color-dodge;
    transition: opacity 0.5s ease;
    transform: rotate(45deg);
    pointer-events: none;
    z-index: 1;
}

.card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--card-color, #888);
    box-shadow: 0 15px 35px rgba(0,0,0,0.9), 0 0 25px var(--card-color, transparent);
    z-index: 10;
}

.card:hover::before {
    opacity: 0.15;
    animation: rotateHolo 6s linear infinite;
}

@keyframes rotateHolo {
    100% { transform: rotate(405deg); }
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    transition: 0.4s;
    filter: brightness(0.85) contrast(1.1);
    position: relative;
    z-index: 2;
}

.card:hover img {
    filter: brightness(1.1) contrast(1.2);
    border-color: var(--card-color, #888);
    box-shadow: 0 0 15px var(--card-color, transparent);
}

.card h3 {
    margin: 12px 0 5px 0;
    color: #e6f1ff;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: 0.3s;
    text-transform: uppercase;
    z-index: 2;
    position: relative;
}

.card:hover h3 {
    color: #fff;
    text-shadow: 0 0 10px var(--card-color, #888);
}

.card button {
    background: rgba(0,0,0,0.5);
    color: #a8b2d1;
    padding: 10px;
    margin-top: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: 700;
    font-family: 'Vampire Wars', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.card button::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%; width: 0; height: 100%;
    background: var(--card-color, rgba(255,255,255,0.1));
    transform: translate(-50%, -50%) skewX(-15deg);
    z-index: -1;
    transition: width 0.3s;
    opacity: 0.3;
}

.card:hover button {
    border-color: var(--card-color, #555);
    color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.6);
}

.card:hover button::after {
    width: 120%;
}


#team_sec, #fight_sec {
    background: rgba(14, 8, 3, 0.82);
    backdrop-filter: blur(12px);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid rgba(201, 162, 39, 0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.85), inset 0 1px 0 rgba(201,162,39,0.08);
}

.player-panel {
    background: rgba(10, 6, 2, 0.85);
    transition: all 0.3s ease;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    border-radius: 6px;
}

.player-panel:hover {
    background: rgba(18, 10, 3, 0.92);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 10px rgba(255,101,0,0.08);
}

.chosen-grid {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.team-card {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(90deg, rgba(10,12,16,0.9) 0%, rgba(20,25,30,0.9) 100%);
    padding: 8px 12px;
    border-radius: 6px;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5), -2px 0 10px var(--card-color, transparent);
    transition: transform 0.2s, background 0.2s;
}

.team-card:hover {
    transform: scale(1.02) translateX(5px);
    background: linear-gradient(90deg, rgba(20,25,30,0.9) 0%, rgba(30,35,40,0.9) 100%);
    border-color: var(--card-color, #888);
}

@keyframes slideInRight {
    0% { transform: translateX(50px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.team-card img {
    border: 2px solid var(--card-color, #888);
    box-shadow: 0 0 10px var(--card-color, rgba(0,0,0,0.5));
}

button {
    font-family: 'Vampire Wars', sans-serif;
    letter-spacing: 1px;
}

#btn1 {
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

#btn1:not(:disabled) {
    background: linear-gradient(135deg, #8b3a00 0%, #5a2000 100%) !important;
    border-color: #ff6500 !important;
    color: #fff !important;
    box-shadow: 0 0 20px rgba(255,101,0,0.5), inset 0 0 10px rgba(255,255,255,0.1);
    animation: breathingGlow 2s infinite alternate;
}

@keyframes breathingGlow {
    0% { box-shadow: 0 0 15px rgba(255,101,0,0.4), 0 0 5px rgba(201,162,39,0.2); }
    100% { box-shadow: 0 0 35px rgba(255,101,0,0.8), 0 0 15px rgba(201,162,39,0.4); }
}

#btn1:not(:disabled):hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

#btn1:not(:disabled)::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(45deg) translateY(-100%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: rotate(45deg) translateY(-100%); }
    20% { transform: rotate(45deg) translateY(100%); }
    100% { transform: rotate(45deg) translateY(100%); }
}

.hide { display: none !important; }


.loading {
    text-align: center;
    width: 100%;
    color: #ff6500;
    font-size: 1.2rem;
    font-style: italic;
    padding: 30px;
    letter-spacing: 3px;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.5; text-shadow: 0 0 8px #ff6500; }
    100% { opacity: 1; text-shadow: 0 0 20px #ff6500, 0 0 40px rgba(255,101,0,0.4); }
}

@media screen and (max-width: 900px) {
    #bottom_part { flex-direction: column; }
    #left_col, #right_col { width: 100%; }
    #right_col {
        position: relative;
        top: 0;
    }
}

#char_modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(5, 6, 8, 0.85);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    visibility: visible;
}

#char_modal.modal-hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(135deg, rgba(20, 25, 30, 0.95) 0%, rgba(10, 12, 16, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px var(--card-color, rgba(0,0,0,0.8)), inset 0 0 20px rgba(255,255,255,0.02);
    border-radius: 12px;
    width: 75vw;
    height: 75vh;
    padding: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    color: #e6f1ff;
    transform: scale(1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.modal-hide .modal-content {
    transform: scale(0.8);
}

#close_modal_btn {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #a8b2d1;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
}

#close_modal_btn:hover {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

#modal_inner {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    height: 100%;
    align-items: center;
    position: relative;
    z-index: 2;
}

.modal-img-wrapper {
    flex: 1;
    min-width: 300px;
    height: 100%;
    border-radius: 10px;
    border: 2px solid var(--card-color, #444);
    box-shadow: 0 0 30px var(--card-color, rgba(0,0,0,0.5));
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1);
}

.modal-info-wrapper {
    flex: 1.5;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 20px;
}

.modal-title {
    font-family: 'Vampire Wars', sans-serif;
    font-size: 3rem;
    margin: 0 0 15px 0;
    color: #fff;
    text-shadow: 0 0 15px var(--card-color, #888);
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-stat-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--card-color, #888);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.modal-stat-title {
    font-weight: bold;
    color: var(--card-color, #a8b2d1);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.modal-stat-value {
    font-size: 1.2rem;
    color: #fff;
}

.modal-abilities {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 15px;
    margin-top: 5px;
    flex-grow: 1;
    overflow-y: auto;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

.modal-abilities h4 {
    margin-top: 0;
    color: #ff6500;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px dashed rgba(255,101,0,0.35);
    padding-bottom: 5px;
}

.modal-abilities ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.modal-abilities li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-left: 20px;
    position: relative;
}

.modal-abilities li::before {
    content: "⚡";
    position: absolute;
    left: 0;
    color: var(--card-color, #fff);
    font-size: 0.8rem;
}

@media screen and (max-width: 900px) {
    .modal-content {
        width: 90vw;
        height: 90vh;
        overflow-y: auto;
    }
    #modal_inner {
        flex-direction: column;
        height: auto;
    }
    .modal-img-wrapper {
        min-height: 300px;
        flex: none;
        width: 100%;
    }
}


#theme_toggle {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(201,162,39,0.1);
    border: 1px solid rgba(201,162,39,0.4);
    color: #c9a227;
    font-size: 1.4rem;
    padding: 8px 14px;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 100;
    line-height: 1;
}
#theme_toggle:hover {
    background: rgba(255,101,0,0.2);
    border-color: #ff6500;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 14px rgba(255,101,0,0.5);
}


html.light-mode body {
    background:
        radial-gradient(ellipse at 30% 0%, rgba(255,180,80,0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 100%, rgba(200,160,50,0.06) 0%, transparent 55%),
        radial-gradient(circle at center, #fdf6ec 0%, #f0e6d0 100%);
    color: #1c1208;
}
html.light-mode body::before { opacity: 0.04; }

html.light-mode #head {
    background: linear-gradient(180deg, rgba(255,245,225,0.97) 0%, rgba(245,230,200,0.95) 100%);
    border-bottom: 2px solid #c9a227;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 0 40px rgba(201,162,39,0.1);
}
html.light-mode #head h1 {
    color: #2a1200;
    text-shadow: 0 0 15px rgba(255,101,0,0.3), 0 0 30px rgba(201,162,39,0.2);
}
html.light-mode #head p { color: #7a5a18; }

html.light-mode #theme_toggle {
    background: rgba(201,162,39,0.1);
    border-color: rgba(201,162,39,0.4);
    color: #7a4800;
}
html.light-mode #theme_toggle:hover { background: rgba(255,101,0,0.12); border-color: #ff6500; }

html.light-mode #top_menu {
    background: rgba(255,245,225,0.75);
    border: 1px solid rgba(201,162,39,0.25);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}
html.light-mode .search_div input,
html.light-mode .filters select,
html.light-mode .sort select {
    background: rgba(255,248,235,0.9);
    color: #1c1208;
    border-color: rgba(201,162,39,0.3);
}
html.light-mode .search_div input:focus,
html.light-mode .filters select:focus,
html.light-mode .sort select:focus {
    box-shadow: 0 0 10px rgba(255,101,0,0.25);
    border-color: #ff6500;
}

html.light-mode #left_col {
    background: rgba(255,248,235,0.5);
    border: 1px solid rgba(201,162,39,0.2);
}
html.light-mode h2 { color: #5a3000; border-bottom-color: rgba(201,162,39,0.4); text-shadow: none; }

html.light-mode .card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(240,242,248,0.98) 100%);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
html.light-mode .card h3 { color: #1c1208; }
html.light-mode .card:hover h3 { color: #000; }
html.light-mode .card button {
    background: rgba(255,248,235,0.85);
    color: #2a1200;
    border-color: rgba(201,162,39,0.3);
}

html.light-mode #team_sec, html.light-mode #fight_sec {
    background: rgba(255,245,225,0.75);
    border: 1px solid rgba(201,162,39,0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
html.light-mode .player-panel {
    background: rgba(255,248,235,0.8);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.04);
}
html.light-mode .player-panel:hover { background: rgba(255,240,215,0.9); }
html.light-mode .team-card {
    background: linear-gradient(90deg, rgba(255,248,235,0.9) 0%, rgba(255,255,240,0.9) 100%);
    border-color: rgba(201,162,39,0.2);
}
html.light-mode .team-card:hover {
    background: linear-gradient(90deg, rgba(255,238,200,0.9) 0%, rgba(255,248,220,0.9) 100%);
}

html.light-mode #char_modal { background-color: rgba(180,150,80,0.4); }
html.light-mode .modal-content {
    background: linear-gradient(135deg, rgba(255,252,240,0.98) 0%, rgba(255,244,220,0.99) 100%);
    border: 1px solid rgba(201,162,39,0.3);
    color: #1c1208;
}
html.light-mode .modal-title { color: #2a1200; }
html.light-mode .modal-stat-box { background: rgba(255,248,220,0.6); }
html.light-mode .modal-stat-value { color: #1c1208; }
html.light-mode .modal-abilities { background: rgba(255,242,200,0.5); border-color: rgba(201,162,39,0.2); }
html.light-mode .modal-abilities h4 { color: #cc2200; }
html.light-mode .modal-abilities li { border-bottom-color: rgba(201,162,39,0.15); color: #1c1208; }
html.light-mode #close_modal_btn { color: #7a5018; }
html.light-mode #close_modal_btn:hover { color: #cc2200; }
