@import url(https://hangeul.pstatic.net/hangeul_static/css/nanum-square.css);

@font-face {
    font-family: "RIDIBatang";
    font-style: normal;
    font-weight: 400;
    src: 
        url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_twelve@1.0/RIDIBatang.woff') format('woff');
}

/* 
----------------------------------------------------
>>> KEY COLOR AND STYLE SETTINGS <<<
Здесь ты можешь легко менять основные цвета игры.
----------------------------------------------------
*/
:root {
    --quote-view: block;
    --explain-view: block;
    --advise-view: block;

    /* --- Main page background (solid color) --- */
    --color-background: #0d0b14; 
    
    /* --- Accent color for highlights, borders, etc. --- */
    --color-accent: #a972cb;
    --color-accent-dark: #8e5aa4;
    
    /* --- Colors for blocks and interface elements --- */
    --color-box: rgba(26, 20, 43, 0.75);
    --color-box-light: rgba(42, 33, 61, 0.85);
    --color-text: #D8D4E4;
    --color-text-darker: #938ca1;
    --color-border: rgba(169, 114, 203, 0.3);
    
    /* --- Glow effect for highlighted elements --- */
    --color-glow: rgba(169, 114, 203, 0.6);
    
    --color-bar: #120f1a;

    --color-normal: #B0B0B0;
    --color-expert: #87CEFA;
    --color-ultimate: #FFD700;
    --color-heat: #52d68a; /* ДОБАВЛЕНО: Зеленый цвет для показателя Heat */

    --scaledown-speed: 1s;


    
}

html {
    scroll-behavior: auto;
    background: var(--color-background);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 18px;
    overflow-y: scroll;
}

/* 
----------------------------------------------------
>>> ДОБАВЛЕНО: Эффект легкого шума для фона <<<
Создаем псевдо-элемент, который накладывается на всю страницу 
и имеет текстуру шума, сгенерированную через SVG.
----------------------------------------------------
*/
html::before {
    content: "";
    position: fixed; /* Покрывает весь экран и не скроллится */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 
     *  Вот здесь магия: мы используем встроенный SVG для генерации шума.
     *  Это избавляет от необходимости загружать отдельную картинку.
     */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    /* 
     *  КЛЮЧЕВОЙ ПАРАМЕТР: Прозрачность шума.
     *  Меняй это значение от 0.02 до 0.1, чтобы сделать шум более или менее заметным.
     */
    opacity: 0.04; 
    z-index: -1; /* Помещает шум ПОД всем остальным контентом */
    pointer-events: none; /* Гарантирует, что слой с шумом не будет мешать кликам */
}


body {
    font-family: 'NanumSquare', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    word-break: keep-all;
    user-select: none;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-bar);
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-accent-dark);
    border-radius: 10px;
    border: 3px solid var(--color-bar);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-accent);
}

::-webkit-scrollbar-button {
    display: none;
}

hr {
    width: 80%;
    background: var(--color-border);
    height: 1px;
    border: none;
    margin: 20px auto;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    background: var(--color-background);
    color: var(--color-accent-dark);
    font-size: 1.5rem;
    margin-top: 20px;
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    background-color: var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--color-glow), 0 0 30px var(--color-accent);
    animation: pulsate 2s ease-in-out infinite alternate;
}

@keyframes pulsate {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 10px var(--color-glow), 0 0 20px var(--color-accent);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 0 25px var(--color-glow), 0 0 50px var(--color-accent);
        opacity: 1;
    }
}


#loadingText {
    transition: opacity 1s ease-in-out;
    opacity: 1;
}

.blurPart {
    opacity: 0;
    transition: opacity 1s ease-in-out !important;
}
.blurPart.visible {
    opacity: 1;
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    transition: all 0.1s ease;
}

.box {
    box-sizing: border-box;
    background: var(--color-box);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 20px;
    margin: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1), inset 0 0 0 1px var(--color-border);
}

.button {
    cursor: pointer;
    background: var(--color-box-light);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.button2 {
    border-radius: 32px;
}

.box-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 5px var(--color-accent), 0 0 10px rgba(0,0,0,0.5);
}

