        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #535352 0%, #0e0e0e 100%); /*page background*/
            background-attachment: fixed; /* Locks the gradient in place */
            color: #e0e0e0;
            min-height: 100vh;
            line-height: 1.6;
            
        }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-width: 300px; /* Add minimum width */
}

        h1 {
            text-align: center;
            color: #e43636;
            font-size: 2.5em;
            margin-bottom: 30px;
            text-shadow: 2px 2px 4px #00000080;
        }

        /* Tab Navigation */
.tab-nav {
    display: flex;
    flex-wrap: wrap;
    background: #0000004d;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    margin-bottom: 0;
    justify-content: center;
    gap: 4px;
    padding: 10px 10px 0 10px; /* Add horizontal padding */
    min-width: 0; /* Allow shrinking */
}

@media (max-width: 770px) {
    .tab-nav {
        flex-direction: column;
        align-items: center;
        padding: 10px 5px 0 5px;
    }
    .tab-btn {
        width: 200px;
        margin-bottom: 5px;
    }
}

.tab-btn {
    background: #ffffff1a;
    color: #e0e0e0;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #ffffff1a;
    border-radius: 4px;
    font-size: 14px;
    width: 180px;
    flex-shrink: 0; /* Change from 50 to 0 */

}

        .tab-btn:hover {
            background: #ffd70033;
            color: #ffd700;
        }

        .tab-btn.active {
            background: #ffd700;
            color: #1a1a2e;
            font-weight: bold;
        }

        /* Tab Content */
        .tab-content {
            background: #0000004d;
            border-radius: 0 0 10px 10px;
            padding: 30px;
            min-height: 600px;
        }

        .tab-pane {
            display: none;
        }

        .tab-pane.active {
            display: block;
        }

        /* Loot Roller Styles */
        .input-section {
            display: grid;
            max-width: 420px;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
            justify-self: center;
        }
