/* === ТЕМЫ И ПЕРЕМЕННЫЕ === */
:root {
    --bg-primary: #eef4fb;
    --bg-secondary: #f5faff;
    --bg-card: white;
    --bg-header: #4d93de;
    --bg-header2: #2b6fb9;
    --bg-h3: #67abef;
    --text-primary: #263646;
    --text-secondary: #5a6d82;
    --text-accent: #2f76c6;
    --border-light: #d7e2ef;
    --border-accent: #6eb4f2;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --btn-bg: #f7fbff;
    --btn-border: #d7e2ef;
    --bonus-btn-text: #2f76c6;
    --footer-bg: #395a7b;
    --footer-text: white;
    --mutant-accent: #eb6a74;
    --mutant-accent-dark: #c94952;
    --mutant-section-bg: #fff1f3;
    --mutant-header-bg: #fff7f8;
    --mutant-header-text: #53272c;
    --mutant-title-bg: #d95a64;
    --cigar-accent: #59c86d;
    --cigar-accent-dark: #2f9749;
    --cigar-section-bg: #eef8ee;
    --cigar-header-bg: #f7fff7;
    --cigar-header-text: #24412a;
    --cigar-title-bg: #46ad5c;
    --tooltip-bg: #2c2c2c;
    --tooltip-text: #f0f0f0;
    --tooltip-accent: #6eb4f2;
}

[data-theme="dark"] {
    --bg-primary: #101824;
    --bg-secondary: #142133;
    --bg-card: #1a293a;
    --bg-header: #2b5f99;
    --bg-header2: #214f83;
    --bg-h3: #3270ac;
    --text-primary: #e4edf8;
    --text-secondary: #aec0d4;
    --text-accent: #7dc0ff;
    --border-light: #31475f;
    --border-accent: #5aa6f0;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --btn-bg: #1d2e41;
    --btn-border: #3d5570;
    --bonus-btn-text: #8bcaff;
    --footer-bg: #162537;
    --footer-text: #dbe8f6;
    --mutant-accent: #ff8f98;
    --mutant-accent-dark: #d45a63;
    --mutant-section-bg: #251518;
    --mutant-header-bg: #2b181c;
    --mutant-header-text: #ffd9dd;
    --mutant-title-bg: #a63d46;
    --cigar-accent: #79d98a;
    --cigar-accent-dark: #4eb866;
    --cigar-section-bg: #16231a;
    --cigar-header-bg: #1b2a1f;
    --cigar-header-text: #d7f0dd;
    --cigar-title-bg: #2f8045;
    --tooltip-bg: #1a1a1a;
    --tooltip-text: #e0e0e0;
    --tooltip-accent: #6fbdf7;
}

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

body {
    cursor: url('https://snipp.ru/demo/712/pointer-1.cur') 4 1, pointer;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

h1 {
    width: 100%;
    height: 85px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 32px;
    text-shadow: 2px 2px 4px var(--shadow-light);
    transition: background-color 0.4s ease;
}

.artifact-title {
    background: linear-gradient(135deg, var(--bg-header), var(--bg-header2));
}

h2 {
    width: 100%;
    height: 60px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 24px;
    text-shadow: 2px 2px 4px var(--shadow-light);
    margin-top: 30px;
    transition: background-color 0.4s ease;
}

.section-title {
    letter-spacing: 0.4px;
}

.mutant-title {
    background: linear-gradient(135deg, var(--mutant-title-bg), var(--mutant-accent-dark));
}

.cigar-title {
    background: linear-gradient(135deg, var(--cigar-title-bg), var(--cigar-accent-dark));
}

h3 {
    width: 100%;
    padding: 15px;
    background-color: var(--bg-h3);
    color: white;
    text-align: center;
    font-size: 18px;
    text-shadow: 1px 1px 2px var(--shadow-light);
    margin-top: 20px;
    transition: background-color 0.4s ease;
}

.header-stats {
    background: linear-gradient(180deg, var(--bg-secondary), rgba(255, 255, 255, 0.8));
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid var(--border-accent);
    color: var(--text-primary);
    position: relative;
    transition: all 0.4s ease;
}

.search-container {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle-btn,
.settings-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-accent);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px var(--shadow-light);
    padding: 0;
    line-height: 1;
}

.theme-toggle-btn:hover,
.settings-btn:hover {
    background: var(--border-accent);
    color: white;
    transform: scale(1.05);
}

.export-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-accent);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin-top: 10px;
}

.export-btn:hover {
    background: var(--border-accent);
    color: white;
}

.search-input {
    width: 200px;
    padding: 10px 15px;
    border: 2px solid var(--border-accent);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.search-input::placeholder {
    color: #999;
    opacity: 0.7;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 12px rgba(110, 180, 242, 0.4);
    width: 250px;
    border-color: var(--border-accent);
}

.sum-display {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-primary);
}