.button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px var(--color-glow);
    border-color: var(--color-accent);
}

.box.active {
    background: var(--color-box-light);
    border-color: var(--color-accent);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 20px var(--color-glow);
}

/* You can add more image URLs to this list or adjust the brightness value (e.g., 0.6 for darker). */
img[src="image/personality1.webp"],
img[src="image/personality2.webp"],
img[src="image/personality3.webp"],
img[src="image/personality4.webp"] {
    filter: brightness(0.75);
}

.box.active img[src*="personality"],
.box.button:hover img[src*="personality"] {
    filter: brightness(1); /* Return to normal brightness on hover/selection */
}


.filterDropdown {
    flex-wrap: wrap;
    position: absolute;
    background-color: var(--color-box-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px;
    margin: 10px;
    z-index: 1000;
}
.filterGroup {
    margin-bottom: 10px;
}
.filterGroup label {
    margin-right: 10px;
}

.hidden {
    display: none;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(50%);
}
.disabledCard {
    opacity: 0.5;
}

.box-img img {
    max-height: calc(100vh - 80px);
    width: 100%;
    border-radius: 10px;
    transition: filter 0.3s ease;
}

.retire {
    filter: grayscale(100%);
}

.box-card {
    overflow: hidden;
    width:50%;
    height:100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.box.halfimage .box-img {
    max-width: 40%;
    margin: 0 auto;
}

.box-title {
    width: 100%;
    font-size: 1.8rem;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.box-subtitle {
    width: 100%;
    font-size: 1.4rem;
    text-align: left;
    margin-left: 64px;
    margin-top: 32px;
    margin-bottom: 10px;
}

.box-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
}

.box.halfimage .box-content {
    align-items: center;
}

.classDetail .box-content {
    flex-wrap: wrap;
}

.box-text {
    margin-top: 1%;
    margin-bottom: 1%;
    margin-left: 2%;
    margin-right: 2%;
    color: var(--color-text-darker);
}
.box.active .box-text, .button:hover .box-text {
    color: var(--color-text);
}

.box.halfimage .box-text {
    width: 60%;
}

.box.describe {
    min-height: 240px;
}

.box.dialogue .box-img {
    max-width: 240px;
}

.box.dialogue .box-text {
    width: 80%;
    font-size: 1.1rem;
}

.storyLine {
    background: var(--color-border);
    height: 2px;
    margin: 80px;
}

blockquote {
    color: var(--color-text-darker);
    border-left: 3px solid var(--color-accent-dark);
    padding: 10px 10px 10px 20px;
    margin: 10px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    font-style: italic;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.1);
    border-radius: 0 8px 8px 0;
}

.active blockquote {
    color: var(--color-text);
    border-left-color: var(--color-accent);
}

blockquote br {
    display: block;
    content: "";
    margin: 0.5em 0;
}

.explain {
    display: var(--explain-view);
    padding-left: 16px;
    margin-left: 0;
    padding-bottom: 16px;
}

.explain li {
    font-size: 0.9rem;
    line-height: 1;
    margin-bottom: 10px;
}

.subtext {
    font-weight: bolder;
    font-size: 0.9rem;
    text-align: center;
}

.subtext i {
    font-weight: normal;
    color: var(--color-text-darker);
    transition: all 0.3s ease;
}

.active .subtext i {
    color: var(--color-text);
}

.tooltip {
    font-weight: bolder;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}
@keyframes shake2 {
    0%, 100% { transform: translateY(0); }
    20%, 60% { transform: translateY(-10px); }
    40%, 80% { transform: translateY(10px); }
}
@keyframes shake3 {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(-5deg); }
    40%, 80% { transform: rotate(5deg); }
}

.shake { animation: shake; }
.shake2 { animation: shake2; }
.shake3 { animation: shake3; }

@keyframes scaleDown { 100% { transform: scale(1); } }

.scale-down { animation: scaleDown var(--scaledown-speed); }
.xscale-down { transform: scaleX(1); }

label {
    display: flex;
    align-items: center;
}

[type="checkbox"] {
    appearance: none;
    position: relative;
    border: 2px solid var(--color-accent-dark);
    border-radius: 1.25em;
    width: 2.25em;
    height: 1.25em;
    transition: all 0.3s ease;
    cursor: pointer;
}

