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

@font-face {
	font-family: "Beleren2016-Bold";
	src: url("../assets/fonts/Beleren2016-Bold.ttf") format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Beleren2016-SmallCaps-Bold";
	src: url("../assets/fonts/Beleren2016SmallCaps-Bold.ttf") format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Beleren2016-SmallCaps-BoldItalic";
	src: url("../assets/fonts/Beleren2016SmallCaps-BoldItalic.ttf") format("truetype");
	font-weight: 700;
	font-style: italic;
	font-display: swap;
}

.main-achievement-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	display: flex;
	justify-content: center;
	padding: 0.15rem 0.15rem calc(0.15rem + env(safe-area-inset-bottom));
	box-sizing: border-box;
	opacity: 0;
	transform: translateY(110%);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
	z-index: 4;
}

.main-achievement-banner.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.ach-page {
	padding: calc(var(--ach-top-bar-height, 3.5rem) + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ach-tabs {
	display: flex;
	gap: 0.75rem;
	padding: 0.5rem 1rem;
	position: sticky;
	top: calc(var(--ach-top-bar-height, 3.5rem) + env(safe-area-inset-top));
	z-index: 12;
	margin: 0 -1rem;
	background: rgba(8, 8, 10);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border-bottom: 1px solid rgba(255, 236, 154, 0.08);
}

.ach-tabs::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -14px;
	height: 14px;
	background: linear-gradient(180deg, rgba(8, 8, 10, 1), rgba(8, 8, 10, 0));
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	pointer-events: none;
}

.ach-tab {
	flex: 1;
	padding: 0.7rem 0.9rem;
	border-radius: 0.75rem;
	border: 1px solid rgba(255, 236, 154, 0.16);
	background:
		linear-gradient(180deg, rgba(32, 30, 28, 0.96), rgba(18, 17, 16, 0.96));
	color: rgba(255, 236, 154, 0.6);
	font-size: clamp(0.85rem, 4vw, 1.15rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-align: center;
	cursor: pointer;
	font-family: "Beleren2016-SmallCaps-Bold", "Spectral", serif;
	box-shadow:
		0 10px 20px rgba(0, 0, 0, 0.5),
		inset 0 0 0 1px rgba(0, 0, 0, 0.65),
		inset 0 1px 0 rgba(255, 255, 255, 0.04);
	position: relative;
	transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ach-tab::after {
	content: "";
	position: absolute;
	inset: 1px;
	border-radius: 0.7rem;
	background: radial-gradient(120% 140% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 55%);
	opacity: 0.4;
	pointer-events: none;
}

.ach-tab.is-active {
	background:
		linear-gradient(180deg, rgba(255, 236, 154, 0.12), rgba(116, 86, 28, 0.22)),
		linear-gradient(180deg, rgba(40, 36, 30, 0.96), rgba(22, 20, 18, 0.96));
	border-color: rgba(255, 236, 154, 0.35);
	color: rgba(255, 236, 154, 0.85);
	box-shadow:
		0 12px 24px rgba(0, 0, 0, 0.6),
		inset 0 0 0 1px rgba(255, 236, 154, 0.15),
		inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ach-tab.is-active::after {
	opacity: 0.55;
}

.ach-tab:focus-visible {
	outline: none;
	border-color: rgba(255, 236, 154, 0.5);
	box-shadow:
		0 0 0 2px rgba(255, 236, 154, 0.2),
		0 12px 24px rgba(0, 0, 0, 0.6),
		inset 0 0 0 1px rgba(255, 236, 154, 0.15);
}

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

.ach-section {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ach-section[hidden] {
	display: none;
}

.ach-list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	align-items: center;
}

.ach-divider {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--main-version-text-color);
	text-transform: uppercase;
	font-size: 0.8rem;
	letter-spacing: 0.5px;
	opacity: 0.8;
}

.ach-divider::before,
.ach-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background-color: var(--grid-item-border-color);
	opacity: 0.6;
}

.ach-card {
	--bg: #0f0f10;
	--panel: #2f2d2a;
	--panel2: #262422;
	--rim1: #6a645e;
	--rim2: #1d1c1a;
	--gold1: #ffec9a;
	--gold2: #b47a1f;
	--text: #c9c0ad;
	--text2: #a79f8e;
	--glow: rgba(255, 215, 120, 0.25);
	--ach-tile-size: clamp(3.25rem, 16vw, 5.75rem);
	--ach-frame-padding: clamp(0.4rem, 1.2vw, 0.6rem);
	--ach-frame-gap: clamp(0.6rem, 3vw, 1.5rem);

	width: 100%;
	max-width: 720px;
	position: relative;
	color: var(--text);
}

.ach-frame {
	height: calc(var(--ach-tile-size) + (var(--ach-frame-padding) * 2));
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: var(--ach-frame-gap);
	padding: var(--ach-frame-padding);
	border-radius: 10px;
	position: relative;
	background:
		linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.10)),
		linear-gradient(180deg, var(--panel), var(--panel2));
	border: 2px solid rgba(255,236,154,0.16);
	box-shadow:
		0 14px 30px rgba(0,0,0,0.55),
		inset 0 0 0 1px rgba(0,0,0,0.55),
		inset 0 10px 18px rgba(0,0,0,0.35);
	color: var(--text);
}

