/* =================
	Questions
   =================
	- Remove overlay /close buttons in the SOS emergeny file because of the helper function
	  in story_chat.js which creates a closing button for every file. Maybe because it 
	  is an action it has to be treated differently. Have a closer look to make it more efficient. 


*/

/* =======================
	SOS EMERGENCY OVERLAY STATION_1 CHAT 
	====================== */

.sos-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	display: grid;
	place-items: center;
	overflow: hidden;
	isolation: isolate;
	background: #000;
	opacity: 1;
	visibility: visible;
	transition: opacity 350ms ease;
}
.sos-overlay.closing {
	opacity: 0;
}
.sos-blackout {
	position: absolute;
	inset: 0;
	z-index: -2;
	background: #000;
	pointer-events: none;
}
.sos-overlay::before {
	content: "";
	position: absolute;
	z-index: -1;
	width: min(90vw, 850px);
	height: min(90vw, 850px);
	background: radial-gradient( circle, rgba(255, 0, 0, 0.34) 0%, rgba(255, 0, 0, 0.15) 32%, rgba(255, 0, 0, 0.04) 58%, transparent 74% );
	border-radius: 50%;
	animation: emergencyGlow 900ms ease-in-out infinite;
	pointer-events: none;
}
@keyframes emergencyGlow {
	0%, 100% {
		opacity: 0.35;
		transform: scale(0.86);
	}

	50% {
		opacity: 1;
		transform: scale(1.08);
	}
}

/* ----  Small close button ----- */

.overlay-close {
	position: absolute;
	top: max(14px, env(safe-area-inset-top));
	right: max(14px, env(safe-area-inset-right));
	z-index: 5;
	width: 38px;
	height: 38px;
	padding: 0;
	display: grid;
	place-items: center;
	color: white;
	background: rgba(15, 0, 0, 0.68);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.16);
	backdrop-filter: blur(8px);
	transition: transform 150ms ease, background 150ms ease;
}
.overlay-close:hover {
	background: rgba(150, 0, 0, 0.8);
	transform: scale(1.08);
}
.overlay-close:active {
	transform: scale(0.94);
}
.overlay-close:focus-visible {
	outline: 3px solid white;
	outline-offset: 4px;
}

/* --------- Main danger visualization --------- */
.sos-danger-effect {
	position: relative;
	z-index: 2;
	width: min(82vw, 520px);
	aspect-ratio: 1;
	display: grid;
	place-items: center;
}

/* Beacon assembly */

.sos-beacon {
	position: relative;
	z-index: 3;
	width: 150px;
	height: 190px;
	display: flex;
	flex-direction: column;
	align-items: center;
	animation: beaconShake 180ms linear infinite;
}
.sos-beacon-light {
	position: relative;
	width: 120px;
	height: 130px;
	background: #d90000;
	border: 7px solid #351515;
	border-bottom-width: 11px;
	border-radius: 65px 65px 18px 18px;
	box-shadow: inset 0 5px 7px rgba(255, 255, 255, 0.15), inset 0 -14px 18px rgba(70, 0, 0, 0.6), inset 8px 0 10px rgba(255, 70, 70, 0.08), inset -8px 0 10px rgba(70, 0, 0, 0.22), 0 0 18px rgba(255, 0, 0, 0.9), 0 0 55px rgba(255, 0, 0, 0.72), 0 0 120px rgba(255, 0, 0, 0.45);
	animation: beaconFlash 700ms steps(2, end) infinite;
}

/* Protective lamp bands */
.sos-beacon-light::after {
	content: "";
	position: absolute;
	inset: 9px 20px;
	border-right: 5px solid rgba(45, 0, 0, 0.55);
	border-left: 5px solid rgba(45, 0, 0, 0.55);
	border-radius: 45%;
	box-shadow: 21px 0 0 rgba(45, 0, 0, 0.38), -21px 0 0 rgba(45, 0, 0, 0.38);
}
.sos-beacon-base {
	width: 145px;
	height: 48px;
	margin-top: -5px;
	background: linear-gradient( 180deg, #596167, #22292d 60%, #101519 );
	border: 5px solid #15191c;
	border-radius: 8px 8px 18px 18px;
	box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.18), 0 10px 20px rgba(0, 0, 0, 0.55);
}

