@charset "utf-8";
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* =========================================================
   [Moonlit Fairy Theme - Play Log Integrated]
   ========================================================= */

:root {
    /* 배경 및 레이아웃 컬러 */
    --bg-dark: #0f1623;
    --bg-card: rgba(13, 17, 23, 0.95);
    --line: rgba(255, 255, 255, 0.15);
    
    /* 텍스트 컬러 */
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* 포인트 컬러 */
    --accent: #64ffda;      /* 민트 (강조/버튼) */
    --accent-gold: #ffecb3; /* 골드 (특별 강조) */
    --danger: #ef4444;      /* 삭제/경고 */

    /* 상태(Status) 배지 컬러 */
    --st-done: #64ffda;     /* 완료 (민트) */
    --st-prog: #60a5fa;     /* 진행중 (블루) */
    --st-hold: #fbbf24;     /* 보류 (앰버) */
    --st-plan: #94a3b8;     /* 예정 (그레이) */
}

/* --- [기본 레이아웃] --- */
#sheetWrap {
    width: 100%; max-width: 1280px; margin: 0 auto;
    font-family: "Pretendard Variable", "Pretendard", sans-serif;
    color: var(--text-primary); font-size: 14px; line-height: 1.5;
    box-sizing: border-box;
}

#sheetWrap a { text-decoration: none; transition: 0.2s; }
#sheetWrap * { box-sizing: border-box; }

/* --- [통합 래퍼 (탭 + 게시판)] --- */
.unified-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 40px -5px rgba(0,0,0,0.5);
    margin-bottom: 20px; overflow: hidden; position: relative;
    display: flex; flex-direction: column;
}

/* --- [헤더 영역] --- */
.sc-header {
    background: rgba(20, 30, 40, 0.6);
    border-top: 1px solid var(--line); /* 탭과 연결되는 라인 */
    border-bottom: 1px solid var(--line);
    padding: 13px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 15px;
}

.sc-header h2 {
    margin: 0; font-size: 16px; font-weight: 700; color: #fff;
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
}

/* 검색바 */
.searchbar { flex: 1; max-width: 300px; position: relative; }
.searchbar input { 
    width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--line); 
    color: #fff; padding: 8px 32px 8px 12px; /* 아이콘 공간 확보 */
    border-radius: 6px; font-size: 13px; outline: none; transition: 0.2s;
}
.searchbar input:focus { border-color: var(--accent); background: rgba(0,0,0,0.5); box-shadow: 0 0 0 1px rgba(100, 255, 218, 0.1); }