@media (min-width: 810px) {
  .input-section {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1200px; /* or whatever container size you like */
  }
}

        .form-group {
            background: #ffffff0d;
            padding: 15px;
            border-radius: 8px;
            border: 1px solid #ffd7004d;
        }

        .form-group label {
            display: block;
            color: #ffd700;
            margin-bottom: 8px;
            font-weight: bold;
        }

        .form-group input, .form-group select {
            width: 100%;
            padding: 10px;
            border: 1px solid #555;
            border-radius: 5px;
            background: #0000004d;
            color: #e0e0e0;
            font-size: 16px;
        }
        .form-group select {
            width: 100%;
            padding: 10px;
            border: 1px solid #555;
            border-radius: 5px;
            background: #0000004d;
            color: #e0e0e0;
            font-size: 16px;
        }

        .form-group select:focus {
            background: #333;
            border-color: #ffd700;
            outline: none;
        }

        .form-group select option {
            background: #333;
            color: #e0e0e0;
        }

        .form-group select option:checked {
            background: #ffd700;
            color: #000;
        }
        .button-section {
            text-align: center;
            margin-bottom: 30px;
        }

        .button-section button {
            background: linear-gradient(45deg, #ffd700, #ffed4e);
            color: #1a1a2e;
            border: none;
            padding: 15px 40px;
            font-size: 18px;
            font-weight: bold;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px #ffd7004d;
        }

        .button-section button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px #ffd70066;
        }

        /* Results Styles */
        .results {
            background: #00000033;
            border-radius: 10px;
            padding: 20px;
            border: 1px solid #ffd7004d;
        }

        .loot-item {
            background: #ffffff0a;
            margin: 10px 0;
            padding: 15px;
            border-radius: 8px;
            border-left: 4px solid #666;
            position: relative;
            transition: all 0.3s ease;
        }

        .loot-item:hover {
            background: #ffffff14;
            transform: scale(1.003);
        }

        .loot-item h3 {
            margin-bottom: 8px;
            color: #e0e0e0;
        }

        .loot-item.gold { border-left-color: #ffd700; }
        .loot-item.gold h3 {
                            color: #ffffff;
                            text-shadow: 1px 1px 0px #242424, -1px 1px 0px #242424, 1px -1px 0px #242424, -1px -1px 0px #242424;
                        }
        .loot-item.potion { border-left-color: #ce4fd7; }
        .loot-item.potion h3 { 
                            color: #d7aeda;
                            text-shadow: 1px 1px 0px #140d24, -1px 1px 0px #140d24, 1px -1px 0px #140d24, -1px -1px 0px #140d24; 
                        }
        .loot-item.magic-consumable { border-left-color: #4ecdc4; }
        .loot-item.magic-consumable h3 {
                            color: #5cebfe;
                            text-shadow: 1px 1px 0px #1e1e1e, -1px 1px 0px #1e1e1e, 1px -1px 0px #1e1e1e, -1px -1px 0px #1e1e1e;
                        }
        .loot-item.rare { border-left-color: #ffff00; background: linear-gradient(175deg, #6d6d6d1a 10%, #a5960c73 100%); }
        .loot-item.rare h3 {
                            color: #ffff00;
                            text-shadow: 1px 1px 0px #1e1e1e, -1px 1px 0px #1e1e1e, 1px -1px 0px #1e1e1e, -1px -1px 0px #1e1e1e;
                        }
        .loot-item.enchanted { border-left-color: #9c88ff; }
        .loot-item.enchanted h3 {
                            color: #8088fa;
                            text-shadow: 1px 1px 0px #141743, -1px 1px 0px #141743, 1px -1px 0px #141743, -1px -1px 0px #141743;
                        }
        .loot-item.cursed { border-left-color: #ff4757; background: linear-gradient(165deg, #6d6d6d1a 0%, #ff47571a 100%); }
        .loot-item.cursed h3 {
                            color: #e63636;
                            text-shadow: 1px 1px 0px #1e1e1e, -1px 1px 0px #1e1e1e, 1px -1px 0px #1e1e1e, -1px -1px 0px #1e1e1e;
                        }
        .loot-item.mundane { border-left-color: #cecece; }
        .loot-item.mundane h3 {
                            color: #ffffff;
                            text-shadow: 1px 1px 0px #242424, -1px 1px 0px #242424, 1px -1px 0px #242424, -1px -1px 0px #242424;
                        }
        .loot-item.nothing { border-left-color: #57606f; color:#aaaaaa}
        .loot-item.nothing h3 {
                            color: #8f8f8f;
                            text-shadow: 1px 1px 0px #1e1e1e, -1px 1px 0px #1e1e1e, 1px -1px 0px #1e1e1e, -1px -1px 0px #1e1e1e;
                        }

        .delete-btn, .copy-btn {
            position: absolute;
            top: 10px;
            width: 25px;
            height: 25px;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            transition: all 0.3s ease;
        }

        .delete-btn {
            right: 10px;
            background: #ff4757;
            color: white;
        }

        .copy-btn {
            right: 40px;
            background: #4ca5e6;
            color: white;
        }

        .delete-btn:hover, .copy-btn:hover {
            transform: scale(1.1);
        }

        .total-value {
            text-align: center;
            font-size: 1.2em;
            font-weight: bold;
            color: #ffd700;
            margin-top: 20px;
            padding: 15px;
            background: #ffd7001a;
            border-radius: 8px;
        }

        /* Table Styles */
        .data-table {
            width: 100%;
            border-collapse: collapse;
            background: #00000033;
            border-radius: 8px;
            overflow: hidden;
            margin: 20px 0;

        }

        .data-table th {
            background: #ffd70033;
            color: #ffd700;
            padding: 12px;
            min-width: 100px;
            text-align: center;
            font-weight: bold;
            border-bottom: 2px solid #ffd7004d;
            cursor: pointer;
            position: relative;
            user-select: none;
            transition: background-color 0.3s ease;
        }

        .data-table th:hover {
            background: #ffd7004d;
        }

        .data-table th.sortable::after {
            content: ' ⇅';
            opacity: 0.5;
            font-size: 0.8em;
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
        }

        .data-table th.sort-asc::after {
            content: ' ▲';
            opacity: 1;
            color: #ffd700;
        }

        .data-table th.sort-desc::after {
            content: ' ▼';
            opacity: 1;
            color: #ffd700;
        }

        .data-table td {
            padding: 10px 12px;
            border-bottom: 1px solid #ffffff1a;
            vertical-align: top;
            text-align: center;
        }

        .data-table tr:nth-child(even) {
            background: hsla(0, 0%, 100%, 0.02);
        }

        .data-table tr:hover {
            background: #ffd7000d;
        }

.info-table {
    display: block;
        }
.info-table {
    width: fit-content;
    border-collapse: collapse;
    background: #00000033;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    padding: 10px;
        }

        .info-table th {
            background: #ffd70033;
            color: #ffd700;
            padding: 12px;
            min-width: 100px;
            text-align: center;
            font-weight: bold;
            border-bottom: 2px solid #ffd7004d;
            cursor: pointer;
            position: relative;
            user-select: none;
            transition: background-color 0.3s ease;
        }

        .info-table th:hover {
            background: #ffd7004d;
        }
        .info-table td {
            padding: 10px 12px;
            border-bottom: 1px solid #ffffff1a;
            vertical-align: top;
            text-align: center;
        }

        .info-table tr:nth-child(even) {
            background: hsla(0, 0%, 100%, 0.02);
        }

        .info-table tr:hover {
            background: #ffd7000d;
        }

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    margin: 20px 0;
    border: 1px solid #ffd7004d;
    border-radius: 8px;
    background: #00000033;
}

/* Ensure tables don't shrink below their content */
.data-table, .info-table {
    border: 1px solid #ffd7004d;
    overflow-x: auto;
    overflow-y: visible;

    width: 100%;
}

/* Style the scrollbar */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #00000033;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #ffd70066;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #ffd700;
}

        .rule-adjustments-section {
            margin-bottom: 30px;
        }

        .rule-adjustments-section h2 {
            color: #e9de41;
            margin-bottom: 15px;
            font-size: 1.5em;
            border-bottom: 2px solid #ffd7004d;
            padding-bottom: 5px;
        }

        .rule-adjustments-section p {
            margin-bottom: 10px;
            line-height: 1.7;
        }

        .term {
            color: #ffffff;
            font-weight: bold;
        }

        /* Item Creator Styles */
        .creator-section {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-top: 20px;
        }

        .creator-controls {
            background: #00000033;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #ffd7004d;
        }

        .quality-options {
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px solid #ffd70033;
        }

        .creator-preview {
            background: #00000033;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #ffd7004d;
        }

        .creator-preview h3 {
            color: #ffd700;
            margin-bottom: 15px;
            text-align: center;
        }

        .created-item {
            min-height: 200px;
            background: #ffffff0d;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 20px;
            border-left: 4px solid #666;
        }

        .created-item.preview-mundane { border-left-color: #57606f; }
        .created-item.preview-enchanted { border-left-color: #9c88ff; }
        .created-item.preview-rare { 
            border-left-color: #ff9500; 
            background: #ff95001a; 
        }
        .created-item.preview-cursed { 
            border-left-color: #ff4757; 
            background: #ff47571a; 
        }

        .creator-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        .create-btn, .reset-btn, .add-affix-btn {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s ease;
        }

        .create-btn {
            background: linear-gradient(45deg, #ffd700, #ffed4e);
            color: #1a1a2e;
        }

        .reset-btn {
            background: #ff4757;
            color: white;
        }

        .add-affix-btn {
            background: #4ca5e6;
            color: white;
            font-size: 12px;
            padding: 5px 10px;
            margin-top: 10px;
        }

        .create-btn:hover, .reset-btn:hover, .add-affix-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px #0000004d;
        }

        .affix-list {
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid #ffd70033;
            border-radius: 4px;
            padding: 10px;
            background: #0000001a;
        }

        .affix-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 5px 0;
            border-bottom: 1px solid #ffffff1a;
        }

        .affix-item:last-child {
            border-bottom: none;
        }

        .remove-affix {
            background: #ff4757;
            color: white;
            border: none;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
        }

        .preview-item-name {
            font-size: 1.2em;
            font-weight: bold;
            color: #e0e0e0;
            margin-bottom: 10px;
        }

        .preview-item-properties {
            color: #b0b0b0;
            margin-bottom: 10px;
            line-height: 1.5;
        }

        .preview-item-value {
            color: #ffd700;
            font-weight: bold;
        }

        .no-loot {
            text-align: center;
            color: #888;
            font-style: italic;
            padding: 40px;
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .tab-nav {
                flex-direction: column;
            }
            
            .tab-btn {
                border-right: none;
                border-bottom: 1px solid #ffffff1a;
            }

            .input-section {
                grid-template-columns: 1fr;
            }

            h1 {
                font-size: 2em;
            }

            .container {
                padding: 10px;
            }
        }
        .tab-indent {
            margin-left: 15px; 
        }

        .detail-pane {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: #1a1a1a;
    border-left: 2px solid #ffd700;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.detail-pane.open {
    right: 0;
}

.detail-header {
    background: #2a2a2a;
    padding: 20px;
    border-bottom: 2px solid #ffd700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.detail-header h2 {
    margin: 0;
    color: #ffd700;
    font-size: 1.5em;
}

.close-detail-btn {
    background: #ff4444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-detail-btn:hover {
    background: #ff6666;
    transform: scale(1.1);
}

.detail-body {
    padding: 20px;
}

.detail-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.detail-section:last-child {
    border-bottom: none;
}

.section-title {
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.subsection-title {
    color: #4ca5e6;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1em;
}

.detail-section p {
    margin: 8px 0;
    color: #e0e0e0;
    line-height: 1.6;
}

.gold-amount {
    font-size: 1.5em;
    color: #ffd700;
    text-align: center;
    font-weight: bold;
}

.table-spell-link {
    color: #4ca5e6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.table-spell-link:hover {
    color: #6bc0ff;
    text-decoration: underline;
}
.spell-link {
    color: #4ca5e6;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background: #ffffff0a;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.spell-link:hover {
    background: #ffffff14;
    color: #6bc0ff;
}

.affix-detail {
    background: #ffffff05;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 3px solid #4ca5e6;
}

.affix-name {
    color: #4ca5e6;
    margin: 0 0 5px 0;
    font-size: 1.05em;
}

.affix-property {
    margin: 0;
    color: #d0d0d0;
}

.properties-text {
    color: #d0d0d0;
    line-height: 1.8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .detail-pane {
        width: 100%;
        right: -100%;
    }
}

.loot-item.unique {
    border-left: 4px solid #cd7f32;
    background: linear-gradient(135deg, #cd7f3210 0%, #8b572a10 100%);
}

.loot-item.unique:hover {
    background: linear-gradient(135deg, #cd7f3220 0%, #8b572a20 100%);
}

.loot-item.unique h3 {
    color: #cd7f32;
    font-weight: bold;
}

.unique-header {
    background: #2a2018 !important;
    border-bottom: 2px solid #cd7f32 !important;
}

.unique-header h2 {
    color: #cd7f32 !important;
}

.unique-title {
    color: #cd7f32 !important;
}

.unique-property {
    background: #cd7f3210;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 8px;
    border-left: 3px solid #cd7f32;
}

.unique-property p {
    margin: 0;
    color: #e0d0c0;
}

/* Prowess feature styling */
.prowess-detail {
    background: #ffffff05;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 3px solid #ceca95;
}

.prowess-name {
    color: #ceca95;
    margin: 0 0 5px 0;
    font-size: 1.05em;
}

.prowess-feature {
    margin: 0;
    color: #d0d0d0;
}