/* Expanding warning waves */
.sos-ring {
	position: absolute;
	width: 170px;
	height: 170px;
	border: 5px solid rgba(255, 55, 55, 0.75);
	border-radius: 50%;
	opacity: 0;
	box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.22), 0 0 20px rgba(255, 0, 0, 0.2);
	animation: emergencyRing 2.1s ease-out infinite;
}
.sos-ring-two {
	animation-delay: 700ms;
}
.sos-ring-three {
	animation-delay: 1400ms;
}

/* Animations */
@keyframes emergencyScreenPulse {
	0%, 100% {
		opacity: 0.2;
	}
	50% {
		opacity: 1;
	}
}
@keyframes emergencyScan {
	from {
		transform: translateY(-20%);
	}
	to {
		transform: translateY(20%);
	}
}
@keyframes beaconFlash {
	0%, 45% {
		filter: brightness(0.65);
	}
	46%, 100% {
		filter: brightness(1.5);
	}
}
@keyframes beaconRotate {
	from {
		transform: rotate(0deg) translateX(37px);
	}
	to {
		transform: rotate(360deg) translateX(37px);
	}
}
@keyframes beaconShake {
	0%, 100% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-1px);
	}
	75% {
		transform: translateX(1px);
	}
}
@keyframes emergencyRing {
	0% {
		opacity: 0.9;
		transform: scale(0.65);
	}
	100% {
		opacity: 0;
		transform: scale(3.8);
	}
}

@media (max-width: 500px) {
	.sos-beacon {
		transform: scale(0.8);
	}
	.sos-danger-effect {
		width: 95vw;
	}
}
@media (prefers-reduced-motion: reduce) {
	.sos-overlay::before,
	.sos-overlay::after,
	.sos-beacon,
	.sos-beacon-light,
	.sos-beacon-light::before,
	.sos-ring {
		animation: none;
	}

	.sos-beacon-light {
		filter: brightness(1.2);
	}
}


/* ===================
	LETTER STATION 1 BLINKING MORSE
   =================== */

/* ==================== SIGNAL LETTER OVERLAY ==================== */
.signal-letter-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	padding: 56px 18px 24px;
	display: grid;
	place-items: center;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.96);
	opacity: 0;
	visibility: hidden;
	transition: opacity 250ms ease, visibility 250ms ease;
}
.signal-letter-overlay.visible {
		opacity: 1;
		visibility: visible;
	}
.signal-letter-overlay.closing {
	opacity: 0;
}

/* ==================== PAPER ==================== */
.signal-letter-paper {
	width: min(640px, 100%);
	margin: auto;
	padding: clamp(24px, 5vw, 42px);
	color: #302719;
	background: repeating-linear-gradient( to bottom, transparent 0, transparent 31px, rgba(86, 67, 38, 0.055) 32px ), #f2ead8;
	border: 1px solid #c5b48f;
	border-radius: 5px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), inset 0 0 40px rgba(89, 64, 28, 0.09);
	transform: translateY(18px) rotate(-0.25deg);
	transition: transform 300ms ease;
}
.signal-letter-overlay.visible
.signal-letter-paper {
	transform: translateY(0) rotate(-0.25deg);
}

