.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-profession-note {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    color: #fbbf24;
}

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

.quest-board-select-btn,
.quest-board-deliver-btn,
.quest-board-cancel-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-action-row {
    display: flex;
    gap: 8px;
}

.quest-board-action-row > button {
    flex: 1;
}

.quest-board-cancel-btn {
    background: #991b1b;
}

.quest-board-cancel-btn:hover {
    background: #b91c1c;
}

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

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

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

#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: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 8px;
    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;
}

/* Wiersze statystyk z tooltipem: kliknięcie pokazuje opis (mobile-friendly),
   a samym tooltipem steruje JS (hover na desktopie + kliknięcie wszędzie). */
.stat-row.map-tooltip-wrapper {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.stat-row.map-tooltip-wrapper:hover .map-tooltip {
    display: none;
}

.stat-row .map-tooltip {
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    font-size: 12px;
    line-height: 1.5;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

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

.stat-row span {
    color: #bbb;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

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

#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;
}


.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: 350px;
    max-height: 65vh;
    border: 1px solid #1f2a36;
    border-radius: 8px;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
.worldmap-grid-wrap.dragging { cursor: grabbing; }

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

.worldmap-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.worldmap-back-btn { display: block; width: 100%; margin: 0 0 12px; padding: 9px 10px; border: 1px solid #854d0e; border-radius: 6px; background: #3b2a17; color: #fcd34d; font-weight: 700; text-align: center; cursor: pointer; }
.worldmap-back-btn:hover { border-color: #f59e0b; background: #5b3a12; color: #fff7d6; }

.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; -webkit-user-drag: none; }
.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-tile-level {
    display: block;
    margin-top: 2px;
    color: #fbbf24;
    font-size: 10px;
}

.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;
}

/* Znacznik informujący, że na mapie znajduje się boss. */
.worldmap-tile-npc {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(30, 64, 175, 0.92);
    color: #dbeafe;
    font-size: 9px;
    border-radius: 10px;
    padding: 1px 5px;
    font-weight: bold;
    z-index: 2;
}

.worldmap-tile-boss {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(127, 29, 29, 0.92);
    color: #fecaca;
    font-size: 9px;
    border-radius: 10px;
    padding: 1px 5px;
    font-weight: bold;
    z-index: 2;
}

.quest-locked-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 10px;
    color: #cbd5e1;
    font-size: 12px;
}

.quest-locked-filters label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.quest-locked-filters input {
    accent-color: #eab308;
}

/* Loch — osobny znacznik od portalu, w lewym dolnym rogu kafelka mapy. */
.worldmap-tile-dungeon {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(76, 29, 149, 0.92);
    color: #ede9fe;
    font-size: 11px;
    border-radius: 10px;
    padding: 1px 5px;
    font-weight: bold;
    z-index: 2;
}

.worldmap-details {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Stały nagłówek (nazwa lokacji + opis) — nie przewija się, jak w oknie
   Techniki: scrollbar zaczyna się dopiero pod nagłówkiem. */
.worldmap-details-header {
    flex: 0 0 auto;
    margin: 0 0 12px;
    padding-bottom: 10px;
    background: #111827;
    border-bottom: 1px solid rgba(116, 151, 181, 0.18);
}

.worldmap-level {
    margin-bottom: 6px;
    color: #cbd5e1;
    font-size: 12px;
}

.worldmap-details-subheader {
    flex: 0 0 auto;
    margin: 0 0 10px;
    padding-bottom: 8px;
    background: #111827;
    border-bottom: 1px solid rgba(116, 151, 181, 0.18);
}

.worldmap-details-subheader .stat-title {
    margin: 0;
}

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

.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-nested-level {
    color: #fbbf24;
}

.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-bestiary {
    display: flex;
    align-items: center;
    gap: 0.25em;
    color: #94a3b8;
    margin: 4px 0;
    line-height: 1;
}

.worldmap-bestiary-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.worldmap-bestiary-icon .emoji-icon {
    display: block;
    margin: 0;
    vertical-align: 0;
}

.worldmap-monster-modifiers {
    color: #94a3b8;
    margin: 6px 0;
    line-height: 1.5;
}

.worldmap-monster-modifiers-title {
    color: #e2e8f0;
    font-weight: bold;
}

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

.worldmap-loot-label {
    color: #e2e8f0;
}

.worldmap-loot-separator {
    color: #e2e8f0;
}

.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-time-cost {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    white-space: nowrap;
}

#cookingRecipeList .skill-card-exp,
#alchemyRecipeList .skill-card-exp {
    font-size: 13px;
}

.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(1020px, 96vw);
	height: min(880px, 92vh);
	max-width: none;
	max-height: 90vh;
	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;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

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

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



.development-points-summary {
	display: flex;
	align-items: baseline;
	color: #b7c8da;
	font-size: 14px;
}

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

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

@media (max-width: 560px) {
	.development-points-summary {
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
	}

	.development-points-summary .development-points-separator {
		display: none;
	}
}

.development-tree-help {
	flex: 0 0 auto;
	padding: 8px 16px 12px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	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: 1040px;
	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: 28px;
	border-radius: inherit;
}

.development-node.major {
	width: 94px;
	height: 94px;
	border-width: 4px;
	color: #fef3c7;
	border-color: #d4a72c;
	background: radial-gradient(circle, #604718, #21170b 72%);
	box-shadow: 0 0 20px rgba(234, 179, 8, 0.32), 0 6px 13px rgba(0, 0, 0, 0.45);
}

.development-node.major .development-node-icon {
	font-size: 42px;
}

.development-node.major.unlocked {
	background: radial-gradient(circle, #715219, #2d210b 72%);
}

.development-node.major.maxed {
	color: #fff7d0;
	border-color: #facc15;
	background: radial-gradient(circle, #8a671d, #34270c 72%);
	box-shadow: 0 0 24px rgba(250, 204, 21, 0.5);
}

.development-node-rank {
	position: absolute;
	right: -8px;
	bottom: -6px;
	min-width: 27px;
	padding: 2px 4px;
	color: #dbe7f1;
	font-size: 11px;
	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% + 10px);
	width: 280px;
	padding: 13px 14px;
	transform: translateX(-50%) translateY(-4px);
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: #c9d6e2;
	font-size: 15.3px;
	line-height: 1.5;
	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% + 10px);
	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: 17.1px;
}

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

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

.development-node-cost {
	color: #f6cf66;
	font-weight: 700;
}

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

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

.development-tree-controls-legend {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	color: #c6d5e3;
	font-size: 12px;
}

.development-tree-controls-legend strong {
	color: #f1f7fb;
}

.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.refundable {
	cursor: pointer;
}

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

.development-node.major.available {
	border-color: #fef08a;
	animation-name: development-major-node-pulse;
}

.development-node.major.available:hover {
	background: radial-gradient(circle, #88651d, #3d2d0c 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); }
}

@keyframes development-major-node-pulse {
	50% { box-shadow: 0 0 26px rgba(250, 204, 21, 0.65); }
}

.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;
}



#battleAttackList {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-gutter: stable;
}

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

.consumable-use-effect {
    position: fixed;
    z-index: 350;
    left: 50%;
    top: 42%;
    max-width: min(88vw, 440px);
    padding: 10px 15px;
    border: 1px solid color-mix(in srgb, var(--consumable-effect-color) 75%, transparent);
    border-radius: 9px;
    background: rgba(8, 15, 28, .92);
    box-shadow: 0 7px 26px rgba(0, 0, 0, .45);
    color: var(--consumable-effect-color);
    font-weight: 800;
    line-height: 1.35;
    white-space: pre-line;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, 0);
    animation: consumable-use-effect 1.8s ease-out forwards;
}

