/* ============================================================
 * 마루 가든 정원 일기 — 피드 CRT 렌더 (게임 화면 동일 비주얼)
 * 참조: game/maru/client/diary_preview.html
 * 스코프: .maru-diary 하위로 전부 격리 (일반 피드 글 무영향)
 * ============================================================ */

/* 나눔손글씨 다행체 (NanumDaHaengCe) — self-host, OFL 무료상업
 * lazy-load: .maru-diary 텍스트가 실제 렌더될 때만 다운로드(font-display:swap)
 * → 일기 안 보는 사용자는 2.7MB woff2 미다운(회선 절감) */
@font-face {
	font-family: 'NanumDaHaengCe';
	src: url('/css/font/NanumDaHaengCe.woff2') format('woff2'),
	     url('/css/font/NanumDaHaengCe.woff') format('woff');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* CRT 초록 프레임 */
.maru-diary {
	position: relative;
	overflow: hidden;
	background: #000;
	border: 2px solid rgba(95,255,160,.6);
	border-radius: 14px;
	padding: 34px 24px 40px;
	box-shadow: 0 0 7px rgba(95,255,160,.55),
	            0 0 20px rgba(95,255,160,.3),
	            inset 0 0 60px rgba(0,0,0,.92),
	            inset 0 0 26px rgba(50,255,130,.05);
	animation: maruCrtFlicker 4.5s infinite steps(60);
	font-family: 'NanumDaHaengCe', 'Pretendard', monospace;
}

/* 스캔라인 */
.maru-diary::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 3;
	background: repeating-linear-gradient(to bottom,
		rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.28) 3px, rgba(0,0,0,.28) 3px);
}

/* 리프레시 글로우 밴드 */
.maru-diary::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 90px;
	pointer-events: none;
	z-index: 2;
	background: linear-gradient(rgba(90,255,150,0), rgba(90,255,150,.05), rgba(90,255,150,0));
	animation: maruCrtScan 7s linear infinite;
}

@keyframes maruCrtScan { 0% { top: -90px; } 100% { top: 100%; } }
@keyframes maruCrtFlicker {
	0%,100% { opacity: 1; }
	48% { opacity: 1; }
	50% { opacity: .94; }
	52% { opacity: 1; }
	92% { opacity: .97; }
}

.maru-diary__head {
	text-align: center;
	font-size: 19px;
	margin-bottom: 4px;
	color: #7dffb5;
	text-shadow: 0 0 5px rgba(125,255,180,.8), 0 0 16px rgba(125,255,180,.4);
	letter-spacing: 1px;
	position: relative;
	z-index: 1;
}

.maru-diary__date {
	text-align: center;
	font-size: 14px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	color: #3fce7c;
	text-shadow: 0 0 4px rgba(63,206,124,.6);
	border-bottom: 1px solid rgba(63,206,124,.35);
	position: relative;
	z-index: 1;
}

.maru-diary__body {
	color: #57f596;
	text-shadow: 0 0 3px rgba(87,245,150,.6), 0 0 10px rgba(87,245,150,.28);
	font-size: 21px;
	line-height: 1.95;
	white-space: pre-wrap;
	word-break: break-word;
	letter-spacing: .4px;
	position: relative;
	z-index: 1;
}

.maru-diary__foot {
	margin-top: 22px;
	text-align: right;
	font-size: 13px;
	color: #3fce7c;
	text-shadow: 0 0 4px rgba(63,206,124,.55);
	position: relative;
	z-index: 1;
}

.maru-diary__cur {
	display: inline-block;
	width: 10px;
	height: 18px;
	margin-left: 2px;
	background: #5fffa0;
	box-shadow: 0 0 8px rgba(95,255,160,.8);
	vertical-align: -2px;
	animation: maruCrtBlink 1.1s steps(1) infinite;
}

@keyframes maruCrtBlink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

/* 모션 민감 사용자 — 플리커/스캔/커서 정지 */
@media (prefers-reduced-motion: reduce) {
	.maru-diary { animation: none; }
	.maru-diary::after { animation: none; display: none; }
	.maru-diary__cur { animation: none; opacity: 1; }
}
