/*
 * Character profile
 *
 * Scoped to .profile-container so the legacy site tables and navigation keep
 * their existing appearance everywhere else.
 */
.profile-container {
	--profile-surface: rgba(20, 13, 10, 0.88);
	--profile-surface-alt: rgba(53, 34, 25, 0.52);
	--profile-surface-hover: rgba(112, 65, 39, 0.34);
	--profile-border: rgba(196, 137, 78, 0.25);
	--profile-border-strong: rgba(221, 168, 94, 0.48);
	--profile-gold: #e7c17b;
	--profile-gold-muted: #bd9460;
	--profile-red: #d4564f;
	--profile-text: #f1e6d7;
	--profile-text-muted: #bbaea3;
	--profile-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
	margin-top: 18px;
	color: var(--profile-text);
}

.profile-container .profile-tabs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
	margin: 0 0 18px;
	padding: 4px;
	border: 1px solid var(--profile-border);
	border-radius: 10px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
		rgba(13, 8, 6, 0.76);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.035),
		0 8px 22px rgba(0, 0, 0, 0.18);
}

.profile-container .profile-tab {
	min-width: 0;
	padding: 11px 12px;
	border: 1px solid transparent;
	border-radius: 7px;
	background: transparent;
	color: var(--profile-text-muted);
	font-family: 'Inter', Tahoma, sans-serif;
	font-size: 12px;
	font-weight: 750;
	line-height: 1;
	letter-spacing: 0.09em;
	text-align: center;
	text-transform: uppercase;
	text-shadow: none;
	cursor: pointer;
	transition:
		color 160ms ease,
		background-color 160ms ease,
		border-color 160ms ease,
		transform 160ms ease;
}

.profile-container .profile-tab:hover {
	border-color: rgba(231, 193, 123, 0.18);
	background: rgba(231, 193, 123, 0.07);
	color: #f8e9cd;
}

.profile-container .profile-tab:active {
	transform: translateY(1px);
}

.profile-container .profile-tab:focus-visible {
	outline: 2px solid var(--profile-gold);
	outline-offset: 2px;
}

.profile-container .profile-tab.is-active {
	border-color: rgba(218, 96, 83, 0.54);
	background:
		linear-gradient(180deg, rgba(218, 96, 83, 0.32), rgba(117, 42, 35, 0.34)),
		rgba(64, 31, 23, 0.82);
	color: #fff4df;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.08),
		0 4px 12px rgba(0, 0, 0, 0.24);
}

.profile-container .profile-tab-content {
	display: block;
	width: 100%;
	margin: 0;
}

.profile-container .profile-tab-content[hidden] {
	display: none !important;
}

.profile-container .profile-tab-content.is-active {
	animation: profile-panel-in 180ms ease-out;
}