.ach-frame:after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 10px;
	background:
		radial-gradient(120px 80px at 18% 20%, rgba(255,255,255,0.06), transparent 70%),
		radial-gradient(260px 140px at 85% 70%, rgba(0,0,0,0.30), transparent 70%),
		linear-gradient(90deg, rgba(0,0,0,0.18), transparent 30%, transparent 70%, rgba(0,0,0,0.18));
	mix-blend-mode: overlay;
	opacity: 0.55;
	pointer-events: none;
}

.icon-tile {
	width: var(--ach-tile-size);
	height: var(--ach-tile-size);
	flex: 0 0 var(--ach-tile-size);
	border-radius: 10px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.18)),
		linear-gradient(180deg, #34312d, #242220);
	box-shadow:
		inset 0 0 0 1px rgba(0,0,0,0.55),
		inset 0 8px 12px rgba(0,0,0,0.35);
	overflow: hidden;
}

.icon-tile:after {
	content: "";
	position: absolute;
	inset: -30px;
	background: radial-gradient(120px 80px at 50% 85%, var(--glow), transparent 70%);
	pointer-events: none;
}

.icon {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	filter:
		drop-shadow(0 8px 10px rgba(0,0,0,0.55))
		drop-shadow(0 0 10px rgba(255, 215, 120, 0.18));
}

.ach-text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	padding-right: 8px;
	position: relative;
	z-index: 1;
	height: 100%;
	align-self: center;
	min-width: 0;
}