/* --- [버튼 스타일] --- */
.btn_write, .btn_action {
    background: rgba(100, 255, 218, 0.1); color: var(--accent) !important;
    border: 1px solid var(--accent); padding: 6px 14px; border-radius: 6px;
    font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    transition: 0.2s;
}
.btn_write:hover, .btn_action:hover { background: var(--accent); color: #000 !important; box-shadow: 0 0 10px rgba(100,255,218,0.2); }

.btn_cancel {
    background: transparent; border: 1px solid var(--line); 
    color: var(--text-muted) !important; padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn_cancel:hover { border-color: #fff; color: #fff !important; }

/* --- [테이블 스타일] --- */
.table-wrapper {
    width: 100%; max-height: 650px; overflow-y: auto;
    background: rgba(0,0,0,0.2); border-top: none;
}
/* 커스텀 스크롤바 */
.table-wrapper::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.table-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.sc-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1000px; }

.sc-table thead th {
    position: sticky; top: 0; z-index: 10;
    background: #0d1117; color: var(--text-muted); font-weight: 600; padding: 12px;
    border-bottom: 1px solid var(--line); text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    white-space: nowrap; /* [중요] 헤더 줄바꿈 방지 */
}

.sc-table td {
    padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle; text-align: center; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 제목 셀 (왼쪽 정렬) */
.sc-subject { text-align: left !important; padding-left: 15px !important; font-weight: 600; color: #fff !important; }

/* 수정 트리거 (클릭 가능 요소) */
.ts-edit { cursor: pointer; transition: 0.2s; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* --- [배지 및 아이콘] --- */
/* 상태 배지 */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; min-width: 44px; text-align: center; }
.st-done { border: 1px solid var(--st-done); color: var(--st-done); background: rgba(100, 255, 218, 0.1); }
.st-prog { border: 1px solid var(--st-prog); color: var(--st-prog); background: rgba(96, 165, 250, 0.1); }
.st-hold { border: 1px solid var(--st-hold); color: var(--st-hold); background: rgba(251, 191, 36, 0.1); }
.st-plan { border: 1px solid var(--st-plan); color: var(--st-plan); background: rgba(255, 255, 255, 0.05); }

/* 룰 알약 배지 */
.rule-pill { display: inline-block; padding: 2px 8px; border-radius: 4px; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

/* 아이콘 링크 (정보/로그) */
.icon-link { 
    display: inline-flex; align-items: center; justify-content: center; 
    width: 26px; height: 26px; border-radius: 4px; 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    transition: 0.2s; 
}
.icon-link:hover { background: var(--accent); border-color: var(--accent); }
.icon-link img { width: 14px; height: 14px; filter: brightness(0) invert(1); transition: 0.2s; }
.icon-link:hover img { filter: brightness(0); } /* 호버 시 검은색 아이콘 */

/* --- [입력 폼 스타일] --- */
.grid { display: grid; gap: 15px; }

.sc-input, .sc-select, .form-control {
    width: 100%; background: #090c10; border: 1px solid var(--line); color: #fff;
    padding: 10px 12px; border-radius: 6px; outline: none; box-sizing: border-box; 
    font-size: 14px; transition: 0.2s;
}
.sc-input:focus, .sc-select:focus, .form-control:focus { 
    border-color: var(--accent); box-shadow: 0 0 0 1px rgba(100, 255, 218, 0.1); 
}

/* --- [모바일 뷰 & 반응형] --- */
.pc-view-area { display: block; }
.mobile-view-area { display: none; padding: 15px; }

@media (max-width: 768px) {
    .pc-view-area { display: none !important; }
    .mobile-view-area { display: block; }
    
    .sc-header { flex-direction: column; align-items: stretch; height: auto; gap: 12px; }
    .searchbar { max-width: 100%; }
    
    /* 모바일 카드 스타일 */
    .mo-play-card {
        background: rgba(20,30,40,0.6); 
        border: 1px solid var(--line);
        border-radius: 12px; margin-bottom: 12px; padding: 16px; 
        position: relative; overflow: hidden;
    }
    
    .mo-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
    .mo-date { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }
    
    .mo-card-title { 
        font-size: 16px; font-weight: 700; color: #fff; 
        margin-bottom: 12px; display: block; line-height: 1.4;
    }
    
    .mo-meta-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
    .mo-meta-item { 
        background: rgba(255,255,255,0.05); padding: 4px 8px; border-radius: 4px; 
        font-size: 12px; color: var(--text-secondary); border: 1px solid var(--line); 
    }
    
    .mo-card-actions { 
        display: flex; gap: 12px; padding-top: 12px; 
        border-top: 1px dashed var(--line); justify-content: flex-end; 
    }
    .mo-action-btn { 
        font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; 
        padding: 4px 8px; border-radius: 4px; transition: 0.2s;
    }
    .mo-action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
    .mo-action-btn img { width: 14px; height: 14px; filter: invert(0.7); }
    .mo-action-btn:hover img { filter: invert(1); }
}

/* --- [모달 팝업] --- */
/* --- [모달 팝업] --- */
@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.ts-modal { 
    display: none; position: fixed; inset: 0; 
    background: rgba(0, 0, 0, 0.7); /* 배경: 시나리오 스타일 */
    z-index: 9999; 
    backdrop-filter: blur(4px); /* 블러 효과 */
    align-items: center; justify-content: center; 
}
.ts-modal.active { display: flex !important; }

.ts-card { 
    width: min(600px, 94vw); 
    background: var(--bg-card); /* 전체 배경색 사용 */
    border: 1px solid var(--accent); /* 민트색 테두리 */
    border-radius: 12px; 
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.15); /* 민트색 발광 */
    display: flex; flex-direction: column; max-height: 90vh; 
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ts-card .head { 
    padding: 15px 20px; 
    border-bottom: 1px solid var(--line); 
    background: transparent; /* [수정] 배경색 투명화 -> 몸통색과 통일 */
    display: flex; justify-content: space-between; align-items: center;
    color: var(--accent); /* [수정] 제목 민트색 */
}
.ts-card .head h3 { margin: 0; font-size: 16px; font-weight: 700; }

.ts-card .body { padding: 20px; overflow-y: auto; color: var(--text-secondary); }

.ts-card .actions { 
    padding: 15px 20px; 
    border-top: 1px solid var(--line); 
    background: transparent; /* [수정] 배경색 투명화 -> 몸통색과 통일 */
    display: flex; justify-content: space-between; /* 양쪽 정렬 */
    align-items: center;
    gap: 8px; 
}

.ts-card label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* [추가] 모달 전용 버튼 (시나리오 스타일) */
/* 기존 btn_write 등과 클래스명이 다르므로 충돌 없음 */
.btn-del { 
    background: transparent; border: 1px solid #f472b6; color: #f472b6; 
    padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 13px;
    transition: 0.2s;
}
.btn-del:hover { background: #f472b6; color: #000; }

.btn-save { 
    background: var(--accent); border: 1px solid var(--accent); color: #000; 
    padding: 8px 20px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 13px;
    transition: 0.2s;
}
.btn-save:hover { background: #fff; border-color: #fff; }

/* 룰 관리 행 스타일 */
.rl-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

/* 룰 관리 행 스타일 */
.rl-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
/* --- [Status Highlights] 상태별 강조 표시 --- */

/* 1. 진행중 (In Progress) - 푸른 빛 */
/* PC */
.highlight-prog td { 
    background: rgba(59, 130, 246, 0.06) !important; 
}
.highlight-prog td:first-child { 
    box-shadow: inset 3px 0 0 var(--st-prog); /* 왼쪽 파란 띠 */
}
/* Mobile */
.mo-play-card.highlight-prog {
    background: rgba(20, 30, 40, 0.9);
    border: 1px solid var(--st-prog);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15); /* 발광 효과 */
}

/* 2. 예정 (Planned) - 밝은 빛 */
/* PC */
.highlight-plan td { 
    background: rgba(255, 255, 255, 0.04) !important;
}
.highlight-plan td:first-child { 
    box-shadow: inset 3px 0 0 rgba(255,255,255,0.4); /* 왼쪽 흰색 띠 */
}
/* Mobile */
.mo-play-card.highlight-plan {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.03);
}

/* 텍스트 강조 */
.highlight-prog .sc-subject .ts-edit, 
.highlight-prog .mo-card-title { 
    color: #fff; text-shadow: 0 0 5px rgba(59, 130, 246, 0.4); 
}
.highlight-plan .sc-subject .ts-edit, 
.highlight-plan .mo-card-title { 
    color: #fff; font-weight: 700; 
}