/* ==================== LETTER HEADER ==================== */
.signal-letter-header {
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid rgba(72, 54, 30, 0.28);
}
.signal-letter-category {
	display: inline-block;
	margin-bottom: 9px;
	padding: 5px 9px;
	color: #f3e9d4;
	background: #614b30;
	border-radius: 3px;
	font-family: "Courier New", monospace;
	font-size: 10px;
	font-weight: bold;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.signal-letter-header h2 {
	margin: 0 0 8px;
	color: #302719;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(27px, 5vw, 38px);
	line-height: 1.1;
}
.signal-letter-sender {
	margin: 0;
	color: #665640;
	font-family: "Courier New", monospace;
	font-size: 13px;
}

/* ==================== LETTER CONTENT ==================== */
.signal-letter-content {
	color: #302719;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 17px;
	line-height: 1.65;
}
.signal-letter-content p {
	color: #302719;
}
.signal-letter-signature {
	margin-top: 28px;
	font-style: italic;
}

/* ==================== RECOVERED NOTE ==================== */
.signal-note {
	margin: 22px 0;
	padding: 18px 14px;
	color: #262015;
	background: rgba(75, 57, 33, 0.1);
	border: 1px dashed rgba(70, 52, 29, 0.45);
	border-radius: 5px;
	font-family: "Courier New", monospace;
	font-size: clamp(20px, 5vw, 27px);
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-align: center;
}

/* ==================== SIGNAL PANEL ==================== */
.signal-lamp-panel {
	margin: 28px 0;
	padding: 22px;
	color: #ece7d7;
	background: #253137;
	border: 3px solid #736649;
	border-radius: 8px;
	text-align: center;
	box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55), 0 8px 18px rgba(62, 45, 25, 0.22);
}
.signal-panel-title {
	margin: 0 0 18px;
	color: #d8cda9 !important;
	font-family: "Courier New", monospace;
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Simple circular signal lamp */
.signal-lamp {
	width: 86px;
	height: 86px;
	margin: 0 auto 20px;
	background: #2b2921;
	border: 7px solid #13181a;
	border-radius: 50%;
	box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 4px 9px rgba(0, 0, 0, 0.45);
	transition: background 80ms linear, box-shadow 80ms linear;
}
.signal-lamp.on {
	background: #ffdc58;
	box-shadow: inset 0 0 9px rgba(255, 255, 255, 0.65), 0 0 16px rgba(255, 220, 88, 1), 0 0 42px rgba(255, 220, 88, 0.8), 0 0 90px rgba(255, 220, 88, 0.4);
}

/* ==================== SIGNAL BUTTON ==================== */
.signal-lamp-button {
	min-width: 145px;
	padding: 10px 17px;
	color: #172025;
	background: #d8cda9;
	border: 2px solid #f1e8ca;
	border-radius: 5px;
	font-family: "Courier New", monospace;
	font-size: 13px;
	font-weight: bold;
	cursor: pointer;
	box-shadow: 0 4px 0 #756b50, 0 7px 10px rgba(0, 0, 0, 0.28);
	transition: transform 120ms ease, background 120ms ease;
}
.signal-lamp-button:hover {
	background: #eee1b9;
	transform: translateY(-1px);
}
.signal-lamp-button:active {
	transform: translateY(3px);
	box-shadow: 0 1px 0 #756b50, 0 3px 5px rgba(0, 0, 0, 0.25);
}
.signal-lamp-button.active {
	color: white;
	background: #8c382c;
	border-color: #b55d4e;
	box-shadow: 0 4px 0 #4d201b, 0 7px 10px rgba(0, 0, 0, 0.28);
}
.signal-lamp-status {
	min-height: 20px;
	margin: 15px 0 0;
	color: rgba(236, 231, 215, 0.75) !important;
	font-family: "Courier New", monospace;
	font-size: 11px;
}

/* ==================== CLOSE BUTTON ==================== */

.signal-letter-close {
	position: fixed;
	top: max(14px, env(safe-area-inset-top));
	right: max(14px, env(safe-area-inset-right));
	z-index: 3;
	width: 38px;
	height: 38px;
	padding: 0;
	display: grid;
	place-items: center;
	color: white;
	background: rgba(25, 25, 25, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	font-family: Arial, sans-serif;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	transition: transform 150ms ease, background 150ms ease;
}
.signal-letter-close:hover {
	background: #813328;
	transform: scale(1.08);
}
.signal-letter-close:active {
	transform: scale(0.94);
}
.signal-letter-close:focus-visible,
.signal-lamp-button:focus-visible {
	outline: 3px solid #ffd869;
	outline-offset: 4px;
}

.signal-answer-section {
	margin-top: 22px;
	padding: 16px;
	border: 1px solid rgba(20, 60, 90, 0.25);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.55);
}

	.signal-answer-section label {
		display: block;
		margin-bottom: 8px;
		font-weight: 700;
	}

.signal-answer-input {
	width: 100%;
	padding: 11px 12px;
	border: 2px solid #9aafbd;
	border-radius: 8px;
	font: inherit;
	text-transform: uppercase;
}

	.signal-answer-input:focus {
		border-color: #12658a;
		outline: 3px solid rgba(18, 101, 138, 0.18);
	}

	.signal-answer-input.incorrect {
		border-color: #b42318;
	}

.signal-answer-status {
	min-height: 22px;
	margin: 8px 0;
	color: #b42318;
	font-weight: 700;
}

.signal-answer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.signal-inventory-button,
.signal-save-button {
	flex: 1 1 160px;
	padding: 11px 14px;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 700;
}

.signal-inventory-button {
	background: #d9e8ef;
	color: #123b50;
}

.signal-save-button {
	background: #12658a;
	color: white;
}

.signal-coordinate-note {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 7px;
	font-size: 1.25rem;
	font-weight: 700;
}

.signal-character-input {
	width: 42px;
	height: 46px;
	padding: 4px;
	border: 2px solid #8299a8;
	border-radius: 7px;
	background: white;
	color: #152f3d;
	font: inherit;
	font-size: 1.2rem;
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
}

	.signal-character-input:focus {
		border-color: #12658a;
		outline: 3px solid rgba(18, 101, 138, 0.2);
	}

	.signal-character-input.incorrect {
		border-color: #b42318;
		background: #fff1f0;
	}

.signal-coordinate-separator {
	margin: 0 7px;
}

.signal-answer-status {
	min-height: 24px;
	margin: 10px 0;
	color: #b42318;
	font-weight: 700;
}

.signal-answer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}

