.thefun-kom {
	--kom-blue: #0057B7;
	--kom-yellow: #FFD500;
	--kom-red: #d43b3b;
	--kom-green: #2f9e44;
	--kom-bg: #fff;
	--kom-border: #d8d8d8;
	max-width: 480px;
	margin: 20px auto;
	font-family: 'Oswald', sans-serif;
	color: #1a1a1a;
	box-sizing: border-box;
	border: 2px solid var(--kom-blue);
	border-radius: 12px;
	overflow: hidden;
	background: #f7f7f4;
}
.thefun-kom *, .thefun-kom *::before, .thefun-kom *::after {
	box-sizing: border-box;
}

/* ---------- screens ---------- */
.kom-screen {
	padding: 20px 18px 24px;
}
.kom-screen[hidden] {
	display: none;
}

/* ---------- start screen ---------- */
.kom-title {
	font-size: 30px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--kom-blue);
	text-align: center;
	margin: 4px 0 2px;
}
.kom-subtitle {
	text-align: center;
	font-weight: 600;
	font-size: 16px;
	color: #444;
	margin: 0 0 14px;
}
.kom-intro {
	font-size: 15px;
	line-height: 1.45;
	text-align: center;
	margin: 0 0 20px;
}
.kom-btn {
	display: block;
	width: 100%;
	border: 0;
	border-radius: 8px;
	font-family: inherit;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: pointer;
	font-size: 18px;
	padding: 16px;
	background: var(--kom-blue);
	color: #fff;
}
.kom-btn:active {
	filter: brightness(0.92);
}
.kom-btn.secondary {
	background: #555;
}
.kom-btn.yellow {
	background: var(--kom-yellow);
	color: #1a1a1a;
}