@keyframes consumable-use-effect {
    0% { opacity: 0; transform: translate(-50%, 14px) scale(.92); }
    15% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    75% { opacity: 1; transform: translate(-50%, -18px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -30px) scale(.98); }
}

/* Potwierdzenie może zostać otwarte nad innym modalem (np. cofanie
   ulepszenia), więc musi zawsze przejmować najwyższą warstwę. */
#confirmationModal { z-index: 300; }

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

/* Dziennik Misji potrzebuje nieco więcej miejsca na dłuższe cele i nagrody. */
#questsModal .modal-box { width: 630px; }

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

.modal-header > * {
    min-width: 0;
}






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

.inventory-fixed-top {
    flex-shrink: 0;
    container-type: inline-size;
}

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

.item-grid.targeting-mode .item-card.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;
}

@container (max-width: 380px) {
    .inventory-sort-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-sort-bar > * {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
    }
}

.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);
}

#confirmationModal[data-variant="dungeon"] .confirmation-modal-box {
    width: min(560px, calc(100vw - 32px));
    max-width: 560px;
    border-color: #2563eb;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .55), 0 0 30px rgba(59, 130, 246, .18);
    overflow-y: auto;
}

#confirmationModal[data-variant="dungeon"] .confirmation-modal-box {
    display: flex;
    flex-direction: column;
}