/* ==================== MOBILE ==================== */
@media (max-width: 520px) {
	.signal-letter-overlay {
		padding: 55px 10px max(14px, env(safe-area-inset-bottom));
	}
	.signal-letter-paper {
		padding: 23px 17px;
	}
	.signal-letter-content {
		font-size: 15px;
	}
	.signal-lamp-panel {
		padding: 19px 13px;
	}
	.signal-note {
		letter-spacing: 0.07em;
	}
}
@media (prefers-reduced-motion: reduce) {
	.signal-letter-overlay,
	.signal-letter-paper,
	.signal-lamp,
	.signal-lamp-button {
		transition: none;
	}
}

/* ==================================================
   SHARED ATTACHMENT OVERLAY
   ================================================== */
.attachment-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(1, 8, 14, 0.94);
	backdrop-filter: blur(8px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 180ms ease, visibility 180ms ease;
}
.attachment-overlay.visible {
	opacity: 1;
	visibility: visible;
}
.attachment-panel {
	position: relative;
	box-sizing: border-box;
	max-width: calc(100vw - 48px);
	max-height: calc(100dvh - 48px);
	color: white;
	background: #102733;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 14px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 25px rgba(80, 190, 225, 0.12);
	overflow: hidden;
	transform: scale(0.96);
	transition: transform 180ms ease;
}
.attachment-overlay.visible .attachment-panel {
	transform: scale(1);
}

/* Same frame for image and video */
.attachment-panel--media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	padding: 9px;
}
.attachment-media {
	display: block;
	width: auto;
	height: auto;
	max-width: min(900px, calc(100vw - 66px));
	max-height: calc(100dvh - 66px);
	object-fit: contain;
	background: #000;
	border-radius: 7px;
}
.attachment-video {
	width: min(820px, calc(100vw - 66px));
}

