/**
 * PanDOS Terminal — styl w metaforze systemu.
 * Tokeny motywu z fallbackiem, żeby działał też poza PanDOS.
 */

/* Pływające okno powłoki — niemodalne, przesuwalne, bez przyciemniania
   reszty strony. Pozycjonowane fixed; JS ustawia left/top. */
.pandos-term {
	--t-accent: var(--pandos-accent-soft, #5593ff);
	--t-green: #3ddc84;
	--t-text: #d7dbe0;
	--t-dim: #8b9099;
	--t-err: #ff6b6b;
	--t-bg: rgba(11, 14, 20, 0.94);
	--t-hairline: var(--pandos-hairline, rgba(255, 255, 255, 0.12));

	position: fixed;
	top: 12%;
	left: 50%;
	z-index: var(--z-popover, 550);
	display: flex;
	flex-direction: column;
	width: min(760px, calc(100vw - 24px));
	height: min(58vh, 480px);
	background: var(--t-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--t-hairline);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.pandos-term.is-hidden,
.pandos-term[hidden] {
	display: none;
}

/* Pasek okna — uchwyt przeciągania + zamknięcie. */
.pandos-term__bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	padding: 10px 14px;
	background: rgba(255, 255, 255, 0.05);
	border-bottom: 1px solid var(--t-hairline);
	cursor: grab;
	user-select: none;
	touch-action: none;
}

.pandos-term.is-dragging .pandos-term__bar {
	cursor: grabbing;
}

/* Przycisk zamknięcia w stylu „traffic light". */
.pandos-term__close {
	width: 12px;
	height: 12px;
	padding: 0;
	background: #ff5f56;
	border: 1px solid #e0443e;
	border-radius: 50%;
	cursor: pointer;
}

.pandos-term__close:hover {
	filter: brightness(1.1);
}

.pandos-term__title {
	font-size: 12px;
	color: var(--t-dim);
	pointer-events: none;
}

/* Ekran */
.pandos-term__screen {
	flex: 1 1 auto;
	padding: 16px;
	overflow-y: auto;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--t-text);
	white-space: pre-wrap;
	word-break: break-word;
}

.pandos-term__screen:focus {
	outline: none;
}

.pandos-term__line {
	min-height: 1.55em;
}

.pandos-term__prompt {
	color: var(--t-green);
}

.pandos-term__accent {
	color: var(--t-accent);
}

.pandos-term__hint {
	color: var(--t-dim);
}

.pandos-term__err {
	color: var(--t-err);
}

/* Listing katalogów: katalogi wyróżnione, pliki neutralne. */
.pandos-term__dir {
	color: var(--t-accent);
	font-weight: 600;
}

.pandos-term__file {
	color: var(--t-green);
}

/* Kod promocyjny — wyróżniony i zaznaczalny */
.pandos-term__code {
	display: inline-block;
	padding: 2px 8px;
	font-weight: 700;
	letter-spacing: 1px;
	color: #fff;
	background: rgba(10, 96, 254, 0.25);
	border: 1px solid var(--t-accent);
	border-radius: 5px;
	user-select: all;
}

/* Wiersz wejścia */
.pandos-term__inputline {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 12px 16px;
	border-top: 1px solid var(--t-hairline);
	background: rgba(255, 255, 255, 0.02);
}

.pandos-term__inputline .pandos-term__prompt {
	flex: 0 0 auto;
	font-size: 13.5px;
}

.pandos-term__input {
	flex: 1 1 auto;
	min-width: 0;
	font: inherit;
	font-size: 13.5px;
	color: var(--t-text);
	background: none;
	border: 0;
	outline: none;
	caret-color: var(--t-green);
}

.pandos-term__noscript {
	color: var(--t-dim);
}

/* --- Bluescreen (wyjście do C:\) --- */
.pandos-bsod {
	position: fixed;
	inset: 0;
	z-index: var(--z-menubar, 500);
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 8vh 10vw;
	background: #0a6cce;
	color: #fff;
	font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

.pandos-bsod[hidden] {
	display: none;
}

.pandos-bsod__inner {
	max-width: 760px;
}

.pandos-bsod__face {
	font-size: 84px;
	font-weight: 300;
	line-height: 1;
	margin-bottom: 24px;
}

.pandos-bsod__lead {
	margin: 0 0 20px;
	font-size: 26px;
	font-weight: 400;
	line-height: 1.35;
}

.pandos-bsod__small {
	margin: 0 0 28px;
	font-size: 16px;
	opacity: 0.9;
}

.pandos-bsod__code {
	margin: 0 0 8px;
	font-family: "SFMono-Regular", Consolas, monospace;
	font-size: 13px;
	opacity: 0.85;
}

.pandos-bsod__hint {
	margin: 24px 0 0;
	font-size: 14px;
	opacity: 0.75;
}

@media (max-width: 640px) {
	.pandos-term {
		height: min(70vh, 480px);
	}

	.pandos-bsod {
		padding: 6vh 8vw;
	}

	.pandos-bsod__face {
		font-size: 60px;
	}

	.pandos-bsod__lead {
		font-size: 21px;
	}
}