/* ---------- play screen: top bar ---------- */
.kom-topbar {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.kom-stat {
	background: #fff;
	border: 1px solid var(--kom-border);
	border-radius: 6px;
	padding: 6px 9px;
	text-align: center;
	flex: 1;
	min-width: 68px;
}
.kom-stat b {
	display: block;
	font-size: 17px;
	color: var(--kom-blue);
}
.kom-stat.kom-timer b {
	color: var(--kom-red);
}

/* ---------- queue strip ---------- */
.kom-queue-strip {
	display: flex;
	gap: 3px;
	overflow: hidden;
	margin-bottom: 12px;
	min-height: 26px;
	align-items: center;
}
.kom-queue-strip svg {
	width: 22px;
	height: 22px;
	flex: none;
	opacity: 0.85;
}
.kom-queue-more {
	font-size: 12px;
	color: #777;
	white-space: nowrap;
}

/* ---------- dossier card ---------- */
.kom-card-wrap {
	position: relative;
	height: 300px;
	margin-bottom: 16px;
	touch-action: pan-y;
}
.kom-card {
	position: absolute;
	inset: 0;
	background: #fff;
	border: 2px solid #222;
	border-radius: 10px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	box-shadow: 0 4px 10px rgba(0,0,0,0.12);
	transition: transform 0.25s ease, opacity 0.25s ease;
}
.kom-card.kom-anim-out-right {
	transform: translateX(140%) rotate(12deg);
	opacity: 0;
}
.kom-card.kom-anim-out-left {
	transform: translateX(-140%) rotate(-12deg);
	opacity: 0;
}
.kom-card.kom-anim-enter {
	transform: translateY(14px);
	opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
	.kom-card {
		transition: none !important;
	}
	.kom-case-timer-bar {
		transition: none !important;
	}
}

.kom-case-timer {
	/* .kom-card е flex column с padding:14px - негативните margin-и я
	   изтеглят до истинския ръб на картата, вместо да стои навътре.
	   align-self:stretch е задължителен - .kom-card има align-items:center
	   (за да центрира аватар/име/текст), което иначе кара този елемент да
	   се свие до content-width (0, защото е празен) вместо да опъне цялата
	   ширина на картата. */
	align-self: stretch;
	flex: none;
	height: 4px;
	background: #eee;
	margin: -14px -14px 10px;
	border-radius: 10px 10px 0 0;
	overflow: hidden;
}
.kom-case-timer-bar {
	height: 100%;
	width: 100%;
	background: var(--kom-blue);
	transition: width 5s linear;
}

.kom-avatar-wrap {
	position: relative;
	width: 96px;
	height: 96px;
	margin-bottom: 8px;
}
.kom-avatar-wrap svg {
	width: 100%;
	height: 100%;
}
.kom-briefcase {
	position: absolute;
	right: -6px;
	bottom: -4px;
	width: 30px;
	height: 30px;
}

.kom-name {
	font-weight: 700;
	font-size: 19px;
	margin: 2px 0;
}
.kom-repeat-badge {
	display: inline-block;
	background: var(--kom-red);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 2px 8px;
	border-radius: 10px;
	margin-bottom: 4px;
}
.kom-field {
	font-size: 13px;
	line-height: 1.35;
	margin: 3px 0;
}
.kom-field .kom-field-label {
	font-weight: 700;
	color: #555;
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.kom-stamp-mark {
	position: absolute;
	top: 40%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-14deg) scale(0.6);
	font-size: 34px;
	font-weight: 700;
	text-transform: uppercase;
	border: 5px solid currentColor;
	border-radius: 10px;
	padding: 4px 16px;
	opacity: 0;
	pointer-events: none;
}
.kom-stamp-mark.kom-stamp-show {
	opacity: 0.9;
	transition: opacity 0.15s ease;
}
.kom-stamp-mark.stay {
	color: var(--kom-red);
}
.kom-stamp-mark.pardon {
	color: var(--kom-green);
}

/* ---------- action buttons ---------- */
.kom-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.kom-action-btn {
	min-height: 64px;
	border: 0;
	border-radius: 10px;
	font-family: inherit;
	font-weight: 700;
	font-size: 17px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: pointer;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.kom-action-btn:active {
	filter: brightness(0.9);
}
.kom-action-stay {
	background: var(--kom-red);
}
.kom-action-pardon {
	background: var(--kom-green);
}
.kom-hint {
	text-align: center;
	font-size: 11px;
	color: #888;
	margin-top: 8px;
}

/* ---------- end screen ---------- */
.kom-end-title {
	font-size: 22px;
	font-weight: 700;
	text-align: center;
	color: var(--kom-blue);
	margin: 4px 0 14px;
	text-transform: uppercase;
}
.kom-end-stats {
	background: #fff;
	border: 1px solid var(--kom-border);
	border-radius: 8px;
	padding: 14px;
	margin-bottom: 14px;
	text-align: center;
}
.kom-end-stats .kom-score {
	font-size: 28px;
	font-weight: 700;
	color: var(--kom-blue);
	line-height: 1.2;
}
.kom-end-stats p {
	margin: 6px 0 0;
	font-size: 14px;
}
.kom-tier {
	text-align: center;
	font-weight: 600;
	font-size: 15px;
	margin-bottom: 18px;
	padding: 0 6px;
}
.kom-end-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}
.kom-more-topic {
	text-align: center;
	font-size: 13px;
	border-top: 1px solid var(--kom-border);
	padding-top: 12px;
}
.kom-more-topic a {
	color: var(--kom-blue);
	font-weight: 600;
}

/* ---------- context line (below the whole game) ---------- */
.kom-context {
	text-align: center;
	font-size: 12px;
	color: #777;
	padding: 8px 14px 14px;
}
.kom-context a {
	color: var(--kom-blue);
}

.kom-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	background: #1a1a1a;
	color: #fff;
	padding: 10px 18px;
	border-radius: 20px;
	font-size: 13px;
	z-index: 9999;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}
.kom-toast.show {
	opacity: 1;
}

@media (max-width: 360px) {
	.kom-title { font-size: 26px; }
	.kom-card-wrap { height: 280px; }
}

/* =====================================================================
   v2.0 - "Комисията": реалните помилвания (пошагова версия, без таймери)
   Новите правила по-долу; горните (v1, аркада на време) остават непипнати
   за общата визия/CSS променливите, но повечето им класове вече не се
   ползват (game-v1.js е архивиран, не се зарежда).
   ===================================================================== */

.kom-btn {
	min-height: 56px;
}
.kom-btn.green {
	background: var(--kom-green);
}
.kom-btn.red {
	background: var(--kom-red);
}

