@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&display=swap');

:root {
    --bg-color: #0d0d12;
    --sidebar-bg: #15151e;
    --border-color: #2a2a3a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent: #4f46e5;

    --ore-red: #ff4d4d;
    --ore-blue: #4d94ff;
    --ore-green: #4dff88;
    --ore-purple: #b366ff;
    --ore-pink: #ff66b3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
}

#ui-container {
    height: 100vh;
    width: 280px;
    flex-shrink: 0;
    display: flex;
    pointer-events: auto;
}

#vignette-overlay {
    position: fixed;
    top: 0;
    left: 280px;
    right: 250px;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 5;
}

#right-sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 10;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    overflow-y: auto;
}

.stat-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.stat-value {
    font-weight: 700;
    color: var(--ore-green);
}

#chat-window {
    margin-top: auto;
    height: 150px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    overflow-y: auto;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-family: monospace;
}

#chat-window::-webkit-scrollbar {
    width: 4px;
}

#chat-window::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.chat-msg {
    padding-left: 0.5rem;
    animation: fadeIn 0.3s ease;
    word-wrap: break-word;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateX(-5px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

#sidebar {
    width: 280px;
    background: #111113;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

#profile-section {
    margin-bottom: 1.5rem;
}

#player-name {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.6rem;
    color: white;
    border-radius: 8px;
    font-size: 0.75rem;
    outline: none;
    text-align: center;
    letter-spacing: 1px;
    font-weight: 700;
    transition: all 0.2s;
}

#player-name:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
}

#world-selector {
    margin-top: auto;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#world-selector h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.world-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.world-btn::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.3;
}

.world-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.world-btn.active {
    background: rgba(79, 70, 229, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.world-btn.active::before {
    opacity: 1;
    box-shadow: 0 0 10px currentColor;
}

#switch-world-2.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.ui-tab-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.ui-tab-content::-webkit-scrollbar {
    width: 4px;
}

.ui-tab-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #a0a0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

#standard-inventory,
#altered-inventory,
#crafting-menu {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#inventory-list,
#altered-list,
#crafting-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#inventory-list::-webkit-scrollbar,
#altered-list::-webkit-scrollbar,
#crafting-list::-webkit-scrollbar {
    width: 6px;
}

#inventory-list::-webkit-scrollbar-thumb,
#altered-list::-webkit-scrollbar-thumb,
#crafting-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.ore-count {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.ore-count:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.icon {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    box-shadow: 0 0 10px currentColor;
}

.icon.red {
    background-color: var(--ore-red);
    color: var(--ore-red);
}

.icon.blue {
    background-color: var(--ore-blue);
    color: var(--ore-blue);
}

.icon.green {
    background-color: var(--ore-green);
    color: var(--ore-green);
}

.icon.purple {
    background-color: var(--ore-purple);
    color: var(--ore-purple);
}

.icon.pink {
    background-color: var(--ore-pink);
    color: var(--ore-pink);
}

.icon.altered {
    border: 1px solid rgba(255, 255, 255, 0.5);
    filter: invert(1) brightness(1.2);
    box-shadow: 0 0 15px currentColor;
}

.name {
    flex: 1;
    font-weight: 400;
    color: var(--text-secondary);
}

.value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#stats {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#fps-value {
    color: var(--ore-green);
    font-weight: 700;
}

.empty-msg {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
}

.name small {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

.hidden {
    display: none !important;
}

#ui-tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

#ui-tabs button {
    flex: 1;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

#ui-tabs button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

#altered-inventory h2,
#crafting-menu h2 {
    margin-top: 0;
}

/* Crafting specific styles */
.craft-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.craft-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.craft-item.active-pickaxe {
    border-color: var(--accent);
    background: rgba(79, 70, 229, 0.1);
}

