/* Istinto Crudo — dark noir graphic-novel design system */

:root {
	--ic-ink: #050505;
	--ic-surface: #111111;
	--ic-elevated: #1a1a1a;
	--ic-paper: #f4f4f5;
	--ic-ash: #a1a1aa;
	--ic-line: #27272a;
	--ic-blood: #dc2626;
	--ic-blood-hot: #e11d48;
	--ic-smoke: #111111;
	--ic-fog: rgba(161, 161, 170, 0.25);
	--ic-font-display: "Cinzel", "Times New Roman", serif;
	--ic-font-ui: Inter, "Segoe UI", sans-serif;
	--ic-font-type: "JetBrains Mono", ui-monospace, monospace;
	--ic-radius: 2px;
	--ic-shadow: 3px 3px 0 #000;
}

body.istinto-crudo-active {
	margin: 0;
	background: var(--ic-ink);
	overflow: hidden;
}

body.istinto-crudo-active #wpadminbar,
body.istinto-crudo-active header,
body.istinto-crudo-active footer,
body.istinto-crudo-active .site-header,
body.istinto-crudo-active .site-footer {
	display: none !important;
}

body.istinto-crudo-active .site,
body.istinto-crudo-active #page,
body.istinto-crudo-active .entry-content,
body.istinto-crudo-active article {
	margin: 0 !important;
	padding: 0 !important;
	max-width: none !important;
}

.ic-app {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: var(--ic-ink);
	color: var(--ic-paper);
	font-family: var(--ic-font-ui);
	font-size: clamp(14px, 2.8vw, 15px);
	line-height: 1.45;
	overflow: hidden;
	isolation: isolate;
	width: 100%;
	height: 100%;
	height: 100dvh;
	max-width: 100vw;
}

.ic-grain {
	pointer-events: none;
	position: absolute;
	inset: 0;
	z-index: 50;
	opacity: 0.12;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	mix-blend-mode: overlay;
}

.ic-screen {
	display: none;
	position: absolute;
	inset: 0;
	flex-direction: column;
	padding: env(safe-area-inset-top, 12px) 16px env(safe-area-inset-bottom, 16px);
	overflow: auto;
	z-index: 1;
}

.ic-screen.is-active {
	display: flex;
}

.ic-brand {
	font-family: var(--ic-font-display);
	font-weight: 700;
	font-size: clamp(2.2rem, 9vw, 3.6rem);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin: 0;
	color: var(--ic-paper);
	text-shadow: 3px 3px 0 #000, 4px 4px 0 var(--ic-blood);
}

.ic-logo {
	display: block;
	object-fit: contain;
	image-rendering: auto;
}

