/* Wiederverwendbarer Spieldetail-Dialog (ClanConcept-Stil) */

.kkk-game-modal {
	--kkk-gm-bg-opacity: 0.32;
	border: 1px solid var(--kkk-border);
	border-radius: 0;
	padding: 0;
	margin: 0;
	max-width: min(780px, calc(100vw - 20px));
	max-height: calc(100vh - 20px);
	width: min(780px, calc(100vw - 20px));
	overflow: auto;
	background: var(--kkk-surface);
	color: var(--kkk-text);
	box-shadow: var(--kkk-shadow);
	position: fixed;
	left: 50%;
	top: 40%;
	transform: translate(-50%, -50%);
}

.kkk-game-modal::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

.kkk-game-modal.has-bg {
	color-scheme: dark;
	color: #e8eef6;
	background: #171c24;
	border-color: rgba(255, 255, 255, 0.16);
	--kkk-text: #e8eef6;
	--kkk-text-muted: #b6c0cc;
	--kkk-heading: #f2f6fb;
	--kkk-surface: #171c24;
	--kkk-bg-muted: rgba(255, 255, 255, 0.08);
	--kkk-border: rgba(255, 255, 255, 0.16);
	--kkk-border-strong: rgba(255, 255, 255, 0.28);
	--kkk-accent: var(--kkk-accent-strong, #c4a35a);
	--kkk-accent-strong: var(--kkk-accent-strong, #c4a35a);
	--kkk-accent-dim: rgba(196, 163, 90, 0.18);
}

.kkk-game-modal.has-bg::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--kkk-gm-bg) center / cover no-repeat;
	opacity: var(--kkk-gm-bg-opacity);
	pointer-events: none;
	z-index: 0;
}

.kkk-game-modal.has-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(rgba(13, 17, 24, 0.55) 0%, rgba(13, 17, 24, 0.84) 100%);
	pointer-events: none;
	z-index: 0;
}

.kkk-game-modal > * {
	position: relative;
	z-index: 1;
}

.kkk-game-modal__inner {
	margin: 0;
	padding: 8px 22px 22px;
	position: relative;
	min-width: 0;
}