.craft-title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.craft-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.craft-recipe {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.craft-req {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
}

.craft-req.met {
    color: var(--ore-green);
}

.craft-req.missing {
    color: var(--ore-red);
}

.craft-btn {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.craft-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.equip-btn {
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
}

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

.active-pickaxe .equip-btn {
    background: var(--ore-green);
    border-color: var(--ore-green);
    color: #000;
    cursor: default;
}



canvas {
    flex: 1;
    display: block;
    cursor: crosshair;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* Index Dialog */
#index-dialog {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    color: var(--text-primary);
    width: 1000px;
    max-width: 95vw;
    box-shadow: 0 0 100px rgba(0, 0, 0, 1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#index-dialog::backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #222;
    border-bottom: 1px solid #444;
}

#close-index {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
}

#index-body {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 0;
    height: 70vh;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

#index-grid {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #111;
    border-right: 1px solid #333;
}

.index-item {
    width: 100%;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    min-height: 50px;
    text-align: center;
}

.index-item:hover {
    filter: brightness(1.2);
    padding-left: 2rem;
}

.index-item.selected {
    outline: 2px solid #fff;
    outline-offset: -2px;
    z-index: 2;
}

#index-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    background: #000;
    color: #fff;
}

#index-detail h3 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

#index-detail .detail-stat {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

#index-detail .detail-note {
    margin-top: 3rem;
    font-size: 1rem;
    color: #ccc;
    font-style: italic;
    line-height: 1.4;
}

.bg-layer {
    background: linear-gradient(90deg, #b4b4b4, #808080);
}

.bg-empty {
    background: #27272a;
}

/* Rarity Backgrounds */
.bg-common {
    background: linear-gradient(90deg, #ffffff, #909090);
}

.bg-uncommon {
    background: linear-gradient(90deg, #00ff00, #008000);
}

.bg-rare {
    background: linear-gradient(90deg, #00aaff, #0055aa);
}

.bg-ultra-rare {
    background: linear-gradient(90deg, #a08cff, #8c00ff);
}

.bg-unique {
    background: linear-gradient(90deg, #ffa500, #ff4500);
}

.bg-legendary {
    background: linear-gradient(90deg, #ffff00, #808000);
}

.bg-exotic {
    background: linear-gradient(90deg, #ff0044, #660022);
}

.bg-supernatural {
    background: linear-gradient(90deg, #0022ff, #000044);
}

.bg-otherworldly {
    background: linear-gradient(90deg, #8800ff, #330066);
}

.bg-dinglebob {
    background: linear-gradient(90deg, #dd8cff, #8cffff);
}

.bg-fingulated {
    background: linear-gradient(90deg, #f5d26d, #96fdda, #f1aeae);
}

.bg-event {
    background: linear-gradient(90deg, #ffffff, #000000);
}

/* Rainbow Text Effect */
.rainbow-text {
    background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 400% 100%;
    animation: rainbow 7s linear infinite;
    font-weight: 900 !important;
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}


/* Event Styles */
.event-box {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(90deg, rgba(250, 204, 21, 0.1), rgba(250, 204, 21, 0.05));
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: pulse-border 2s infinite alternate;
}

.event-box.inactive {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-color);
    animation: none;
}

.event-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #facc15;
    font-weight: 700;
}

.event-box.inactive .event-label {
    color: var(--text-secondary);
}

.event-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.event-timer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: monospace;
}

@keyframes pulse-border {
    0% {
        border-color: rgba(250, 204, 21, 0.2);
        box-shadow: 0 0 5px rgba(250, 204, 21, 0.1);
    }

    100% {
        border-color: rgba(250, 204, 21, 0.6);
        box-shadow: 0 0 15px rgba(250, 204, 21, 0.2);
    }
}

/* Broadcast Tab Styles */
#broadcast-feed {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

#broadcast-section {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 300px;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.broadcast-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 0.85rem;
    border-left: 4px solid var(--accent);
    animation: slide-in 0.3s ease-out;
}

.broadcast-item .time {
    display: block;
    font-size: 0.7rem;
    color: #a1a1aa;
    margin-bottom: 0.2rem;
}

.broadcast-item .msg {
    color: var(--text-primary);
    line-height: 1.4;
}

.broadcast-item .chance {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.8;
}

@keyframes slide-in {
    from {
        transform: translateX(-10px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.tab-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

#broadcast-input-wrap {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

#broadcast-input {
    width: 100%;
    background: #09090b;
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

#broadcast-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.02);
}