#confirmationModal[data-variant="dungeon"] .confirmation-icon { order: 1; }
#confirmationModal[data-variant="dungeon"] .confirmation-title { order: 2; }
#confirmationModal[data-variant="dungeon"] .confirmation-options { order: 3; }
#confirmationModal[data-variant="dungeon"] .confirmation-options { margin-bottom: 18px; }
#confirmationModal[data-variant="dungeon"] .confirmation-message { order: 4; }
#confirmationModal[data-variant="dungeon"] .confirmation-warning { order: 5; }
#confirmationModal[data-variant="dungeon"] .confirmation-preview-cards { order: 6; }
#confirmationModal[data-variant="dungeon"] .confirmation-item { order: 7; }
#confirmationModal[data-variant="dungeon"] .confirmation-actions { order: 8; }

#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="normal"] .confirmation-modal-box { border-color: #e2e8f0; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="normal"] .confirmation-accept-btn { background: #e2e8f0; color: #0f172a; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="normal"] .confirmation-accept-btn:hover { background: #ffffff; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="normal"] .confirmation-item { border-color: #e2e8f0; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="normal"] .confirmation-options select { border-color: #e2e8f0; }

#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="challenging"] .confirmation-modal-box { border-color: #16a34a; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="challenging"] .confirmation-accept-btn { background: #15803d; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="challenging"] .confirmation-accept-btn:hover { background: #16a34a; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="challenging"] .confirmation-item { border-color: #16a34a; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="challenging"] .confirmation-options select { border-color: #16a34a; }

#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="hard"] .confirmation-modal-box { border-color: #2563eb; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="hard"] .confirmation-accept-btn { background: #1d4ed8; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="hard"] .confirmation-accept-btn:hover { background: #2563eb; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="hard"] .confirmation-item { border-color: #2563eb; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="hard"] .confirmation-options select { border-color: #2563eb; }

#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="extreme"] .confirmation-modal-box { border-color: #a855f7; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="extreme"] .confirmation-accept-btn { background: #7e22ce; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="extreme"] .confirmation-accept-btn:hover { background: #a855f7; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="extreme"] .confirmation-item { border-color: #a855f7; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="extreme"] .confirmation-options select { border-color: #a855f7; }

#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="nightmare"] .confirmation-modal-box { border-color: #f97316; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="nightmare"] .confirmation-accept-btn { background: #c2410c; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="nightmare"] .confirmation-accept-btn:hover { background: #f97316; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="nightmare"] .confirmation-item { border-color: #f97316; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="nightmare"] .confirmation-options select { border-color: #f97316; }