.kkk-game-modal__drag {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	margin: 0 -8px 6px;
	cursor: grab;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.kkk-game-modal__drag:hover .kkk-game-modal__drag-grip,
.kkk-game-modal__drag.is-dragging .kkk-game-modal__drag-grip {
	opacity: 0.9;
}

.kkk-game-modal__drag.is-dragging {
	cursor: grabbing;
}

.kkk-game-modal.is-dragging {
	user-select: none;
}

.kkk-game-modal__drag-grip {
	display: block;
	width: 42px;
	height: 4px;
	border-radius: 999px;
	background: currentColor;
	opacity: 0.35;
}

.kkk-game-modal__close {
	position: absolute;
	top: 4px;
	right: 8px;
	z-index: 2;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kkk-game-modal__close:hover {
	opacity: 1;
}

.kkk-game-modal__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 44px 16px 0;
	min-width: 0;
}

.kkk-game-modal__title img {
	width: 28px;
	height: 28px;
	border-radius: 4px;
	flex: 0 0 auto;
	object-fit: cover;
	background: var(--kkk-bg-muted);
}

.kkk-game-modal__title h2 {
	margin: 0;
	font-family: var(--kkk-font-display, inherit);
	font-size: 1.35rem;
	line-height: 1.25;
	color: var(--kkk-heading);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.kkk-game-modal__top {
	display: flex;
	gap: 22px;
	align-items: flex-start;
	margin: 0 0 4px;
	min-width: 0;
}

.kkk-game-modal__info {
	flex: 1 1 0;
	min-width: 0;
}

.kkk-game-modal__side {
	flex: 0 0 min(300px, 42%);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
}

.kkk-game-modal__media {
	width: 100%;
	position: relative;
	aspect-ratio: 460 / 215;
	overflow: hidden;
	border: 1px solid var(--kkk-border);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	background: var(--kkk-bg-muted);
}

.kkk-game-modal__media img,
.kkk-game-modal__media video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.kkk-game-modal__video {
	opacity: 0;
	transition: opacity 0.35s ease;
}

.kkk-game-modal__video.is-on {
	opacity: 1;
}

.kkk-game-modal__genres,
.kkk-game-modal__desc,
.kkk-game-modal__meta {
	margin: 0 0 12px;
	font-size: 0.92rem;
	line-height: 1.45;
	color: var(--kkk-text-muted);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.kkk-game-modal__desc {
	color: var(--kkk-text);
}

.kkk-game-modal__nodesc {
	opacity: 0.7;
	font-style: italic;
}

.kkk-game-modal__meta dt {
	margin: 0;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.8;
}

.kkk-game-modal__meta dd {
	margin: 0 0 0.55rem;
	color: var(--kkk-text);
}

.kkk-game-modal__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 140px;
	margin: 8px 0 4px;
	padding: 18px 12px;
	text-align: center;
	color: var(--kkk-text-muted);
}

.kkk-game-modal__loading p {
	margin: 0;
}

.kkk-game-modal__spinner {
	width: 28px;
	height: 28px;
	border: 2px solid var(--kkk-border);
	border-top-color: var(--kkk-accent-strong, var(--kkk-accent));
	border-radius: 50%;
	animation: kkk-gm-spin 0.7s linear infinite;
}

.kkk-game-modal__actions {
	margin: 12px 0 0;
	display: flex;
	justify-content: center;
}

.kkk-game-modal__actions .kkk-btn {
	width: 100%;
	text-align: center;
	box-sizing: border-box;
}

.kkk-game-modal__owners-title {
	margin: 16px 0 10px;
	font-size: 0.95rem;
	color: var(--kkk-heading);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.kkk-game-modal__owners-title span {
	font-weight: 500;
	color: var(--kkk-text-muted);
}

.kkk-game-modal__owners {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-height: min(240px, 40vh);
	overflow: auto;
}

.kkk-game-modal__owner {
	display: inline-flex;
	align-items: center;
	padding: 5px 10px;
	border: 1px solid var(--kkk-border);
	background: var(--kkk-bg-muted);
	color: var(--kkk-accent-strong);
	text-decoration: none;
	font-size: 0.85rem;
	line-height: 1.2;
}

.kkk-game-modal__owner:hover,
.kkk-game-modal__owner:focus-visible {
	border-color: var(--kkk-accent-strong);
	background: var(--kkk-accent-dim);
	color: var(--kkk-heading);
	outline: none;
}

.kkk-game-modal__empty {
	margin: 0;
	color: var(--kkk-text-muted);
	font-size: 0.9rem;
}

.kkk-game-modal__error {
	margin: 1rem 0;
	color: #f0b4b4;
}

.kkk-game-modal .is-missing-icon {
	object-fit: contain !important;
	opacity: 0.85;
	background: var(--kkk-bg-muted);
}

.kkk-member__game-link {
	appearance: none;
	padding: 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-decoration: none;
}

.kkk-member__game-link:hover,
.kkk-member__game-link:focus-visible {
	border-color: var(--kkk-accent);
	outline: none;
}

.kkk-home-games__btn.kkk-game-open {
	cursor: pointer;
}

@keyframes kkk-gm-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 639px) {
	.kkk-game-modal {
		max-width: calc(100vw - 16px);
		width: calc(100vw - 16px);
		max-height: calc(100vh - 16px);
	}

	.kkk-game-modal__inner {
		padding: 6px 14px 16px;
	}

	.kkk-game-modal__top {
		flex-direction: column;
		gap: 14px;
	}

	.kkk-game-modal__side {
		flex: none;
		width: 100%;
		order: -1;
	}

	.kkk-game-modal__title h2 {
		font-size: 1.15rem;
		white-space: normal;
	}

	.kkk-game-modal__owners {
		max-height: min(30vh, 180px);
	}

	.kkk-game-modal__drag {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kkk-game-modal__video {
		display: none !important;
	}

	.kkk-game-modal__spinner {
		animation: none;
		border-top-color: var(--kkk-border);
		opacity: 0.6;
	}
}
