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

@font-face {
    font-family: 'Minecraft';
    src: url('../fonts/Minecraft.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Minecraft', 'Courier New', monospace;
    background: #0a0a0a;
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Make some elements use normal font size for readability */
input, select, button, .menu-item-name, .result-label, .result-value, label, h3 {
    font-size: 11px;
    letter-spacing: 0.3px;
}

h1, h2 {
    font-size: 16px;
    letter-spacing: 1px;
}

h3 {
    font-size: 12px;
}

input, select, textarea {
    font-family: 'Press Start 2P', 'Courier New', monospace;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #1a1a1a;
    min-height: 100vh;
    border-left: 1px solid #2a2a2a;
    border-right: 1px solid #2a2a2a;
}

header {
    background: #111;
    border-bottom: 1px solid #2a2a2a;
    padding: 30px 40px;
}

header h1 {
    font-size: 2.2em;
    color: #fff;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.95em;
    color: #888;
}

main {
    padding: 40px;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }
    
    .defender-armor-wrapper {
        flex-direction: column;
    }
}

.setup-section {
    background: #151515;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 25px;
}

.setup-section h2 {
    font-size: 1.4em;
    color: #fff;
    margin-bottom: 25px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a2a;
}

/* Weapon selector - icon based */
.weapon-selector {
    margin-bottom: 25px;
}

.weapon-selector label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #aaa;
    font-size: 0.9em;
}

