* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a1a;
    color: #eee;
    overflow-x: hidden;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #16213e;
    border-bottom: 1px solid #1a1a3e;
}
.header h1 { font-size: 18px; color: #e94560; }
.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}
.header-controls a { color: #e94560; text-decoration: none; }
button {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    background: #e94560;
    color: #fff;
}
button:hover { background: #c73e54; }
button:disabled { background: #555; cursor: not-allowed; }
.stats {
    padding: 6px 14px;
    background: #1a1a2e;
    border-radius: 4px;
    font-size: 12px;
    color: #4ecca3;
}
.grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 2px;
}
.cell {
    position: relative;
    background: #111;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #1a1a3e;
}
.cell:hover { border-color: #e94560; }
.cell video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cell .label {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 11px;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 3px;
    color: #4ecca3;
}
.cell .status-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-connected { background: #4ecca3; }
.dot-disconnected { background: #e94560; }
.dot-connecting { background: #e9c46a; }
.dot-hls { background: #e9c46a; }
.cell .mode-badge {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: bold;
}
.badge-webrtc { background: #4ecca3; color: #000; }
.badge-hls { background: #e9c46a; color: #000; }

/* 모드 선택 */
.mode-switch { display: flex; gap: 2px; }
.mode-btn {
    padding: 6px 12px;
    background: #1a1a2e;
    border: 1px solid #333;
    color: #888;
}
.mode-btn.active {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
}
.btn-test {
    background: #e9c46a;
    color: #000;
}
.btn-test:hover { background: #d4b04a; }

/* 풀스크린 모달 */
.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 100;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.fullscreen-overlay.active { display: flex; }
.fullscreen-overlay video {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
}
.fullscreen-overlay .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 24px;
    background: none;
    color: #fff;
    cursor: pointer;
}
.fullscreen-overlay .cam-title {
    margin-top: 10px;
    font-size: 16px;
    color: #4ecca3;
}