[type="checkbox"]::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: calc(1.25em - 8px);
    height: calc(1.25em - 8px);
    border-radius: 50%;
    transform: scale(0.8);
    background: var(--color-accent-dark);
    transition: all 250ms linear;
}

[type="checkbox"]:checked {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

[type="checkbox"]:checked::before {
    background: var(--color-bar);
    left: 1em;
}

.fadeInMoveUp {
    text-align: center;
    pointer-events: none;
    animation-name: fadeInMoveUp;
    animation-duration: 4s;
    position: absolute;
    z-index: 100;
    opacity: 0;
    font-weight: bolder;
    text-shadow: 0 0 5px white;
}

@keyframes fadeInMoveUp {
    0% { transform: translateY(0); opacity: 0; }
    50% { transform: translateY(-20px); opacity: 1; }
    80% { transform: translateY(-20px); opacity: 1; }
    100% { transform: translateY(-20px); opacity: 0; }
}

.scrollTo {
    background: var(--color-box-light);
    color: var(--color-accent);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0;
    padding: 0;
    position: fixed;
    z-index: 200;
    cursor: pointer;
    border: 1px solid var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}
.scrollTo h2 { margin: 0; }

#scrollToTop { bottom: 86px; right: 16px; }
#scrollToBottom, #scrollToBottom2 { bottom: 20px; right: 16px; }

.cardList { justify-content: center; }

/* --- Base card brightness setting --- */
.card {
    isolation: isolate;
    outline: 2px solid transparent; /* Reserve space for outline */
    font-family: 'RIDIBatang';
    width: 30vmin;
    height: 45vmin;
    margin: 18px 10px;
    border-radius: 20px;
    overflow: visible;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    filter: brightness(0.9); /* Base brightness for unselected cards */
}

.card.bad { box-shadow: 0 0 30px rgba(255, 80, 80, 1); outline: 1px solid rgba(255, 80, 80, 1); }
.card.meet { box-shadow: 0 0 30px rgba(255, 255, 80, 1); }

/* --- UPDATE: Stronger highlight for selected cards --- */
.card.active {
    filter: brightness(0.95) contrast(120%); /* Make selected cards brighter */
    outline: 3px solid var(--color-accent); /* Add a thicker, solid outline */
    box-shadow: 
        0 0 10px var(--color-glow),   /* Ближний, резкий свет */
        0 0 30px var(--color-glow),   /* Средний фокус */
        0 0 60px var(--color-glow);   /* Дальний, сильный разброс */
}

.card.spell { box-shadow: 0 0 30px rgba(100, 50, 255, 1); opacity: 0.8; }
.card.selected { box-shadow: 0 0 10px var(--color-glow); opacity: 0.8; }

.card-image {
    line-height: 0;
    width: 90%;
    top: -5%;
    left: 5%;
    overflow: hidden;
    position: relative;
    border-radius: 50% 50% 0 0;
}

.card-image img { width: 100%; object-fit: cover; }
.card.wildcard .card-image img { filter: sepia(100%); }

.card-image-original {
    position: absolute;
    top: 0px;
    left: 0px;
    transition: all 0.2s ease;
}

.card-name {
    overflow: hidden;
    width: 99%;
    height: 10%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: -1%;
    top: -5%;
    padding: 2%;
    position: relative;
    color: white;
    text-shadow: 0 1px 3px #000;
    text-align: center;
    font-size: 2.7vmin; 
    border-radius: 5px;
    z-index: 2;
}

.card-text {
    left: 5%;
    top: -5%;
    width: 82%;
    height: 23.5%;
    padding: 4%;
    position: relative;
    display: flex;
    align-items: center;
    font-size: 1.6vmin;
    line-height: 1.3;
    overflow: hidden;
    color: #222222;
}

.card-text br { display: block; content: ""; margin: 0.4em 0; }
.card-text span { transition: color 0.5s; }
.runningText { color: #228B22; }
.completeText { color: #555555; }

.card-type {
    width: 40%;
    height: 6.25%;
    top:-7%;
    left:30%;
    position: relative;
    font-weight: bold;
    text-align: center;
    font-size: 2vmin;
    border-radius: 30%;
    color: #333333;
}

.quickBar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: var(--color-bar);
    font-size: 1rem;
    font-weight: bold;
    padding: 5px;
    text-align: center;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.quickBar .box {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--color-text-darker);
}
.quickBar .box:hover {
    color: var(--color-accent);
    background: rgba(169, 114, 203, 0.1);
}
.quickBar .box.active {
    color: var(--color-accent);
    text-shadow: 0 0 5px var(--color-accent);
}

#deckInfo {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--color-bar);
    font-size: 1rem;
    font-weight: bold;
    padding: 10px;
    text-align: center;
    display: none;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}
#deckInfo .box {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 5px 10px;
}