.ic-logo--hero {
	width: min(42vw, 180px);
	height: auto;
	margin: 0 auto 0.75rem;
	filter: drop-shadow(3px 3px 0 #000);
}

.ic-logo--mark {
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border: 1px solid var(--ic-line);
	border-radius: var(--ic-radius);
	background: #000;
}

.ic-panel--brand {
	text-align: center;
}

.ic-hud-brand {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 1;
	min-width: 0;
}

.ic-hud-brand .ic-hud-title {
	flex: 1;
}

.ic-typewriter {
	font-family: var(--ic-font-type);
	color: var(--ic-blood-hot);
	font-size: 0.85rem;
	margin: 0 0 0.5rem;
	letter-spacing: 0.04em;
}

.ic-btn {
	appearance: none;
	border: 1px solid var(--ic-paper);
	border-radius: var(--ic-radius);
	background: transparent;
	color: var(--ic-paper);
	font-family: var(--ic-font-ui);
	font-weight: 600;
	font-size: 0.9rem;
	padding: 0.85rem 1.15rem;
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	box-shadow: var(--ic-shadow);
	transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease, transform 0.1s ease;
}

.ic-btn:active {
	transform: translate(1px, 1px);
	box-shadow: 1px 1px 0 #000;
}

.ic-btn--blood {
	background: var(--ic-blood);
	border-color: var(--ic-blood);
	color: #fff;
}

.ic-btn--blood:active,
.ic-btn--blood:hover {
	background: var(--ic-blood-hot);
	border-color: var(--ic-blood-hot);
}

.ic-btn--ghost {
	border-color: var(--ic-line);
	color: var(--ic-paper);
	background: transparent;
}

.ic-btn--ghost:hover {
	background: var(--ic-paper);
	color: var(--ic-ink);
	border-color: var(--ic-paper);
}

.ic-icon-btn {
	appearance: none;
	width: 40px;
	height: 40px;
	border: 1px solid var(--ic-line);
	border-radius: var(--ic-radius);
	background: var(--ic-surface);
	color: var(--ic-paper);
	font-size: 1.1rem;
	cursor: pointer;
	box-shadow: 2px 2px 0 #000;
}

.ic-panel {
	border: 1px solid var(--ic-line);
	background: var(--ic-surface);
	padding: 1.1rem 1.2rem;
	border-radius: var(--ic-radius);
	box-shadow: var(--ic-shadow);
	clip-path: none;
	animation: ic-panel-in 0.35s ease both;
}

.ic-lab-desk {
	flex: 1;
	background: var(--ic-surface);
	border: 1px solid var(--ic-line);
	border-radius: var(--ic-radius);
	padding: 1.25rem;
	position: relative;
	box-shadow: var(--ic-shadow);
}

.ic-list-item {
	text-align: left;
	border: 1px solid var(--ic-line);
	border-radius: var(--ic-radius);
	background: var(--ic-surface);
	color: var(--ic-paper);
	padding: 0.9rem 1rem;
	cursor: pointer;
	font-family: inherit;
	box-shadow: 2px 2px 0 #000;
}

.ic-card {
	border: 1px solid var(--ic-line);
	border-radius: var(--ic-radius);
	background: var(--ic-surface);
	padding: 0.75rem;
	min-height: 140px;
	box-shadow: 2px 2px 0 #000;
}

.ic-dossier {
	border: 1px solid var(--ic-paper);
	border-radius: var(--ic-radius);
	padding: 1rem;
	background: var(--ic-surface);
	box-shadow: var(--ic-shadow);
}

.ic-toast {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 60;
	background: var(--ic-paper);
	color: var(--ic-ink);
	padding: 0.7rem 1rem;
	font-weight: 600;
	font-size: 0.9rem;
	max-width: 90%;
	text-align: center;
	border-radius: var(--ic-radius);
	border-left: 4px solid var(--ic-blood);
	box-shadow: var(--ic-shadow);
}

.ic-flash-blood {
	animation: ic-crimson-flash 0.35s ease;
}

@keyframes ic-crimson-flash {
	0% {
		box-shadow: inset 0 0 0 0 transparent;
	}
	40% {
		box-shadow: inset 0 0 0 3px var(--ic-blood-hot), inset 0 0 40px rgba(225, 29, 72, 0.35);
	}
	100% {
		box-shadow: inset 0 0 0 0 transparent;
	}
}

.ic-hud {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.75rem;
	position: relative;
	z-index: 5;
}

.ic-hud-title {
	font-family: var(--ic-font-display);
	font-weight: 700;
	font-size: 1.35rem;
	text-transform: uppercase;
	flex: 1;
}

.ic-hud-stats {
	display: flex;
	gap: 0.75rem;
	font-size: 0.85rem;
	color: var(--ic-paper);
}

.ic-hud-tools {
	display: flex;
	gap: 0.35rem;
}

.ic-stat b {
	color: var(--ic-blood-hot);
}

.ic-ink-drop {
	display: inline-block;
	width: 0.55em;
	height: 0.7em;
	background: var(--ic-blood);
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	vertical-align: middle;
}

/* Boot cover — first screen */
.ic-screen--boot {
	padding: 0;
	justify-content: flex-end;
	overflow: hidden;
	min-height: 100%;
	min-height: 100dvh;
}

.ic-boot-cover {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.ic-boot-cover__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

.ic-boot-cover__scrim {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(5, 5, 5, 0.2) 0%, rgba(5, 5, 5, 0.45) 38%, rgba(5, 5, 5, 0.88) 68%, #050505 100%);
	pointer-events: none;
}

.ic-boot-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	box-sizing: border-box;
	width: 100%;
	max-width: min(28rem, 100%);
	margin: 0 auto;
	padding:
		max(0.75rem, env(safe-area-inset-top, 0px))
		clamp(0.85rem, 4vw, 1.5rem)
		calc(env(safe-area-inset-bottom, 12px) + 1rem);
	animation: ic-panel-in 0.4s ease both;
}

.ic-logo--boot {
	width: clamp(56px, 14vw, 88px);
	height: clamp(56px, 14vw, 88px);
	margin-bottom: 0.55rem;
	border: 1px solid var(--ic-line);
	border-radius: var(--ic-radius);
	background: #000;
	box-shadow: var(--ic-shadow);
}

.ic-boot-lead {
	margin: 0.35rem 0 1rem;
	color: var(--ic-ash);
	font-size: clamp(0.85rem, 2.8vw, 0.98rem);
	line-height: 1.45;
	max-width: 36rem;
	padding: 0 0.25rem;
}

.ic-boot-lead--story {
	color: #d4cfc4;
	font-size: clamp(0.9rem, 3.1vw, 1.05rem);
	line-height: 1.55;
	text-align: left;
	min-height: 9.5em;
	margin-bottom: 0.65rem;
	opacity: 0;
	animation: ic-story-in 0.45s ease forwards;
}

.ic-boot-lead--story.is-fading {
	animation: ic-story-in 0.45s ease forwards;
}

@keyframes ic-story-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.ic-boot-story {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.ic-boot-progress {
	display: flex;
	justify-content: center;
	gap: 0.4rem;
	margin: 0 0 0.85rem;
}

.ic-boot-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(232, 226, 214, 0.25);
	border: 1px solid rgba(232, 226, 214, 0.35);
}

.ic-boot-dot.is-on {
	background: var(--ic-blood);
	border-color: var(--ic-blood);
	box-shadow: 0 0 8px rgba(183, 28, 28, 0.45);
}

.ic-boot-hub {
	width: 100%;
}

.ic-screen--boot .ic-brand {
	font-size: clamp(1.55rem, 7.5vw, 2.8rem);
	margin-bottom: 0.15rem;
	line-height: 1.1;
	word-break: break-word;
}

.ic-boot-actions {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	width: 100%;
	max-width: 22rem;
}

.ic-btn--boot,
.ic-boot-actions .ic-btn--ghost {
	border: 1px solid #ffffff;
	color: #ffffff;
	background: transparent;
	box-shadow: none;
	width: 100%;
	min-height: 48px;
	font-size: clamp(0.78rem, 2.6vw, 0.9rem);
	padding: 0.8rem 0.9rem;
}

.ic-btn--boot:hover,
.ic-btn--boot:focus-visible,
.ic-boot-actions .ic-btn--ghost:hover,
.ic-boot-actions .ic-btn--ghost:focus-visible {
	background: #ffffff;
	color: #050505;
	border-color: #ffffff;
}

.ic-btn--boot:active,
.ic-boot-actions .ic-btn--ghost:active {
	transform: translate(1px, 1px);
}

@media (max-height: 700px) {
	.ic-logo--boot {
		width: 52px;
		height: 52px;
		margin-bottom: 0.35rem;
	}

	.ic-boot-lead {
		margin-bottom: 0.75rem;
		font-size: 0.82rem;
	}

	.ic-boot-lead--story {
		min-height: 8em;
		font-size: 0.88rem;
		margin-bottom: 0.5rem;
	}

	.ic-screen--boot .ic-brand {
		font-size: clamp(1.4rem, 6vw, 2rem);
	}

	.ic-btn--boot,
	.ic-boot-actions .ic-btn--ghost {
		min-height: 44px;
		padding: 0.65rem 0.75rem;
	}
}

@media (min-width: 768px) {
	.ic-boot-content {
		padding-bottom: 2rem;
	}

	.ic-boot-cover__img {
		object-position: center center;
	}
}

.ic-boot-panels {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	justify-content: center;
	max-width: 28rem;
	margin: 0 auto;
	width: 100%;
}

.ic-panel--2 {
	animation-delay: 0.12s;
}

.ic-panel--3 {
	animation-delay: 0.24s;
}

@keyframes ic-panel-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.ic-lab-lead {
	font-family: var(--ic-font-type);
	color: var(--ic-ash);
	margin-top: 0;
}

.ic-lab-ink {
	margin: 0.35rem 0 0;
	font-family: var(--ic-font-type);
	font-size: 0.95rem;
	color: var(--ic-paper);
	letter-spacing: 0.04em;
}

.ic-lab-ink b {
	color: #f4f4f5;
	font-size: 1.1em;
}

.ic-lab-actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 1.25rem 0;
}