/* Shared close button */
.attachment-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 10;
	width: 36px;
	height: 36px;
	padding: 0;
	display: grid;
	place-items: center;
	color: white;
	background: rgba(5, 17, 24, 0.88);
	border: 1px solid rgba(255, 255, 255, 0.48);
	border-radius: 50%;
	font: 300 27px/1 Arial, sans-serif;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.14);
	transition: transform 150ms ease, background 150ms ease;
}
.attachment-close:hover {
	background: #8b3329;
	transform: scale(1.07);
}
.attachment-close:active {
	transform: scale(0.94);
}
.attachment-close:focus-visible {
	outline: 3px solid #ffd76d;
	outline-offset: 3px;
}

/* ==================================================
   PROFESSIONAL CONTACT REQUEST
   ================================================== */
.attachment-panel--contact {
	width: min(460px, calc(100vw - 32px));
	padding: 0;
}
.contact-request {
	padding: 24px;
}
.contact-request__label {
	margin: 0 48px 22px 0;
	color: rgba(255, 255, 255, 0.58);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}
.contact-request__profile {
	display: flex;
	align-items: center;
	gap: 15px;
	padding-bottom: 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.contact-request__avatar {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, 0.28);
	border-radius: 50%;
	background: #d7e8ed;
}
.contact-request__initials {
	display: grid;
	place-items: center;
	color: #102633;
	font-size: 20px;
	font-weight: 700;
}
.contact-request__identity {
	min-width: 0;
}
.contact-request__identity h2 {
	margin: 0 0 5px;
	color: white;
	font-size: 20px;
	line-height: 1.2;
}
.contact-request__identity p {
	margin: 0;
	color: rgba(255, 255, 255, 0.62);
	font-size: 14px;
}
.contact-request__body {
	padding: 19px 0;
}
.contact-request__body p {
	margin: 0;
	color: rgba(255, 255, 255, 0.84);
	line-height: 1.55;
}
.contact-request__hint {
	margin-top: 10px !important;
	color: rgba(255, 255, 255, 0.58) !important;
	font-size: 13px;
}
.contact-request__actions {
	display: flex;
	gap: 10px;
}
.contact-request__actions button {
	min-height: 42px;
	padding: 10px 16px;
	border-radius: 8px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background 150ms ease, transform 150ms ease, opacity 150ms ease;
}
.contact-request__send {
	flex: 1;
	color: #092119;
	background: #a9e2c8;
	border: 1px solid #cdf2e1;
}
.contact-request__send:hover:not(:disabled) {
	background: #c6eedc;
	transform: translateY(-1px);
}
.contact-request__dismiss {
	color: rgba(255, 255, 255, 0.84);
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.24);
}
.contact-request__dismiss:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.08);
}
.contact-request__actions button:disabled {
	opacity: 0.6;
	cursor: wait;
}
.contact-request__status {
	min-height: 21px;
	margin: 15px 0 0;
	color: #bceeff;
	font-size: 14px;
	font-weight: 700;
}
.contact-request.sent
.contact-request__status {
	color: #81e7a3;
}
@media (max-width: 520px) {
	.attachment-overlay {
		padding: 10px;
	}
	.attachment-panel {
		max-width: calc(100vw - 20px);
		max-height: calc(100dvh - 20px);
	}
	.attachment-media {
		max-width: calc(100vw - 38px);
		max-height: calc(100dvh - 38px);
	}
	.attachment-video {
		width: calc(100vw - 38px);
	}
	.contact-request {
		padding: 20px 17px;
	}
	.contact-request__actions {
		flex-direction: column;
	}
}
@media (prefers-reduced-motion: reduce) {
	.attachment-overlay,
	.attachment-panel,
	.attachment-close,
	.contact-request__actions button {
		transition: none;
	}
}
.attachment-panel--message {
	width: min(430px, calc(100vw - 32px));
	padding: 30px 24px 24px;
}
.attachment-message h2 {
	margin: 0 45px 12px 0;
	font-size: 20px;
}
.attachment-message p {
	margin: 0;
	color: rgba(255, 255, 255, 0.75);
	line-height: 1.5;
}