#totalSum,
#finalSum,
#mutantTotalSum {
    color: var(--text-accent);
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
}

#totalSum,
#mutantTotalSum {
    font-size: 28px;
}

#finalSum {
    font-size: 18px;
}

#totalSum:hover,
#finalSum:hover,
#mutantTotalSum:hover {
    opacity: 0.8;
    background-color: rgba(47, 118, 198, 0.12);
}

.bonus-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.bonus-btn {
    padding: 10px 16px;
    border: 2px solid var(--border-accent);
    background-color: var(--bg-card);
    color: var(--bonus-btn-text);
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 70px;
}

.bonus-btn:hover {
    background-color: var(--border-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-light);
}

.bonus-btn.active {
    background-color: var(--border-accent);
    color: white;
}

.final-sum {
    font-size: 18px;
    color: var(--text-accent);
    font-weight: bold;
    margin-top: 10px;
}

.reset-btn {
    padding: 8px 12px;
    margin-top: 10px;
    background-color: var(--bg-header2);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background-color: var(--bg-header);
}

.content {
    flex: 1;
    width: 90%;
    max-width: 1400px;
    margin: 20px auto;
    text-align: center;
}

.buttons-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.item {
    cursor: url('https://snipp.ru/demo/712/pointer-1.cur') 4 1, pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background-color: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px var(--shadow-light);
    color: var(--text-primary);
    position: relative;
}

.item:hover {
    border-color: var(--border-accent);
    box-shadow: 0 4px 10px var(--shadow-light);
    transform: translateY(-5px);
}

.item.hidden {
    display: none;
}

.item-name {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.image-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 8px;
    transition: transform 0.2s;
    position: relative;
}

.image-button:hover {
    transform: scale(1.1);
}

.image-button img {
    cursor: url('https://snipp.ru/demo/712/pointer-1.cur') 4 1, pointer;
    width: 70px;
    height: 70px;
    object-fit: contain;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 5px;
    background: var(--bg-card);
}

.price {
    font-size: 14px;
    color: var(--text-accent);
    font-weight: bold;
    margin-bottom: 8px;
    cursor: pointer;
    position: relative;
}

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

.price-input {
    width: 100%;
    padding: 4px;
    border: 2px solid var(--border-accent);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: center;
}

.controls {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 6px;
}

.button-group {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.btn-control {
    width: 35px;
    height: 35px;
    border: 1px solid var(--border-light);
    background-color: var(--btn-bg);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-control:hover {
    background-color: var(--border-accent);
    color: white;
    border-color: var(--border-accent);
}

.quantity {
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    color: var(--text-primary);
    min-width: 45px;
}

/* Мутанты */
.mutant-section {
    background-color: var(--mutant-section-bg);
    text-align: center;
    border-top: 2px solid var(--mutant-accent);
    transition: background-color 0.4s;
}

.mutant-header-stats {
    background-color: var(--mutant-header-bg);
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid var(--mutant-accent);
    color: var(--mutant-header-text);
    transition: all 0.4s;
}

.mutant-sum-display {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--mutant-header-text);
}

.mutant-bonus-buttons {
    margin-top: 0;
}

.mutant-final-sum {
    color: var(--mutant-accent-dark);
}

#mutantTotalSum,
#mutantFinalSum {
    color: var(--mutant-accent-dark);
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
}

#mutantTotalSum:hover,
#mutantFinalSum:hover {
    opacity: 0.8;
    background-color: rgba(217, 73, 82, 0.12);
}

.mutant-bonus-buttons .bonus-btn {
    border-color: var(--mutant-accent);
    color: var(--mutant-accent-dark);
}

.mutant-bonus-buttons .bonus-btn:hover,
.mutant-bonus-buttons .bonus-btn.active {
    background-color: var(--mutant-accent);
    border-color: var(--mutant-accent);
    color: white;
}

.mutant-buttons-container {
    gap: 15px;
    margin: 20px auto;
    width: 90%;
    max-width: 1400px;
}

.mutant-item {
    border-color: var(--border-light);
}

.mutant-item:hover {
    border-color: var(--mutant-accent);
}

.mutant-item .item-name {
    min-height: 40px;
}

.mutant-item .price {
    color: var(--mutant-accent-dark);
}

.mutant-item .btn-control:hover {
    background-color: var(--mutant-accent);
    border-color: var(--mutant-accent);
}

#mutantResetBtn {
    background-color: var(--mutant-accent-dark);
}

#mutantResetBtn:hover {
    background-color: var(--mutant-accent);
}