.ic-lab-meta {
	color: var(--ic-ash);
	font-size: 0.9rem;
}

.ic-hint {
	color: var(--ic-ash);
	font-size: 0.88rem;
}

.ic-lievito {
	color: var(--ic-blood-hot);
}

.ic-additivo {
	color: var(--ic-ash);
}

/* Puzzle */
.ic-puzzle-board {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 5px;
	max-width: min(360px, 92vw);
	margin: 0.75rem auto;
	width: 100%;
	aspect-ratio: 1;
}

.ic-app .ic-tile,
.ic-app button.ic-tile {
	appearance: none !important;
	-webkit-appearance: none !important;
	border: 2px solid transparent !important;
	cursor: pointer;
	border-radius: 3px;
	position: relative;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0;
	min-height: 0;
	width: 100%;
	height: 100%;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-family: var(--ic-font-display) !important;
	font-weight: 700 !important;
	font-size: clamp(0.85rem, 3.8vw, 1.15rem) !important;
	line-height: 1 !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	color: #f4f4f5 !important;
	background-clip: padding-box;
}

.ic-app .ic-tile--lievito,
.ic-app button.ic-tile--lievito {
	background: #b91c1c !important;
	background-color: #b91c1c !important;
	border-color: #7f1d1d !important;
	color: #fff5f5 !important;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35) !important;
}

