body {
    font-family: 'Roboto Mono', monospace;
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-y: scroll;
}

.container {
    width: 100%;
    max-width: 1200px;
    background-color: #2b2b2b; /* Slightly lighter inner background */
    border: 1px solid #444;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 8px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

header h1 {
    color: #f0f0f0;
    font-size: 2.8em;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    letter-spacing: 2px;
}

.game-section {
    margin-bottom: 50px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 25px;
    background-color: #333333;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
}

.game-section h2 {
    color: #d3d3d3;
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.section-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

/* Armor Section Specifics */
.armor-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

.armor-slot {
    border: 1px dashed #555;
    background-color: #2a2a2a;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    position: relative;
    min-height: 250px; /* Ensure consistent height */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.slot-label {
    color: #bbb;
    font-size: 1.1em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-display {
    width: 100%;
    height: 180px; /* Fixed height for image area */
    background-color: #3a3a3a;
    border: 1px solid #555;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden; /* To hide overflow of blurred images */
}

.item-display.empty::before {
    content: "ПУСТО";
    color: #777;
    font-size: 1.5em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.item-display img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: blur(8px); /* Blurred by default */
    transition: filter 0.3s ease;
}

.item-display.revealed img {
    filter: blur(0); /* Unblurred when revealed */
}

.item-btn {
    background-color: #555;
    color: #eee;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.8em;
    line-height: 1;
    cursor: pointer;
    position: absolute; /* Buttons are positioned absolutely within their parent .armor-slot or .item-card */
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.item-btn:hover {
    background-color: #777;
    transform: scale(1.05);
}

.add-item-btn {
    bottom: 10px;
    left: 10px;
}

.remove-item-btn {
    top: 10px;
    right: 10px;
    background-color: #b30000;
}

.remove-item-btn:hover {
    background-color: #ff3333;
}

.add-mod-btn {
    bottom: 10px;
    left: 50px; /* Adjusted position */
    font-size: 1.4em; /* Smaller for mod button */
    background-color: #0077b3;
}

.add-mod-btn:hover {
    background-color: #0099ff;
}

.large-add-btn {
    position: static; /* Remove absolute positioning */
    width: 50px;
    height: 50px;
    font-size: 2.5em;
    margin-right: 20px;
    margin-bottom: 20px; /* Space from content when flex-wrapped */
}

/* Weapon and Misc Section Specifics */
.weapon-container, .misc-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    flex-grow: 1; /* Allows it to take available space */
}

.item-card {
    border: 1px solid #555;
    background-color: #2a2a2a;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    position: relative;
    width: 180px; /* Fixed width for cards */
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.item-card .item-display {
    width: 100%;
    height: 150px; /* Smaller for cards */
}

.item-card .remove-item-btn {
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    font-size: 1.2em;
}

.item-card .add-mod-btn {
    bottom: 5px;
    left: 5px;
    width: 25px;
    height: 25px;
    font-size: 1.2em;
}

.item-card .item-name {
    color: #eee;
    font-size: 1.1em;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Combat Section Specifics */
.combat-plan-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.combat-plan-card {
    background-color: #2a2a2a;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 15px;
    position: relative;
}

.combat-plan-card h3 {
    color: #eee;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4em;
    border-bottom: 1px dashed #444;
    padding-bottom: 5px;
}

.combat-plan-card p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 10px;
}

.combat-plan-card .remove-item-btn { /* Reusing remove-item-btn style */
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    font-size: 1.2em;
}

/* Modals */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #3a3a3a;
    margin: auto;
    padding: 30px;
    border: 1px solid #555;
    width: 80%;
    max-width: 700px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #eee;
    text-decoration: none;
}

#search-input {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #555;
    background-color: #2a2a2a;
    color: #eee;
    border-radius: 4px;
    font-size: 1.1em;
}

#search-input::placeholder {
    color: #888;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    max-height: 500px; /* Limit height for scrollability */
    overflow-y: auto;
    padding-right: 10px; /* For scrollbar */
}

.search-item {
    background-color: #2a2a2a;
    border: 1px solid #444;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.search-item:hover {
    background-color: #3e3e3e;
    transform: translateY(-3px);
}

.search-item-image-container {
    width: 100px;
    height: 100px;
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: blur(8px); /* Always blurred in search results */
}

.search-item-name {
    color: #eee;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Item Info Modal */
#item-info-display {
    color: #eee;
    line-height: 1.6;
}

#item-info-display h3 {
    font-size: 1.8em;
    color: #f0f0f0;
    margin-bottom: 15px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

#item-info-display p {
    margin-bottom: 10px;
}

#item-info-display .item-image-full {
    max-width: 200px;
    max-height: 200px;
    display: block;
    margin: 0 auto 20px auto;
    border: 1px solid #555;
    border-radius: 5px;
    object-fit: contain;
}

#item-info-display .mod-list-title {
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
    border-top: 1px dashed #444;
    padding-top: 10px;
}

#item-info-display .mod-item {
    background-color: #2a2a2a;
    border: 1px solid #444;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#item-info-display .mod-item .remove-mod-btn {
    background-color: #b30000;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.8em;
}

#item-info-display .mod-item .remove-mod-btn:hover {
    background-color: #ff3333;
}

/* Mod Selection Modal */
#mod-selection-modal h3 {
    color: #f0f0f0;
    font-size: 1.6em;
    margin-bottom: 20px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.mod-item-selection {
    background-color: #2a2a2a;
    border: 1px solid #444;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.mod-item-selection:hover {
    background-color: #3e3e3e;
    transform: translateY(-3px);
}

.mod-item-selection-name {
    color: #eee;
    font-size: 1em;
    margin-bottom: 5px;
}

.mod-item-selection-desc {
    color: #bbb;
    font-size: 0.8em;
}

/* Combat Modal */
.combat-input {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #555;
    background-color: #2a2a2a;
    color: #eee;
    border-radius: 4px;
    font-size: 1.1em;
}

textarea.combat-input {
    resize: vertical;
    min-height: 100px;
}

#save-combat-plan-btn {
    background-color: #0077b3;
    color: #eee;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#save-combat-plan-btn:hover {
    background-color: #0099ff;
}

/* Scrollbar styles for dark theme */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #333;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}