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

body {
    margin: 0;
    background: black url("assets/background.png") center / cover no-repeat;
    font-family: "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", Arial, sans-serif;
}

.emoji-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin: 0 .04em;
    vertical-align: -.12em;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
	width: 100%;
}




#loginOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-box {
    background: #111827;
    border: 1px solid #1f2a36;
    padding: 45px 60px;
    border-radius: 10px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(407px, calc(100vw - 32px));
}

.auth-screen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.game-auth-title {
    color: #f1c40f;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 0 3px 18px rgba(241, 196, 15, 0.35);
}

@media (max-width: 440px) {
    .login-box {
        padding: 32px 24px;
    }

    .character-select-box {
        padding: 24px;
    }
}

.login-box h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.login-box p {
    color: #94a3b8;
    font-size: 14px;
}

.login-box input {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #1f2a36;
    background: #0b1220;
    color: white;
    font-size: 14px;
}

.login-box input:focus {
    outline: 2px solid #f1c40f;
}

.login-box button {
    padding: 10px 12px;
    border-radius: 6px;
    border: none;
    background: #f1c40f;
    color: #111827;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.login-box button:hover {
    background: #d4ac0d;
}




#characterSelectOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
#characterSelectOverlay.hidden { display: none; }

.character-select-box {
    background: #111827;
    border: 1px solid #1f2a36;
    border-radius: 10px;
    padding: 30px 40px;
    text-align: center;
    color: #e2e8f0;
    width: min(420px, calc(100vw - 32px));
}

.character-select-box h2 {
    color: #f1c40f;
    margin-bottom: 16px;
}

.character-select-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.character-select-stats span {
    color: #64748b;
    margin-right: 6px;
}

.training-badge {
    background: #1e3a5f;
    color: #93c5fd;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    margin-bottom: 16px;
}

#enterWorldBtn {
    width: 100%;
    background: #f1c40f;
    color: #111827;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}
#enterWorldBtn:hover {
    background: #d4ac0d;
}

#exitGame {
    width: 100%;
    background: #1f2a36;
    color: #e2e8f0;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
}
#exitGame:hover {
    background: #2d3f52;
}




#ui {
    display: none;
	position: relative;
    grid-template-columns: 1fr 300px;
    grid-template-rows: 80px 40px 1fr;
    height: 100dvh;
    /* padding: 0; */
    max-width: 1148px;
    margin: 0 auto;
    /* gap: 0; */
    background: #0f172a;
    box-sizing: border-box;
    /* border: 4px solid #111827; */
    /* border-radius: 5px; */
    /* box-shadow: 0 0 20px rgba(241, 196, 15, 0.3); */
}

#ui.visible {
    display: grid;
}



#top {
    grid-column: 1 / -1;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    color: white;
    border: 2px solid #fff;
    border-left-width: 4px;
    border-right-width: 4px;
    border-top-width: 4px;
}

.icon {
    font-size: 14px;
}



#mapInfo {
    grid-column: 1 / -1;
    background: #0f172a;
    color: white;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 2px solid #fff;
    border-left-width: 4px;
    border-bottom-width: 4px;
    border-right-width: 4px;
}

#left, #right {
    min-height: 0;
}

#left {
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    overflow: hidden;
	background: #0f172a;
	position: relative;
    height: min(760px, calc(100dvh - 136px));
    border: 2px solid #fff;
    border-left-width: 4px;
	border-bottom-width: 4px;
}

#right {
    background: #0f172a;
    color: white;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 2px solid #fff;
    border-right-width: 4px;
	border-left-width: 4px;
    border-bottom-width: 0px;
}

.login-box .secondary-login-button {
    background: transparent;
    border: 1px solid #475569;
    color: #cbd5e1;
}
.login-box .secondary-login-button:hover { background: #1f2937; }

.character-select-caption {
    color: #94a3b8;
    font-size: 14px;
    margin: -8px 0 16px;
}

.character-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    max-height: 310px;
    overflow-y: auto;
}