.ic-app .ic-tile--additivo,
.ic-app button.ic-tile--additivo {
	background: #3f3f46 !important;
	background-color: #3f3f46 !important;
	border-color: #27272a !important;
	color: #a1a1aa !important;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45) !important;
}

.ic-app .ic-tile.is-selected,
.ic-app button.ic-tile.is-selected {
	outline: 2px solid #f4f4f5 !important;
	outline-offset: 1px;
	z-index: 1;
	transform: scale(1.04);
}

.ic-puzzle-score {
	text-align: center;
}

.ic-hint--puzzle {
	text-align: center;
	max-width: 22rem;
	margin: 0.35rem auto 0.5rem;
	line-height: 1.4;
}

/* Studio */
.ic-studio-stage {
	position: relative;
	flex: 1;
	min-height: 280px;
	background: radial-gradient(circle at center, #1e1e22 0%, var(--ic-ink) 70%);
	border: 2px solid var(--ic-ash);
	overflow: hidden;
}

.ic-studio-radar {
	position: absolute;
	inset: 10%;
	border: 1px solid rgba(183, 28, 28, 0.35);
	border-radius: 50%;
	animation: ic-radar 4s linear infinite;
}

.ic-studio-radar::after {
	content: "";
	position: absolute;
	inset: 20%;
	border: 1px solid rgba(183, 28, 28, 0.2);
	border-radius: 50%;
}

@keyframes ic-radar {
	to {
		transform: rotate(360deg);
	}
}

.ic-studio-spawns {
	position: absolute;
	inset: 0;
}

.ic-spawn-tear {
	position: absolute;
	width: 56px;
	height: 56px;
	transform: translate(-50%, -50%);
	cursor: pointer;
	animation: ic-tear-pulse 1.4s ease-in-out infinite;
	border: none;
	background: transparent;
	padding: 0;
}

.ic-spawn-tear img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
	filter: contrast(1.15);
}

@keyframes ic-tear-pulse {
	0%,
	100% {
		filter: drop-shadow(0 0 0 transparent);
		transform: translate(-50%, -50%) scale(1);
	}
	50% {
		filter: drop-shadow(0 0 8px rgba(183, 28, 28, 0.55));
		transform: translate(-50%, -50%) scale(1.06);
	}
}

/* Map — china noir (tile ink + pin rossi / echi bianchi) */
.ic-screen[data-screen="map"] {
	padding: 0;
	background: #050505;
}

.ic-hud--map {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: calc(env(safe-area-inset-top, 8px) + 8px) 12px 8px;
	background: linear-gradient(180deg, rgba(5, 5, 5, 0.94), transparent);
	margin: 0;
	z-index: 5;
}

.ic-map {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: #0a0a0a;
}

/* Solo le tile: china leggibile (prima brightness troppo bassa → mappa nera). */
.ic-map .leaflet-tile-pane {
	filter: grayscale(0.85) contrast(1.25) brightness(1.05);
}

.ic-map .leaflet-tile-pane .ic-map-tiles {
	image-rendering: auto;
}

.ic-map .leaflet-container {
	background: #050505;
	font: inherit;
}