.ach-name {
	font-weight: 700;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	font-size: clamp(0.85rem, 3.4vw, 1.15rem);
	line-height: 1.1;
	color: rgba(255,236,154,0.90);
	text-shadow: 0 1px 0 rgba(0,0,0,0.7);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ach-desc {
	font-size: clamp(0.8rem, 3.8vw, 1.25rem);
	line-height: 1.2;
	color: var(--text2);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ach-card.locked {
	filter: saturate(0.70);
	opacity: 0.82;
	--glow: rgba(140, 140, 140, 0.22);
}

.ach-card.locked .icon {
	filter: grayscale(1) brightness(0.9) drop-shadow(0 8px 10px rgba(0,0,0,0.55));
	opacity: 0.85;
}

.ach-card.locked .ach-name {
	color: rgba(140, 135, 125, 0.95);
}

.ach-card.locked .ach-desc {
	color: rgba(120, 115, 105, 0.9);
}

.ach-overlay {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem;
	background: rgba(5, 5, 6, 0.95);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	z-index: 15;
}

.ach-overlay.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.ach-overlay-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	border: 1px solid rgba(255,236,154,0.35);
	background: rgba(20, 18, 16, 0.7);
	color: rgba(255,236,154,0.9);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	z-index: 2;
}

.ach-overlay .achievement-card {
	aspect-ratio: 474 / 661;
	display: flex;
	width: min(90vw, 420px);
	flex-direction: column;
	--pill-radius: 0.5rem;
	container-type: size;
	justify-content: center;
	align-items: center;
	position: relative;
	border-radius: 0.5rem;
	overflow: hidden;
	padding: 1.5rem;
	color: #f3e7d1;
	--ach-border: #6f7a85;
	--ach-border-shadow: 0 1px 4px rgba(10,12,16,0.5);
	background:
		radial-gradient(120% 80% at 50% 90%, rgba(247,211,122,0.28), transparent 55%),
		linear-gradient(180deg, rgba(0,0,0,0.65), rgba(0,0,0,0.35)),
		linear-gradient(135deg, #3a2a18, #1f140b);
	box-shadow:
		0 0 28px rgba(150, 185, 220, 0.25),
		0 12px 35px rgba(0,0,0,0.55),
		0 30px 70px rgba(0,0,0,0.65),
		inset 0 0 0 2px rgba(247,211,122,0.18),
		inset 0 0 0 6px rgba(0,0,0,0.35);
}

.ach-overlay .achievement-card::before {
	content: "";
	position: absolute;
	inset: -10px;
	border-radius: calc(0.5rem + 10px);
	background: radial-gradient(120% 120% at 50% 0%, rgba(180, 210, 240, 0.35), transparent 60%);
	filter: blur(12px);
	opacity: 0.55;
	z-index: 0;
	pointer-events: none;
}

.ach-overlay .ach-title,
.ach-overlay .ach-category {
	width: 100%;
	background:
		radial-gradient(120% 90% at 0% 0%, rgba(20, 25, 32, 0.35), transparent 55%),
		radial-gradient(120% 90% at 100% 0%, rgba(20, 25, 32, 0.35), transparent 55%),
		linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0) 45%),
		linear-gradient(180deg, #c6cbd4 0%, #8c95a1 55%, #6a727c 100%);
	border-radius: var(--pill-radius);
	border: 4px solid var(--ach-border);
	border-bottom-width: 2px;
	box-shadow: var(--ach-border-shadow);
	position: relative;
	overflow: hidden;
	font-family: "Beleren2016-SmallCaps-Bold", serif;
}

.ach-overlay .ach-title {
	height: calc(100% * 60 / 700);
}

.ach-overlay .ach-category {
	height: calc(100% * 55 / 700);
	border-top-width: 2px;
}

.ach-overlay .ach-image {
	height: calc(100% * 350 / 700);
	width: calc(100% - (2 * var(--pill-radius)));
	margin: 0 auto;
	border: 4px solid var(--ach-border);
	border-bottom-width: 2px;
	border-top-width: 2px;
	box-shadow: var(--ach-border-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
}

.ach-overlay .ach-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(120% 80% at 20% 20%, rgba(180, 200, 220, 0.28), transparent 55%),
		radial-gradient(120% 90% at 80% 85%, rgba(90, 110, 130, 0.35), transparent 60%),
		linear-gradient(180deg, rgba(90, 105, 120, 0.45), rgba(25, 30, 36, 0.55));
	opacity: 0.9;
	z-index: 0;
}

.ach-overlay .ach-image::after {
	content: "";
	position: absolute;
	inset: -60% -40%;
	background:
		radial-gradient(70% 140% at 50% 50%, rgba(200, 215, 235, 0.25), transparent 70%),
		radial-gradient(50% 120% at 50% 50%, rgba(210, 230, 255, 0.18), transparent 75%);
	transform: translateX(-35%);
	animation: ach-reflet 8s ease-in-out infinite;
	opacity: 0.45;
	z-index: 3;
	mix-blend-mode: screen;
	pointer-events: none;
}

.ach-overlay .ach-image-img {
	height: 100%;
	width: auto;
	display: block;
	object-fit: contain;
	position: relative;
	z-index: 1;
	-webkit-mask-image: radial-gradient(circle at 50% 55%, #000 62%, transparent 82%);
	mask-image: radial-gradient(circle at 50% 55%, #000 62%, transparent 82%);
	filter: drop-shadow(0 0 18px rgba(180, 200, 220, 0.25));
}

.ach-overlay .ach-description {
	height: calc(100% * 235 / 700);
	width: calc(100% - (2 * var(--pill-radius)));
	margin: 0 auto;
	background:
		repeating-linear-gradient(
			45deg,
			rgba(220, 225, 232, 0.3) 0px,
			rgba(220, 225, 232, 0.3) 18px,
			rgba(195, 202, 210, 0.3) 36px,
			rgba(195, 202, 210, 0.3) 54px,
			rgba(220, 225, 232, 0.3) 72px
		),
		linear-gradient(180deg, #cfd4dc 0%, #8f98a3 55%, #6f7882 100%);
	position: relative;
	overflow: visible;
	border: 4px solid var(--ach-border);
	border-bottom-width: 2px;
	border-top-width: 2px;
	box-shadow: var(--ach-border-shadow);
	font-family: "Beleren2016-Bold", serif;
}

.ach-overlay .ach-border-shadow {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow:
		inset 0 0 6px rgba(10, 12, 16, 0.35),
		inset 0 0 0 2px rgba(10, 12, 16, 0.45);
	pointer-events: none;
	z-index: 1;
	color: #000001;
}

.ach-overlay .ach-number {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translate(-50%, 50%);
	width: fit-content;
	padding: 0.25rem 0.5rem;
	background:
		repeating-linear-gradient(
			45deg,
			rgba(220, 225, 232, 0.3) 0px,
			rgba(220, 225, 232, 0.3) 18px,
			rgba(195, 202, 210, 0.3) 36px,
			rgba(195, 202, 210, 0.3) 54px,
			rgba(220, 225, 232, 0.3) 72px
		),
		linear-gradient(180deg, #cfd4dc 0%, #8f98a3 55%, #6f7882 100%);
	border-radius: 999px;
	border: 4px solid var(--ach-border);
	border-bottom-width: 2px;
	border-top-width: 2px;
	font-family: "Beleren2016-SmallCaps-BoldItalic", serif;
	color: #000001;
	z-index: 2;
}

.ach-overlay .ach-text-title {
	display: flex;
	align-items: center;
	height: 100%;
	padding-left: 0.85rem;
	font-size: clamp(0.6rem, 3.6cqh, 2.5rem);
	line-height: 1.1;
}

.ach-overlay .ach-text-descr {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	padding: 0.85rem;
	padding-bottom: 6cqh;
	font-size: clamp(0.6rem, 3.4cqh, 2.5rem);
	line-height: 1.1;
	width: 100%;
	box-sizing: border-box;
}

.ach-overlay .ach-text-descr-date {
	font-family: "Beleren2016-SmallCaps-BoldItalic", serif;
	font-size: clamp(0.5rem, 3cqh, 2.3rem);
	text-align: right;
}

.ach-overlay.is-locked .achievement-card {
	filter: saturate(0.65);
}

.ach-overlay.is-locked .ach-image-img {
	filter: grayscale(1) brightness(0.85);
}

.ach-overlay.is-locked .ach-text-title,
.ach-overlay.is-locked .ach-text-descr,
.ach-overlay.is-locked .ach-text-descr-date,
.ach-overlay.is-locked .ach-number {
	color: rgba(120, 115, 105, 0.9);
}

.ach-global-card {
	--ach-unlock-percent: 0%;
	--ach-global-fill: rgba(255, 236, 154, 0.12);
	--ach-global-bg: rgba(12, 12, 16, 0.75);

	width: 100%;
	max-width: 720px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0rem 0.75rem;
	min-height: 64px;
	border-radius: 2px;
	background:
		linear-gradient(90deg,
			var(--ach-global-fill) 0%,
			var(--ach-global-fill) var(--ach-unlock-percent),
			var(--ach-global-bg) var(--ach-unlock-percent),
			var(--ach-global-bg) 100%);
	border: 1px solid rgba(255, 236, 154, 0.14);
	box-shadow: 0 12px 25px rgba(0, 0, 0, 0.45);
	cursor: pointer;
}

.ach-global-icon {
	width: clamp(2.5rem, 10vw, 3.25rem);
	height: clamp(2.5rem, 10vw, 3.25rem);
	border-radius: 8px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.ach-global-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ach-global-text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.ach-global-title {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: rgba(255, 236, 154, 0.95);
	font-size: clamp(0.75rem, 3.5vw, 1.05rem);
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ach-global-desc {
	color: rgba(255, 255, 255, 0.78);
	font-size: clamp(0.7rem, 3.1vw, 0.95rem);
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ach-global-rate {
	font-weight: 700;
	color: rgba(255, 255, 255, 0.9);
	font-size: clamp(0.75rem, 3.2vw, 1rem);
	text-align: right;
	min-width: 4.5rem;
}

.ach-global-card.locked {
	filter: saturate(0.7);
}

.ach-global-card.locked .ach-global-icon img {
	filter: grayscale(1) brightness(0.9);
}

.ach-global-card.locked .ach-global-title {
	color: rgba(180, 175, 160, 0.9);
}

.ach-global-card.locked .ach-global-desc {
	color: rgba(160, 155, 145, 0.75);
}

.ach-global-message {
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.95rem;
	text-align: center;
	padding: 1rem 0;
}

@keyframes ach-reflet {
	0% { transform: translateX(-40%); }
	50% { transform: translateX(40%); }
	100% { transform: translateX(-40%); }
}
.ach-page,
.main-achievement-banner {
	font-family: "Spectral", "Times New Roman", serif;
}