#info-tab {
    position: fixed;
    left: 0;
    top: 0;
    width: 30vh; /* ИЗМЕНЕНО: было 45vh, стало 30vh для компактности */
    height: 100%;
    background: rgba(26, 20, 43, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
    border-right: 1px solid var(--color-border);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Cinzel', serif;
    z-index: 200;
}
.portrait { position: relative; margin: 0 auto; overflow: hidden; }
.portraitBattle {
    position: relative;
    width: 30vh;
    height: 30vh;
    margin: 0 auto;
    margin-bottom: 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-border);
    box-shadow: 0 0 20px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,0.5);
}
.clothes { position: absolute; top: 0; left: 0; pointer-events: none; width: 100%; }
.filter { position:absolute; opacity: 0; z-index:50; height:100%; width:100%; transition: opacity 0.5s; }

.number {
    color: var(--color-accent);
    text-shadow: 0 0 5px var(--color-glow);
    transition: color 0.5s;
}

/* ДОБАВЛЕНО: Правила для исправления цвета цифр */
#lewd.number {
    color: var(--color-text); /* Устанавливаем цвет как у обычного текста */
}
#Heat.number {
    color: var(--color-heat); /* Используем новую переменную для зеленого цвета */
}

#info-tab .box { padding: 0; overflow: visible; align-items: center; background: transparent; border: none; box-shadow: none; }
#info-tab .box-title { font-family: 'Cinzel', serif; }

#button-tab {
    position: fixed;
    right: 0;
    top: 0;
    width: 10vw;
    height: 100%;
    background: rgba(26, 20, 43, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.5);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    z-index: 200;
}

#button-tab .buttons { display: flex; font-size: 1rem; flex-direction: column; gap: 10px; }
#button-tab .battleButton {
    padding: 10px 0;
    width: 100%;
    align-items: center;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--color-border);
}
#button-tab .battleButton:hover {
    background: var(--color-box-light);
    border-color: var(--color-accent);
}
#button-tab .battleButton.active {
    background: var(--color-box-light);
    border-color: var(--color-accent);
    box-shadow: 0 0 10px var(--color-glow);
}
#button-tab .battleButton p { margin: 0; }

#main-content {
    flex-grow: 1;
    padding-left: 30vh; /* ИЗМЕНЕНО: было 45vh, стало 30vh */
    padding-right: 10vw;
    box-sizing: border-box;
}

.battleContent { min-height: 50vh; }
.battleContent.turnContent {
    background: transparent;
    border: 1px solid var(--color-border);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    border-radius: 20px;
    margin-bottom: 16px;
}
.battleContent .box { align-self: flex-start; }

#message-wrapper { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 300; pointer-events: none; visibility: hidden; }
#message {
    font-family: 'Cinzel', 'Black Han Sans', sans-serif;
    font-weight: 700;
    position: relative;
    font-size: 6rem;
    background: rgba(169, 114, 203, 0.2);
    border: 2px solid var(--color-accent);
    min-width: 50vw;
    color: white;
    text-shadow: 0 0 15px #000;
    border-radius: 20px;
    text-align: center;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    padding: 20px;
}

#speech-bubble {
    word-break: break-all;
    width: 20vw;
    min-height: 10vh;
    position: fixed;
    padding: 20px;
    background: var(--color-box-light);
    border-radius: 10px;
    border: 1px solid var(--color-border);
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.speechArrow::before {
    border-top: 15px solid transparent;
    border-left: 0px solid transparent;
    border-right: 30px solid var(--color-border);
    border-bottom: 15px solid transparent;
    content:"";
    position:fixed;
    top: 50%;
    left: -31px;
}