/* ===========================
	HENRY RUDI RIDDLE
   ===========================
*/

/* ==================================================
   HENRY RUDI GALLERY
   ================================================== */

.attachment-panel--henry-gallery {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.attachment-panel--henry-gallery > .attachment-close {
    position: sticky;
    top: 0;
    margin-left: auto;
    margin-bottom: 8px;
}

.henry-gallery h2 {
	margin: 0 48px 16px 0;
	color: white;
}

.henry-gallery__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 16px 0;
}

.henry-gallery__item {
	padding: 0;
	overflow: hidden;
	background: none;
	border: 3px solid transparent;
	border-radius: 14px;
	cursor: pointer;
	transition: border-color 150ms ease, transform 150ms ease;
}

	.henry-gallery__item:hover {
		border-color: rgba(255, 255, 255, 0.4);
		transform: translateY(-1px);
	}

	.henry-gallery__item:focus-visible {
		outline: 3px solid #ffd76d;
		outline-offset: 3px;
	}

	.henry-gallery__item.selected {
		border-color: #4cd137;
	}

	.henry-gallery__item img {
		display: block;
		width: 100%;
		height: 130px;
		object-fit: cover;
	}

.henry-gallery__feedback {
	margin: 0;
	color: rgba(255, 255, 255, 0.75);
	line-height: 1.5;
}

@media (max-width: 520px) {
    .attachment-panel--henry-gallery {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        padding: 12px;
    }

    .henry-gallery h2 {
        margin: 0 0 14px;
        font-size: 18px;
    }

    .henry-gallery__grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 0;
    }

    .henry-gallery__item img {
        display: block;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

/* ===================
	LINK DESIGN ON PAGE Wanny_dispatch, Nansen_dispatch, Final Dispatch
	================== */
.chat-link {
	color: #4aa8ff;
	text-decoration: underline;
}

.message:hover .chat-link {
	color: #7bc3ff;
}
/* ==========================
   SIGNAL INTERCEPT ATTACK Station_4_1.html
   ========================== */

.attack-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.95);
	display: none;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	z-index: 9999;
	overflow: hidden;
}

	.attack-overlay.active {
		display: flex;
	}

.flicker {
	animation: flicker 0.18s infinite;
}

@keyframes flicker {
	0% {
		opacity: 1;
	}

	20% {
		opacity: 0.75;
	}

	40% {
		opacity: 1;
	}

	60% {
		opacity: 0.82;
	}

	80% {
		opacity: 1;
	}

	100% {
		opacity: 0.72;
	}
}

.scanlines::before {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient( to bottom, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 2px, transparent 4px );
	pointer-events: none;
	z-index: 2;
}

.noise {
	position: absolute;
	inset: 0;
	background-image: radial-gradient( rgba(255, 255, 255, 0.08) 1px, transparent 1px );
	background-size: 6px 6px;
	opacity: 0.08;
	animation: noiseMove 0.15s infinite;
	pointer-events: none;
}

@keyframes noiseMove {
	0% {
		transform: translate(0, 0);
	}

	25% {
		transform: translate(2px, -1px);
	}

	50% {
		transform: translate(-2px, 2px);
	}

	75% {
		transform: translate(1px, -2px);
	}

	100% {
		transform: translate(0, 0);
	}
}

.disconnect-text {
	display: none;
	z-index: 3;
	margin-bottom: 20px;
	color: #ff4040;
	font-size: 2rem;
	font-weight: bold;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 2px;
}

	.disconnect-text.show {
		display: block;
	}