.weapon-slots {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.weapon-slot {
    position: relative;
    width: 50px;
    height: 50px;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weapon-slot:hover {
    background: #333;
    border-color: #4a4a4a;
    transform: scale(1.05);
}

.weapon-slot.selected {
    border-color: #4a90e2;
    background: #1a2a3a;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.weapon-icon {
    width: 42px;
    height: 42px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Armor Inventory - Minecraft Style */
.defender-armor-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.armor-container {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-shrink: 0;
    position: relative;
}

.armor-slots {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #2a2a2a;
    padding: 8px;
    border-radius: 4px;
    border: 2px solid #1a1a1a;
    flex-shrink: 0;
}

.minecraft-slot {
    position: relative;
    width: 42px;
    height: 42px;
    background: #4a4a4a;
    border: 2px solid #2a2a2a;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.minecraft-slot:hover {
    background: #5a5a5a;
    border-color: #3a3a3a;
    transform: scale(1.05);
}

.minecraft-slot:active {
    transform: scale(0.98);
}

.slot-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.armor-icon {
    width: 36px;
    height: 36px;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.slot-menu {
    position: absolute;
    top: 0;
    left: calc(100% + 10px);
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    z-index: 1000;
    display: none;
    min-width: 220px;
    max-width: 280px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Make sure menu doesn't overlap with armor slots */
.armor-container {
    overflow: visible;
    position: relative;
}

.slot-menu.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    color: #e0e0e0;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #222;
}

.menu-item-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item-icon img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.menu-item-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.9em;
}

.menu-item.selected {
    background: #1a2a3a;
    border-left: 3px solid #4a90e2;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #aaa;
    font-size: 0.9em;
}

.input-group h3 {
    margin-bottom: 15px;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
}

.input-group input[type="number"],
.input-group input[type="text"],
.input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    font-size: 1em;
    background: #1a1a1a;
    color: #e0e0e0;
    transition: border-color 0.2s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #4a90e2;
}

.input-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.input-group label {
    display: flex;
    align-items: center;
    color: #aaa;
    font-size: 0.95em;
}

/* Add enchant button */
.add-enchant-btn {
    width: 100%;
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 15px;
}

.add-enchant-btn:hover {
    background: #3a3a3a;
    border-color: #4a90e2;
}

.enchant-select {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
    padding: 10px;
    border-radius: 4px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    transition: background 0.15s;
}

.enchant-select:hover {
    background: #222;
}

.enchant-select label {
    flex: 1;
    margin-bottom: 0;
    color: #aaa;
    font-size: 0.9em;
}

.enchant-tier-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.enchant-tier-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #2a2a2a;
    border-radius: 4px;
    background: #2a2a2a;
    color: #aaa;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.enchant-tier-btn:hover {
    border-color: #4a4a4a;
    background: #3a3a3a;
}

.enchant-tier-btn.selected.tier-1 {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.enchant-tier-btn.selected.tier-2 {
    background: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.enchant-tier-btn.selected.tier-3 {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.enchant-select .remove-btn {
    padding: 4px 8px;
    background: #dc3545;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    font-size: 0.8em;
    transition: background 0.2s;
    margin-left: auto;
}

.enchant-select .remove-btn:hover {
    background: #c82333;
}

/* Tier selector for Passive Melee Damage */
.tier-selector {
    margin-top: 10px;
}

.tier-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.tier-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #2a2a2a;
    border-radius: 4px;
    background: #2a2a2a;
    color: #aaa;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tier-btn:hover {
    border-color: #4a4a4a;
    background: #3a3a3a;
}

.tier-btn.selected {
    background: #4a90e2;
    border-color: #4a90e2;
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #fff;
    font-size: 1.2em;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #2a2a2a;
    color: #fff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.enchant-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    background: #0a0a0a;
    color: #e0e0e0;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.enchant-search:focus {
    outline: none;
    border-color: #4a90e2;
}

.enchant-results {
    max-height: 400px;
    overflow-y: auto;
}

.enchant-result-item {
    padding: 12px;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background 0.15s;
    color: #e0e0e0;
}

.enchant-result-item:last-child {
    border-bottom: none;
}

.enchant-result-item:hover {
    background: #222;
}

.enchant-result-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#weapon-enchants-group,
#attacker-leggings-enchants-group,
#defender-leggings-enchants-group {
    display: none;
}

.calculate-button {
    width: 100%;
    padding: 14px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

.calculate-button:hover {
    background: #3a80d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.calculate-button:active {
    transform: translateY(0);
}

.results {
    margin-top: 25px;
    padding: 20px;
    background: #151515;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.results.hidden {
    display: none;
}

.results h3 {
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.2em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #aaa;
    font-size: 0.95em;
}

.result-value {
    font-weight: 600;
    color: #fff;
    font-size: 1.1em;
}

.regularity-check {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #2a2a2a;
}

.regularity-check .result-value {
    font-size: 1.2em;
}

.regularity-check .result-value.yes {
    color: #28a745;
}

.regularity-check .result-value.no {
    color: #dc3545;
}

footer {
    background: #111;
    padding: 20px 40px;
    text-align: center;
    color: #666;
    font-size: 0.85em;
    border-top: 1px solid #2a2a2a;
    margin-top: 40px;
}

footer p {
    margin: 3px 0;
}

footer a {
    color: #4a90e2;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.info-text {
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

.section-label {
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Additional Options Section */
.additional-options-section {
    margin-top: 25px;
    padding: 20px;
    background: #151515;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    position: relative;
    min-height: fit-content;
}

/* Collapsible functionality - must come before .additional-options-section h3 */
.collapsible-header {
    cursor: pointer !important;
    user-select: none;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
    transition: color 0.2s ease;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    width: 100%;
    position: relative;
}

.collapsible-header > span:first-child {
    flex: 1;
}

.additional-options-section h3:not(.collapsible-header) {
    margin-bottom: 20px;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
}

.collapsible-header:hover {
    color: #fff;
}

.collapse-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
    color: #888;
    flex-shrink: 0;
    margin-left: 10px;
    pointer-events: none;
}

.collapsible.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
    opacity: 1;
}

.collapsible.collapsed .collapsible-content {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
}

.additional-options-section .input-group {
    margin-bottom: 15px;
}

.additional-options-section .input-group:last-child {
    margin-bottom: 0;
}

/* Conditional options */
.conditional-option {
    margin-top: 10px;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #2a2a2a;
}

.conditional-option label {
    display: flex;
    align-items: center;
    color: #aaa;
    font-size: 0.9em;
}

.conditional-option input[type="number"] {
    width: 100px;
    margin-left: 10px;
    padding: 6px 8px;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    background: #0a0a0a;
    color: #e0e0e0;
}

/* Scrollbar styling */
.slot-menu::-webkit-scrollbar {
    width: 8px;
}

.slot-menu::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.slot-menu::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

.slot-menu::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Heart icons styling */
.heart-icon {
    display: inline-block;
    vertical-align: middle;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background: transparent;
}

#damage-hearts {
    display: inline-block;
    vertical-align: middle;
}

#damage-dmg {
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
}

/* Gold Calculator Styles */
.gold-calculator-section {
    padding: 30px;
}

.gold-settings-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
    margin-top: 20px !important;
    width: 100% !important;
}

.settings-column {
    background: #151515 !important;
    padding: 20px !important;
    border: 1px solid #2a2a2a !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    float: none !important;
}

.settings-column h3 {
    margin-bottom: 20px !important;
    color: #fff !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #2a2a2a !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

@media (max-width: 1200px) {
    .gold-settings-grid {
        grid-template-columns: 1fr !important;
    }
}