.speechArrow::after {
    border-top: 14px solid transparent;
    border-left: 0px solid transparent;
    border-right: 28px solid var(--color-box-light);
    border-bottom: 14px solid transparent;
    content:"";
    position:fixed;
    top: calc(50% + 1px);
    left: -28px;
}

.battleLog {
    padding: 10px;
    padding-bottom: 2vh;
    font-size: 1rem;
    word-wrap: break-word;
    user-select:text;
    box-sizing: border-box;
}

#log-container {
    background: var(--color-bar);
    color: white;
    position: fixed;
    bottom: 0;
    left: 30vh; /* ИЗМЕНЕНО: было 45vh, стало 30vh */
    right: 10vw;
    height: 20vh;
    opacity: 0.8;
    overflow-y: auto;
    z-index: 200;
    border-top: 1px solid var(--color-border);
}

#endingDocument img {
    max-height: calc(50vh - 80px);
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

#useActions{ scroll-behavior: smooth; }
#useActions::-webkit-scrollbar{ display:none; }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 900;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    padding: 20px;
    border-radius: 10px;
    max-width: 80%;
    min-width: 300px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

/* --- FIX: Reverted to Original Table Layout Logic (Themed) --- */
.modal-body {
    background-color: transparent;
    padding: 0;
}
.modal-body h2 {
    text-align: center;
    margin-bottom: 20px;
}
.caption {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 10px;
    background-color: var(--color-box-light);
    position: sticky;
    top: 0;
    z-index: 1;
    border-radius: 8px;
}
.caption-item {
    text-align: center;
    font-weight: bold;
    position: relative;
    flex: 1;
    padding: 0 5px;
}

.caption-item + .caption-item::before {
    content: "|";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-border);
}
.caption-item.captionNum { flex: 0.5; }
.caption-item.captionName { flex: 1.5; text-align: left; }
.caption-item.captionFace { flex: 0.5; }
.caption-item.captionPs { flex: 0.5; }

.profile-list {
    overflow-y: auto;
    background-color: var(--color-box);
    border-radius: 5px;
    padding: 10px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.3s;
    background-color: transparent;
    align-items: center;
    border-radius: 4px;
}
.profile-item:last-child {
    border-bottom: none;
}
.profile-item:hover {
    background-color: var(--color-box-light);
}
.profile-item span {
    text-align: center;
    position: relative;
    flex: 1;
    padding: 0 5px;
}
.profile-item span + span::before {
    content: "|";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-border);
}
.profile-item span.captionNum { flex: 0.5; }
.profile-item span.captionName { flex: 1.5; text-align: left;}
.profile-item span.captionFace { flex: 0.5; }
.profile-item span.captionPs { flex: 0.5; }