.ic-map-ink {
	pointer-events: none;
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0.12;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.ic-map-vignette {
	pointer-events: none;
	position: absolute;
	inset: 0;
	z-index: 2;
	box-shadow:
		inset 0 0 70px 24px rgba(0, 0, 0, 0.55),
		inset 0 0 0 1px rgba(244, 244, 245, 0.06);
}

.ic-gps-status {
	position: absolute;
	bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	left: 12px;
	right: 12px;
	z-index: 4;
	margin: 0;
	font-size: 0.8rem;
	color: var(--ic-ash);
	text-align: center;
	pointer-events: none;
}

.ic-app .leaflet-div-icon.ic-leaflet-pin,
.ic-app .ic-leaflet-pin {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	overflow: visible !important;
}

.ic-app .leaflet-marker-icon {
	border: none !important;
}

/* Pin giocatore — alone bianca */
.ic-player-pin {
	position: relative;
	width: 40px;
	height: 40px;
}

.ic-player-pin__ring {
	position: absolute;
	inset: 0;
	border: 2px solid #f4f4f5;
	border-radius: 50%;
	box-shadow: 0 0 0 5px rgba(244, 244, 245, 0.12), 0 0 14px rgba(244, 244, 245, 0.3);
	animation: ic-player-pulse 2.2s ease-in-out infinite;
}

.ic-player-pin__core {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 10px;
	height: 10px;
	margin: -5px 0 0 -5px;
	border-radius: 50%;
	background: #dc2626;
	border: 2px solid #f4f4f5;
	box-shadow: 0 0 0 1px #000;
}

@keyframes ic-player-pulse {
	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(1.1);
		opacity: 0.75;
	}
}

/* Sorgenti Vive — goccia carminio */
.ic-app button.ic-sorgente-pin,
.ic-sorgente-pin {
	appearance: none !important;
	-webkit-appearance: none !important;
	border: none !important;
	background: transparent !important;
	padding: 0 !important;
	margin: 0 !important;
	width: 24px !important;
	height: 34px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	filter: drop-shadow(0 2px 0 #000);
}

.ic-sorgente-pin__tear {
	display: block;
	width: 18px;
	height: 18px;
	margin: 0 auto;
	background: #dc2626;
	border: 2px solid #f4f4f5;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: inset 0 0 0 1px #7f1d1d;
}

/* Echi — disco compatto (niente PNG full-bleed sulla mappa) */
.ic-app button.ic-echo-pin,
.ic-echo-pin {
	appearance: none !important;
	-webkit-appearance: none !important;
	border: none !important;
	background: transparent !important;
	padding: 0 !important;
	margin: 0 !important;
	width: 52px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	animation: ic-echo-breathe 2.4s ease-in-out infinite;
}

.ic-echo-pin__disc {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 40px !important;
	height: 40px !important;
	max-width: 40px !important;
	max-height: 40px !important;
	border-radius: 50%;
	border: 2px solid #f4f4f5;
	background: #0a0a0a;
	overflow: hidden !important;
	color: #f4f4f5;
	font-family: var(--ic-font-display);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	box-shadow: 0 0 0 1px #000, 0 3px 0 #000;
}

.ic-echo-pin__label {
	font-family: var(--ic-font-ui);
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #f4f4f5;
	text-shadow: 0 1px 0 #000;
}

@keyframes ic-echo-breathe {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-2px);
	}
}

/* Tooltip stile fumetto */
.leaflet-tooltip.ic-map-bubble {
	background: #050505 !important;
	border: 2px solid #dc2626 !important;
	border-radius: 2px !important;
	color: #f4f4f5 !important;
	font-family: var(--ic-font-ui);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.3rem 0.5rem !important;
	box-shadow: 3px 3px 0 #000;
}

.leaflet-tooltip.ic-map-bubble::before {
	border-top-color: #dc2626 !important;
}

/* Bottom nav */
.ic-nav {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 30;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
	padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
	background: rgba(5, 5, 5, 0.96);
	border-top: 1px solid #27272a;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.55);
}

.ic-nav.is-hidden {
	display: none !important;
}

.ic-nav__btn {
	appearance: none;
	border: none;
	background: transparent;
	color: #a1a1aa;
	font-family: var(--ic-font-ui);
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.45rem 0.2rem;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	min-height: 52px;
}

.ic-nav__ico {
	font-size: 1.05rem;
	line-height: 1;
	color: #f4f4f5;
}

.ic-nav__btn.is-active {
	color: #f4f4f5;
}

.ic-nav__btn.is-active .ic-nav__ico {
	color: #dc2626;
}