.mutant-card-visual {
    width: 70px;
    height: 70px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: linear-gradient(135deg, var(--bg-header), var(--bg-header2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* Сигары */
.cigar-section {
    background-color: var(--cigar-section-bg);
    text-align: center;
    border-top: 2px solid var(--cigar-accent);
    transition: background-color 0.4s ease;
}

.cigar-header-stats {
    background-color: var(--cigar-header-bg);
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid var(--cigar-accent);
    color: var(--cigar-header-text);
    position: relative;
    transition: all 0.4s ease;
}

.cigar-search-container {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
}

.cigar-search-input {
    border-color: var(--cigar-accent);
}

.cigar-search-input:focus {
    box-shadow: 0 0 12px rgba(50, 205, 50, 0.3);
    border-color: var(--cigar-accent);
}

.cigar-sum-display {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--cigar-header-text);
}

#cigarTotalSum,
#cigarFinalSum {
    color: var(--cigar-accent-dark);
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
}

#cigarTotalSum {
    font-size: 28px;
}

#cigarFinalSum {
    font-size: 18px;
}

#cigarTotalSum:hover,
#cigarFinalSum:hover {
    opacity: 0.8;
    background-color: rgba(34, 139, 34, 0.12);
}

.cigar-bonus-buttons {
    margin-top: 0;
}

.cigar-bonus-buttons .bonus-btn {
    border-color: var(--cigar-accent);
    color: var(--cigar-accent-dark);
}

.cigar-bonus-buttons .bonus-btn:hover,
.cigar-bonus-buttons .bonus-btn.active {
    background-color: var(--cigar-accent);
    border-color: var(--cigar-accent);
    color: white;
}

.cigar-final-sum {
    color: var(--cigar-accent-dark);
}

.cigar-reset-btn {
    background-color: var(--cigar-accent-dark);
}

.cigar-reset-btn:hover {
    background-color: #1a6b1a;
}

.cigar-buttons-container {
    gap: 15px;
    margin: 20px auto;
    width: 90%;
    max-width: 1400px;
}

.cigar-item:hover {
    border-color: var(--cigar-accent);
}

.cigar-item .price {
    color: var(--cigar-accent-dark);
}

.cigar-item .btn-control:hover {
    background-color: var(--cigar-accent);
    border-color: var(--cigar-accent);
}

/* Модальное окно настроек */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 20px;
    border: 2px solid var(--border-accent);
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-btn:hover {
    color: var(--text-accent);
}

.price-table {
    width: 100%;
    border-collapse: collapse;
}

.price-table th,
.price-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.price-table input {
    width: 100%;
    padding: 6px;
    border: 2px solid var(--border-accent);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.save-settings-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: var(--border-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* Футер */
footer {
    width: 100%;
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 20px;
    text-align: center;
    margin-top: auto;
    transition: background-color 0.4s, color 0.4s;
}

footer a {
    display: inline-block;
    margin: 10px 5px;
}

footer img {
    width: 40px;
    height: 40px;
    transition: transform 0.2s;
    filter: brightness(0.9);
}

[data-theme="dark"] footer img {
    filter: invert(0.8);
}

/* Копирование тултип */
.copy-tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.2s;
}

/* Туториал подсказка свойств артефактов */
.artifact-tooltip {
    position: fixed;
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-left: 4px solid var(--tooltip-accent);
    max-width: 280px;
    opacity: 0;
    transition: opacity 0.2s ease;
    line-height: 1.5;
}

.artifact-tooltip strong {
    color: var(--tooltip-accent);
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.artifact-tooltip .property-positive {
    color: #4caf50;
}

.artifact-tooltip .property-negative {
    color: #ff5252;
}

.artifact-tooltip .property-neutral {
    color: #ffb74d;
}

/* Адаптив */
@media (max-width: 1024px) {
    .buttons-container { grid-template-columns: repeat(5, 1fr); }
    .search-input { width: 150px; }
    .search-input:focus { width: 200px; }
}

@media (max-width: 768px) {
    .buttons-container { grid-template-columns: repeat(3, 1fr); }
    h1 { font-size: 24px; height: 70px; }
    h2 { font-size: 20px; height: 55px; }
    .search-container {
        position: static;
        justify-content: center;
        margin-bottom: 15px;
    }
    .cigar-search-container {
        position: static;
        justify-content: center;
        margin-bottom: 15px;
    }
    .search-input { width: 180px; }
    .search-input:focus { width: 220px; }
}

@media (max-width: 480px) {
    .buttons-container { grid-template-columns: repeat(2, 1fr); }
    .search-container {
        width: 100%;
        justify-content: center;
    }
    .cigar-search-container {
        width: 100%;
        justify-content: center;
    }
    .search-input { width: 100%; max-width: 200px; }
    .search-input:focus { width: 100%; max-width: 200px; }
}