#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="infernal"] .confirmation-modal-box { border-color: #dc2626; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="infernal"] .confirmation-accept-btn { background: #b91c1c; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="infernal"] .confirmation-accept-btn:hover { background: #dc2626; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="infernal"] .confirmation-item { border-color: #dc2626; }
#confirmationModal[data-variant="dungeon"][data-dungeon-difficulty="infernal"] .confirmation-options select { border-color: #dc2626; }

#confirmationModal[data-variant="dungeon"] .confirmation-accept-btn:focus {
    outline: none;
    box-shadow: none;
}

.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);
}

#confirmationModal[data-variant="dungeon"] .confirmation-icon {
    border-color: #2563eb;
    background: rgba(37, 99, 235, .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;
}

/* Czerwone ostrzeżenie w potwierdzeniu (np. zysk netto zerowy/ujemny). */
.confirmation-warning {
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(239, 68, 68, .55);
    border-radius: 6px;
    background: rgba(239, 68, 68, .12);
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

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

.confirmation-options {
    margin-top: 14px;
    text-align: left;
}

.confirmation-options label {
    display: grid;
    gap: 6px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 700;
}

.confirmation-options select {
    width: 100%;
    padding: 9px;
    border: 1px solid #1d4ed8;
    border-radius: 6px;
    background: #0b1220;
    color: #f8fafc;
}

.confirmation-preview-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
    text-align: left;
}

.confirmation-preview-card {
    min-width: 0;
    padding: 10px;
    border: 1px solid #334155;
    border-radius: 7px;
    background: rgba(11, 18, 32, .82);
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.45;
}

.confirmation-preview-card strong {
    display: block;
    margin-bottom: 5px;
    color: #f8fafc;
    font-size: 13px;
}

.confirmation-preview-card div {
    white-space: pre-line;
}

.confirmation-preview-card.boss { border-color: #b45309; }

@media (max-width: 560px) {
    .confirmation-preview-cards { grid-template-columns: 1fr; }
}

#confirmationModal[data-variant="dungeon"] .confirmation-item {
    border-color: #1d4ed8;
}

#confirmationModal[data-variant="dungeon"] .confirmation-message,
#confirmationModal[data-variant="dungeon"] .confirmation-item {
    text-align: left;
    white-space: pre-line;
}

.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;
}

#confirmationModal[data-variant="dungeon"] .confirmation-accept-btn {
    background: #1d4ed8;
}

#confirmationModal[data-variant="dungeon"] .confirmation-accept-btn:hover {
    background: #2563eb;
}

.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;
    font-size: 11px;
    line-height: 1.2;
}
.slot-item {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    font-size: 11px;
    line-height: 1.25;
    font-weight: bold;
    cursor: pointer;
}

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

.item-card {
    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-grid .item-name {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    font-size: 11px;
    line-height: 1.25;
}

.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;
}

.sell-btn:disabled {
    background: #475569;
    color: #94a3b8;
    cursor: not-allowed;
}

.shop-remaining {
    color: #64748b;
    font-size: 11px;
    margin-bottom: 3px;
    text-align: center;
}

.shop-remaining.shop-remaining-empty {
    color: #ff6b6b;
    font-weight: 600;
}

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

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

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

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





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

.stash-mobile-switch {
    display: none;
    width: min(94vw, 520px);
    gap: 6px;
}

.stash-mobile-switch.hidden {
    display: none !important;
}

.stash-mobile-switch-btn {
    flex: 1;
    min-width: 0;
    padding: 9px 8px;
    border: 1px solid #334155;
    border-radius: 7px;
    background: #172033;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.stash-mobile-switch-btn.active {
    border-color: #f1c40f;
    background: #f1c40f;
    color: #111827;
}

.stash-box {
    width: 580px;
    max-width: 90vw;
    max-height: 80vh;
    min-width: 0;
    background: #111827;
    border: 1px solid #1f2a36;
    border-radius: 10px;
    padding: 20px;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-wrap: anywhere;
}