.ic-app--with-nav .ic-screen {
	padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.ic-app--with-nav .ic-screen[data-screen="map"] {
	padding-bottom: 0;
}

.ic-hud--map {
	z-index: 6;
}

.ic-list {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.ic-list-item strong {
	display: block;
	font-family: var(--ic-font-display);
	font-size: 1.15rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ic-list-item span {
	color: var(--ic-ash);
	font-size: 0.85rem;
}

.ic-dossier h2 {
	font-family: var(--ic-font-display);
	margin: 0 0 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ic-dossier-actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 1rem;
}

.ic-tag {
	display: inline-block;
	border: 1px solid var(--ic-ash);
	padding: 0.15rem 0.4rem;
	margin: 0.15rem 0.15rem 0 0;
	font-size: 0.75rem;
	color: var(--ic-ash);
	text-transform: uppercase;
}

.ic-grimorio-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.65rem;
}

.ic-card img {
	width: 64px;
	height: 64px;
	display: block;
	margin-bottom: 0.4rem;
	object-fit: cover;
	filter: contrast(1.15);
}

.ic-card h3 {
	font-family: var(--ic-font-display);
	font-size: 1rem;
	margin: 0 0 0.25rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ic-card p {
	margin: 0;
	font-size: 0.78rem;
	color: var(--ic-ash);
}

.ic-card .ic-count {
	color: var(--ic-blood-hot);
	font-weight: 600;
}

.ic-rarity-C {
	border-color: #6e6a64;
}
.ic-rarity-U {
	border-color: #9e9a90;
}
.ic-rarity-R {
	border-color: var(--ic-blood);
}
.ic-rarity-E {
	border-color: var(--ic-blood-hot);
	box-shadow: inset 0 0 0 1px var(--ic-blood);
}

.ic-boss-stage {
	text-align: center;
}

.ic-boss-art {
	width: 140px;
	height: 140px;
	margin: 0 auto 0.75rem;
	filter: contrast(1.2) grayscale(0.15);
}

.ic-boss-weak {
	font-family: var(--ic-font-type);
	color: var(--ic-blood-hot);
}

.ic-ritual {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 1rem;
}

.ic-ritual button {
	text-align: left;
	white-space: normal;
}

.ic-victory {
	text-align: center;
	max-width: 22rem;
	margin: 0 auto;
}

.ic-victory h2 {
	font-family: var(--ic-font-display);
	text-transform: uppercase;
	font-size: 2rem;
	text-shadow: 2px 2px 0 var(--ic-blood);
}

.ic-qr {
	display: flex;
	justify-content: center;
	margin: 1rem 0;
	padding: 0.75rem;
	background: var(--ic-paper);
}

.ic-qr canvas,
.ic-qr img {
	display: block;
}

.ic-form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-width: 22rem;
}

.ic-form label {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.85rem;
	color: var(--ic-ash);
}

.ic-form input {
	background: var(--ic-smoke);
	border: 1px solid var(--ic-ash);
	color: var(--ic-paper);
	padding: 0.7rem;
	font-family: inherit;
}

.ic-form-actions {
	display: flex;
	gap: 0.5rem;
}

.ic-form-msg {
	color: var(--ic-blood-hot);
	min-height: 1.2em;
}

/* Combat dossier overlay */
.ic-overlay {
	position: absolute;
	inset: 0;
	z-index: 40;
	background: rgba(5, 5, 5, 0.94);
	display: flex;
	align-items: stretch;
	justify-content: center;
	padding: env(safe-area-inset-top, 8px) 12px env(safe-area-inset-bottom, 12px);
	overflow: auto;
}

.ic-overlay.is-hidden {
	display: none;
}

.ic-dossier-fight {
	width: min(100%, 26rem);
	margin: auto;
	border: 1px solid var(--ic-line);
	background: #0a0a0a;
	box-shadow: var(--ic-shadow);
	padding: 0.85rem 1rem 1.1rem;
	animation: ic-panel-in 0.35s ease both;
}

.ic-overlay.is-strike .ic-dossier-fight {
	animation: ic-shake 0.22s linear;
}

.ic-dossier-fight__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	border-bottom: 1px solid var(--ic-line);
	padding-bottom: 0.55rem;
	margin-bottom: 0.75rem;
}

.ic-dossier-fight__close {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--ic-ash);
	font-family: var(--ic-font-type);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	padding: 0.25rem 0;
}