@keyframes profile-panel-in {
	from {
		opacity: 0;
		transform: translateY(3px);
	}

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

.profile-container .section-header {
	position: relative;
	margin: 18px 0 0;
	padding: 11px 15px 10px 17px;
	border: 1px solid var(--profile-border);
	border-bottom-color: rgba(196, 137, 78, 0.18);
	border-radius: 9px 9px 0 0;
	background:
		linear-gradient(90deg, rgba(166, 103, 47, 0.22), rgba(64, 36, 25, 0.56) 48%, rgba(26, 17, 13, 0.84)),
		var(--profile-surface);
	color: var(--profile-gold);
	font-family: 'Cinzel', Georgia, serif;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.075em;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
	text-transform: uppercase;
	box-shadow: inset 3px 0 0 rgba(212, 86, 79, 0.72);
}

.profile-container .profile-tab-content > .section-header:first-child {
	margin-top: 0;
}

.profile-container .profile-data-table,
.profile-container .characters-table {
	width: 100%;
	margin: 0;
	border: 1px solid var(--profile-border);
	border-top: 0;
	border-spacing: 0;
	border-collapse: separate;
	border-radius: 0 0 9px 9px;
	overflow: hidden;
	background: var(--profile-surface);
	box-shadow: var(--profile-shadow);
}

.profile-container .profile-data-table tr,
.profile-container .characters-table tr {
	border: 0;
	background: transparent;
}

.profile-container .profile-data-table tbody tr:nth-child(odd),
.profile-container .characters-table tbody tr:nth-child(odd) {
	background: rgba(255, 255, 255, 0.018);
}

.profile-container .profile-data-table tbody tr:nth-child(even),
.profile-container .characters-table tbody tr:nth-child(even) {
	background: var(--profile-surface-alt);
}

.profile-container .profile-data-table tbody tr:hover,
.profile-container .characters-table tbody tr:hover {
	background: var(--profile-surface-hover);
}

.profile-container .profile-data-table td,
.profile-container .profile-data-table th,
.profile-container .characters-table td,
.profile-container .characters-table th {
	padding: 11px 15px;
	border: 0;
	border-bottom: 1px solid rgba(196, 137, 78, 0.14);
	color: var(--profile-text);
	font-family: 'Inter', Tahoma, sans-serif;
	font-size: 13px;
	line-height: 1.45;
	text-align: left;
	text-shadow: none;
	vertical-align: middle;
	overflow-wrap: anywhere;
	transition: background-color 160ms ease;
}

.profile-container .profile-data-table tbody tr:last-child > *,
.profile-container .characters-table tbody tr:last-child > * {
	border-bottom: 0;
}

.profile-container .profile-data-table td:first-child,
.profile-container .profile-data-table th[scope="row"] {
	width: 34%;
	color: var(--profile-gold-muted);
	font-weight: 650;
}

.profile-container .profile-data-table td:last-child {
	color: var(--profile-text);
	font-weight: 450;
}

.profile-container .profile-data-table strong,
.profile-container .profile-data-table b,
.profile-container .characters-table strong {
	color: #f2c77d;
	font-weight: 700;
}

.profile-container .profile-data-table a,
.profile-container .characters-table a,
.profile-container .death-details a {
	color: #e06b61;
	font-weight: 650;
	text-decoration: none;
	text-underline-offset: 3px;
}

.profile-container .profile-data-table a:hover,
.profile-container .characters-table a:hover,
.profile-container .death-details a:hover {
	color: #ffc99b;
	text-decoration: underline;
}

.profile-container .profile-data-table a:focus-visible,
.profile-container .characters-table a:focus-visible,
.profile-container .death-details a:focus-visible {
	border-radius: 2px;
	outline: 2px solid var(--profile-gold);
	outline-offset: 2px;
}

.profile-container .profile-table-scroll {
	width: 100%;
	overflow-x: auto;
	border-radius: 0 0 9px 9px;
	box-shadow: var(--profile-shadow);
}

.profile-container .profile-table-scroll .characters-table {
	min-width: 570px;
	box-shadow: none;
}

.profile-container .characters-table thead {
	background:
		linear-gradient(180deg, rgba(204, 145, 78, 0.16), rgba(62, 38, 28, 0.32)),
		var(--profile-surface);
}

.profile-container .characters-table thead th {
	color: var(--profile-gold);
	font-size: 11px;
	font-weight: 750;
	letter-spacing: 0.055em;
	text-transform: uppercase;
}

.profile-container .characters-table .character-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.profile-container .characters-table .character-link.is-online {
	color: #72d890;
}

.profile-container .characters-table .character-link.is-offline {
	color: #b9afa8;
}

.profile-container .characters-table .char-world {
	margin-top: 3px;
	color: #a68c72;
	font-size: 11px;
}

.profile-container .character-status-dot {
	width: 8px;
	height: 8px;
	margin-left: 7px;
	border: 1px solid rgba(255, 255, 255, 0.28);
}

.profile-container .character-status-dot.online {
	background: #55cf78;
	box-shadow: 0 0 0 3px rgba(85, 207, 120, 0.1), 0 0 8px rgba(85, 207, 120, 0.55);
}

.profile-container .character-status-dot.offline {
	background: #a99990;
	box-shadow: 0 0 0 3px rgba(169, 153, 144, 0.08);
}

.profile-container .profile-list,
.profile-container .quest-list-container {
	width: 100%;
	border: 1px solid var(--profile-border);
	border-top: 0;
	border-radius: 0 0 9px 9px;
	overflow: hidden;
	background: var(--profile-surface);
	box-shadow: var(--profile-shadow);
}

.profile-container .death-entry,
.profile-container .exp-entry,
.profile-container .quest-item,
.profile-container .task-item {
	min-height: 45px;
	padding: 11px 15px;
	border: 0;
	border-bottom: 1px solid rgba(196, 137, 78, 0.14);
	background: transparent;
	box-sizing: border-box;
	text-shadow: none;
}

.profile-container .death-entry:last-child,
.profile-container .exp-entry:last-child,
.profile-container .quest-item:last-child,
.profile-container .task-item:last-child {
	border-bottom: 0;
}

.profile-container .death-entry:nth-child(even),
.profile-container .exp-entry:nth-child(even),
.profile-container .quest-item:nth-child(even),
.profile-container .task-item:nth-child(even) {
	background: var(--profile-surface-alt);
}

.profile-container .death-entry:hover,
.profile-container .exp-entry:hover,
.profile-container .quest-item:hover,
.profile-container .task-item:hover {
	background: var(--profile-surface-hover);
}

.profile-container .death-info,
.profile-container .death-details,
.profile-container .exp-amount,
.profile-container .quest-name,
.profile-container .task-name {
	color: var(--profile-text);
}

.profile-container .death-time,
.profile-container .exp-date {
	color: var(--profile-gold-muted);
	font-variant-numeric: tabular-nums;
}

.profile-container .exp-amount {
	font-variant-numeric: tabular-nums;
}

.profile-container .exp-amount.positive::before {
	content: "+";
	color: #72d890;
}

.profile-container .exp-amount.negative {
	color: #f08078;
}

.profile-container .exp-amount.is-empty {
	max-width: 68%;
	color: #a99a8d;
	font-size: 12px;
	font-style: italic;
	font-weight: 450;
}

.profile-container .quest-icon {
	width: 18px;
	height: 18px;
	object-fit: contain;
}

.profile-container .quest-status {
	padding: 3px 7px;
	border: 1px solid rgba(231, 193, 123, 0.22);
	border-radius: 999px;
	color: var(--profile-gold);
	font-size: 10px;
	font-weight: 700;
	line-height: 1.2;
}

.profile-container .quest-item.incomplete {
	opacity: 0.64;
}

.profile-container .quest-item.incomplete .quest-name {
	color: var(--profile-text-muted);
}

.profile-container .quest-item.completed .quest-status {
	border-color: rgba(85, 207, 120, 0.28);
	background: rgba(85, 207, 120, 0.08);
	color: #7cde98;
}

.profile-container .task-icon {
	width: 50px;
	height: 22px;
	object-fit: contain;
}

.profile-container .empty-state {
	padding: 30px 16px;
	border: 1px solid var(--profile-border);
	border-top: 0;
	border-radius: 0 0 9px 9px;
	background: var(--profile-surface);
	color: var(--profile-text-muted);
	box-shadow: var(--profile-shadow);
	text-shadow: none;
}

.profile-container .profile-comment {
	padding: 14px 15px;
	border: 1px solid var(--profile-border);
	border-top: 0;
	border-radius: 0 0 9px 9px;
	background: var(--profile-surface);
	color: var(--profile-text);
	font-size: 13px;
	line-height: 1.65;
	box-shadow: var(--profile-shadow);
	text-shadow: none;
	overflow-wrap: anywhere;
}

.profile-alert {
	border: 1px solid rgba(255, 165, 0, 0.28);
	border-left-width: 4px;
	border-radius: 7px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

@media (max-width: 680px) {
	.profile-container .profile-tab {
		padding-inline: 7px;
		font-size: 11px;
	}

	.profile-container .profile-data-table td,
	.profile-container .profile-data-table th,
	.profile-container .characters-table td,
	.profile-container .characters-table th {
		padding: 10px 11px;
	}

	.profile-container .profile-data-table td:first-child,
	.profile-container .profile-data-table th[scope="row"] {
		width: 37%;
	}

	.profile-container .exp-entry {
		align-items: flex-start;
		flex-direction: column;
		gap: 4px;
	}

	.profile-container .exp-amount,
	.profile-container .exp-amount.is-empty {
		max-width: 100%;
		text-align: left;
	}

	.profile-container .quest-item {
		flex-wrap: wrap;
	}

	.profile-container .quest-status {
		margin-left: 30px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.profile-container .profile-tab,
	.profile-container .profile-tab-content {
		animation: none;
		transition: none;
	}
}