.stash-box.hidden {
    display: none;
}

.stash-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 10px;
}

.stash-tab {
    background: #1f2a36;
    color: #94a3b8;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}
.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 .item-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 {
    flex: 0 0 auto;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #1f2a36;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 13px;
    color: #94a3b8;
}

.shop-reset-timer {
    color: #c084fc;
}

.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: 820px;
}

.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;
}

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

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

.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;
}





.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-header-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
}

.skill-battle-visibility {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #111827;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.skill-battle-visibility:has(input:checked) {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

.skill-battle-visibility input {
    margin: 0;
    accent-color: #22c55e;
    cursor: pointer;
}

.skill-battle-visibility input:disabled {
    cursor: wait;
}

.battle-technique-selection-note {
    margin-top: 7px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.35;
    text-align: right;
}

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

.skill-card-exp {
    font-size: 11px;
}

.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;
    flex: 0 0 auto;
    align-items: center;
    position: relative;
    min-height: 26px;
    padding: 3px 7px;
    border: 1px solid #334155;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.7);
    cursor: pointer;
    white-space: nowrap;
}

.attack-stat.is-upgraded {
    border-color: #4ade80;
}

/* Tooltip etykiety techniki pokazywany kliknięciem (i hoverem na desktopie) —
   steruje nim JS (showTooltip), więc CSS-owa reguła :hover jest wyłączona.
   Szerokość dopasowuje się do treści, z limitem dla dłuższych opisów. */
.attack-stat .map-tooltip {
    width: max-content;
    max-width: 280px;
    font-size: 12px;
    line-height: 1.5;
}

.summon-details-toggle {
    color: #fde68a;
    font: inherit;
}

.summon-details-toggle:hover,
.summon-details-toggle[aria-expanded="true"] {
    border-color: #f59e0b;
    background: rgba(120, 53, 15, 0.35);
}

.summon-details-toggle.is-upgraded {
    border-color: #4ade80;
}

.summon-details-toggle-arrow {
    display: inline-block;
    margin-left: 5px;
    transition: transform 0.18s ease;
}

.summon-details-toggle[aria-expanded="true"] .summon-details-toggle-arrow {
    transform: rotate(90deg);
}

.summon-details-panel {
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid #334155;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.78);
    color: #e2e8f0;
}

.summon-details-panel[hidden] {
    display: none;
}

.summon-details-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #263449;
}

.summon-details-name {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 700;
}

.summon-details-caption {
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summon-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    padding-top: 9px;
}

.summon-details-section h4 {
    margin: 0 0 5px;
    color: #93c5fd;
    font-size: 12px;
}

.summon-details-section dl {
    display: grid;
    gap: 2px;
    margin: 0;
}

.summon-details-section dl > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.48);
    font-size: 11px;
}

.summon-details-section dt {
    color: #94a3b8;
}

.summon-details-section dd {
    margin: 0;
    color: #f8fafc;
    font-weight: 600;
    text-align: right;
}

.summon-technique-details {
    grid-column: 1 / -1;
}

.summon-technique-details dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
}

.summon-effect-info {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #94a3b8;
    font: inherit;
    white-space: normal;
}

.summon-parameter-info {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #94a3b8;
    font: inherit;
    white-space: normal;
}

.summon-parameter-info:hover {
    color: #e2e8f0;
    background: none;
}

.summon-effect-info:hover {
    color: #e2e8f0;
    background: none;
}

.summon-technique-name-info {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
}

.summon-technique-name-info:hover {
    color: #bfdbfe;
    background: none;
}

@media (max-width: 620px) {
    .summon-details-grid,
    .summon-technique-details dl {
        grid-template-columns: 1fr;
    }

    .summon-details-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}