.ic-dossier-fight__close:hover {
	color: var(--ic-paper);
}

.ic-dossier-fight__no {
	margin: 0;
	font-family: var(--ic-font-type);
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	color: var(--ic-ash);
	text-transform: uppercase;
}

.ic-dossier-fight__title {
	margin: 0 0 0.65rem;
	font-family: var(--ic-font-display);
	font-size: clamp(1.25rem, 5.5vw, 1.75rem);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	line-height: 1.15;
	color: var(--ic-paper);
	text-shadow: 2px 2px 0 #000, 3px 3px 0 rgba(183, 28, 28, 0.55);
}

.ic-stability {
	margin-bottom: 0.85rem;
}

.ic-stability__label {
	margin: 0 0 0.35rem;
	text-align: center;
	font-family: var(--ic-font-type);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	color: var(--ic-paper);
}

.ic-stability__track {
	height: 10px;
	border: 1px solid #7f1d1d;
	background: #1a0a0a;
	overflow: hidden;
}

.ic-stability__fill {
	display: block;
	height: 100%;
	width: 100%;
	background: linear-gradient(90deg, #7f1d1d, var(--ic-blood-hot));
	transition: width 0.2s ease;
}

.ic-dossier-fight__art {
	margin: 0 auto 0.75rem;
	width: min(100%, 220px);
	aspect-ratio: 1;
	border: 1px solid var(--ic-line);
	background: #000;
	overflow: hidden;
}

.ic-dossier-fight__art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	filter: contrast(1.12);
}

.ic-dossier-fight__quote {
	margin: 0 0 0.45rem;
	font-family: var(--ic-font-type);
	font-size: 0.82rem;
	line-height: 1.45;
	color: var(--ic-ash);
	text-align: center;
	min-height: 2.2em;
}

.ic-dossier-fight__lore {
	margin: 0 0 0.85rem;
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--ic-paper);
	text-align: center;
}

.ic-dossier-fight__hint {
	margin: 0.45rem 0 0.75rem;
	font-size: 0.82rem;
	color: var(--ic-ash);
	text-align: center;
	line-height: 1.4;
}

.ic-dossier-fight__rule {
	margin: 0 0 0.55rem;
	padding: 0.4rem 0;
	border-top: 1px solid var(--ic-line);
	border-bottom: 1px solid var(--ic-line);
	font-family: var(--ic-font-type);
	font-size: 0.7rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	text-align: center;
	color: var(--ic-ash);
}

.ic-dossier-fight__ink {
	margin: 0 0 0.35rem;
	text-align: center;
	font-size: 0.8rem;
	color: var(--ic-ash);
}

.ic-dossier-fight__actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

/* Arena — Pokémon GO style throw */
.ic-overlay--arena {
	padding: 0;
	align-items: stretch;
	background: #050505;
}

.ic-arena {
	position: relative;
	width: 100%;
	max-width: 28rem;
	margin: 0 auto;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	padding:
		calc(env(safe-area-inset-top, 8px) + 8px)
		14px
		calc(env(safe-area-inset-bottom, 12px) + 12px);
	box-sizing: border-box;
	background:
		radial-gradient(ellipse 80% 50% at 50% 38%, rgba(183, 28, 28, 0.18), transparent 55%),
		radial-gradient(ellipse 100% 70% at 50% 100%, #121212, #050505 70%);
}

.ic-arena__hud {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	z-index: 2;
}

.ic-arena__meta {
	text-align: right;
}

.ic-arena__name {
	margin: 0;
	font-family: var(--ic-font-display);
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ic-arena__ink {
	margin: 0.2rem 0 0;
	font-size: 0.75rem;
	color: var(--ic-ash);
	font-family: var(--ic-font-type);
}

.ic-stability--arena {
	margin: 0.65rem 0 0.35rem;
}

.ic-arena__stage {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 280px;
}

.ic-arena__target {
	position: relative;
	width: min(72vw, 260px);
	height: min(72vw, 260px);
}

.ic-capture-ring {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 100%;
	height: 100%;
	border: 3px solid #f4f4f5;
	border-radius: 50%;
	transform: translate(-50%, -50%) scale(1);
	pointer-events: none;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 18px rgba(220, 38, 38, 0.25);
	transition: border-color 0.1s linear;
}

.ic-capture-ring[data-grade="nice"] {
	border-color: #a1a1aa;
}

.ic-capture-ring[data-grade="great"] {
	border-color: #fbbf24;
}

.ic-capture-ring[data-grade="excellent"] {
	border-color: #dc2626;
	box-shadow: 0 0 22px rgba(220, 38, 38, 0.55);
}

.ic-arena__creature {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 72%;
	height: 72%;
	transform: translate(-50%, -50%);
	animation: ic-creature-float 2.8s ease-in-out infinite;
}

.ic-arena__creature img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.75));
	user-select: none;
	pointer-events: none;
}