.character-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 24px 12px 12px;
    border: 1px solid #334155;
    border-radius: 7px;
    background: #0b1220;
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
}
.character-card:hover { border-color: #f8fafc; background: #172033; }
.character-card:focus {
    outline: none;
    border-color: #f1c40f;
    background: #172033;
    box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.32), 0 0 14px rgba(241, 196, 15, 0.16);
}
.character-card strong { color: #f1c40f; font-size: 15px; }
.character-card span, .character-list-empty { color: #94a3b8; font-size: 12px; }
.character-card .character-card-info { color: #94a3b8; }
.character-list-empty { margin: 6px 0; }
.character-card-row { display: flex; align-items: center; gap: 8px; }
.character-card-row .character-card { flex: 1; }
.delete-character-button {
    height: 60px;
    padding: 0 10px;
    border: 1px solid #7f1d1d;
    border-radius: 7px;
    background: #2b1115;
    color: #fca5a5;
    font-size: 12px;
    cursor: pointer;
}
.delete-character-button:hover { background: #7f1d1d; color: #fff; }
.delete-character-button:disabled { cursor: wait; opacity: .6; }
.create-character-form { display: flex; gap: 8px; margin-bottom: 10px; }
.create-character-form input { min-width: 0; flex: 1; }
.create-character-form button { white-space: nowrap; }
.character-select-error { color: #fca5a5; font-size: 12px; margin: 0 0 10px; }

.create-character-button {
    width: 100%;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid #64748b;
    border-radius: 7px;
    background: #334155;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
    color: #e2e8f0;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}
.create-character-button:hover { background: #475569; transform: translateY(-1px); }
.create-character-button span { font-size: 18px; vertical-align: -1px; }
.create-character-button:disabled { cursor: not-allowed; filter: grayscale(1); opacity: .6; transform: none; }
.admin-panel-entry { width: 100%; margin-bottom: 8px; padding: 11px; border: 1px solid #b45309; border-radius: 7px; background: #78350f; color: #fef3c7; font-weight: 800; cursor: pointer; }
.admin-panel-entry:hover { background: #92400e; }
.admin-panel-entry.hidden { display: none; }
.admin-panel-overlay { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .82); }
.admin-panel-overlay.hidden { display: none; }
.admin-panel-dialog { width: min(680px, 100%); max-height: min(720px, calc(100vh - 32px)); overflow: hidden; padding: 24px; border: 1px solid #92400e; border-radius: 14px; background: #111827; box-shadow: 0 24px 70px rgba(0,0,0,.7); color: #e2e8f0; }
.admin-panel-header, .admin-list-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-panel-header { margin-bottom: 22px; padding-bottom: 15px; border-bottom: 1px solid #374151; }
.admin-panel-header span { color: #f59e0b; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.admin-panel-header h2 { margin: 2px 0 0; color: #fef3c7; }
.admin-panel-header > button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: #1f2937; color: #fff; font-size: 24px; cursor: pointer; }
.admin-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-card { display: flex; min-height: 170px; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 7px; padding: 20px; border: 1px solid #374151; border-radius: 12px; background: linear-gradient(145deg, #1f2937, #111827); color: #fff; text-align: left; cursor: pointer; }
.admin-card:hover { border-color: #f59e0b; transform: translateY(-2px); }
.admin-card-icon { margin-bottom: auto; font-size: 35px; }
.admin-card strong { font-size: 17px; }
.admin-card small { color: #9ca3af; }
.admin-card small b { color: #fbbf24; font-size: 16px; }
.admin-list-header { margin-bottom: 12px; }
.admin-list-header button { border: 0; background: none; color: #fbbf24; font-weight: 700; cursor: pointer; }
.admin-list { max-height: 500px; overflow-y: auto; }
.admin-list-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px; border-bottom: 1px solid #273244; }
.admin-list-row > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.admin-list-row small { color: #94a3b8; }
.admin-delete-button { padding: 7px 11px; border: 1px solid #7f1d1d; border-radius: 6px; background: #2b1115; color: #fca5a5; font-weight: 700; cursor: pointer; }
.admin-delete-button:hover:not(:disabled) { background: #991b1b; color: #fff; }
.admin-delete-button:disabled { border-color: #374151; background: #1f2937; color: #6b7280; cursor: not-allowed; }
.create-character-overlay.admin-delete-overlay { z-index: 1300; }
.admin-empty { padding: 30px; color: #94a3b8; text-align: center; }
@media (max-width: 560px) { .admin-card-grid { grid-template-columns: 1fr; } .admin-card { min-height: 125px; } }

.account-vault-gold { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; color: #f8fafc; font-size: 13px; }
.account-vault-gold input { width: 100px; padding: 7px; border: 1px solid #475569; border-radius: 5px; background: #0b1220; color: #fff; }
.account-vault-gold button { padding: 7px 10px; border: 0; border-radius: 5px; background: #b45309; color: #fff; cursor: pointer; }

.create-character-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
}
.create-character-overlay.hidden { display: none; }
.create-character-dialog {
    width: min(380px, calc(100vw - 32px));
    padding: 28px;
    border: 1px solid #475569;
    border-radius: 12px;
    background: #111827;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    color: #e2e8f0;
}
.create-character-dialog h2 { margin: 0 0 8px; color: #f1c40f; }
.takeover-loading-dialog { text-align: center; }
.takeover-loading-spinner { width: 38px; height: 38px; margin: 0 auto 16px; border: 4px solid #374151; border-top-color: #f59e0b; border-radius: 50%; animation: takeover-spin .8s linear infinite; }
@keyframes takeover-spin { to { transform: rotate(360deg); } }
.create-character-dialog p { margin: 0 0 18px; color: #94a3b8; font-size: 13px; }
.create-character-dialog input { width: 100%; margin-bottom: 10px; padding: 11px; border: 1px solid #334155; border-radius: 6px; background: #0b1220; color: #fff; }
.create-character-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.create-character-actions button { border: 0; border-radius: 6px; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.create-character-cancel { background: #334155; color: #e2e8f0; }
.create-character-confirm { background: #f1c40f; color: #172033; }
.delete-character-dialog { border-color: #7f1d1d; }
.delete-character-dialog h2 { color: #fca5a5; }
.confirm-delete-character { background: #b91c1c; color: #fff; }
.confirm-delete-character:hover { background: #dc2626; }
.login-error-dialog { text-align: center; border-color: #7f1d1d; }
.login-error-dialog h2 { color: #fca5a5; }
.login-error-dialog .create-character-actions { justify-content: center; }
.login-error-dialog .create-character-confirm { min-width: 120px; }
.login-error-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    place-items: center;
    border: 2px solid #ef4444;
    border-radius: 50%;
    background: rgba(127, 29, 29, 0.32);
    color: #fca5a5;
    font-size: 28px;
    font-weight: 800;
}

#rightExtra { display: none; }
#ui.desktop-extra {
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    max-width: 1448px;
}
#ui.desktop-extra #rightExtra { grid-column: 1; grid-row: 3; }
#ui.desktop-extra #left { grid-column: 2; grid-row: 3; border-left-width: 2px; }
#ui.desktop-extra #right { grid-column: 3; grid-row: 3; }
#ui.desktop-extra #rightExtra {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    overflow-y: auto;
    background: #0f172a;
    color: white;
    border: 2px solid #fff;
    border-left-width: 4px;
	border-right-width: 4px;
    border-bottom-width: 0px;
}
@media (max-width: 1359px) { #ui.desktop-extra { grid-template-columns: 1fr 300px; } #ui.desktop-extra #rightExtra { display: none; } }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f2a36;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.panel-header h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.panel-controls {
    display: flex;
    gap: 4px;
}

.panel-controls button {
    background: #1f2a36;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.panel-controls button:hover {
    background: #2d3f52;
}

.panel-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dpad {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
    gap: 6px;
    justify-content: center;
}

.dpad button {
    background: #1f2a36;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
}

.dpad button:active {
    background: #2d3f52;
}

.dpad button.interact {
    background: #f1c40f;
    color: #111827;
    font-weight: bold;
}



#questTracker {
    max-height: 250px;
    overflow-y: auto;
}



canvas {
    width: 100%;
    height: 100%;
    display: block;
}





.player-header {
    flex-shrink: 0;
    text-align: center;
}

.player-rank {
    text-align: center;
    margin-top: 2px;
    margin-bottom: 2px;
    color: #aaa;
    font-size: 14px;
}




.panel-content-box {
    background: #1b1b1b;
    border: 1px solid #444;
    border-radius: 10px;
	
	max-height: 350px;
    overflow-y: auto;

    padding: 12px;

    color: #eee;
    font-size: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 8px 8px;
    margin-bottom: 6px;

    background: #242424;
    border-radius: 6px;

    transition: background .2s;
}

.stat-row span,
.stat-row strong {
    line-height: 1;
}

.stat-row:hover {
    background: #303030;
}

.stat-row span {
    color: #bbb;
	margin-right: 5px;
}

.stat-row strong {
    color: #66d9ff;
}

#player-exp-text {
    flex-shrink: 0;
    white-space: nowrap;
}

[title]:not(button):not(a):not(input):not(select):not(textarea):not([role="button"]) {
    cursor: default;
}

.player-name {
    text-align: center;

    font-size: 24px;
    font-weight: bold;

    color: #f0c040;

    text-shadow: 0 0 8px rgba(240, 192, 64, .5);
}

.stat-title {
    text-align: center;

    font-size: 18px;
    font-weight: bold;

    color: #fff;

    border-bottom: 1px solid #444;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.exp-bar {
    background: #1f2a36;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin: 4px 0 10px;
}

.exp-fill {
    height: 100%;
    background: #38bdf8;
    transition: width 0.3s ease;
}


@media (max-width: 410px) {	
	#top {
		padding: 6px;
	}
	
	.top-icons-left {
		gap: 2px;
	}

	.top-icons-right {
		gap: 2px;
	}
}

@media (max-width: 768px) {
    #ui {
        height: auto;
        min-height: 100dvh;
        grid-template-columns: 1fr;
        grid-template-rows: 80px 40px auto 1fr;
		align-content: start;
    }

    #left {
        height: 400px;
    }
	
	#right {
        overflow-y: auto;
    }
	
	.label {
        display: none;
    }

    .icon {
        font-size: 16px;
    }
	
	.modal-overlay.stash-mode {
        flex-direction: column;
        gap: 12px;
        overflow-y: auto;
        padding: 12px 0;
    }

    .modal-overlay.stash-mode .inventory-modal-box {
        width: 90vw;
        max-width: 90vw;
        max-height: 60vh;
    }

    .stash-box {
        width: 90vw;
        max-width: 90vw;
        max-height: 30vh;
    }
}

@media (min-width: 768px) {
	.worldmap-layout {
		grid-template-columns: 500px 1fr;
	}
}




.modal-box-worldmap {
    width: 850px;
    max-width: 85vw;
    max-height: 85vh;
	background: #111827;
    border: 1px solid #1f2a36;
    border-radius: 10px;
    padding: 20px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    color: #e2e8f0;
}

.worldmap-layout {
    display: grid;
    gap: 16px;
    overflow: hidden;
    height: 70vh;
    max-height: 70vh;
}

.worldmap-boss-chance {
    font-size: 11px;
    color: #f59e0b;
    margin-top: 4px;
    font-weight: bold;
}

.worldmap-grid-wrap {
    overflow: hidden;
    min-height: 400px;
    max-height: 65vh;
    border: 1px solid #1f2a36;
    border-radius: 8px;
    cursor: grab;
    touch-action: none;
}
.worldmap-grid-wrap.dragging { cursor: grabbing; }

.worldmap-grid {
    display: grid;
    grid-auto-rows: 90px;
    grid-auto-columns: 90px;
    gap: 5px;
    width: max-content;
    transform-origin: 0 0;
    will-change: transform;
}

.worldmap-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.worldmap-center-btn { padding: 6px 10px; border: 1px solid #475569; border-radius: 5px; background: #1f2937; color: #e2e8f0; cursor: pointer; }

.worldmap-tile {
    background: #0b1220;
    border: 2px solid #1f2a36;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    text-align: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.worldmap-tile-preview { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .68; image-rendering: pixelated; }
.worldmap-tile::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(2, 6, 23, .16), rgba(2, 6, 23, .7)); pointer-events: none; }
.worldmap-tile-name, .worldmap-nested-badge { z-index: 2; }
.worldmap-tile:hover {
    border-color: #f1c40f;
}
.worldmap-tile.selected {
    border-color: #f1c40f;
    background: #1f2a36;
}

.worldmap-tile-name {
    font-size: 11px;
    font-weight: bold;
    color: #e2e8f0;
}

.worldmap-nested-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: #f1c40f;
    color: #111827;
    font-size: 9px;
    border-radius: 10px;
    padding: 1px 5px;
    font-weight: bold;
}

.worldmap-details {
    overflow-y: auto;
    padding-right: 6px;
    min-height: 0;
}

.worldmap-section {
    margin-bottom: 16px;
}

.worldmap-nested-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.worldmap-nested-item {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}
.worldmap-nested-item:hover {
    border-color: #f1c40f;
}

.worldmap-npc-card, .worldmap-monster-card, .worldmap-info-card {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 12px;
}

.worldmap-npc-name, .worldmap-monster-name {
    font-weight: bold;
    color: #f1c40f;
    margin-bottom: 4px;
}

.worldmap-monster-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #94a3b8;
    margin: 4px 0;
}

.worldmap-monster-modifiers {
    font-size: 11px;
    color: #f59e0b;
    margin-top: 4px;
}

.worldmap-loot-list {
    font-size: 11px;
    color: #4ade80;
}

.worldmap-profession-count {
    color: #e2e8f0;
    font-size: 11px;
}

.worldmap-chest-unopened {
    color: #f1c40f;
}

.worldmap-chest-opened {
    color: #4ade80;
}

.hunting-result-actions {
    display: grid;
    gap: 5px;
    color: #a7f3d0;
}



.alchemy-ingredients {
    font-size: 11px;
    color: #94a3b8;
    margin: 6px 0;
}

.alchemy-quantity-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.alchemy-qty-btn {
    background: #1f2a36;
    color: white;
    border: none;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 14px;
}
.alchemy-qty-btn:hover {
    background: #2d3f52;
}

.alchemy-qty-value {
    font-size: 13px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.alchemy-qty-max {
    background: #1e3a5f;
    color: #93c5fd;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    margin-left: auto;
}
.alchemy-qty-max:hover {
    background: #2d4f7a;
}



.stats-section {
    margin-bottom: 18px;
}
.stats-section:last-child {
	margin-bottom: 0;
}

.modal-box.development-tree-modal-box {
	width: min(1120px, 96vw);
	height: min(880px, 92vh);
	max-width: none;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background:
		radial-gradient(circle at 50% 10%, rgba(44, 110, 150, 0.2), transparent 35%),
		linear-gradient(180deg, #111b29, #090f18);
}

.development-tree-header {
	flex: 0 0 auto;
	align-items: flex-start;
}

.development-tree-header h2 {
	margin-bottom: 5px;
}

.development-tree-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.development-points-summary {
	color: #b7c8da;
	font-size: 14px;
}

.development-points-summary strong {
	color: #67e8f9;
	font-size: 17px;
}

.development-points-summary span {
	margin: 0 8px;
	color: #597087;
}

.development-tree-help {
	flex: 0 0 auto;
	padding: 8px 16px 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	color: #9eb1c4;
	font-size: 13px;
	border-bottom: 1px solid rgba(116, 151, 181, 0.18);
}

.development-tree-legend {
	display: flex;
	gap: 12px;
	font-size: 11px;
}

.development-tree-legend > span {
	display: flex;
	align-items: center;
	gap: 5px;
}

.development-tree-legend i {
	width: 11px;
	height: 11px;
	border: 2px solid;
	border-radius: 50%;
}

.development-tree-legend i.available { border-color: #fff; }
.development-tree-legend i.maxed { border-color: #4ade80; }
.development-tree-legend i.locked { border-color: #ef4444; }

.development-tree-viewport {
	flex: 1 1 auto;
	position: relative;
	overflow: hidden;
	min-height: 0;
	border: 1px solid rgba(116, 151, 181, 0.18);
	border-radius: 8px;
	cursor: grab;
	touch-action: none;
}

.development-tree-viewport.dragging {
	cursor: grabbing;
}

.development-tree {
	position: relative;
	width: 1400px;
	height: 900px;
	min-width: 1400px;
	background-image:
		radial-gradient(circle, rgba(110, 202, 234, 0.09) 1px, transparent 1px),
		radial-gradient(circle at 50% 45%, rgba(54, 141, 183, 0.1), transparent 42%);
	background-size: 28px 28px, auto;
	transform-origin: 0 0;
	will-change: transform;
}

.development-tree-connections {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.development-tree-connections line {
	stroke: #34495e;
	stroke-width: 5;
	stroke-linecap: round;
	filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.7));
}

.development-tree-connections line.active {
	stroke: #43c8e8;
	filter: drop-shadow(0 0 5px rgba(67, 200, 232, 0.7));
}

.development-node {
	position: absolute;
	z-index: 1;
	width: 62px;
	height: 62px;
	padding: 0;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	color: #9aa8b6;
	border: 3px solid #526171;
	border-radius: 50%;
	background: radial-gradient(circle, #233241, #101923 72%);
	box-shadow: 0 6px 13px rgba(0, 0, 0, 0.45);
	cursor: default;
	overflow: visible;
}

.development-node-icon {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	font-size: 27px;
	border-radius: inherit;
}

.development-node-rank {
	position: absolute;
	right: -8px;
	bottom: -6px;
	min-width: 27px;
	padding: 2px 4px;
	color: #dbe7f1;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	border: 1px solid #526171;
	border-radius: 8px;
	background: #0b1119;
}

.development-node-tooltip {
	position: absolute;
	z-index: 20;
	left: 50%;
	top: calc(100% + 12px);
	width: 245px;
	padding: 11px 12px;
	transform: translateX(-50%) translateY(-4px);
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: #c9d6e2;
	font-size: 12px;
	line-height: 1.35;
	text-align: left;
	border: 1px solid #496176;
	border-radius: 8px;
	background: rgba(7, 14, 22, 0.97);
	box-shadow: 0 9px 24px rgba(0, 0, 0, 0.55);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.development-node:hover,
.development-node:focus-visible {
	z-index: 10;
}

.development-node:hover .development-node-tooltip,
.development-node:focus-visible .development-node-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.development-node.near-left-edge .development-node-tooltip {
	left: -15px;
	transform: translateY(-4px);
}

.development-node.near-left-edge:hover .development-node-tooltip,
.development-node.near-left-edge:focus-visible .development-node-tooltip {
	transform: translateY(0);
}

.development-node.near-right-edge .development-node-tooltip {
	right: -15px;
	left: auto;
	transform: translateY(-4px);
}

.development-node.near-right-edge:hover .development-node-tooltip,
.development-node.near-right-edge:focus-visible .development-node-tooltip {
	transform: translateY(0);
}

.development-node.near-bottom-edge .development-node-tooltip {
	top: auto;
	bottom: calc(100% + 12px);
	transform: translateX(-50%) translateY(4px);
}

.development-node.near-bottom-edge:hover .development-node-tooltip,
.development-node.near-bottom-edge:focus-visible .development-node-tooltip {
	transform: translateX(-50%) translateY(0);
}

.development-node-tooltip strong {
	color: #f1f7fb;
	font-size: 14px;
}

.development-node-description {
	color: #9caebe;
}

.development-node-tooltip-rank {
	color: #d7e4ee;
	font-weight: 700;
}

.development-node-effects {
	display: flex;
	flex-direction: column;
	color: #78d9ef;
}

.development-node-requirement {
	color: #db7777;
	font-weight: 700;
}

.development-node.unlocked {
	color: #d8f6ff;
	background: radial-gradient(circle, #1c4b5e, #10232e 72%);
	box-shadow: 0 0 14px rgba(47, 177, 211, 0.24);
}

.development-node.available {
	color: #fff;
	border-color: #fff;
	cursor: pointer;
	animation: development-node-pulse 2s ease-in-out infinite;
}

.development-node.available:hover {
	transform: translate(-50%, -50%) scale(1.08);
	background: radial-gradient(circle, #28637a, #12303e 72%);
}

.development-node.maxed {
	color: #d8ffe4;
	border-color: #4ade80;
	background: radial-gradient(circle, #1e5935, #10291b 72%);
	box-shadow: 0 0 15px rgba(74, 222, 128, 0.35);
}

.development-node.maxed .development-node-rank {
	color: #9ff0b9;
	border-color: #36a85f;
}

.development-node.locked {
	color: #ac7070;
	border-color: #ef4444;
	background: radial-gradient(circle, #472222, #241315 72%);
	box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.development-node.unaffordable {
	opacity: 0.72;
}

@keyframes development-node-pulse {
	50% { box-shadow: 0 0 18px rgba(255, 255, 255, 0.4); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 5px;
}

.stats-grid .stat-row {
    margin-bottom: 0;
}

.stats-empty {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    grid-column: 1 / -1;
}



#battleAttackModal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#battleAttackModal:not(.hidden) {
    display: flex;
}

.battle-attack-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.battle-attack-card:hover {
    border-color: #f1c40f;
}

.battle-attack-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.battle-attack-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.battle-attack-card-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #94a3b8;
}

.battle-attack-cooldown-badge {
    background: #7f1d1d;
    color: #fecaca;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
}

.battle-attack-chakra-badge {
    background: #1e3a5f;
    color: #93c5fd;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
}

.battle-enemy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.battle-enemy-card, .battle-ally-card {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 8px;
}
.battle-enemy-card.defeated, .battle-ally-card.defeated {
    opacity: 0.4;
}

.battle-ally-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.battle-turn-order {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 5px;
    margin: 4px 0;
}

.battle-turn-badge {
    flex-shrink: 0;
    background: #1f2a36;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
    color: #94a3b8;
}

.battle-turn-badge.is-player {
    border-color: #38bdf8;
    color: #93c5fd;
    font-weight: bold;
}

.battle-turn-badge.is-ally {
    border-color: #4ade80;
    color: #86efac;
}

.battle-turn-badge.is-enemy {
    border-color: #f87171;
    color: #fca5a5;
}

.battle-turn-badge.is-next {
    border-width: 2px;
    box-shadow: 0 0 5px currentColor;
    transform: scale(1.06);
}

.battle-target-player-info {
    font-size: 12px;
    color: #93c5fd;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #1e3a5f;
    border-radius: 6px;
}

.battle-target-player-info.chakra-preview-active strong {
    color: #f1c40f;
}

.battle-target-player-info.chakra-preview-negative strong {
    color: #f87171;
}

#battleTargetList .battle-attack-card.selected {
    border-color: #f1c40f;
    box-shadow: 0 0 0 1px #f1c40f;
}

#battleTargetList .primary-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #f1c40f;
    color: #111827;
    font-weight: bold;
    cursor: pointer;
}

#battleTargetList .primary-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}




@keyframes hitShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

@keyframes floatDamage {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-30px); opacity: 0; }
}

.hit-shake {
    animation: hitShake 0.35s ease;
}

.hit-flash {
    box-shadow: 0 0 0 2px #f87171 inset;
}

.floating-damage-wrap {
    position: relative;
}

.floating-damage {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    font-weight: bold;
    color: #f87171;
    animation: floatDamage 0.8s ease forwards;
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
}

.floating-damage.is-crit {
    color: #fbbf24;
    font-size: 19px;
}




#battleTargetModal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#battleTargetModal:not(.hidden) {
    display: flex;
}

#battleItemModal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#battleItemModal:not(.hidden) {
    display: flex;
}

#battleItemList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#battleItemList .battle-item-card {
    cursor: pointer;
}




#battleWindow {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    display: none;

    justify-content: center;
    align-items: center;

    z-index: 9999;
}

#battleWindow.active {
    display: flex;
}

#battleWindow.boss-fight .battle-box {
    border-color: #dc2626;
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.5);
}

.battle-box button {
    margin-top: 4px;
    padding: 12px 26px;

    background: linear-gradient(#e53935, #c62828);
    color: #fff;

    border: 1px solid #8b1e1e;
    border-radius: 6px;

    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .5px;

    cursor: pointer;

    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
    transition: transform .15s ease, filter .2s ease;
}

.battle-box button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.battle-box button:active {
    transform: translateY(1px);
}

.battle-box {
    width: min(450px, 85vw);
    background: #222;
    border: 2px solid #555;
    border-radius: 12px;
    padding: 15px;
    color: #fff;
}

.battle-status {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin: 5px 0;
}

.name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.info-icon {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 50%;
	margin-bottom: 8px;
    background: #353F4A;
    color: #94a3b8;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.info-icon .tooltip {
    display: none;
    position: absolute;
    top: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    border: 1px solid #1f2a36;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #e2e8f0;
    text-align: left;
    line-height: 1.6;
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    white-space: normal;
    z-index: 50;
}

.info-icon:hover .tooltip {
    display: block;
}

.name {
    font-weight: bold;
    font-size: 15px;
	margin-bottom: 5px;
	text-align: center;
}

.battle-enemy-name, .battle-ally-name {
	font-weight: bold;
    font-size: 15px;
    margin-bottom: 5px;
	text-align: center;
}

.vs {
    font-size: 26px;
    font-weight: bold;
    color: #f0c040;
}

.hp-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #2ecc71, #27ae60);
    transition: width .3s;
}

.battle-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    text-align: center;
    margin: 20px 0;
}

.hp-bar {
    position: relative;
    width: 100%;
    height: 20px;
    background: #444;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.chakra-bar {
    position: relative;
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.battle-player-card {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 8px;
}

.battle-log {
    height: 100px;
    overflow-y: auto;
    background: #111;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 5px;
    text-align: center;
    font-size: 14px;
}

.battle-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}

.hidden {
    display: none !important;
}

.battle-actions button {
    padding: 4px;
    font-size: 15px;
    font-weight: bold;
}

#attackList {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    display: flex;
}

.chakra-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #3498db, #8e44ad);
    transition: width .3s;
}



.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-overlay.hidden { display: none; }

.modal-box {
    background: #111827;
    border: 1px solid #1f2a36;
    border-radius: 10px;
    padding: 15px;
    width: 580px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    color: #e2e8f0;
}

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






.inventory-modal-box {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    min-height: 400px;
}

.inventory-fixed-top {
    flex-shrink: 0;
}

.inventory-scroll-area {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
}

.inventory-grid.targeting-mode .inventory-item.targetable {
    cursor: crosshair;
    outline: 1px dashed #38bdf8;
	outline-offset: -3px;
}

.inventory-gold-footer {
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #1f2a36;
    text-align: right;
    font-size: 13px;
    color: #94a3b8;
}
.inventory-gold-footer strong {
    color: #fbbf24;
}

.inventory-sort-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}

.inventory-sort-bar select {
    background: #1f2a36;
    color: #e2e8f0;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}

.sort-btn {
    background: #1f2a36;
    color: #94a3b8;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}
.sort-btn:hover {
    background: #2d3f52;
}
.sort-btn.active {
    background: #f1c40f;
    color: #111827;
    font-weight: bold;
}

.equipment-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas:
        "head armor legs boots"
        "weapon necklace ring waist";
    gap: 8px;
    margin-bottom: 16px;
}

.confirmation-modal-box {
    width: 410px;
    padding: 24px;
    overflow: hidden;
    text-align: center;
    border-color: #7f1d1d;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .55), 0 0 28px rgba(239, 68, 68, .12);
}

#confirmationModal[data-variant="legendary"] .confirmation-modal-box {
    border-color: #b45309;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .55), 0 0 30px rgba(245, 158, 11, .18);
}

.confirmation-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    border: 1px solid #7f1d1d;
    border-radius: 50%;
    background: rgba(127, 29, 29, .22);
    font-size: 28px;
}

#confirmationModal[data-variant="legendary"] .confirmation-icon {
    border-color: #b45309;
    background: rgba(180, 83, 9, .2);
}

.confirmation-title {
    margin: 0 0 8px;
    color: #f8fafc;
    font-size: 21px;
}

.confirmation-message {
    margin: 0;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
}

.confirmation-item {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 7px;
    background: #0b1220;
    color: #e2e8f0;
    font-weight: 700;
}

#confirmationModal[data-variant="legendary"] .confirmation-item {
    border-color: #92400e;
    color: #fbbf24;
}

.confirmation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.confirmation-actions button {
    border: 0;
    border-radius: 7px;
    padding: 10px 14px;
    color: #f8fafc;
    font-weight: 700;
    cursor: pointer;
}

.confirmation-cancel-btn {
    background: #334155;
}

.confirmation-cancel-btn:hover {
    background: #475569;
}

.confirmation-accept-btn {
    background: #991b1b;
}

.confirmation-accept-btn:hover {
    background: #b91c1c;
}

#confirmationModal[data-variant="legendary"] .confirmation-accept-btn {
    background: #b45309;
}

#confirmationModal[data-variant="legendary"] .confirmation-accept-btn:hover {
    background: #d97706;
}

.equipment-slots .equip-slot:nth-child(1) { grid-area: weapon; }
.equipment-slots .equip-slot:nth-child(2) { grid-area: armor; }
.equipment-slots .equip-slot:nth-child(3) { grid-area: necklace; }
.equipment-slots .equip-slot:nth-child(4) { grid-area: ring; }
.equipment-slots .equip-slot:nth-child(5) { grid-area: waist; }
.equipment-slots .equip-slot:nth-child(6) { grid-area: legs; }
.equipment-slots .equip-slot:nth-child(7) { grid-area: boots; }
.equipment-slots .equip-slot:nth-child(8) { grid-area: head; }

.equip-slot {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
}

.slot-label { color: #64748b; margin-bottom: 4px; }
.slot-item { font-weight: bold; cursor: pointer; }

.inventory-grid {
    display: grid;
	min-height: 100px;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 8px;
}

.inventory-item {
    display: flex;
    flex-direction: column;
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
}

.item-name {
    cursor: pointer;
    font-weight: bold;
}

.item-name:hover {
    text-decoration: underline;
}

.item-level-suffix {
    white-space: nowrap;
}

.qty {
    color: #64748b;
    font-size: 12px;
	margin-bottom: 3px;
}

.sell-btn {
    margin-top: auto;
	margin-bottom: 3px;
    background: #78350f;
    color: #fef3c7;
    border: none;
    border-radius: 4px;
    padding: 4px;
    font-size: 11px;
    cursor: pointer;
}

.sell-btn:hover {
    background: #92400e;
}

.inventory-divider {
    height: 1px;
    background: #1f2a36;
    margin: 12px 0;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inventory-slot-count {
    font-size: 12px;
    color: #94a3b8;
}

.inventory-slot-count.full {
    color: #f87171;
    font-weight: bold;
}





.modal-overlay.stash-mode {
    gap: 24px;
    justify-content: center;
}

.stash-box {
    width: 520px;
    max-height: 80vh;
    background: #111827;
    border: 1px solid #1f2a36;
    border-radius: 10px;
    padding: 20px;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
}

.stash-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.stash-tab {
    background: #1f2a36;
    color: #94a3b8;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}
.stash-tab.active {
    background: #f1c40f;
    color: #111827;
    font-weight: bold;
}

.stash-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.stash-quick-actions button {
    background: #166534;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
.stash-quick-actions button:hover {
    background: #15803d;
}

.modal-overlay.vault-busy .inventory-grid,
.modal-overlay.vault-busy .account-vault-gold {
    pointer-events: none;
    opacity: .65;
}

.modal-overlay.vault-busy button:disabled {
    cursor: wait;
    opacity: .6;
}

.stash-sort-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}

.stash-sort-btn {
    background: #1f2a36;
    color: #94a3b8;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}
.stash-sort-btn:hover {
    background: #2d3f52;
}
.stash-sort-btn.active {
    background: #f1c40f;
    color: #111827;
    font-weight: bold;
}

.stash-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 12px;
    color: #94a3b8;
}





.shop-gold-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #1f2a36;
    text-align: right;
    font-size: 13px;
    color: #94a3b8;
}

.shop-gold-footer strong {
    color: #fbbf24;
}




.element-training-banner {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    border: 2px solid #38bdf8;
    border-radius: 8px;
    padding: 8px 16px;
    color: #e2e8f0;
    font-size: 13px;
    z-index: 110;
    text-align: center;
}
.element-training-banner.hidden { display: none; }

.element-technique-preview {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-radius: 6px;
    padding: 8px 10px;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.45;
}

.element-technique-preview strong { color: #f1c40f; }
.element-technique-preview span { color: #94a3b8; }



.modal-box-wide {
    width: 780px;
}

.quest-board-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quest-board-refresh-timer {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 10px;
    text-align: right;
}

.quest-board-card {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-left: 3px solid #f1c40f;
    border-radius: 8px;
    padding: 12px 14px;
}

.quest-board-card-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
}

.quest-board-card-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.quest-board-card-objective {
    font-size: 12px;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.quest-board-card-rewards {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
}

.quest-board-select-btn,
.quest-board-deliver-btn {
    width: 100%;
    background: #166534;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
.quest-board-select-btn:hover,
.quest-board-deliver-btn:hover:not(:disabled) {
    background: #15803d;
}

.quest-board-deliver-btn:disabled {
    background: #475569;
    cursor: not-allowed;
    opacity: 0.65;
}

.quest-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.technique-upgrade-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 12px;
}

.technique-upgrade-summary strong {
    color: #facc15;
}

.technique-upgrade-summary .info-icon {
    display: inline-flex;
    flex: 0 0 16px;
    align-self: center;
    margin-bottom: 0;
}

.technique-upgrade-summary .info-icon .tooltip {
    right: 0;
    left: auto;
    transform: none;
}

.quest-filter-bar select {
    background: #1f2a36;
    color: #e2e8f0;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
}





.top-icons-left {
    display: flex;
    gap: 6px;
    align-items: center;
}

.top-icons-right {
    display: flex;
    gap: 6px;
    align-items: center;
}

.top-icons-left button {
    background: #1f2a36;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.top-icons-left button:hover {
    background: #2d3f52;
}

.top-icons-right button {
    background: #1f2a36;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.top-icons-right button:hover {
    background: #2d3f52;
}




.settings-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1f2a36;
}
.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    cursor: pointer;
}

.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid #1f2a36;
}

.settings-tab {
    background: none;
    border: none;
    color: #64748b;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}
.settings-tab.active {
    color: #f1c40f;
    border-bottom: 2px solid #f1c40f;
}

.settings-tab-content.hidden { display: none; }

@media (max-width: 767px) {
    #settingExtraPanelsRow,
    #settingsHotkeysTab,
    #settingsTabHotkeys {
        display: none !important;
    }
}

.hotkey-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #1f2a36;
}

.hotkey-slots {
    display: flex;
    gap: 4px;
}

.hotkey-slot-btn {
    min-width: 56px;
    background: #1f2a36;
    color: #e2e8f0;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    cursor: pointer;
}
.hotkey-slot-btn.listening {
    background: #f1c40f;
    color: #111827;
}

.hotkey-slot-clear {
    background: #7f1d1d;
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    cursor: pointer;
    font-size: 10px;
}
.hotkey-slot-clear:hover {
    background: #991b1b;
}

.danger-btn {
    width: 100%;
    background: #7f1d1d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 8px;
}
.danger-btn:hover {
    background: #991b1b;
}




.skills-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-card {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-radius: 8px;
    padding: 12px;
}

.skill-card-type {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
}

.skill-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.skill-card-name {
    font-weight: bold;
    font-size: 14px;
}

.skill-card-desc {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 8px;
}

.skill-card-stats {
    display: flex;
	flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.attack-stat {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 7px;
    border: 1px solid #334155;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.7);
    cursor: help;
}

.attack-area-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.attack-area-label .info-icon {
    display: inline-flex;
    flex: 0 0 16px;
    margin-bottom: 0;
}

.skill-upgrade-btn {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    border: 1px solid #8b5cf6;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.fixed-list-modal-box {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-fixed-top {
    flex: 0 0 auto;
}

.modal-scroll-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

#skillsList.modal-scroll-area {
    padding-top: 2px;
}

.leaderboard-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.leaderboard-filters select {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #1f2a36;
    color: #e2e8f0;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-refresh-timer {
    margin: -4px 0 10px;
    color: #64748b;
    font-size: 11px;
    text-align: right;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #1f2a36;
    border-radius: 8px;
    background: #0b1220;
}

.leaderboard-position {
    color: #94a3b8;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.leaderboard-position::before {
    content: "#";
    font-size: 11px;
}

.leaderboard-player,
.leaderboard-score {
    display: flex;
    flex-direction: column;
}

.leaderboard-player small,
.leaderboard-score small {
    color: #94a3b8;
    font-size: 11px;
}

.leaderboard-score {
    align-items: flex-end;
}

.leaderboard-score strong {
    color: #facc15;
    font-size: 18px;
}

.leaderboard-entry.top-1 { border-color: #facc15; }
.leaderboard-entry.top-2 { border-color: #94a3b8; }
.leaderboard-entry.top-3 { border-color: #b45309; }

@media (max-width: 650px) {
    .leaderboard-filters { grid-template-columns: 1fr; }
}

.skill-upgrade-btn:hover:not(:disabled) {
    filter: brightness(1.15);
}

.skill-upgrade-btn:disabled {
    background: #1f2a36;
    color: #64748b;
    border-color: #334155;
    cursor: not-allowed;
}

.skill-card.activity-in-progress {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.skill-card.activity-in-progress .skill-learn-btn:disabled,
.skill-card.activity-in-progress .skill-upgrade-btn:disabled {
    background: #075985;
    color: #e0f2fe;
    border-color: #38bdf8;
}

.technique-upgrade-modal-box {
    max-width: 720px;
}

#techniqueUpgradePreview {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
}

.technique-upgrade-preview-title {
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
}

.technique-upgrade-preview-stats,
.technique-upgrade-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.technique-upgrade-preview-stats > span,
.technique-upgrade-resources > span {
    padding: 6px 9px;
    border-radius: 6px;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 12px;
}

.technique-upgrade-preview-stats strong span {
    color: #4ade80;
}

.technique-upgrade-options {
    display: grid;
    gap: 9px;
}

.technique-upgrade-resources {
    margin-bottom: 5px;
    font-size: 12px;
}

.technique-upgrade-option {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #1e293b;
    color: #e2e8f0;
    text-align: left;
    cursor: pointer;
}

.technique-upgrade-option:hover:not(:disabled),
.technique-upgrade-option:focus-visible:not(:disabled) {
    border-color: #8b5cf6;
    background: #312e81;
    outline: none;
}

.technique-upgrade-option:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.technique-upgrade-option-icon {
    font-size: 24px;
    text-align: center;
}

.technique-upgrade-option strong,
.technique-upgrade-option small {
    display: block;
}

.technique-upgrade-option small {
    margin-top: 3px;
    color: #94a3b8;
}

.technique-upgrade-option-state {
    color: #a78bfa;
    font-size: 12px;
    font-weight: 700;
}

.skill-card.locked {
    opacity: 0.5;
    filter: grayscale(0.6);
}

.skill-card-requirement {
    font-size: 12px;
    color: #f87171;
    margin-top: 4px;
}

.skill-learn-btn {
    width: 100%;
    background: #166534;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 6px;
}
.skill-learn-btn:hover {
    background: #15803d;
}
.skill-learn-btn[disabled] {
    background: #1f2a36;
    color: #64748b;
    cursor: not-allowed;
}

.skill-learned-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #cbd5e1;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.skill-learned-filter input {
    accent-color: #8b5cf6;
    cursor: pointer;
}

.hotbar-slot.activity-locked {
    opacity: 0.45;
    filter: grayscale(0.8);
    cursor: not-allowed;
}




#minimapCanvas {
    width: 100%;
    height: auto;
    background: #05080f;
    border-radius: 6px;
    display: block;
}




.close-btn {
    background: #1f2a36;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}




#toastContainer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    z-index: 300;
    pointer-events: none;
}

.lootbox-toast {
    position: static;
    border: 2px solid;
    border-radius: 8px;
    padding: 12px 20px;
    background: #111827;
    color: #e2e8f0;
    font-size: 14px;
}

.lootbox-modal-box {
    width: 520px;
}

.lootbox-description {
    color: #94a3b8;
    margin-bottom: 8px;
}

.lootbox-count {
    color: #fbbf24;
    font-size: 13px;
    margin-bottom: 14px;
}

.lootbox-section-title,
.lootbox-results-title {
    font-weight: bold;
    margin: 12px 0 6px;
}

.lootbox-pool {
    border: 1px solid #1f2a36;
    border-radius: 6px;
    overflow: hidden;
}

.lootbox-pool-entry {
    display: flex;
    justify-content: space-between;
    padding: 7px 10px;
    font-size: 13px;
}

.lootbox-pool-item {
    cursor: help;
}

.lootbox-pool-entry + .lootbox-pool-entry {
    border-top: 1px solid #1f2a36;
}

.lootbox-rarity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    font-size: 13px;
}

.lootbox-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.lootbox-actions button {
    flex: 1;
}

.lootbox-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lootbox-upgrade-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 7px;
    font-size: 13px;
}

.lootbox-quantity-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
}

.lootbox-quantity-row input {
    width: 58px;
    padding: 7px;
    text-align: center;
    color: #e2e8f0;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 5px;
}

.lootbox-quantity-btn,
.lootbox-quantity-max {
    min-width: 32px;
    padding: 7px 10px;
    color: #e2e8f0;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 5px;
    cursor: pointer;
}

.lootbox-quantity-max { margin-left: auto; }
.lootbox-quantity-btn:hover,
.lootbox-quantity-max:hover { border-color: #facc15; }

.lootbox-results {
    border-top: 1px solid #1f2a36;
    margin-top: 14px;
    padding-top: 2px;
    font-size: 13px;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; }
    100% { opacity: 0; }
}



.tutorial-box {
    max-height: 85vh;
    overflow-y: auto;
}

.tutorial-content {
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
}

.tutorial-content p {
    margin-bottom: 10px;
}

.tutorial-content img,
.tutorial-content video {
    display: block;
}



#dialogueBox {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    max-width: 85%;
    background: #111827;
    border: 2px solid #f1c40f;
    border-radius: 10px;
    padding: 16px 20px;
    color: #e2e8f0;
    z-index: 150;
}
#dialogueBox.hidden { display: none; }

.dialogue-name {
    font-weight: bold;
    color: #f1c40f;
    margin-bottom: 6px;
}

.dialogue-text {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.dialogue-hint {
    font-size: 11px;
    color: #64748b;
    text-align: right;
}

.dialogue-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}

.dialogue-options button {
    background: #1f2a36;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
}
.dialogue-options button:hover {
    background: #2d3f52;
}




#questTracker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quest-entry {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-left: 3px solid #f1c40f;
    border-radius: 6px;
    padding: 8px 10px;
}

.quest-name {
    font-weight: bold;
    font-size: 13px;
    color: #f1c40f;
    margin-bottom: 4px;
}

.quest-step {
    font-size: 12px;
    color: #94a3b8;
}

#questTracker:empty::before,
#questTracker .quest-empty {
    color: #64748b;
    font-size: 12px;
    font-style: italic;
}




#hotbar {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 100;
}

.hotbar-slot {
    width: 48px;
    height: 48px;
    background: #111827;
    border: 2px solid #3b5166;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 10px;
    text-align: center;
    position: relative;
	opacity: 0.85;
}

.hotbar-slot.empty {
    color: #374151;
    cursor: default;
}

.hotbar-slot:not(.empty):hover {
    border-color: #f1c40f;
}

.hotbar-slot .qty {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    color: #94a3b8;
}

.hotbar-slot .key {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 9px;
    color: #64748b;
}




.quest-compass {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(17, 24, 39, 0.85);
    border: 2px solid #f1c40f;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    justify-content: center;
    z-index: 90;
}

.quest-compass-arrow {
    transition: transform 0.2s ease;
    transform-origin: 50% 50%;
}

.quest-compass-label {
    position: absolute;
    bottom: -22px;
    white-space: nowrap;
    font-size: 10px;
    color: #e2e8f0;
    background: rgba(17, 24, 39, 0.85);
    padding: 2px 6px;
    border-radius: 4px;
}




.quest-section {
    margin-bottom: 16px;
}
.quest-section:last-child {
    margin-bottom: 0;
}

.quest-card {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-left: 3px solid #f1c40f;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.quest-card.locked {
    opacity: 0.5;
    filter: grayscale(0.5);
    border-left-color: #64748b;
}
.quest-card.completed {
    border-left-color: #4ade80;
}

.quest-card-name {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 4px;
}

.quest-card-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.quest-card-step {
    font-size: 12px;
    color: #e2e8f0;
}

.quest-card-requirement {
    font-size: 11px;
    color: #f87171;
    margin-top: 4px;
}

.quest-lock-category {
    margin: 10px 0 2px;
    padding-top: 8px;
    border-top: 1px solid #334155;
    color: #facc15;
    font-size: 12px;
    font-weight: 700;
}

.quest-card-rewards {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
}

.quest-empty-small {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.quest-track-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
    cursor: pointer;
}

.quest-difficulty-badge {
    display: inline-block;
    background: #1f2a36;
    color: #f1c40f;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}





#gatherProgressBar {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 10px;
    background: #1f2a36;
    border-radius: 5px;
    overflow: visible;
    z-index: 120;
}
#gatherProgressBar.hidden { display: none; }

#interactionProgressLabel {
    position: absolute;
    bottom: 15px;
    left: 50%;
    width: 280px;
    transform: translateX(-50%);
    color: #e9d5ff;
    font-size: 12px;
    text-align: center;
}

.skill-card-header-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#interactionTimingTarget {
    position: absolute;
    top: -2px;
    height: 14px;
    border: 2px solid #facc15;
    border-radius: 6px;
    box-sizing: border-box;
    background: rgba(250, 204, 21, 0.2);
    z-index: 1;
    pointer-events: none;
}

#interactionTimingTarget.hidden { display: none; }

.battle-status-effects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    min-height: 0;
    margin-top: 5px;
}

.battle-status-effect {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #475569;
    border-radius: 50%;
    background: #172033;
    font-size: 15px;
    cursor: help;
}

.battle-status-effect.debuff { border-color: #ef4444; }
.battle-status-effect.buff { border-color: #22c55e; }

.battle-status-effect-turns {
    position: absolute;
    right: -4px;
    bottom: -4px;
    min-width: 13px;
    padding: 0 2px;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 9px;
    line-height: 13px;
    text-align: center;
}

.quest-reward-attack { color: #c4b5fd; }
.quest-reward-element-unlock { color: #67e8f9; }

#gatherProgressFill {
    height: 100%;
    width: 0%;
    background: #4ade80;
    transition: width 0.1s linear;
}





.item-tooltip-wrapper {
    position: relative;
    display: inline-block;
	margin-bottom: 3px;
}

.item-tooltip {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    background: #111827;
    border: 1px solid #1f2a36;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 11px;
    color: #e2e8f0;
    text-align: left;
    line-height: 1.5;
    white-space: normal;
    width: 180px;
    z-index: 60;
    pointer-events: none;
}

.item-tooltip.tooltip-bottom {
    bottom: auto;
    top: 110%;
}

.item-tooltip-wrapper:hover .item-tooltip {
    display: block;
}

.tooltip-bonus {
    color: #4ade80;
}

.tooltip-price {
    color: #fbbf24;
}

.tooltip-divider {
    border: none;
    border-top: 1px solid #1f2a36;
    margin: 6px 0;
}

.tooltip-compare-title {
    font-size: 10px;
    color: #64748b;
    margin-bottom: 2px;
}

.tooltip-compare-up {
    color: #4ade80;
    font-size: 11px;
}

.tooltip-compare-down {
    color: #f87171;
    font-size: 11px;
}

.tooltip-compare-note {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}




#mapInfo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-icon {
    position: relative;
    width: 16px;
    /* height: 16px; */
    border-radius: 50%;
    background: #353F4A;
    color: #94a3b8;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
	margin-left: -4px;
}

#activeBuffs {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.buff-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #1f2a36;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    color: #e2e8f0;
}

.buff-badge .buff-icon {
    font-size: 13px;
}

.map-tooltip-wrapper {
    position: relative;
    display: inline-block;
}

#mapInfo > .map-tooltip-wrapper {
    display: flex;
    align-items: center;
    height: 18px;
	padding-top: 2px;
}

.map-tooltip {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    background: #111827;
    border: 1px solid #1f2a36;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 11px;
    color: #e2e8f0;
    text-align: left;
    line-height: 1.5;
    white-space: normal;
    width: 200px;
    z-index: 60;
    pointer-events: none;
}

.map-tooltip-wrapper:hover .map-tooltip {
    display: block;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 18px;
    color: #e2e8f0;
    font-weight: 600;
    padding-right: 10px;
    margin-right: 2px;
    border-right: 1px solid #334155;
}

#mapInfoText {
    display: flex;
    align-items: center;
    height: 18px;
}

.weather-icon {
    display: block;
    transform: translateY(-1px);
}

.weather-tooltip-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: help;
}

.weather-tooltip-wrapper .map-tooltip {
    left: 0;
    transform: none;
}

.worldmap-section .map-tooltip {
    top: 110%;
    bottom: auto;
    right: 0;
    left: auto;
    transform: none;
}




::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
    border: 2px solid #111;
}

::-webkit-scrollbar-thumb:hover {
    background: #f0c040;
}
.market-modal-box { width: min(1000px, 94vw); height: min(760px, 90vh); padding: 0; }
.market-fixed-top { padding: 18px 18px 0; border-bottom: 1px solid rgba(241,196,15,.16); background: linear-gradient(180deg, rgba(25,32,42,.98), rgba(17,24,39,.98)); }
.market-tabs { display: flex; gap: 8px; padding: 10px 0 12px; flex-wrap: wrap; }
.market-tab, .market-row button, .market-mailbox-gold button {
    min-height: 34px;
    padding: 7px 14px;
    border: 1px solid #475569;
    border-radius: 7px;
    background: linear-gradient(180deg, #273548, #172131);
    color: #dbe7f5;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 5px rgba(0,0,0,.22);
    transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease;
}
.market-tab:hover, .market-row button:hover, .market-mailbox-gold button:hover {
    border-color: #d4a72c;
    color: #ffe28a;
    background: linear-gradient(180deg, #35445a, #202c3d);
    transform: translateY(-1px);
}
.market-tab.active {
    border-color: #f1c40f;
    color: #16120a;
    background: linear-gradient(180deg, #f8d94d, #c99712);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 12px rgba(241,196,15,.18);
}
.market-row button[data-cancel] {
    border-color: #7f1d1d;
    background: linear-gradient(180deg, #7f1d1d, #4c1010);
    color: #fee2e2;
}
.market-row button[data-cancel]:hover { border-color: #ef4444; background: linear-gradient(180deg, #991b1b, #681515); color: #fff; }
.market-row button:disabled, .market-mailbox-gold button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.market-notice { min-height: 22px; padding: 0 0 8px; color: #a7f3d0; font-size: 12px; }
.market-notice.error { color: #fca5a5; }
.market-content { padding: 14px 18px 20px; }
.market-row { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px; margin-bottom: 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(0,0,0,.2); }
.market-row small, .market-row label { display: block; opacity: .75; }
.market-item-name {
    display: inline-block;
    max-width: 100%;
    font-size: 13px;
    cursor: help;
}
.market-item-name > strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.market-row input {
    width: 90px;
    margin-left: 6px;
    padding: 7px 8px;
    border: 1px solid #475569;
    border-radius: 6px;
    outline: none;
    background: #101827;
    color: #f8fafc;
    font-family: inherit;
}
.market-row input:focus { border-color: #f1c40f; box-shadow: 0 0 0 2px rgba(241,196,15,.12); }
.market-row-action { display: flex; gap: 6px; }
.market-sell-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}
.market-sticky-controls {
    position: sticky;
    z-index: 4;
    top: -14px;
    margin: -14px -2px 12px;
    padding: 14px 2px 2px;
    background: linear-gradient(180deg, #111827 82%, rgba(17,24,39,.94));
    box-shadow: 0 8px 12px rgba(0,0,0,.18);
}
.market-sticky-controls .market-sell-toolbar { margin-bottom: 10px; }
.market-sticky-controls .market-rules { margin-bottom: 8px; }
.market-gold-preview {
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid rgba(241,196,15,.3);
    border-radius: 6px;
    background: rgba(241,196,15,.08);
    color: #f8d85a;
    white-space: nowrap;
}
.market-gold-preview strong { color: #fff0a6; }
.market-sell-toolbar select {
    min-width: 180px;
    padding: 7px 9px;
    border: 1px solid #475569;
    border-radius: 6px;
    background: #101827;
    color: #e2e8f0;
    font-family: inherit;
}
.market-sell-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.market-sell-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "item button" "fields fields";
    margin-bottom: 0;
}
.market-sell-row > div:first-child { grid-area: item; min-width: 0; }
.market-sell-row > button { grid-area: button; align-self: start; }
.market-sell-fields { grid-area: fields; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.market-sell-fields label { display: grid; grid-template-columns: auto minmax(70px, 1fr); align-items: center; gap: 6px; }
.market-sell-fields input { width: 100%; margin-left: 0; box-sizing: border-box; }
.market-rules, .market-mailbox-gold { padding: 12px; margin-bottom: 12px; border-radius: 8px; background: rgba(241,196,15,.1); }
.market-mailbox-gold { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 760px) {
    .market-row { grid-template-columns: 1fr; }
    .market-sell-grid { grid-template-columns: 1fr; }
    .market-sell-row { grid-template-columns: minmax(0, 1fr) auto; }
    .market-gold-preview { width: 100%; margin-left: 0; box-sizing: border-box; text-align: right; }
}