/* Jedna linia etykiet techniki — przy 6 etykietach karta dzieli je na 2 linie po 3. */
.attack-stat-line {
    display: flex;
    flex-wrap: wrap;
    gap: inherit;
    width: 100%;
}

.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;
}

#skillsModal .fixed-list-modal-box {
    height: min(760px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
}

#battleAttackModal .modal-box {
    max-height: min(409px, calc(100dvh - 24px));
}

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

.modal-scroll-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    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.online {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.08);
}

.leaderboard-online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
    vertical-align: middle;
}

.leaderboard-online-count {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #22c55e;
    vertical-align: middle;
}

.top-online-count {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-right: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #1f2a36;
    color: #22c55e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

.top-online-count.hidden {
    display: none;
}

.top-online-count .leaderboard-online-dot {
    margin-right: 4px;
	margin-top: 2px;
}

.character-card.online {
    border-color: rgba(34, 197, 94, 0.55);
}

/* Zielona ramka oznacza sesję online, a żółte tło — kartę
   aktualnie wybraną klawiaturą (Enter). */
.character-card.online:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.75);
}

.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-entry-button {
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.leaderboard-entry-button:hover,
.leaderboard-entry-button:focus-visible {
    border-color: #60a5fa;
    outline: none;
    background: #111c2e;
}

.leaderboard-profile-modal-box {
    width: min(560px, calc(100vw - 28px));
    height: min(760px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
}
.leaderboard-profile-content { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding: 2px 0; }
.leaderboard-profile-summary { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.leaderboard-profile-scroll { padding-bottom: 2px; }
.leaderboard-profile-summary span,
.leaderboard-profile-section li { padding: 9px 10px; border: 1px solid #1f2a36; border-radius: 6px; background: #0b1220; }
.leaderboard-profile-summary strong { color: #facc15; }
.leaderboard-profile-section { margin-top: 14px; }
.leaderboard-profile-scroll .leaderboard-profile-section:first-child { margin-top: 0; }
.leaderboard-profile-section h3 { margin: 0 0 8px; font-size: 15px; }
.leaderboard-profile-section ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
.leaderboard-profile-section li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.leaderboard-profile-section li strong { color: #cbd5e1; white-space: nowrap; }
.leaderboard-profile-section .leaderboard-profile-empty { display: block; color: #94a3b8; }

.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;
    line-height: 22px;
}

/* Kolory skuteczności używane w oknie areny. */
.winrate-good {
    color: #4ade80;
}

.winrate-bad {
    color: #f87171;
}

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

/* Własny wpis gracza: złota ramka z poświatą, żeby od razu było widać, gdzie jesteś. */
.leaderboard-entry.is-self {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.07);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.55), 0 0 14px rgba(251, 191, 36, 0.25);
}

.leaderboard-entry.is-self .leaderboard-position {
    color: #fbbf24;
}

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

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

.skill-upgrade-btn.upgrade-available {
    border-color: #c4b5fd;
    box-shadow: 0 0 12px rgba(139, 92, 246, .48);
}

.skill-upgrade-btn.first-upgrade-available {
    background: linear-gradient(135deg, #15803d, #166534);
    border-color: #4ade80;
    box-shadow: 0 0 12px rgba(74, 222, 128, .42);
}

.skill-upgrade-btn.management-only {
    background: linear-gradient(135deg, #0369a1, #075985);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, .34);
}

.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 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

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

.technique-upgrade-preview-stats > span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 6px;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.25;
    text-align: center;
}

.technique-upgrade-preview-stats > span:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.technique-upgrade-preview-stats > span > strong {
    margin-left: 4px;
}

.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;
}

@media (max-width: 420px) {
    .technique-upgrade-preview-stats {
        grid-template-columns: 1fr;
    }

    .technique-upgrade-preview-stats > span:last-child:nth-child(odd) {
        grid-column: auto;
    }
}

.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;
}

.technique-upgrade-reset {
    width: 100%;
    margin-top: 6px;
    padding: 10px;
    border: 1px solid #b45309;
    border-radius: 8px;
    background: #451a03;
    color: #fde68a;
    font-weight: 700;
    cursor: pointer;
}

.technique-upgrade-reset:hover,
.technique-upgrade-reset:focus-visible {
    border-color: #f59e0b;
    background: #78350f;
    outline: none;
}

.technique-upgrade-reset-notice {
    padding: 10px 12px;
    border: 1px solid #b45309;
    border-radius: 8px;
    background: #451a03;
    color: #fde68a;
    font-size: 13px;
    line-height: 1.45;
}

.skill-card.locked {
    opacity: 0.5;
}

.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;
}

@media (max-width: 560px) {
    #skillsModal .quest-filter-bar {
        flex-wrap: wrap;
    }

    #skillsModal .quest-filter-bar select {
        flex: 1 1 140px;
        min-width: 0;
        max-width: 100%;
    }

    #skillsModal .skill-learned-filter {
        box-sizing: border-box;
        flex: 1 1 140px;
        min-width: 0;
        justify-content: center;
    }
}

