body { background: #e3e3e3; color: #fff; font-family: 'Segoe UI', sans-serif; margin: 0; padding: 4px; }
.grid {
    display: grid;
    grid-template-columns:
        repeat(5, 1fr)
        10px
        repeat(5, 1fr)
        10px
        repeat(2, 1fr);

    column-gap: 4px;
    row-gap: 4px;
}

/* 세로 구분선 */
.v-divider {
	width: 2px;
	background: #555;
	margin-left:4px;
}

/* 가로 구분선 */
.divider {
	grid-column: 1 / -1;
	height: 2px;
	background: #555;
	margin-top: 2px;
    margin-bottom: 2px;
}

/* 카드 기본 스타일 */
.card { 
	background: #f2f2f2; border-radius: 4px; overflow: hidden; 
	display: flex; flex-direction: column; cursor: pointer; 
	position: relative; border: 1px solid #333; transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #00aeef;
}

/* 전체화면 핵심 수정 */
.card:fullscreen { 
	width: 100vw; height: 100vh; background: #121212; padding: 0; border: none;
	display: flex; flex-direction: column; /* 세로로 배치 */
}
.card:fullscreen .status-text { font-size: 30px; color: #1f1f1f; }
.card:fullscreen .status-text.error span { font-size: 30px; }
.card:fullscreen .prog-txt { font-size: 26px; width: fit-content;}
.card:fullscreen .temp-info { font-size: 22px; } 
.card:fullscreen .temp-val { font-size: 24px; }
.card:fullscreen .row-bottom { font-size: 22px; }
.card:fullscreen #n-0,
.card:fullscreen [id^="n-"] { font-size: 24px; color: #1f1f1f;}     /* 파일명 */

/* 비디오 컨테이너: 전체화면 시 상태창을 제외한 나머지 공간을 꽉 채움 */
.video-container{
    width:100%;
    aspect-ratio:16/9;
    background:#000;
    position:relative;
    overflow:hidden;

    display:flex;
    align-items:center;
    justify-content:center;
}

.video-box{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}

.card:fullscreen .video-container { 
	flex-grow: 1; /* 비디오가 남는 공간 차지 */
	aspect-ratio: auto; /* 비율 고정 해제하여 공간에 맞춤 */
	overflow: hidden;
}

.video-box { 
	width: 100%; height: 100%; object-fit: contain; /* 비디오 왜곡 방지하며 꽉 채움 */
}

/* 하단 상태바: 전체화면 시에도 하단에 고정되도록 설정 */
.status-bar { 
	background: #333; padding: 12px; display: flex; 
	box-sizing: border-box; flex-shrink: 0; /* 크기 줄어들지 않게 고정 */
}
.card:fullscreen .status-bar {
	background: #e3e3e3;
	height: 200px; /* 전체화면 시 가독성을 위해 살짝 키움 */
	border-top: 1px solid #444;
	justify-content: center; /* 내용 중앙 정렬 */
	margin-bottom: 20px;
}
.card:fullscreen .info-main {
	 width: 80vw;
} /* 전체화면 시 너무 퍼지지 않게 제한 */

/* 전체화면 진행바 */
.card:fullscreen .prog-bg {
    height: 12px;      /* 크게 */
    width: 100%;
}


.thumb-box { width: 35px; height: 35px; background: #444; border-radius: 2px; margin-right: 12px; flex-shrink: 0; object-fit: cover; }

.card:fullscreen .thumb-box {
	width: 150px;   /* 기존 75px → 2배 */
	height: 150px;
}


.card:fullscreen .slot-container {
	padding-bottom: 30px;
}
/* 되돌리기 버튼 */
.back-btn { 
	position: absolute; top: 20px; right: 20px; background: rgba(0,0,0,0.6); 
	color: white; width: 40px; height: 40px; border-radius: 50%; 
	display: none; z-index: 100; cursor: pointer; border: 1px solid #555;
	align-items: center; justify-content: center; font-size: 20px;
}
.card:fullscreen .back-btn { display: flex; }

.status-text {
	font-size: 15px;
	color: #333333;
	font-weight: bold;
}
/* 에러 텍스트 색상 */
.status-text.error {
	color: #ff4d4d;
    overflow: hidden;
    white-space: nowrap;
	position: relative;
    min-width: 0;
}

.status-text.error span {
    display: inline-block;
    white-space: nowrap;
	font-size: 15px;
	padding-bottom: 3px;
}

.status-text.error.marquee span {
    animation-name: scroll-loop;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* 카드 테두리 깜빡임 */
.card.alert {
	border: 5px solid #ff0000;
	animation: blink-border 1s infinite;
}

@keyframes blink-border {
	0%, 100% { border-color: #ff0000; }
	50% { border-color: transparent; }
}


/* 나머지 요소들 */
.offline-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.2);  display: none; align-items: center; justify-content: center; color: #red; font-size: 20px; font-weight: bold; letter-spacing: 2px; z-index: 8888;}
.info-main { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.row-top { display: flex; justify-content: space-between; }
.temp-info { display: flex; gap: 12px; font-size: 11px; color: #888; text-align: right; }
.temp-val { color: #ccc; display: block; font-size: 12px; }
.row-mid { display: flex; align-items: center; margin-top: 8px; }
.prog-txt { color: #00af42; font-weight: bold; font-size: 13px; }
.card:not(:fullscreen) .row-mid-left { color: #1f1f1f; }
.prog-bg { background: #f2f2f2; border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; background: #00af42; transition: width 0.5s; }
.row-bottom { display: flex; justify-content: flex-end; gap: 12px; font-size: 9px; color: #777; }
.val { color: #bbb; margin-left: 3px; }

/* 기본 */
.layout-full { display: none; }

/* fullscreen 상태 (JS 클래스 기준) */
.card.is-full .layout-normal { display: none; }
.card.is-full .layout-full { display: flex; }

/* ===== 일반 카드 레이아웃 ===== */
.card:not(:fullscreen) .status-bar { 
	background: #fff; padding: 5px; display: flex; 
	line-height: 0.5;
	width: 100%;
}

.card:not(:fullscreen) .layout-normal {
    display: grid;
    grid-template-rows: auto auto;
    gap: 8px;
width: 100%;
}

/* 진행바 */
.card:not(:fullscreen) .prog-bg {
    height: 6px;
    width: 100%;
}

/* 상단 묶음 */
.card:not(:fullscreen) .top-contents {
    display: flex;
    gap: 5px;
    align-items: center;
	min-width: 0;
}

/* 썸네일 */
.card:not(:fullscreen) .thumb-box {
    width: 35px;
    height: 35px;
    flex-shrink: 0; /* 줄어들지 않게 */
}

/* 오른쪽 */
.card:not(:fullscreen) .info-side {
    flex: 1; /* 남는 공간 전부 차지 */
	min-width: 0;
	overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
	padding-top: 0;
	padding-bottom: 0;
	line-height: 1.0;
}

/* 하단 유지 */
.card:not(:fullscreen) .info-bottom {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.card:not(:fullscreen) .row-bottom{
	color: #1f1f1f;
    display: grid;
    grid-template-columns: 1fr 1fr;
	height: 10px;
}

.card:not(:fullscreen) .row-bottom .item{
    display: flex;
    flex-direction: column;
    align-items: center; /* 중앙정렬 */
	position: relative; 
    gap: 2px;
}

/* 마우스오버시 라벨 */
.label {
    position: absolute;
    top: 5px;
    left: 8px;
    font-size: 12px;
	color: white;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 4px;
    display: none;
    pointer-events: none;
	z-index: 9999;
}

.card:fullscreen .label {
    font-size: 50px;
    top: 20px;
    left: 20px;
}

/* 챔버 온도 (뱀부 전용) - 라벨 반대쪽, 카메라 우상단 */
.chamber-temp {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 12px;
    color: white;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 4px;
    display: none;
    pointer-events: none;
    z-index: 9999;
}

.card:fullscreen .chamber-temp {
    font-size: 50px;
    top: 20px;
    right: 20px;
}


/* 파일명 길때 슬라이딩 */
.file-name {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
	color: #333333;
}

.file-name span {
    display: inline-block;
    white-space: nowrap;
	font-size: 10px;
	padding-bottom: 3px;
}

.file-name.marquee span {
    animation-name: scroll-loop;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes scroll-loop {
    0%		{ transform: translateX(0); }
	20%		{ transform: translateX(0); }
    80%	{ transform: translateX(var(--move)); }
	100%	{ transform: translateX(var(--move)); }
}

.card:fullscreen .file-name span {
    font-size: 32px;
    padding-bottom: 0;
    padding-top: 0;
}
/* 파일명 길때 슬라이딩 */


/* 필라멘트 표시: 일반(그리드) 카드는 카메라 오버레이(.fila-*, common.css)를 쓰고,
   전체화면(상세보기)은 기존 그대로 큰 슬롯 그리드로 보여준다. */
.slot-container {
    display: flex;
    gap: 6px;
}

.slot-side {
    flex: 1;
    display: grid;
    gap: 4px;
}

.grid-1 {
    grid-template-columns: 1fr;
	border: 1px solid #d3d3d3;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
	border: 1px solid #d3d3d3;
}

.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
	justify-content: space-between; /* 좌우 끝 */
    align-items: center;
    white-space: nowrap;            /* 줄바꿈 금지 */
	min-width: 0;   /* 중요 */
	
}

.slot-color {
    width: 100%;
    height: 10px;
    border-radius: 2px;
}

.slot-type {
    
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
	font-size: 8px;
	padding-top: 2px;
	color: #555;
}

.card:fullscreen .slot-type {
    font-size: 15px;
    padding-bottom: 0;
    padding-top: 0;
}

.slot.empty .slot-color {
    background: #222 !important;
}

.slot-empty {
    font-size: 10px;
    color: #555;
    text-align: center;
}

/* 설정 버튼은 이제 마지막 카드 안 유틸리티 패널에 인라인으로 들어감 (아래 .utility-setting-btn 참고) */

/* 모달 배경 */
.modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(15,23,42,0.55);
    backdrop-filter:blur(6px);
    z-index:10000;
    justify-content:center;
    align-items:center;
}

/* 로그인창 스타일 */
.modal-box{
    width:100%;
    max-width:420px;
    background:#ffffff;
    border-radius:20px;
    padding:32px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.18),
        0 2px 8px rgba(0,0,0,0.08);
    animation:popup 0.18s ease;
}

@keyframes popup{
    from{
        opacity:0;
        transform:translateY(10px) scale(0.98);
    }
    to{
        opacity:1;
        transform:translateY(0) scale(1);
    }
}

.row{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.row label{
    font-size:14px;
    color:#334155;
    font-weight:600;
}

.input-wrap{
    display:flex;
    align-items:center;
    border:1px solid #dbe2ea;
    border-radius:14px;
    padding:0 14px;
    height:52px;
    background:#f8fafc;
}

.input-wrap:focus-within{
    border-color:#2563eb;
    background:#fff;
    box-shadow:0 0 0 4px rgba(37,99,235,0.08);
}

.input-wrap input{
    flex:1;
    border:none;
    outline:none;
    background:transparent;
    font-size:16px;
    height:100%;
}

.input-wrap span{
    color:#64748b;
    font-size:14px;
}

.btns{
    margin-top:24px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}

.btns button{
    height:48px;
    border:none;
    border-radius:14px;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition:0.18s;
}

.btns button:first-child{
    background:#2563eb;
    color:#fff;
}

.btns button:first-child:hover{
    transform:translateY(-1px);
    box-shadow:0 10px 20px rgba(37,99,235,0.22);
}

.btns button:last-child{
    background:#eef2f7;
    color:#334155;
}

.btns button:last-child:hover{
    background:#e2e8f0;
}

.utility-label {
    color: #555;
}

.utility-value {
    color: #111;
}

.utility-setting-btn {
    background: #eef2f7;
    color: #334155;
}

.utility-setting-btn:hover {
    background: #e2e8f0;
}

.slider {
    background: #d1d5db;
}

input:checked + .slider {
    background: #3b82f6;
}