.kom-topbar2 {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	font-weight: 700;
	color: #555;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.kom-note-line {
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--kom-blue);
	margin: 0 0 10px;
}

/* ---------- досие карта (v2) ---------- */
.kom-card2 {
	position: relative;
	background: #fff;
	border: 2px solid #222;
	border-radius: 10px;
	padding: 16px;
	margin-bottom: 14px;
	box-shadow: 0 4px 10px rgba(0,0,0,0.12);
	text-align: left;
}
.kom-card2.kom-enter-slow {
	transition: transform 1.2s ease, opacity 1.2s ease;
	transform: translateY(0);
	opacity: 1;
}
.kom-card2.kom-flash-yellow {
	animation: kom-flash-border 0.5s ease-in-out 3;
}
@keyframes kom-flash-border {
	0%, 100% { border-color: #222; }
	50% { border-color: var(--kom-yellow); }
}

.kom-field.kom-stagger-in {
	transition: opacity 0.3s ease;
}

.kom-stamp2 {
	position: absolute;
	top: 10px;
	right: 10px;
	pointer-events: none;
}
.kom-stamp2-word {
	display: inline-block;
	color: var(--kom-green);
	font-weight: 700;
	font-size: 20px;
	text-transform: uppercase;
	border: 4px solid var(--kom-green);
	border-radius: 8px;
	padding: 3px 10px;
	transform: rotate(-10deg) scale(0.7);
	opacity: 0;
	transition: opacity 0.15s ease, transform 0.15s ease;
}
.kom-stamp2.kom-stamp2-show .kom-stamp2-word {
	opacity: 0.9;
	transform: rotate(-10deg) scale(1);
}
.kom-after-line {
	margin: 10px 0 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--kom-green);
	border-top: 1px dashed var(--kom-border);
	padding-top: 8px;
}

.kom-tremble {
	animation: kom-tremble-kf 0.35s ease-in-out infinite;
}
@keyframes kom-tremble-kf {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-2px); }
	75% { transform: translateX(2px); }
}

/* ---------- решение (3 бутона) ---------- */
.kom-decide-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
@media (min-width: 480px) {
	.kom-decide-buttons {
		flex-direction: row;
	}
}

.kom-continue-row {
	margin-top: 14px;
}

/* ---------- въпрос + опции (стъпка 2 и 3) ---------- */
.kom-question-block {
	margin-bottom: 4px;
}
.kom-question {
	font-size: 18px;
	font-weight: 700;
	color: var(--kom-blue);
	text-align: center;
	margin: 4px 0 14px;
}
.kom-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.kom-option-btn {
	text-align: left;
	background: #fff;
	border: 2px solid var(--kom-border);
	border-radius: 8px;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 14px;
	min-height: 48px;
	cursor: pointer;
	color: #1a1a1a;
}
.kom-option-btn:active {
	background: #f0f0f0;
}
.kom-option-btn:disabled {
	cursor: default;
	opacity: 0.65;
}
.kom-option-btn.kom-correct {
	border-color: var(--kom-green);
	background: #eaf7ec;
	opacity: 1;
	font-weight: 700;
}
.kom-reveal-line {
	margin: 14px 0 0;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}
.kom-joke-line {
	color: #a06a00;
	font-weight: 700;
}

/* ---------- разкриване (стъпка 4) ---------- */
.kom-disclosure {
	background: #fff;
	border: 1px solid var(--kom-border);
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 14px;
}
.kom-followup {
	margin: 10px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--kom-red);
}
.kom-followup a {
	color: var(--kom-blue);
}

/* ---------- интро "Досие № 23" ---------- */
.kom-dossier-intro {
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1a1a1a;
	border-radius: 10px;
	opacity: 0;
	transition: opacity 1s ease;
}
.kom-dossier-intro.kom-dim-show {
	opacity: 1;
}
.kom-dossier-intro-text {
	color: var(--kom-yellow);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
	.kom-card2, .kom-card2.kom-enter-slow {
		transition: none !important;
		animation: none !important;
	}
	.kom-tremble {
		animation: none !important;
	}
	.kom-field.kom-stagger-in {
		transition: none !important;
	}
	.kom-dossier-intro {
		transition: none !important;
	}
}