.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;
}




/* Kompaktowe ikonowe przyciski okien: X zamykania oraz „Wyśrodkuj" (⌖).
   Wszędzie ten sam wygląd — kwadrat 36×36 z obramówką i złotym hoverem. */
.close-btn,
.dev-tree-center-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    background: #1f2a36;
    color: #b7c8da;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.close-btn:hover,
.dev-tree-center-btn:hover {
    color: #f1c40f;
    border-color: #f1c40f;
}




#toastContainer {
    position: fixed;
    /* Poniżej górnego menu (pasek ikon), żeby toasty go nie zasłaniały. */
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    z-index: 300;
    pointer-events: none;
}

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

#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;
}

#dungeonTracker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.dungeon-cooldown-entry {
    background: #0b1220;
    border: 1px solid #1f2a36;
    border-left: 3px solid #64748b;
    border-radius: 6px;
    padding: 8px 10px;
}

.dungeon-cooldown-name {
    font-size: 13px;
    font-weight: bold;
    color: #e2e8f0;
    overflow-wrap: anywhere;
}

.dungeon-cooldown-status {
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.dungeon-cooldown-entry.is-ready { border-left-color: #4ade80; }
.dungeon-cooldown-entry.is-ready .dungeon-cooldown-status { color: #4ade80; }
.dungeon-cooldown-entry.is-cooldown,
.dungeon-cooldown-entry.is-active { border-left-color: #fbbf24; }
.dungeon-cooldown-entry.is-cooldown .dungeon-cooldown-status,
.dungeon-cooldown-entry.is-active .dungeon-cooldown-status { color: #fbbf24; }

.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;
}

.quest-compass {
    position: absolute;
    top: 16px;
    /* Zachowujemy miejsce po prawej na podpis — kompas pozostaje nad jego środkiem. */
    right: min(140px, calc(50% - 28px));
    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;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.3;
    font-size: 10px;
    color: #e2e8f0;
    background: rgba(17, 24, 39, 0.85);
    padding: 2px 6px;
    border-radius: 4px;
}




.quest-tabs {
    display: flex;
    gap: 6px;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.quest-tab {
    border: 1px solid #475569;
    border-radius: 7px;
    padding: 6px 10px;
    background: #172131;
    color: #dbe7f5;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.quest-tab:hover {
    border-color: #d4a72c;
    color: #ffe28a;
}

.quest-tab.active {
    border-color: #f1c40f;
    background: linear-gradient(180deg, #f8d94d, #c99712);
    color: #16120a;
}

.quest-tab-panel {
    min-height: 100%;
}

.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 {
    border-left-color: #64748b;
    background: #0d1320;
}

.quest-card.locked .quest-card-name,
.quest-card.locked .quest-card-desc,
.quest-card.locked .quest-card-rewards {
    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;
}

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