.card-info-tooltip {
    position: absolute;
    background-color: var(--color-box-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    padding: 15px;
    display: none;
    z-index: 1000;
    width: 250px;
    word-wrap: break-word;
    font-size: 0.85rem;
    color: var(--color-text);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.card-info-tooltip.visible { display: block; opacity: 1; }
.card-info-tooltip div { margin-bottom: 8px; line-height: 1.4; }
.card-info-tooltip div:last-child { margin-bottom: 0; }
.card-info-tooltip .name { font-weight: bold; font-size: 0.9rem; color: #fff; }
.card-info-tooltip .desc { font-size: 0.8rem; color: var(--color-text-darker); }

.negativeEffect { animation: negativeAnimation 10s infinite; }
@keyframes negativeAnimation {
    9% { filter: none; }
    10% { filter: invert(1); }
    11% { filter: none; }
    29% { filter: none; }
    30% { filter: invert(1); }
    31% { filter: none; }
    32% { filter: invert(1); }
    33% { filter: none; }
    50% { filter: none; }
}

.classInfoImg, .classInfoImgSmall { transition: opacity 0.5s; }

#collectionImgSwap, #collectionImgDetail {
    flex: 0 1 calc(30% - 20px);
    text-align: center;
    display: block;
    border: 1px solid var(--color-border);
}

.story-img { flex: 0 1 calc(50% - 20px); background: transparent; }
.collectionImg { max-width: 80%; }

.dynamicSize25 { flex: 0 1 calc(25% - 20px); }
.dynamicSize20 { flex: 0 1 calc(20% - 20px); }

/* Responsive adjustments */
@media screen and (max-width: 1200px) {
    .dynamicSize25 { flex: 0 1 calc(33.33% - 20px); }
    .dynamicSize20 { flex: 0 1 calc(25% - 20px); }
}

@media screen and (max-width: 768px) {
    html { font-size: 16px; }
    p { margin: 8px; }
    .dynamicSize25 { flex: 0 1 calc(50% - 20px); }
    .dynamicSize20 { flex: 0 1 calc(50% - 20px); }
    .quickBar { font-size: 0.7rem; }
    #deckInfo { font-size: 0.7rem; }
    .hide-on-mobile { display: none !important; }
    .box.halfimage .box-content { flex-wrap: wrap; }
    .box.halfimage .box-img { max-width: 100%; }
    .box.halfimage .box-text { width: 100%; }
    .collectionImg { max-width: 60%; }
    .story-img { flex: 0 1 calc(80% - 20px); }
    .profile-detail { flex-wrap: wrap; justify-content: center; }
    #rule-text { width: 100%; }

    #rotate-message {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.9);
        color: white;
        font-size: 2rem;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
    }
    @media screen and (orientation: portrait) { #rotate-message { display: flex; } }
}

@media screen and (min-width: 769px) { .hide-on-desktop { display: none; } }


/* --- 1. Левая панель (статы и портрет игрока/врага) --- */
#info-tab {
    width: 30vh;            /* Ширина панели. Можете уменьшить, например, до 25vh. */
    padding: 5px;           /* Внутренние отступы. Уменьшено с 20px до 5px. */
}

/* --- 2. Портреты в левой панели --- */
.portraitBattle {
    width: 25vh;            /* Ширина круглого портрета. Уменьшено с 30vh. */
    height: 25vh;           /* Высота круглого портрета. Уменьшено с 30vh. */
    margin-bottom: 10px;    /* Отступ снизу. Уменьшено с 20px. */
}

/* --- 3. Правая панель (кнопки) --- */
#button-tab {
    width: 7vw;             /* Ширина панели. Уменьшено с 10vw. */
    padding: 5px;           /* Внутренние отступы. Уменьшено с 20px до 5px. */
}

/* --- 4. Основная игровая область (центр) --- */
/* Этот блок нужен, чтобы контент не залезал под боковые панели. */
#main-content {
    padding-left: 30vh;     /* Должно совпадать с шириной левой панели (width у #info-tab) */
    padding-right: 7vw;     /* Должно совпадать с шириной правой панели (width у #button-tab) */
}

/* --- 5. Контейнер лога внизу --- */
/* Этот блок тоже нужно скорректировать под новые размеры панелей. */
#log-container {
    left: 30vh;             /* Должно совпадать с шириной левой панели (width у #info-tab) */
    right: 7vw;             /* Должно совпадать с шириной правой панели (width у #button-tab) */
}

/* --- Стили для разделителя категорий (КЛАССЫ / РАСЫ) --- */
.categoryTitle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 2em 0; /* Добавил умеренные отступы для воздуха, можете убрать, если не нужно */
}

.categoryTitle h2 {
    white-space: nowrap;
    /* ИЗМЕНЕНИЕ ЗДЕСЬ: Добавляем !important, чтобы переопределить инлайн-стиль */
    color: var(--color-accent) !important; 
    font-size: 2em;
    text-shadow: 0 0 8px var(--color-glow);
}

.categoryTitle div {
    flex-grow: 1;
    height: 1px;
}

.categoryTitle div:first-of-type {
    margin-right: 15px;
    background: linear-gradient(to right, transparent, var(--color-border));
}

.categoryTitle div:last-of-type {
    margin-left: 15px;
    background: linear-gradient(to left, transparent, var(--color-border));
}