.ic-arena__creature.is-hit {
	animation: ic-creature-hit 0.45s ease;
}

.ic-arena__creature.is-dodge {
	animation: ic-creature-dodge 0.45s ease;
}

.ic-arena__creature.is-caught {
	animation: ic-creature-catch 0.65s ease forwards;
}

@keyframes ic-creature-float {
	0%,
	100% {
		transform: translate(-50%, -50%) translateY(0);
	}
	50% {
		transform: translate(-50%, -50%) translateY(-10px);
	}
}

@keyframes ic-creature-hit {
	0%,
	100% {
		transform: translate(-50%, -50%) scale(1);
	}
	30% {
		transform: translate(-50%, -50%) scale(0.92);
		filter: brightness(1.35);
	}
	60% {
		transform: translate(-50%, -54%) scale(1.06);
	}
}

@keyframes ic-creature-dodge {
	0%,
	100% {
		transform: translate(-50%, -50%);
	}
	40% {
		transform: translate(-20%, -58%) rotate(-8deg);
	}
}

@keyframes ic-creature-catch {
	to {
		transform: translate(-50%, -50%) scale(0.15);
		opacity: 0;
	}
}

.ic-throw-feedback {
	position: absolute;
	bottom: 8%;
	left: 0;
	right: 0;
	text-align: center;
	margin: 0;
	font-family: var(--ic-font-display);
	font-size: 1.35rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #fff;
	text-shadow: 2px 2px 0 #000;
	min-height: 1.4em;
	pointer-events: none;
}

.ic-throw-feedback[data-grade="excellent"] {
	color: #ef4444;
}

.ic-throw-feedback[data-grade="great"] {
	color: #fbbf24;
}

.ic-throw-feedback[data-grade="nice"] {
	color: #e4e4e7;
}

.ic-throw-feedback[data-grade="miss"] {
	color: #71717a;
}

.ic-arena__hint {
	margin: 0.35rem 0 0.5rem;
	text-align: center;
	font-size: 0.8rem;
	color: var(--ic-ash);
	line-height: 1.35;
}

.ic-orb-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	padding-bottom: 0.25rem;
	touch-action: none;
}

.ic-orb-wrap__label {
	margin: 0;
	font-size: 0.72rem;
	color: var(--ic-ash);
	font-family: var(--ic-font-type);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ic-ink-orb {
	appearance: none;
	border: none;
	background: transparent;
	width: 72px;
	height: 72px;
	padding: 0;
	cursor: grab;
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	touch-action: none;
	z-index: 3;
}

.ic-ink-orb.is-armed {
	cursor: grabbing;
}

.ic-ink-orb__drop {
	display: block;
	width: 56px;
	height: 56px;
	margin: 8px auto 0;
	border-radius: 50% 50% 50% 8%;
	transform: rotate(-45deg);
	background: radial-gradient(circle at 35% 30%, #f87171, #b91c1c 55%, #7f1d1d);
	box-shadow: 0 0 0 2px #fff, 0 8px 20px rgba(185, 28, 28, 0.55);
}

.ic-ink-orb.is-flying .ic-ink-orb__drop {
	animation: ic-orb-fly 0.48s ease-in forwards;
}

@keyframes ic-orb-fly {
	0% {
		transform: rotate(-45deg) translate(0, 0) scale(1);
		opacity: 1;
	}
	70% {
		opacity: 1;
	}
	100% {
		transform: rotate(-45deg) translate(0, -220px) scale(0.35);
		opacity: 0;
	}
}

.ic-dossier-fight__actions .ic-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

@keyframes ic-shake {
	0%,
	100% {
		transform: translate(0);
	}
	25% {
		transform: translate(-3px, 1px);
	}
	75% {
		transform: translate(3px, -1px);
	}
}

.ic-toast.is-hidden {
	display: none;
}

.is-hidden {
	display: none !important;
}

.leaflet-container {
	background: #050505;
	font: inherit;
}