.code-box {
	display: none;
	z-index: 3;
	width: min(90vw, 700px);
	min-height: 220px;
	overflow: hidden;
	padding: 20px;
	border: 1px solid #00ff66;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.7);
	box-shadow: 0 0 20px rgba(0, 255, 102, 0.2);
	color: #00ff66;
	font-family: monospace;
	font-size: 14px;
}

	.code-box.show {
		display: block;
	}

.code-line {
	margin: 4px 0;
	white-space: pre-wrap;
}

.code-green {
	color: #00ff66;
}

.code-red {
	color: #ff4c4c;
}

.code-blue {
	color: #4db8ff;
}

.code-yellow {
	color: #ffe066;
}

.mask-wrap {
	display: none;
	z-index: 4;
	flex-direction: column;
	align-items: center;
}

	.mask-wrap.show {
		display: flex;
	}

.mask-image {
	width: min(70vw, 360px);
	border-radius: 14px;
	box-shadow: 0 0 35px rgba(255, 255, 255, 0.18);
	animation: maskPulse 1.6s infinite alternate;
}

@keyframes maskPulse {
	from {
		transform: scale(1);
		filter: brightness(0.9);
	}

	to {
		transform: scale(1.04);
		filter: brightness(1.1);
	}
}

.mask-text {
	max-width: 600px;
	margin-top: 16px;
	color: white;
	font-size: 1.1rem;
	text-align: center;
}

.video-wrap {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 18px;
	overflow: auto;
	background: rgba(0, 0, 0, 0.94);
}

	.video-wrap.show {
		display: flex;
	}

.hacker-video {
	max-height: calc(100dvh - 155px);
	display: block;
	width: auto;
	max-width: min(92vw, 520px);
	height: auto;
	object-fit: contain;
	background: #000;
}

.continue-btn {
	position: fixed;
	left: 50%;
	bottom: calc(70px + env(safe-area-inset-bottom));
	z-index: 10005;
	display: none;
	min-width: 150px;
	padding: 12px 24px;
	border: 2px solid #00ff66;
	border-radius: 6px;
	background: #050505;
	color: #00ff66;
	font-size: 1rem;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 1px;
	cursor: pointer;
	transform: translateX(-50%);
	box-shadow: 0 0 18px rgba(0, 255, 102, 0.45);
}

	.continue-btn.show {
		display: block;
	}

.glitch {
	position: relative;
	animation: glitchMove 0.2s infinite;
}

@keyframes glitchMove {
	0% {
		transform: translate(0, 0);
	}

	25% {
		transform: translate(2px, -1px);
	}

	50% {
		transform: translate(-2px, 1px);
	}

	75% {
		transform: translate(1px, 2px);
	}

	100% {
		transform: translate(0, 0);
	}
}

.blackout {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: black;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

	.blackout.show {
		opacity: 1;
	}


@media (max-width: 600px) {
	.video-wrap {
		justify-content: center;
		padding: 10px 10px 80px;
		overflow: hidden;
	}

	.hacker-video {
		width: auto;
		max-width: 100%;
		max-height: calc(100dvh - 100px);
	}
	.continue-btn {
		bottom: calc(72px + env(safe-area-inset-bottom));
	}
}

/* ==========================
   HENRY RUDI RESULT VIDEO
   ========================== */

.henry-result-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	background: rgba(0, 0, 0, 0.96);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.18s ease, visibility 0.18s ease;
}

	.henry-result-overlay.visible {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

.henry-result-panel {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	width: min(94vw, 760px);
	max-height: calc(100dvh - 30px);
}
.henry-result-back {
	align-self: flex-start;
	padding: 9px 14px;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 6px;
	background: rgba(10, 18, 24, 0.95);
	color: #ffffff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

	.henry-result-back:hover,
	.henry-result-back:focus-visible {
		border-color: #ffffff;
		background: rgba(28, 42, 52, 0.98);
	}

.henry-result-video {
	display: block;
	width: 100%;
	height: auto;
	max-height: calc(100dvh - 100px);
	object-fit: contain;
	background: #000;
	border-radius: 8px;
}

@media (max-width: 600px) {
	.henry-result-overlay {
		padding: 10px;
	}

	.henry-result-panel {
		width: 100%;
	}

	.henry-result-video {
		max-height: calc(100dvh - 85px);
	}

	.henry-result-back {
		padding: 8px 12px;
		font-size: 0.9rem;
	}
}

/* =========================================================
   SHARED PHONE BUTTON IMPROVEMENTS
   Keep this at the END of the CSS file
   ========================================================= */

@media (max-width: 600px) {

	/*
     * Prevent global button rules from stretching or
     * squeezing buttons unexpectedly.
     */
	.overlay-close,
	.signal-letter-close,
	.attachment-close,
	.signal-lamp-button,
	.signal-inventory-button,
	.signal-save-button,
	.contact-request__actions button,
	.henry-result-back,
	.continue-btn {
		box-sizing: border-box;
		font-family: inherit;
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
	}

	/* -----------------------------------------
       ROUND CLOSE BUTTONS
       ----------------------------------------- */

	.overlay-close,
	.signal-letter-close,
	.attachment-close {
		width: 32px !important;
		height: 32px !important;
		min-width: 32px !important;
		min-height: 32px !important;
		display: grid;
		place-items: center;
		padding: 0 !important;
		margin: 0;
		border-radius: 50% !important;
		font-family: Arial, sans-serif;
		font-size: 20px !important;
		font-weight: 400;
		line-height: 1;
		box-shadow: 0 3px 9px rgba(0, 0, 0, 0.38);
	}

	.overlay-close,
	.signal-letter-close {
		top: max(8px, env(safe-area-inset-top));
		right: max(8px, env(safe-area-inset-right));
	}

	.attachment-close {
		top: 8px;
		right: 8px;
	}

		/*
     * Larger invisible tap area while the visible
     * circle remains small.
     */
		.overlay-close::after,
		.signal-letter-close::after,
		.attachment-close::after {
			content: "";
			position: absolute;
			inset: -6px;
		}

	/* -----------------------------------------
       MORSE / SIGNAL CONTROLS
       ----------------------------------------- */

	.signal-lamp-button {
		min-width: 0;
		width: min(100%, 180px);
		padding: 9px 14px;
		border-radius: 7px;
		font-size: 12px;
		line-height: 1.2;
	}

	.signal-answer-actions {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
		margin-top: 10px;
	}

	.signal-inventory-button,
	.signal-save-button {
		width: 100%;
		min-height: 40px;
		padding: 9px 12px;
		border-radius: 7px;
		font-size: 13px;
		line-height: 1.2;
		flex: none;
	}

	/* -----------------------------------------
       CONTACT REQUEST BUTTONS
       ----------------------------------------- */

	.contact-request__actions {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
	}

		.contact-request__actions button {
			width: 100%;
			min-height: 40px;
			padding: 9px 13px;
			border-radius: 7px;
			font-size: 13px;
			line-height: 1.2;
		}

	/* -----------------------------------------
       HACKER VIDEO CONTINUE BUTTON
       ----------------------------------------- */

	.video-wrap .continue-btn {
		min-width: 0;
		width: min(78vw, 190px);
		bottom: calc( 66px + env(safe-area-inset-bottom) );
		padding: 9px 15px;
		border-width: 1px;
		border-radius: 7px;
		font-size: 12px;
		line-height: 1.2;
		letter-spacing: 0.06em;
	}

	/* -----------------------------------------
       HENRY RESULT BACK BUTTON
       ----------------------------------------- */

	.henry-result-back {
		align-self: flex-start;
		min-height: 36px;
		padding: 7px 11px;
		border-radius: 7px;
		font-size: 12px;
		line-height: 1.2;
	}
}